diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..99483af14e1e7d9904bc061eafc8cb61a0a23b28 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +dist +downloads +.git +*.rar +.env +.DS_Store diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..5334f03a45d4821c06446cdfda65142040d7e303 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,51 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +public/icons/@twistedbrody[[:space:]]dowload.png filter=lfs diff=lfs merge=lfs -text +public/icons/@twistedbrody.png filter=lfs diff=lfs merge=lfs -text +public/icons/1.png filter=lfs diff=lfs merge=lfs -text +public/icons/2.png filter=lfs diff=lfs merge=lfs -text +public/icons/3.png filter=lfs diff=lfs merge=lfs -text +public/icons/4.png filter=lfs diff=lfs merge=lfs -text +public/icons/icones.png filter=lfs diff=lfs merge=lfs -text +public/icons/logo.png filter=lfs diff=lfs merge=lfs -text +dist/icons/@twistedbrody[[:space:]]dowload.png filter=lfs diff=lfs merge=lfs -text +dist/icons/@twistedbrody.png filter=lfs diff=lfs merge=lfs -text +dist/icons/1.png filter=lfs diff=lfs merge=lfs -text +dist/icons/2.png filter=lfs diff=lfs merge=lfs -text +dist/icons/3.png filter=lfs diff=lfs merge=lfs -text +dist/icons/4.png filter=lfs diff=lfs merge=lfs -text +dist/icons/icones.png filter=lfs diff=lfs merge=lfs -text +dist/icons/logo.png filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f5698f82ba73fe4d3e9efe6e185f904020ff192a --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +.env diff --git a/App.tsx b/App.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e9383718690d4e42086675934713b46558daa254 --- /dev/null +++ b/App.tsx @@ -0,0 +1,603 @@ + +import { Plus, Settings, Layers, User, Copy } from 'lucide-react'; +import { useState, useEffect, useMemo } from 'react'; +import { HDComicViewer } from './components/HDComicViewer'; +import { NewMangaModal } from './components/NewMangaModal'; +import { SettingsModal } from './components/SettingsModal'; +import { AnnouncementBanner } from './components/AnnouncementBanner'; +import { ComicDetail } from './components/ComicDetail'; +import { ChapterReader } from './components/ChapterReader'; +import { InfoPage } from './components/InfoPage'; +import { BulkCategoryModal } from './components/BulkCategoryModal'; +import { CategoryFilterModal } from './components/CategoryFilterModal'; +import { Category } from './types/manga'; + +import { SearchBar } from './components/SearchBar'; +import { SearchResults } from './components/SearchResults'; +import { Toaster, toast } from 'sonner'; +import { getAllMangas, deleteManga } from './services/manga'; +import { Manga, Chapter } from './types/manga'; +import { searchItems } from './utils/searchUtils'; +import { GlobalFooter } from './components/GlobalFooter'; + +type SortType = 'random' | 'name' | 'date' | 'pages' | 'modified' | 'views'; +type SortDirection = 'asc' | 'desc'; + +function App() { + const [showModal, setShowModal] = useState(false); + const [showSettingsModal, setShowSettingsModal] = useState(false); + const [showFilterModal, setShowFilterModal] = useState(false); + const [isAdmin, setIsAdmin] = useState(false); + const [editingManga, setEditingManga] = useState(null); + const [isCategoryPlusEnabled, setIsCategoryPlusEnabled] = useState(false); + const [isCopyIdsEnabled, setIsCopyIdsEnabled] = useState(false); + const [selectedMangaIds, setSelectedMangaIds] = useState([]); + const [showBulkModal, setShowBulkModal] = useState(false); + const [selectedComicId, setSelectedComicId] = useState(null); + const [navigationHistory, setNavigationHistory] = useState([]); + const [selectedChapter, setSelectedChapter] = useState<{ manga: Manga; chapter: Chapter } | null>(null); + const [mangas, setMangas] = useState([]); + const [showHD, setShowHD] = useState(false); + const [showInfo, setShowInfo] = useState(false); + const [loading, setLoading] = useState(true); + const [searchTerm, setSearchTerm] = useState(''); + const [selectedCategories, setSelectedCategories] = useState([]); + const [selectedAuthors, setSelectedAuthors] = useState([]); + const [sortType, setSortType] = useState(() => + (localStorage.getItem('sortType') as SortType) || 'modified' + ); + const [sortDirection, setSortDirection] = useState(() => + (localStorage.getItem('sortDirection') as SortDirection) || 'desc' + ); + + useEffect(() => { + // Check for admin mode via URL query parameter + const searchParams = new URLSearchParams(window.location.search); + const isAdminMode = searchParams.get('admin') === 'true'; + setIsAdmin(isAdminMode); + }, []); + + useEffect(() => { + localStorage.setItem('sortType', sortType); + }, [sortType]); + + useEffect(() => { + localStorage.setItem('sortDirection', sortDirection); + }, [sortDirection]); + + useEffect(() => { + // Initialize Telegram Web App + // @ts-expect-error Window interface is extended in vite-env.d.ts + if (window.Telegram?.WebApp) { + // @ts-expect-error Window interface is extended in vite-env.d.ts + window.Telegram.WebApp.ready(); + } + loadMangas(); + + const hash = window.location.hash.slice(1); + if (hash && hash.startsWith('manga/')) { + if (hash.endsWith('/hd')) { + const mangaId = hash.replace('manga/', '').replace('/hd', ''); + setSelectedComicId(mangaId); + setShowHD(true); + } else { + const mangaId = hash.replace('manga/', ''); + setSelectedComicId(mangaId); + setShowHD(false); + } + } else if (hash === 'info') { + setShowInfo(true); + } + + const handleHashChange = () => { + const hash = window.location.hash.slice(1); + if (!hash) { + setSelectedComicId(null); + setSelectedChapter(null); + setShowInfo(false); + setShowHD(false); + } else if (hash.startsWith('manga/')) { + if (hash.endsWith('/hd')) { + const mangaId = hash.replace('manga/', '').replace('/hd', ''); + setSelectedComicId(mangaId); + setShowHD(true); + } else { + const mangaId = hash.replace('manga/', ''); + setSelectedComicId(mangaId); + setShowHD(false); + } + setSelectedChapter(null); + setShowInfo(false); + } else if (hash === 'info') { + setShowInfo(true); + setSelectedComicId(null); + setSelectedChapter(null); + } + }; + + window.addEventListener('hashchange', handleHashChange); + return () => window.removeEventListener('hashchange', handleHashChange); + }, []); + + useEffect(() => { + if (!isCategoryPlusEnabled && !isCopyIdsEnabled) { + setSelectedMangaIds([]); + } + }, [isCategoryPlusEnabled, isCopyIdsEnabled]); + + async function loadMangas() { + try { + setLoading(true); + const data = await getAllMangas(); + setMangas(data); + } catch (error) { + console.error('Error loading mangas:', error); + } finally { + setLoading(false); + } + } + + const allCategories = useMemo(() => { + const categoriesMap = new Map(); + mangas.forEach(manga => { + manga.categories?.forEach(cat => { + if (!categoriesMap.has(cat.id)) { + categoriesMap.set(cat.id, cat); + } + }); + }); + return Array.from(categoriesMap.values()); + }, [mangas]); + + const searchResult = useMemo(() => { + if (!searchTerm.trim()) { + return { items: mangas, query: '', resultCount: mangas.length }; + } + return searchItems( + mangas.map(m => ({ + id: m.id, + title: m.title, + author: m.author, + categories: m.categories ? m.categories.map(c => c.name) : [] + })), + searchTerm, + { fuzzyMatch: true, minChars: 1 } + ); + }, [mangas, searchTerm]); + + const filteredMangas = useMemo(() => { + let items = searchResult.items.length > 0 + ? searchResult.items.map(item => mangas.find(m => m.id === item.id)).filter(Boolean) as Manga[] + : []; + + if (selectedCategories.length > 0) { + items = items.filter(m => + selectedCategories.some(selCat => m.categories?.some(c => c.name === selCat)) + ); + } + + if (selectedAuthors.length > 0) { + items = items.filter(m => + selectedAuthors.includes(m.author) + ); + } + + const sorted = [...items]; + + if (sortType === 'random') { + return sorted.sort(() => Math.random() - 0.5); + } + + sorted.sort((a, b) => { + let compareValue = 0; + + if (sortType === 'name') { + compareValue = a.title.localeCompare(b.title); + } else if (sortType === 'date') { + const dateA = new Date(a.created_at || 0).getTime(); + const dateB = new Date(b.created_at || 0).getTime(); + compareValue = dateA - dateB; + } else if (sortType === 'modified') { + const dateA = new Date(a.updated_at || a.created_at || 0).getTime(); + const dateB = new Date(b.updated_at || b.created_at || 0).getTime(); + compareValue = dateA - dateB; + } else if (sortType === 'pages') { + const pagesA = a.chapters?.reduce((sum: number, ch: any) => sum + (ch.pages?.length || 0), 0) || 0; + const pagesB = b.chapters?.reduce((sum: number, ch: any) => sum + (ch.pages?.length || 0), 0) || 0; + compareValue = pagesA - pagesB; + } else if (sortType === 'views') { + compareValue = (a.views || 0) - (b.views || 0); + } + + return sortDirection === 'asc' ? compareValue : -compareValue; + }); + + return sorted; + }, [mangas, searchTerm, searchResult.items, sortType, sortDirection, selectedCategories, selectedAuthors]); + + const handleEditManga = (manga: Manga) => { + setEditingManga(manga); + setShowModal(true); + }; + + const handleDeleteManga = async (mangaId: string) => { + try { + await deleteManga(mangaId); + await loadMangas(); + } catch (error) { + console.error('Error deleting manga:', error); + alert('Error al eliminar el manga. Por favor intenta de nuevo.'); + } + }; + + const toggleSelectManga = (id: string) => { + setSelectedMangaIds(prev => { + if (prev.includes(id)) { + return prev.filter(mId => mId !== id); + } else { + return [...prev, id]; + } + }); + }; + + const handleSelectComic = (mangaId: string) => { + if (isCategoryPlusEnabled || isCopyIdsEnabled) { + toggleSelectManga(mangaId); + return; + } + window.location.hash = `manga/${mangaId}`; + setSelectedComicId(mangaId); + setShowHD(false); + }; + + const handleBackToHome = () => { + window.location.hash = ''; + setSelectedComicId(null); + setShowInfo(false); + }; + + const handleNavigateToManga = (newMangaId: string) => { + if (selectedComicId) { + setNavigationHistory([...navigationHistory, selectedComicId]); + } + window.location.hash = `manga / ${newMangaId} `; + setSelectedComicId(newMangaId); + }; + + const handleSelectCategory = (category: string) => { + setSelectedCategories(prev => { + if (prev.includes(category)) { + return prev.filter(c => c !== category); + } + return [...prev, category]; + }); + handleBackToHome(); + }; + + const handleRemoveCategory = (category: string) => { + setSelectedCategories(prev => prev.filter(c => c !== category)); + }; + + const handleSelectAuthor = (author: string) => { + setSelectedAuthors(prev => { + if (prev.includes(author)) { + return prev.filter(c => c !== author); + } + return [...prev, author]; + }); + handleBackToHome(); + }; + + const handleRemoveAuthor = (author: string) => { + setSelectedAuthors(prev => prev.filter(c => c !== author)); + }; + + const mangaItems = useMemo(() => filteredMangas.map(manga => { + const chapterCount = manga.chapters?.length || 0; + const totalPages = manga.chapters?.reduce((sum: number, ch: any) => sum + (ch.pages?.length || 0), 0) || 0; + return { + id: manga.id, + title: manga.title, + author: manga.author, + chapterCount, + pageCount: totalPages, + thumbnail: manga.cover_url || manga.thumbnail_url || undefined, + manga, + }; + }), [filteredMangas]); + + if (selectedChapter) { + return ( + setSelectedChapter(null)} + /> + ); + } + + if (showInfo) { + return ; + } + + if (selectedComicId !== null) { + let currentManga = mangas.find(m => m.id === selectedComicId); + + if (showHD && currentManga) { + return ( + { + window.history.back(); + // Fallback if history back doesn't work or we want explicit control: + // window.location.hash = `manga / ${ selectedComicId } `; + }} + /> + ); + } + + return ( + { + if (navigationHistory.length > 0) { + const previousId = navigationHistory[navigationHistory.length - 1]; + setNavigationHistory(navigationHistory.slice(0, -1)); + window.location.hash = `manga / ${previousId} `; + setSelectedComicId(previousId); + } else { + handleBackToHome(); + } + }} + onReadChapter={(chapter) => { + if (currentManga) { + setSelectedChapter({ manga: currentManga, chapter }); + } + }} + onMangaLoaded={(loadedManga) => { + if (!currentManga) { + currentManga = loadedManga; + } + }} + onNavigateToManga={handleNavigateToManga} + onSelectCategory={handleSelectCategory} + onSelectAuthor={handleSelectAuthor} + isAdmin={isAdmin} + /> + ); + } + + return ( +
+
+
+
+ Twisted Brody Logo +

+ Twisted Brody MangaFlow +

+
+
+ {(isCategoryPlusEnabled || isCopyIdsEnabled) && ( +
+ + + {isCopyIdsEnabled ? 'Modo Copiar Activo' : 'Modo Plus Activo'} + + + {selectedMangaIds.length} + +
+ )} + {isAdmin && ( + <> + + + + )} +
+
+
+ +
+ + +
+ setShowFilterModal(true)} + /> + {searchTerm && ( +
+ {searchResult.resultCount} resultado{searchResult.resultCount !== 1 ? 's' : ''} encontrado{searchResult.resultCount !== 1 ? 's' : ''} +
+ )} + + {(selectedCategories.length > 0 || selectedAuthors.length > 0) && ( +
+ Filtrado por: + {selectedCategories.map(cat => ( + + ))} + {selectedAuthors.map(auth => ( + + ))} + {(selectedCategories.length > 0 || selectedAuthors.length > 0) && ( + + )} +
+ )} +
+ +
+ {false ? ( +
+ ) : ( + <> + + + + )} +
+
+ + {/* Bulk Action Bar */} + {(isCategoryPlusEnabled || isCopyIdsEnabled) && selectedMangaIds.length > 0 && ( +
+
+
+ {selectedMangaIds.length} seleccionados + Listos para acción +
+
+ +
+ {isCategoryPlusEnabled && ( + + )} + {isCopyIdsEnabled && ( + + )} +
+
+
+ )} + + + + { + setShowModal(false); + setEditingManga(null); + }} + editingManga={editingManga} + onMangaCreated={(mangaId) => { + loadMangas(); + setEditingManga(null); + if (mangaId && !editingManga) { + setTimeout(() => { + handleSelectComic(mangaId); + }, 500); + } + }} + onDelete={isAdmin ? handleDeleteManga : undefined} + /> + + setShowBulkModal(false)} + selectedMangaIds={selectedMangaIds} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + + setShowSettingsModal(false)} + isAdmin={isAdmin} + onAdminChange={setIsAdmin} + isCategoryPlusEnabled={isCategoryPlusEnabled} + onCategoryPlusChange={setIsCategoryPlusEnabled} + isCopyIdsEnabled={isCopyIdsEnabled} + onCopyIdsChange={setIsCopyIdsEnabled} + /> + + setShowFilterModal(false)} + categories={allCategories} + selectedCategories={selectedCategories} + onToggleCategory={handleSelectCategory} + onClearFilters={() => setSelectedCategories([])} + /> + +
+ ); +} + +export default App; + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e73f0dd48b93e7f938f2b70883c141e0162abebf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +# 1. Usar Node 20 +FROM node:20-slim + +# 2. Instalar Python, pip y dependencias de sistema para PDF/Imágenes +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-full \ + build-essential \ + libvips-dev \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# 3. Copiar archivos de dependencias primero (para cache) +COPY package.json package-lock.json* ./ +COPY requirements.txt ./ + +# 4. Instalar dependencias de Node (incluyendo devDeps para el build) +RUN npm install + +# 5. Instalar dependencias de Python +# Usamos --break-system-packages porque en imágenes nuevas de Debian/Ubuntu es necesario +RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt + +# 6. Copiar todo el código +COPY . . + +# 7. IMPORTANTE: Construir el Frontend +# Si tienes errores de TypeScript, podrías usar: RUN npm run build || true (solo para debug) +RUN npm run build + +# 8. Permisos para carpetas de descargas +RUN mkdir -p downloads && chmod 777 downloads + +# 9. Hugging Face usa el puerto 7860 por defecto +ENV PORT=7860 +EXPOSE 7860 + +# 10. Comando para arrancar el servidor de Node +# Asegúrate de que tu server.js escuche en el puerto process.env.PORT +CMD ["node", "server.js"] diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..595914c5973058eb82046b45578a3ee43b7655ef --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +--- +title: Twisted brody mangaflow +emoji: 🏢 +colorFrom: pink +colorTo: blue +sdk: docker +pinned: false +--- + +Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference diff --git a/check_db.js b/check_db.js new file mode 100644 index 0000000000000000000000000000000000000000..85029563a8a66b913e9a2b57712c4855d406e387 --- /dev/null +++ b/check_db.js @@ -0,0 +1,28 @@ +import { initializeApp } from 'firebase/app'; +import { getFirestore, collection, getDocs } from 'firebase/firestore'; + +const firebaseConfig = { + apiKey: "AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE", + authDomain: "twistedbrody-9d163.firebaseapp.com", + projectId: "twistedbrody-9d163", + storageBucket: "twistedbrody-9d163.firebasestorage.app", + messagingSenderId: "733213514129", + appId: "1:733213514129:web:e9694684f5c3994ed06230", + measurementId: "G-N8TQ7MY42W" +}; + +const app = initializeApp(firebaseConfig); +const db = getFirestore(app); + +async function run() { + const q = collection(db, "chapters"); + const snapshot = await getDocs(q); + if (!snapshot.empty) { + const doc = snapshot.docs[0]; + const data = doc.data(); + console.log("Manga ID:", data.manga_id || data.mangaId); + console.log("Original Pages:", data.original_pages?.slice(0, 2)); + console.log("Pages:", data.pages?.slice(0, 2)); + } +} +run(); diff --git a/check_db.ts b/check_db.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f6b908812ca346b3ce2628015970449a669b230 --- /dev/null +++ b/check_db.ts @@ -0,0 +1,44 @@ +import { initializeApp } from 'firebase/app'; +import { getFirestore, collection, getDocs, query, orderBy, limit } from 'firebase/firestore'; + +const firebaseConfig = { + apiKey: "AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE", + authDomain: "twistedbrody-9d163.firebaseapp.com", + projectId: "twistedbrody-9d163", + storageBucket: "twistedbrody-9d163.firebasestorage.app", + messagingSenderId: "733213514129", + appId: "1:733213514129:web:e9694684f5c3994ed06230", + measurementId: "G-N8TQ7MY42W" +}; + +const app = initializeApp(firebaseConfig); +const db = getFirestore(app); + +async function check() { + console.log("Fetching mangas from DB..."); + const q = query(collection(db, 'mangas'), orderBy('created_at', 'desc'), limit(3)); + const snap = await getDocs(q); + + if (snap.empty) { + console.log("NO MANGAS IN DB!"); + } else { + snap.forEach(doc => { + console.log(`Manga ${doc.id}: ${doc.data().title}`); + console.log(JSON.stringify(doc.data(), null, 2)); + }); + } + + console.log("\nFetching chapters..."); + const q2 = query(collection(db, 'chapters'), orderBy('created_at', 'desc'), limit(3)); + const snap2 = await getDocs(q2); + if (snap2.empty) { + console.log("NO CHAPTERS IN DB!"); + } else { + snap2.forEach(doc => { + console.log(`Chapter ${doc.id}: ${doc.data().title}`); + console.log(JSON.stringify(doc.data(), null, 2)); + }); + } +} + +check().catch(console.error).finally(() => process.exit(0)); diff --git a/converter.py b/converter.py new file mode 100644 index 0000000000000000000000000000000000000000..2c32b70aca63ad66c1dbeec70a1a85341cce2b27 --- /dev/null +++ b/converter.py @@ -0,0 +1,50 @@ +import img2pdf +import requests +import sys +import json +import os +from concurrent.futures import ThreadPoolExecutor + +def download_image(args): + url, index, total = args + try: + response = requests.get(url, timeout=15, headers={'User-Agent': 'Mozilla/5.0'}) + if response.status_code == 200: + # Imprimimos progreso para Node.js + print(f"PROGRESS:IMAGE_DONE", flush=True) + return index, response.content + except Exception as e: + print(f"DEBUG: Error en imagen {index}: {e}", flush=True) + return index, None + +def create_pdf(urls, output_name): + total = len(urls) + print(f"DEBUG: Iniciando descarga paralela de {total} imágenes...", flush=True) + + # Descarga en paralelo (50 hilos a la vez para saturar la conexión) + # Esto es lo que lo hace igual de rápido que el ZIP + with ThreadPoolExecutor(max_workers=50) as executor: + results = list(executor.map(download_image, [(url, i, total) for i, url in enumerate(urls)])) + + # Ordenamos las imágenes por su índice original para que el manga no esté desordenado + results.sort(key=lambda x: x[0]) + img_data = [data for index, data in results if data is not None] + + if img_data: + print("DEBUG: Empaquetando PDF...", flush=True) + with open(output_name, "wb") as f: + # img2pdf es ultra rápido porque no re-comprime + f.write(img2pdf.convert(img_data)) + print("STATUS:SUCCESS", flush=True) + else: + print("STATUS:ERROR", flush=True) + +if __name__ == "__main__": + try: + input_data = sys.stdin.read() + if not input_data: + sys.exit(1) + data = json.loads(input_data) + create_pdf(data['urls'], data['output']) + except Exception as e: + print(f"DEBUG: Error crítico: {e}", flush=True) diff --git a/debug_firestore.ts b/debug_firestore.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0ae7e16f5e436c50136184b8cc8b607ee3fdc6c --- /dev/null +++ b/debug_firestore.ts @@ -0,0 +1,46 @@ + +import { initializeApp } from "firebase/app"; +import { getFirestore, collection, getDocs, orderBy, query } from "firebase/firestore"; + +const firebaseConfig = { + apiKey: "AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE", + authDomain: "twistedbrody-9d163.firebaseapp.com", + projectId: "twistedbrody-9d163", + storageBucket: "twistedbrody-9d163.firebasestorage.app", + messagingSenderId: "733213514129", + appId: "1:733213514129:web:e9694684f5c3994ed06230", + measurementId: "G-N8TQ7MY42W" +}; + +const app = initializeApp(firebaseConfig); +const db = getFirestore(app); + +async function checkDB() { + console.log("--- DEBUGGING FIRESTORE ---"); + try { + const mangasRef = collection(db, 'mangas'); + + // 1. Count Total (Raw) + const snapshotRaw = await getDocs(mangasRef); + console.log(`[RAW CHECK] Total Documents in 'mangas': ${snapshotRaw.size}`); + + if (snapshotRaw.size > 0) { + console.log("Sample ID:", snapshotRaw.docs[0].id); + console.log("Sample Data:", snapshotRaw.docs[0].data()); + } + + // 2. Count with Query (orderBy) + try { + const q = query(mangasRef, orderBy('created_at', 'desc')); + const snapshotQuery = await getDocs(q); + console.log(`[QUERY CHECK] Documents with orderBy('created_at'): ${snapshotQuery.size}`); + } catch (e) { + console.error("[QUERY FAIL] orderBy failed. Likely missing index or field:", e.message); + } + + } catch (error) { + console.error("CRITICAL ERROR:", error); + } +} + +checkDB(); diff --git a/deploy_git.bat b/deploy_git.bat new file mode 100644 index 0000000000000000000000000000000000000000..5d04582fc4b16d8d9c8dfc49cb0d2f34e81660b9 --- /dev/null +++ b/deploy_git.bat @@ -0,0 +1,17 @@ +@echo off +echo Inicializando repositorio... +git init +echo Configurando usuario... +git config user.name "CodeByDante" +git config user.email "codebydante@users.noreply.github.com" +echo Añadiendo archivos... +git add . +echo Committing... +git commit -m "feat: Update Project via Agent" +echo Configurando rama y remote... +git branch -M main +git remote remove origin +git remote add origin https://github.com/CodeByDante/twisted-brody-MangaFlow.git +echo Intentando push (puede requerir autenticacion)... +git push -u origin main --force +pause diff --git a/dist/assets/index-B6p1GwGs.js b/dist/assets/index-B6p1GwGs.js new file mode 100644 index 0000000000000000000000000000000000000000..b3e849f2011d0b67f8f8be44fab415bc82e6160b --- /dev/null +++ b/dist/assets/index-B6p1GwGs.js @@ -0,0 +1,3562 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var qu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var bw={exports:{}},Bc={},Ew={exports:{}},Ve={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ml=Symbol.for("react.element"),NS=Symbol.for("react.portal"),AS=Symbol.for("react.fragment"),PS=Symbol.for("react.strict_mode"),RS=Symbol.for("react.profiler"),DS=Symbol.for("react.provider"),jS=Symbol.for("react.context"),LS=Symbol.for("react.forward_ref"),OS=Symbol.for("react.suspense"),MS=Symbol.for("react.memo"),VS=Symbol.for("react.lazy"),Ry=Symbol.iterator;function FS(t){return t===null||typeof t!="object"?null:(t=Ry&&t[Ry]||t["@@iterator"],typeof t=="function"?t:null)}var Iw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sw=Object.assign,Tw={};function jo(t,e,n){this.props=t,this.context=e,this.refs=Tw,this.updater=n||Iw}jo.prototype.isReactComponent={};jo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};jo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function kw(){}kw.prototype=jo.prototype;function Dp(t,e,n){this.props=t,this.context=e,this.refs=Tw,this.updater=n||Iw}var jp=Dp.prototype=new kw;jp.constructor=Dp;Sw(jp,jo.prototype);jp.isPureReactComponent=!0;var Dy=Array.isArray,Cw=Object.prototype.hasOwnProperty,Lp={current:null},Nw={key:!0,ref:!0,__self:!0,__source:!0};function Aw(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Cw.call(e,r)&&!Nw.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,ye=K[fe];if(0>>1;fei(J,N))tei(Ie,J)?(K[fe]=Ie,K[te]=N,fe=te):(K[fe]=J,K[H]=N,fe=H);else if(tei(Ie,N))K[fe]=Ie,K[te]=N,fe=te;else break e}}return ie}function i(K,ie){var N=K.sortIndex-ie.sortIndex;return N!==0?N:K.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var u=[],c=[],f=1,h=null,p=3,m=!1,b=!1,S=!1,P=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(K){for(var ie=n(c);ie!==null;){if(ie.callback===null)r(c);else if(ie.startTime<=K)r(c),ie.sortIndex=ie.expirationTime,e(u,ie);else break;ie=n(c)}}function L(K){if(S=!1,T(K),!b)if(n(u)!==null)b=!0,le(F);else{var ie=n(c);ie!==null&&ve(L,ie.startTime-K)}}function F(K,ie){b=!1,S&&(S=!1,y(x),x=-1),m=!0;var N=p;try{for(T(ie),h=n(u);h!==null&&(!(h.expirationTime>ie)||K&&!C());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,p=h.priorityLevel;var ye=fe(h.expirationTime<=ie);ie=t.unstable_now(),typeof ye=="function"?h.callback=ye:h===n(u)&&r(u),T(ie)}else r(u);h=n(u)}if(h!==null)var R=!0;else{var H=n(c);H!==null&&ve(L,H.startTime-ie),R=!1}return R}finally{h=null,p=N,m=!1}}var D=!1,_=null,x=-1,E=5,k=-1;function C(){return!(t.unstable_now()-kK||125fe?(K.sortIndex=N,e(c,K),n(u)===null&&K===n(c)&&(S?(y(x),x=-1):S=!0,ve(L,N-fe))):(K.sortIndex=ye,e(u,K),b||m||(b=!0,le(F))),K},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(K){var ie=p;return function(){var N=p;p=ie;try{return K.apply(this,arguments)}finally{p=N}}}})(Lw);jw.exports=Lw;var YS=jw.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var XS=V,Fn=YS;function X(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xh=Object.prototype.hasOwnProperty,JS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ly={},Oy={};function ZS(t){return Xh.call(Oy,t)?!0:Xh.call(Ly,t)?!1:JS.test(t)?Oy[t]=!0:(Ly[t]=!0,!1)}function eT(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function tT(t,e,n,r){if(e===null||typeof e>"u"||eT(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function pn(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Jt[t]=new pn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Jt[e]=new pn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Jt[t]=new pn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Jt[t]=new pn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Jt[t]=new pn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Jt[t]=new pn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Jt[t]=new pn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Jt[t]=new pn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Jt[t]=new pn(t,5,!1,t.toLowerCase(),null,!1,!1)});var Mp=/[\-:]([a-z])/g;function Vp(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Mp,Vp);Jt[e]=new pn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Mp,Vp);Jt[e]=new pn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Mp,Vp);Jt[e]=new pn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Jt[t]=new pn(t,1,!1,t.toLowerCase(),null,!1,!1)});Jt.xlinkHref=new pn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Jt[t]=new pn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Fp(t,e,n,r){var i=Jt.hasOwnProperty(e)?Jt[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var u=` +`+i[o].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=o&&0<=a);break}}}finally{eh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?fa(t):""}function nT(t){switch(t.tag){case 5:return fa(t.type);case 16:return fa("Lazy");case 13:return fa("Suspense");case 19:return fa("SuspenseList");case 0:case 2:case 15:return t=th(t.type,!1),t;case 11:return t=th(t.type.render,!1),t;case 1:return t=th(t.type,!0),t;default:return""}}function tf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case qs:return"Fragment";case Hs:return"Portal";case Jh:return"Profiler";case Up:return"StrictMode";case Zh:return"Suspense";case ef:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Vw:return(t.displayName||"Context")+".Consumer";case Mw:return(t._context.displayName||"Context")+".Provider";case zp:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Bp:return e=t.displayName||null,e!==null?e:tf(t.type)||"Memo";case pi:e=t._payload,t=t._init;try{return tf(t(e))}catch{}}return null}function rT(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tf(e);case 8:return e===Up?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Mi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Uw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function iT(t){var e=Uw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Wl(t){t._valueTracker||(t._valueTracker=iT(t))}function zw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Uw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Wu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function nf(t,e){var n=e.checked;return ft({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Vy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Mi(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Bw(t,e){e=e.checked,e!=null&&Fp(t,"checked",e,!1)}function rf(t,e){Bw(t,e);var n=Mi(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?sf(t,e.type,n):e.hasOwnProperty("defaultValue")&&sf(t,e.type,Mi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Fy(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function sf(t,e,n){(e!=="number"||Wu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var pa=Array.isArray;function io(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Gl.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ua(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var _a={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sT=["Webkit","ms","Moz","O"];Object.keys(_a).forEach(function(t){sT.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),_a[e]=_a[t]})});function Ww(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||_a.hasOwnProperty(t)&&_a[t]?(""+e).trim():e+"px"}function Gw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Ww(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var oT=ft({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lf(t,e){if(e){if(oT[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(X(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(X(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(X(61))}if(e.style!=null&&typeof e.style!="object")throw Error(X(62))}}function uf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cf=null;function $p(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var df=null,so=null,oo=null;function By(t){if(t=vl(t)){if(typeof df!="function")throw Error(X(280));var e=t.stateNode;e&&(e=Gc(e),df(t.stateNode,t.type,e))}}function Kw(t){so?oo?oo.push(t):oo=[t]:so=t}function Qw(){if(so){var t=so,e=oo;if(oo=so=null,By(t),e)for(t=0;t>>=0,t===0?32:31-(yT(t)/vT|0)|0}var Kl=64,Ql=4194304;function ma(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ma(a):(s&=o,s!==0&&(r=ma(s)))}else o=n&~i,o!==0?r=ma(o):s!==0&&(r=ma(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function gl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-or(e),t[e]=n}function bT(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Ea),Xy=" ",Jy=!1;function m_(t,e){switch(t){case"keyup":return YT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function g_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ws=!1;function JT(t,e){switch(t){case"compositionend":return g_(e);case"keypress":return e.which!==32?null:(Jy=!0,Xy);case"textInput":return t=e.data,t===Xy&&Jy?null:t;default:return null}}function ZT(t,e){if(Ws)return t==="compositionend"||!Xp&&m_(t,e)?(t=f_(),Eu=Kp=_i=null,Ws=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=n0(n)}}function w_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?w_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function __(){for(var t=window,e=Wu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Wu(t.document)}return e}function Jp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function lk(t){var e=__(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&w_(n.ownerDocument.documentElement,n)){if(r!==null&&Jp(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=r0(n,s);var o=r0(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Gs=null,yf=null,Sa=null,vf=!1;function i0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vf||Gs==null||Gs!==Wu(r)||(r=Gs,"selectionStart"in r&&Jp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sa&&Wa(Sa,r)||(Sa=r,r=Zu(yf,"onSelect"),0Ys||(t.current=If[Ys],If[Ys]=null,Ys--)}function it(t,e){Ys++,If[Ys]=t.current,t.current=e}var Vi={},ln=Gi(Vi),_n=Gi(!1),vs=Vi;function xo(t,e){var n=t.type.contextTypes;if(!n)return Vi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function bn(t){return t=t.childContextTypes,t!=null}function tc(){lt(_n),lt(ln)}function d0(t,e,n){if(ln.current!==Vi)throw Error(X(168));it(ln,e),it(_n,n)}function A_(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(X(108,rT(t)||"Unknown",i));return ft({},n,r)}function nc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vi,vs=ln.current,it(ln,t),it(_n,_n.current),!0}function h0(t,e,n){var r=t.stateNode;if(!r)throw Error(X(169));n?(t=A_(t,e,vs),r.__reactInternalMemoizedMergedChildContext=t,lt(_n),lt(ln),it(ln,t)):lt(_n),it(_n,n)}var Mr=null,Kc=!1,mh=!1;function P_(t){Mr===null?Mr=[t]:Mr.push(t)}function wk(t){Kc=!0,P_(t)}function Ki(){if(!mh&&Mr!==null){mh=!0;var t=0,e=Xe;try{var n=Mr;for(Xe=1;t>=o,i-=o,Fr=1<<32-or(e)+i|n<x?(E=_,_=null):E=_.sibling;var k=p(y,_,T[x],L);if(k===null){_===null&&(_=E);break}t&&_&&k.alternate===null&&e(y,_),w=s(k,w,x),D===null?F=k:D.sibling=k,D=k,_=E}if(x===T.length)return n(y,_),ct&&is(y,x),F;if(_===null){for(;xx?(E=_,_=null):E=_.sibling;var C=p(y,_,k.value,L);if(C===null){_===null&&(_=E);break}t&&_&&C.alternate===null&&e(y,_),w=s(C,w,x),D===null?F=C:D.sibling=C,D=C,_=E}if(k.done)return n(y,_),ct&&is(y,x),F;if(_===null){for(;!k.done;x++,k=T.next())k=h(y,k.value,L),k!==null&&(w=s(k,w,x),D===null?F=k:D.sibling=k,D=k);return ct&&is(y,x),F}for(_=r(y,_);!k.done;x++,k=T.next())k=m(_,y,x,k.value,L),k!==null&&(t&&k.alternate!==null&&_.delete(k.key===null?x:k.key),w=s(k,w,x),D===null?F=k:D.sibling=k,D=k);return t&&_.forEach(function(j){return e(y,j)}),ct&&is(y,x),F}function P(y,w,T,L){if(typeof T=="object"&&T!==null&&T.type===qs&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case ql:e:{for(var F=T.key,D=w;D!==null;){if(D.key===F){if(F=T.type,F===qs){if(D.tag===7){n(y,D.sibling),w=i(D,T.props.children),w.return=y,y=w;break e}}else if(D.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===pi&&m0(F)===D.type){n(y,D.sibling),w=i(D,T.props),w.ref=oa(y,D,T),w.return=y,y=w;break e}n(y,D);break}else e(y,D);D=D.sibling}T.type===qs?(w=fs(T.props.children,y.mode,L,T.key),w.return=y,y=w):(L=Pu(T.type,T.key,T.props,null,y.mode,L),L.ref=oa(y,w,T),L.return=y,y=L)}return o(y);case Hs:e:{for(D=T.key;w!==null;){if(w.key===D)if(w.tag===4&&w.stateNode.containerInfo===T.containerInfo&&w.stateNode.implementation===T.implementation){n(y,w.sibling),w=i(w,T.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else e(y,w);w=w.sibling}w=Eh(T,y.mode,L),w.return=y,y=w}return o(y);case pi:return D=T._init,P(y,w,D(T._payload),L)}if(pa(T))return b(y,w,T,L);if(ta(T))return S(y,w,T,L);nu(y,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,w!==null&&w.tag===6?(n(y,w.sibling),w=i(w,T),w.return=y,y=w):(n(y,w),w=bh(T,y.mode,L),w.return=y,y=w),o(y)):n(y,w)}return P}var _o=L_(!0),O_=L_(!1),sc=Gi(null),oc=null,Zs=null,nm=null;function rm(){nm=Zs=oc=null}function im(t){var e=sc.current;lt(sc),t._currentValue=e}function kf(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function lo(t,e){oc=t,nm=Zs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(wn=!0),t.firstContext=null)}function Xn(t){var e=t._currentValue;if(nm!==t)if(t={context:t,memoizedValue:e,next:null},Zs===null){if(oc===null)throw Error(X(308));Zs=t,oc.dependencies={lanes:0,firstContext:t}}else Zs=Zs.next=t;return e}var us=null;function sm(t){us===null?us=[t]:us.push(t)}function M_(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,sm(e)):(n.next=i.next,i.next=n),e.interleaved=n,Gr(t,r)}function Gr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var mi=!1;function om(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function V_(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function $r(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ni(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,qe&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Gr(t,n)}return i=r.interleaved,i===null?(e.next=e,sm(r)):(e.next=i.next,i.next=e),r.interleaved=e,Gr(t,n)}function Su(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,qp(t,n)}}function g0(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ac(t,e,n,r){var i=t.updateQueue;mi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=u))}if(s!==null){var h=i.baseState;o=0,f=c=u=null,a=s;do{var p=a.lane,m=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var b=t,S=a;switch(p=e,m=n,S.tag){case 1:if(b=S.payload,typeof b=="function"){h=b.call(m,h,p);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=S.payload,p=typeof b=="function"?b.call(m,h,p):b,p==null)break e;h=ft({},h,p);break e;case 2:mi=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=m,u=h):f=f.next=m,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);_s|=o,t.lanes=o,t.memoizedState=h}}function y0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=yh.transition;yh.transition={};try{t(!1),e()}finally{Xe=n,yh.transition=r}}function t1(){return Jn().memoizedState}function Ik(t,e,n){var r=Pi(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},n1(t))r1(e,n);else if(n=M_(t,e,n,r),n!==null){var i=hn();ar(n,t,r,i),i1(n,e,r)}}function Sk(t,e,n){var r=Pi(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(n1(t))r1(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,ur(a,o)){var u=e.interleaved;u===null?(i.next=i,sm(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=M_(t,e,i,r),n!==null&&(i=hn(),ar(n,t,r,i),i1(n,e,r))}}function n1(t){var e=t.alternate;return t===ht||e!==null&&e===ht}function r1(t,e){Ta=uc=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function i1(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,qp(t,n)}}var cc={readContext:Xn,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useInsertionEffect:tn,useLayoutEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useMutableSource:tn,useSyncExternalStore:tn,useId:tn,unstable_isNewReconciler:!1},Tk={readContext:Xn,useCallback:function(t,e){return mr().memoizedState=[t,e===void 0?null:e],t},useContext:Xn,useEffect:x0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,ku(4194308,4,Y_.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ku(4194308,4,t,e)},useInsertionEffect:function(t,e){return ku(4,2,t,e)},useMemo:function(t,e){var n=mr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=mr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Ik.bind(null,ht,t),[r.memoizedState,t]},useRef:function(t){var e=mr();return t={current:t},e.memoizedState=t},useState:v0,useDebugValue:pm,useDeferredValue:function(t){return mr().memoizedState=t},useTransition:function(){var t=v0(!1),e=t[0];return t=Ek.bind(null,t[1]),mr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ht,i=mr();if(ct){if(n===void 0)throw Error(X(407));n=n()}else{if(n=e(),$t===null)throw Error(X(349));ws&30||B_(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,x0(H_.bind(null,r,s,t),[t]),r.flags|=2048,el(9,$_.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=mr(),e=$t.identifierPrefix;if(ct){var n=Ur,r=Fr;n=(r&~(1<<32-or(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ja++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[vr]=e,t[Qa]=r,p1(t,e,!1,!1),e.stateNode=t;e:{switch(o=uf(n,r),n){case"dialog":at("cancel",t),at("close",t),i=r;break;case"iframe":case"object":case"embed":at("load",t),i=r;break;case"video":case"audio":for(i=0;iIo&&(e.flags|=128,r=!0,aa(s,!1),e.lanes=4194304)}else{if(!r)if(t=lc(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),aa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ct)return nn(e),null}else 2*Tt()-s.renderingStartTime>Io&&n!==1073741824&&(e.flags|=128,r=!0,aa(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Tt(),e.sibling=null,n=dt.current,it(dt,r?n&1|2:n&1),e):(nn(e),null);case 22:case 23:return wm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?jn&1073741824&&(nn(e),e.subtreeFlags&6&&(e.flags|=8192)):nn(e),null;case 24:return null;case 25:return null}throw Error(X(156,e.tag))}function jk(t,e){switch(em(e),e.tag){case 1:return bn(e.type)&&tc(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return bo(),lt(_n),lt(ln),um(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return lm(e),null;case 13:if(lt(dt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));wo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return lt(dt),null;case 4:return bo(),null;case 10:return im(e.type._context),null;case 22:case 23:return wm(),null;case 24:return null;default:return null}}var iu=!1,on=!1,Lk=typeof WeakSet=="function"?WeakSet:Set,ce=null;function eo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){wt(t,e,r)}else n.current=null}function Of(t,e,n){try{n()}catch(r){wt(t,e,r)}}var A0=!1;function Ok(t,e){if(xf=Xu,t=__(),Jp(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,f=0,h=t,p=null;t:for(;;){for(var m;h!==n||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(u=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===t)break t;if(p===n&&++c===i&&(a=o),p===s&&++f===r&&(u=o),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(wf={focusedElem:t,selectionRange:n},Xu=!1,ce=e;ce!==null;)if(e=ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ce=t;else for(;ce!==null;){e=ce;try{var b=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var S=b.memoizedProps,P=b.memoizedState,y=e.stateNode,w=y.getSnapshotBeforeUpdate(e.elementType===e.type?S:er(e.type,S),P);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var T=e.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(L){wt(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,ce=t;break}ce=e.return}return b=A0,A0=!1,b}function ka(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Of(e,n,s)}i=i.next}while(i!==r)}}function Xc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Mf(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function y1(t){var e=t.alternate;e!==null&&(t.alternate=null,y1(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[vr],delete e[Qa],delete e[Ef],delete e[vk],delete e[xk])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function v1(t){return t.tag===5||t.tag===3||t.tag===4}function P0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||v1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vf(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ec));else if(r!==4&&(t=t.child,t!==null))for(Vf(t,e,n),t=t.sibling;t!==null;)Vf(t,e,n),t=t.sibling}function Ff(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Ff(t,e,n),t=t.sibling;t!==null;)Ff(t,e,n),t=t.sibling}var Kt=null,tr=!1;function di(t,e,n){for(n=n.child;n!==null;)x1(t,e,n),n=n.sibling}function x1(t,e,n){if(_r&&typeof _r.onCommitFiberUnmount=="function")try{_r.onCommitFiberUnmount($c,n)}catch{}switch(n.tag){case 5:on||eo(n,e);case 6:var r=Kt,i=tr;Kt=null,di(t,e,n),Kt=r,tr=i,Kt!==null&&(tr?(t=Kt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Kt.removeChild(n.stateNode));break;case 18:Kt!==null&&(tr?(t=Kt,n=n.stateNode,t.nodeType===8?ph(t.parentNode,n):t.nodeType===1&&ph(t,n),Ha(t)):ph(Kt,n.stateNode));break;case 4:r=Kt,i=tr,Kt=n.stateNode.containerInfo,tr=!0,di(t,e,n),Kt=r,tr=i;break;case 0:case 11:case 14:case 15:if(!on&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Of(n,e,o),i=i.next}while(i!==r)}di(t,e,n);break;case 1:if(!on&&(eo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){wt(n,e,a)}di(t,e,n);break;case 21:di(t,e,n);break;case 22:n.mode&1?(on=(r=on)||n.memoizedState!==null,di(t,e,n),on=r):di(t,e,n);break;default:di(t,e,n)}}function R0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Lk),e.forEach(function(r){var i=qk.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zn(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Vk(r/1960))-r,10t?16:t,bi===null)var r=!1;else{if(t=bi,bi=null,fc=0,qe&6)throw Error(X(331));var i=qe;for(qe|=4,ce=t.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uTt()-vm?hs(t,0):ym|=n),En(t,e)}function k1(t,e){e===0&&(t.mode&1?(e=Ql,Ql<<=1,!(Ql&130023424)&&(Ql=4194304)):e=1);var n=hn();t=Gr(t,e),t!==null&&(gl(t,e,n),En(t,n))}function Hk(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),k1(t,n)}function qk(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(e),k1(t,n)}var C1;C1=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||_n.current)wn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return wn=!1,Rk(t,e,n);wn=!!(t.flags&131072)}else wn=!1,ct&&e.flags&1048576&&R_(e,ic,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Cu(t,e),t=e.pendingProps;var i=xo(e,ln.current);lo(e,n),i=dm(null,e,r,t,i,n);var s=hm();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,bn(r)?(s=!0,nc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,om(e),i.updater=Yc,e.stateNode=i,i._reactInternals=e,Nf(e,r,t,n),e=Rf(null,e,r,!0,s,n)):(e.tag=0,ct&&s&&Zp(e),dn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Cu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=Gk(r),t=er(r,t),i){case 0:e=Pf(null,e,r,t,n);break e;case 1:e=k0(null,e,r,t,n);break e;case 11:e=S0(null,e,r,t,n);break e;case 14:e=T0(null,e,r,er(r.type,t),n);break e}throw Error(X(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Pf(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),k0(t,e,r,i,n);case 3:e:{if(d1(e),t===null)throw Error(X(387));r=e.pendingProps,s=e.memoizedState,i=s.element,V_(t,e),ac(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Eo(Error(X(423)),e),e=C0(t,e,r,n,i);break e}else if(r!==i){i=Eo(Error(X(424)),e),e=C0(t,e,r,n,i);break e}else for(Ln=Ci(e.stateNode.containerInfo.firstChild),Vn=e,ct=!0,nr=null,n=O_(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wo(),r===i){e=Kr(t,e,n);break e}dn(t,e,r,n)}e=e.child}return e;case 5:return F_(e),t===null&&Tf(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,_f(r,i)?o=null:s!==null&&_f(r,s)&&(e.flags|=32),c1(t,e),dn(t,e,o,n),e.child;case 6:return t===null&&Tf(e),null;case 13:return h1(t,e,n);case 4:return am(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=_o(e,null,r,n):dn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),S0(t,e,r,i,n);case 7:return dn(t,e,e.pendingProps,n),e.child;case 8:return dn(t,e,e.pendingProps.children,n),e.child;case 12:return dn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,it(sc,r._currentValue),r._currentValue=o,s!==null)if(ur(s.value,o)){if(s.children===i.children&&!_n.current){e=Kr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=$r(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),kf(s.return,n,e),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(X(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),kf(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}dn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,lo(e,n),i=Xn(i),r=r(i),e.flags|=1,dn(t,e,r,n),e.child;case 14:return r=e.type,i=er(r,e.pendingProps),i=er(r.type,i),T0(t,e,r,i,n);case 15:return l1(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Cu(t,e),e.tag=1,bn(r)?(t=!0,nc(e)):t=!1,lo(e,n),s1(e,r,i),Nf(e,r,i,n),Rf(null,e,r,!0,t,n);case 19:return f1(t,e,n);case 22:return u1(t,e,n)}throw Error(X(156,e.tag))};function N1(t,e){return n_(t,e)}function Wk(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(t,e,n,r){return new Wk(t,e,n,r)}function bm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Gk(t){if(typeof t=="function")return bm(t)?1:0;if(t!=null){if(t=t.$$typeof,t===zp)return 11;if(t===Bp)return 14}return 2}function Ri(t,e){var n=t.alternate;return n===null?(n=Gn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Pu(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")bm(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case qs:return fs(n.children,i,s,e);case Up:o=8,i|=8;break;case Jh:return t=Gn(12,n,e,i|2),t.elementType=Jh,t.lanes=s,t;case Zh:return t=Gn(13,n,e,i),t.elementType=Zh,t.lanes=s,t;case ef:return t=Gn(19,n,e,i),t.elementType=ef,t.lanes=s,t;case Fw:return Zc(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Mw:o=10;break e;case Vw:o=9;break e;case zp:o=11;break e;case Bp:o=14;break e;case pi:o=16,r=null;break e}throw Error(X(130,t==null?t:typeof t,""))}return e=Gn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function fs(t,e,n,r){return t=Gn(7,t,r,e),t.lanes=n,t}function Zc(t,e,n,r){return t=Gn(22,t,r,e),t.elementType=Fw,t.lanes=n,t.stateNode={isHidden:!1},t}function bh(t,e,n){return t=Gn(6,t,null,e),t.lanes=n,t}function Eh(t,e,n){return e=Gn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Kk(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rh(0),this.expirationTimes=rh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Em(t,e,n,r,i,s,o,a,u){return t=new Kk(t,e,n,a,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Gn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},om(s),t}function Qk(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(D1)}catch(t){console.error(t)}}D1(),Dw.exports=Un;var j1=Dw.exports;const e2=zc(j1);var L1,U0=j1;L1=U0.createRoot,U0.hydrateRoot;/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var t2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Re=(t,e)=>{const n=V.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,...c},f)=>V.createElement("svg",{ref:f,...t2,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${n2(t)}`,a].join(" "),...c},[...e.map(([h,p])=>V.createElement(h,p)),...Array.isArray(u)?u:[u]]));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r2=Re("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const So=Re("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i2=Re("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z0=Re("BookMarked",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["polyline",{points:"10 2 10 10 13 7 16 10 16 2",key:"13o6vz"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nl=Re("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s2=Re("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wl=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const id=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sd=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O1=Re("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M1=Re("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o2=Re("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a2=Re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ua=Re("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hf=Re("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ca=Re("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V1=Re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qf=Re("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wf=Re("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B0=Re("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $0=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F1=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l2=Re("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U1=Re("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u2=Re("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z1=Re("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B1=Re("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const co=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const km=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gf=Re("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cm=Re("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gc=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c2=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H0=Re("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $1=Re("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d2=Re("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h2=Re("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wr=Re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nm=Re("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const In=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Am=Re("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pm=Re("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Ih=new Set;function Kn({src:t,alt:e,className:n="",imgClassName:r="",objectFit:i="contain",aspectRatio:s,loading:o,draggable:a}){const u=Ih.has(t),[c,f]=V.useState(u),[h,p]=V.useState(!1),[m,b]=V.useState(0);V.useEffect(()=>{Ih.has(t)?(f(!0),p(!1)):(f(!1),p(!1)),b(0)},[t]);const S=()=>{p(!1),f(!1),b(w=>w+1)},P=()=>{f(!0),p(!1),Ih.add(t)},y=m>0?`${t}${t.includes("?")?"&":"?"}retry=${m}`:t;return d.jsxs("div",{className:`relative w-full h-full overflow-hidden ${h?"bg-[#1a1a1a]/50 rounded-lg min-h-[300px]":""} ${n}`,style:s&&s!=="auto"?{aspectRatio:s}:void 0,children:[d.jsx("div",{className:`absolute inset-0 flex items-center justify-center transition-opacity duration-500 ${c?"opacity-0 pointer-events-none":"opacity-100"}`,children:h?d.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center max-w-sm w-full h-full",children:[d.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center mb-3",children:d.jsx(r2,{className:"w-6 h-6 text-red-500"})}),d.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"La imagen no cargó. ImgBB podría tener problemas."}),d.jsxs("button",{onClick:S,className:"flex items-center justify-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 text-white rounded-lg transition-colors border border-gray-700 w-full max-w-[200px]",children:[d.jsx(km,{className:"w-4 h-4"}),d.jsxs("span",{children:["Reintentar (",m,")"]})]})]}):d.jsx("div",{className:"w-8 h-8 border-2 border-[#bb86fc] border-t-transparent rounded-full animate-spin"})}),!h&&d.jsx("img",{src:y,alt:e,loading:o,draggable:a,className:`w-full h-full object-${i} transition-all duration-1000 ease-linear ${r} ${c?"opacity-100":"opacity-0"}`,onLoad:P,onError:()=>{p(!0),f(!1)}})]})}function H1({images:t,initialIndex:e,onClose:n}){const[r,i]=V.useState(e),[s,o]=V.useState(!1),[a,u]=V.useState(0),[c,f]=V.useState(1),[h,p]=V.useState({x:0,y:0}),[m,b]=V.useState(!1),[S,P]=V.useState({x:0,y:0}),[y,w]=V.useState(null),[T,L]=V.useState(1),F=V.useRef(null);V.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}),[]);const D=H=>{const J=t.length;return(H%J+J)%J},_=H=>Math.hypot(H[0].clientX-H[1].clientX,H[0].clientY-H[1].clientY),x=(H,J)=>{const te=window.innerWidth,Ie=window.innerHeight,pe=(te*J-te)/2,Fe=(Ie*J-Ie)/2;return{x:Math.min(Math.max(H.x,-pe),pe),y:Math.min(Math.max(H.y,-Fe),Fe)}},E=s?2:1,k=()=>{i(H=>D(H-E)),u(0),f(1),p({x:0,y:0})},C=()=>{i(H=>D(H+E)),u(0),f(1),p({x:0,y:0})},j=(H,J)=>{b(!0),P({x:H,y:J})},A=(H,J)=>{if(m)if(c>1){const te=H-S.x,Ie=J-S.y;p(pe=>({x:pe.x+te,y:pe.y+Ie})),P({x:H,y:J})}else{const te=H-S.x;u(te)}},de=()=>{var te;if(b(!1),w(null),c>1)return;const J=(((te=F.current)==null?void 0:te.clientWidth)||window.innerWidth)*.25;Math.abs(a)>J?a>0?k():C():u(0)},oe=H=>{H.preventDefault(),j(H.clientX,H.clientY)},le=H=>{H.preventDefault(),A(H.clientX,H.clientY)},ve=()=>de(),K=H=>{if(H.touches.length===2){const J=_(H.touches);w(J),L(c),b(!1)}else H.touches.length===1&&j(H.touches[0].clientX,H.touches[0].clientY)},ie=H=>{if(H.touches.length===2&&y!==null){const te=_(H.touches)/y,Ie=Math.min(Math.max(T*te,1),4);f(Ie),p(pe=>x(pe,Ie))}else H.touches.length===1&&A(H.touches[0].clientX,H.touches[0].clientY)},N=H=>{if(y!==null&&H.touches.length<2){w(null);return}de()};V.useEffect(()=>{function H(J){J.key==="Escape"?n():J.key==="ArrowLeft"?k():J.key==="ArrowRight"?C():J.key==="+"||J.key==="="?f(te=>{const Ie=Math.min(te+.5,4);return p(pe=>x(pe,Ie)),Ie}):J.key==="-"&&f(te=>{const Ie=Math.max(te-.5,1);return p(pe=>x(pe,Ie)),Ie})}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[c,s]);let fe=`translateX(calc(-33.333333% + ${a}px))`,ye=m?"none":"transform 0.1s ease-out";a===0&&(ye="none");const R=H=>{const J=D(H);if(s){const te=D(H+1);return d.jsxs("div",{className:"flex w-full h-full items-center justify-center px-2 sm:px-10",children:[d.jsx("div",{className:"flex-1 h-full flex items-center justify-end",children:d.jsx(Kn,{src:t[J],alt:`Página ${J+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-lg origin-right object-right transition-none"})}),d.jsx("div",{className:"flex-1 h-full flex items-center justify-start",children:d.jsx(Kn,{src:t[te],alt:`Página ${te+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-lg origin-left object-left transition-none"})})]})}else return d.jsx(Kn,{src:t[J],alt:`Página ${J+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-2xl transition-none"})};return d.jsxs("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 select-none touch-none overflow-hidden",style:{touchAction:"none"},ref:F,onWheel:H=>{H.stopPropagation();const J=H.deltaY<0?.5:-.5;f(te=>{const Ie=Math.min(Math.max(te+J,1),4);return p(pe=>x(pe,Ie)),Ie})},onMouseDown:oe,onMouseMove:le,onMouseUp:ve,onMouseLeave:()=>{b(!1),c===1&&u(0)},onTouchStart:K,onTouchMove:ie,onTouchEnd:N,children:[d.jsxs("div",{className:"absolute top-6 right-6 flex items-center gap-4 z-50",children:[d.jsxs("div",{className:"flex items-center gap-2 bg-black/50 rounded-lg p-1",children:[d.jsx("button",{onClick:()=>o(!s),className:`p-2 transition-colors ${s?"text-[#bb86fc]":"text-white hover:text-[#bb86fc]"}`,title:s?"Vista Individual":"Vista de Libro",children:s?d.jsx(nl,{className:"w-5 h-5"}):d.jsx(s2,{className:"w-5 h-5"})}),d.jsx("div",{className:"w-px h-4 bg-white/20 mx-1"}),d.jsx("button",{onClick:()=>f(H=>{const J=Math.max(H-.5,1);return p(te=>x(te,J)),J}),className:"p-2 text-white hover:text-[#bb86fc] transition-colors",children:d.jsx(Pm,{className:"w-5 h-5"})}),d.jsxs("span",{className:"text-white text-sm min-w-[3ch] text-center",children:[Math.round(c*100),"%"]}),d.jsx("button",{onClick:()=>f(H=>{const J=Math.min(H+.5,4);return p(te=>x(te,J)),J}),className:"p-2 text-white hover:text-[#bb86fc] transition-colors",children:d.jsx(Am,{className:"w-5 h-5"})})]}),d.jsx("button",{onClick:n,className:"p-2 rounded-lg bg-white/10 hover:bg-white/20 text-white transition-all duration-200",children:d.jsx(In,{className:"w-6 h-6"})})]}),d.jsxs("div",{className:"flex h-full w-[300%] absolute top-0 left-0",style:{transform:fe,transition:ye},children:[d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:R(r-E)}),d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:d.jsx("div",{className:"relative flex items-center justify-center w-full h-full",style:{transform:`translate(${h.x}px, ${h.y}px) scale(${c})`,transition:m?"none":"transform 0.1s ease-out",cursor:c>1?m?"grabbing":"grab":"default"},onDoubleClick:H=>{H.stopPropagation(),f(J=>J>1?1:2.5),p({x:0,y:0})},children:R(r)})}),d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:R(r+E)})]}),c===1&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:H=>{H.stopPropagation(),k()},className:"absolute left-4 sm:left-8 top-1/2 -translate-y-1/2 p-3 sm:p-4 rounded-lg text-white opacity-40 hover:opacity-100 transition-opacity duration-200 z-40",children:d.jsx(id,{className:"w-8 h-8 sm:w-10 sm:h-10"})}),d.jsx("button",{onClick:H=>{H.stopPropagation(),C()},className:"absolute right-4 sm:right-8 top-1/2 -translate-y-1/2 p-3 sm:p-4 rounded-lg text-white opacity-40 hover:opacity-100 transition-opacity duration-200 z-40",children:d.jsx(sd,{className:"w-8 h-8 sm:w-10 sm:h-10"})})]}),d.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 text-white px-4 py-2 rounded-lg text-sm font-medium z-40 pointer-events-none",children:s?`${r+1}-${Math.min(r+2,t.length)} / ${t.length}`:`${r+1} / ${t.length}`})]})}function od(){return d.jsxs("footer",{className:"py-6 border-t border-gray-800/50 flex flex-col md:flex-row items-center justify-between gap-4 text-gray-400 text-sm mt-auto w-full px-8 relative",children:[d.jsxs("div",{className:"flex flex-wrap justify-center gap-6 mx-auto",children:[d.jsxs("a",{href:"https://t.me/twistedbrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.295-.605.295l.213-3.054 5.56-5.022c.242-.213-.054-.333-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z"})}),"Twisted Brody"]}),d.jsxs("a",{href:"https://t.me/+CmmZFHM9hpViYzMx",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.295-.605.295l.213-3.054 5.56-5.022c.242-.213-.054-.333-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z"})}),"Canal Hub"]}),d.jsxs("a",{href:"https://x.com/TwistedBrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X"]}),d.jsxs("a",{href:"https://www.patreon.com/cw/Twistedbrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M0 .48v23.04h4.22V.48zm15.385 0c-4.764 0-8.641 3.88-8.641 8.65 0 4.755 3.877 8.623 8.641 8.623 4.75 0 8.615-3.868 8.615-8.623C24 4.36 20.136.48 15.385.48z"})}),"Patreon"]}),d.jsxs("button",{onClick:()=>{window.location.hash="info"},className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx(F1,{className:"w-4 h-4"}),d.jsx("span",{children:"Info"})]})]}),d.jsxs("div",{className:"md:absolute md:right-8 text-xs opacity-50",children:["Twisted Brody MangaFlow © ",new Date().getFullYear()]})]})}function f2({manga:t,onBack:e}){const n=t.chapters&&t.chapters.length>0?t.chapters[0]:null,r=n?n.original_pages&&n.original_pages.length>0?n.original_pages:n.pages:[],[i,s]=V.useState("vertical"),[o,a]=V.useState(1),[u,c]=V.useState(!1),[f,h]=V.useState(0);if(!r||r.length===0)return d.jsxs("div",{className:"min-h-screen bg-[#121212] flex flex-col items-center justify-center",children:[d.jsx("button",{onClick:e,className:"absolute top-6 left-6 p-2 hover:bg-[#333] rounded-lg transition-colors text-white",children:d.jsx(So,{className:"w-6 h-6"})}),d.jsx("div",{className:"text-gray-400 text-lg",children:"No hay páginas disponibles"})]});const p=()=>a(S=>Math.min(S+.25,3)),m=()=>a(S=>Math.max(S-.25,.5)),b=()=>a(1);return d.jsxs("div",{className:"min-h-screen flex flex-col bg-[#121212]",children:[d.jsxs("header",{className:"sticky top-0 z-50 bg-[#121212]/90 backdrop-blur-md border-b border-gray-800 px-4 py-3 flex items-center justify-between gap-4",children:[d.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:d.jsxs("button",{onClick:e,className:"p-2 hover:bg-[#333] rounded-lg transition-colors text-white flex items-center gap-2",children:[d.jsx(So,{className:"w-5 h-5"}),d.jsx("span",{className:"font-semibold text-sm hidden sm:inline",children:"Volver"})]})}),d.jsx("div",{className:"flex-1 flex justify-center min-w-0",children:d.jsxs("h1",{className:"text-white font-bold truncate text-center max-w-full",children:[t.title," ",d.jsx("span",{className:"text-[#bb86fc] text-xs ml-2 border border-[#bb86fc] px-1 rounded",children:"HD"})]})}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1 hidden md:flex",children:[d.jsx("button",{onClick:()=>s("vertical"),className:`p-2 rounded-md transition-all duration-200 ${i==="vertical"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Vertical",children:d.jsx(Gf,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>s("gallery"),className:`p-2 rounded-md transition-all duration-200 ${i==="gallery"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Galería",children:d.jsx(qf,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>s("grid"),className:`p-2 rounded-md transition-all duration-200 ${i==="grid"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Cuadrícula",children:d.jsx(Wf,{className:"w-4 h-4"})})]}),i==="vertical"&&d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsx("button",{onClick:m,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",children:d.jsx(Pm,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-xs text-gray-300 w-8 text-center",children:[Math.round(o*100),"%"]}),d.jsx("button",{onClick:p,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",children:d.jsx(Am,{className:"w-4 h-4"})}),d.jsx("button",{onClick:b,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",title:"Reset",children:d.jsx(km,{className:"w-3 h-3"})})]})]})]}),d.jsx("div",{className:"md:hidden px-4 py-2 border-b border-gray-800 bg-[#121212] flex justify-center",children:d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsxs("button",{onClick:()=>s("vertical"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="vertical"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(Gf,{className:"w-3 h-3"})," Vertical"]}),d.jsxs("button",{onClick:()=>s("gallery"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="gallery"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(qf,{className:"w-3 h-3"})," Galería"]}),d.jsxs("button",{onClick:()=>s("grid"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="grid"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(Wf,{className:"w-3 h-3"})," Cuadrícula"]})]})}),d.jsx("main",{className:"flex-1 w-full max-w-[1920px] mx-auto px-0 sm:px-4 py-6",children:d.jsx("div",{className:` + bg-[#050505] min-h-screen transition-all duration-150 ease-out + ${i==="vertical"?"flex flex-col items-center gap-1":""} + ${i==="gallery"?"masonry-container p-2":""} + ${i==="grid"?"grid grid-cols-3 md:grid-cols-5 gap-2 p-2":""} + `,children:r.map((S,P)=>{const y=S;return i==="vertical"?d.jsx("div",{className:"relative transition-all duration-200",style:{width:o===1?"100%":`${100*o}%`,maxWidth:o>1?"none":"80rem"},children:d.jsx("div",{className:`mx-auto ${o<=1?"max-w-5xl":""}`,children:d.jsx(Kn,{src:y,alt:`Página ${P+1}`,aspectRatio:"auto",objectFit:"contain",loading:P<3?"eager":"lazy",className:"w-full h-auto",imgClassName:"w-full h-auto block"})})},P):d.jsx("div",{className:` + group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02] + ${i==="gallery"?"masonry-item":""} + `,onClick:()=>{h(P),c(!0)},children:d.jsx(Kn,{src:y,alt:`Página ${P+1}`,aspectRatio:i==="grid"?"1/1":"auto",objectFit:i==="grid"?"cover":"contain",loading:P<5?"eager":"lazy",className:"w-full h-auto rounded-lg",imgClassName:"group-hover:scale-110"})},P)})})}),d.jsx(od,{}),u&&d.jsx(H1,{images:r,initialIndex:f,onClose:()=>c(!1)})]})}async function q0(t,e,n){const r=await p2(t),i=m2(t);try{const s=await fetch("/api/process-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:r,name:t.name,index:e,total:n})});if(!s.ok)throw new Error(`Server processing failed: ${s.statusText}`);const o=await s.json();if(!o.success||!o.data)throw new Error("Invalid response from processing server");return{thumbnail:o.data.thumbnail,original:r,webpDisplay:o.data.webp,webpCover:o.data.webp,originalFormat:i,originalBase64:r,originalUnmodified:r}}catch(s){throw console.error("Error processing image on server, falling back to local:",s),s}}async function p2(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{var s;return e((s=i.target)==null?void 0:s.result)},r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(t)})}function m2(t){var r;const e=t.type;if(e==="image/png")return"png";if(e==="image/jpeg")return"jpg";if(e==="image/gif")return"gif";if(e==="image/webp")return"webp";const n=(r=t.name.split(".").pop())==null?void 0:r.toLowerCase();return n&&["png","jpg","jpeg","gif","webp"].includes(n)?n==="jpeg"?"jpg":n:"jpg"}async function g2(t){return new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const i=r.width/r.height;i<.9?e("portrait"):i>1.1?e("landscape"):e("square")},r.onerror=()=>n(new Error("Failed to load image")),r.src=t})}const Rm="userApiKey";function y2(t){if(!t||t.trim()==="")throw new Error("API key no puede estar vacía");localStorage.setItem(Rm,t.trim())}function q1(){return localStorage.getItem(Rm)}function v2(){localStorage.removeItem(Rm)}const W1="imageBatchSize",W0=10;function au(t){if(t<0)throw new Error("El tamaño del lote no puede ser negativo");localStorage.setItem(W1,t.toString())}function G1(){const t=localStorage.getItem(W1);if(!t)return W0;const e=parseInt(t,10);return isNaN(e)||e<0?W0:e>=999999?0:e}const x2="90ba8efe6890e9e76175089dc182a22a",w2="https://api.imgbb.com/1/upload";function _2(){return q1()||x2}const Ru=t=>new Promise(e=>setTimeout(e,t));async function yc(t,e,n=3){var u,c,f;const r=t.includes(",")?t.split(",")[1]:t,i=_2(),s=`${w2}?key=${i}`,o=new FormData;o.append("image",r),e&&o.append("name",e);let a=0;for(;ah.abort(),3e4);try{const m=await fetch(s,{method:"POST",body:o,signal:h.signal});if(clearTimeout(p),!m.ok){const S=await m.text();if(m.status===429||S.includes("rate limit"))throw new Error("API_BURNED");if(m.status===403||m.status===401)throw new Error("API_INVALID_KEY");if(m.status>=500&&a=n)throw m}}throw new Error("No se pudo subir la imagen a ImgBB tras varios intentos.")}async function lu(t,e,n){const r=G1(),i=[];if(r===0||r>=t.length){const s=t.map((a,u)=>{const c=e?`${e}_${u+1}`:void 0;return yc(a,c)}),o=await Promise.all(s);i.push(...o),n&&n(t.length,t.length)}else for(let s=0;s{const h=s+f,p=e?`${e}_${h+1}`:void 0;return yc(c,p)}),u=await Promise.all(a);i.push(...u),n&&n(Math.min(s+r,t.length),t.length),s+r{};var G0={};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const K1=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},E2=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],a=t[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Q1={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,h=(s&3)<<4|a>>4;let p=(a&15)<<2|c>>6,m=c&63;u||(m=64,o||(p=64)),r.push(n[f],n[h],n[p],n[m])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(K1(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):E2(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(p),c!==64){const m=a<<4&240|c>>2;if(r.push(m),h!==64){const b=c<<6&192|h;r.push(b)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class I2 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const S2=function(t){const e=K1(t);return Q1.encodeByteArray(e,!0)},vc=function(t){return S2(t).replace(/\./g,"")},Y1=function(t){try{return Q1.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */function T2(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */const k2=()=>T2().__FIREBASE_DEFAULTS__,C2=()=>{if(typeof process>"u"||typeof G0>"u")return;const t=G0.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},N2=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&Y1(t[1]);return e&&JSON.parse(e)},ad=()=>{try{return b2()||k2()||C2()||N2()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},X1=t=>{var e,n;return(n=(e=ad())==null?void 0:e.emulatorHosts)==null?void 0:n[t]},J1=t=>{const e=X1(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},Z1=()=>{var t;return(t=ad())==null?void 0:t.config},eb=t=>{var e;return(e=ad())==null?void 0:e[`_${t}`]};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class A2{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** + * @license + * Copyright 2025 Google LLC + * + * 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. + */function As(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Dm(t){return(await fetch(t,{credentials:"include"})).ok}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function tb(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...t};return[vc(JSON.stringify(n)),vc(JSON.stringify(o)),""].join(".")}const Aa={};function P2(){const t={prod:[],emulator:[]};for(const e of Object.keys(Aa))Aa[e]?t.emulator.push(e):t.prod.push(e);return t}function R2(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let K0=!1;function jm(t,e){if(typeof window>"u"||typeof document>"u"||!As(window.location.host)||Aa[t]===e||Aa[t]||K0)return;Aa[t]=e;function n(p){return`__firebase__banner__${p}`}const r="__firebase__banner",s=P2().prod.length>0;function o(){const p=document.getElementById(r);p&&p.remove()}function a(p){p.style.display="flex",p.style.background="#7faaf0",p.style.position="fixed",p.style.bottom="5px",p.style.left="5px",p.style.padding=".5em",p.style.borderRadius="5px",p.style.alignItems="center"}function u(p,m){p.setAttribute("width","24"),p.setAttribute("id",m),p.setAttribute("height","24"),p.setAttribute("viewBox","0 0 24 24"),p.setAttribute("fill","none"),p.style.marginLeft="-6px"}function c(){const p=document.createElement("span");return p.style.cursor="pointer",p.style.marginLeft="16px",p.style.fontSize="24px",p.innerHTML=" ×",p.onclick=()=>{K0=!0,o()},p}function f(p,m){p.setAttribute("id",m),p.innerText="Learn more",p.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",p.setAttribute("target","__blank"),p.style.paddingLeft="5px",p.style.textDecoration="underline"}function h(){const p=R2(r),m=n("text"),b=document.getElementById(m)||document.createElement("span"),S=n("learnmore"),P=document.getElementById(S)||document.createElement("a"),y=n("preprendIcon"),w=document.getElementById(y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.created){const T=p.element;a(T),f(P,S);const L=c();u(w,y),T.append(w,b,P,L),document.body.appendChild(T)}s?(b.innerText="Preview backend disconnected.",w.innerHTML=` + + + + + + +`):(w.innerHTML=` + + + + + + +`,b.innerText="Preview backend running in this workspace."),b.setAttribute("id",m)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function un(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function D2(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(un())}function j2(){var e;const t=(e=ad())==null?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function L2(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function O2(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function M2(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function V2(){const t=un();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function F2(){return!j2()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function U2(){try{return typeof indexedDB=="object"}catch{return!1}}function z2(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)==null?void 0:s.message)||"")}}catch(n){e(n)}})}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const B2="FirebaseError";class Dr extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=B2,Object.setPrototypeOf(this,Dr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,_l.prototype.create)}}class _l{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?$2(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Dr(i,a,r)}}function $2(t,e){return t.replace(H2,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const H2=/\{\$([^}]+)}/g;function q2(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Es(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(Q0(s)&&Q0(o)){if(!Es(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Q0(t){return t!==null&&typeof t=="object"}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function bl(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function W2(t,e){const n=new G2(t,e);return n.subscribe.bind(n)}class G2{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");K2(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=Sh),i.error===void 0&&(i.error=Sh),i.complete===void 0&&(i.complete=Sh);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function K2(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Sh(){}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function Zt(t){return t&&t._delegate?t._delegate:t}class Fi{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const os="[DEFAULT]";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Q2{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new A2;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(X2(e))try{this.getOrInitializeService({instanceIdentifier:os})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=os){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=os){return this.instances.has(e)}getOptions(e=os){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Y2(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=os){return this.component?this.component.multipleInstances?e:os:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Y2(t){return t===os?void 0:t}function X2(t){return t.instantiationMode==="EAGER"}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class J2{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new Q2(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */var Ue;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Ue||(Ue={}));const Z2={debug:Ue.DEBUG,verbose:Ue.VERBOSE,info:Ue.INFO,warn:Ue.WARN,error:Ue.ERROR,silent:Ue.SILENT},eC=Ue.INFO,tC={[Ue.DEBUG]:"log",[Ue.VERBOSE]:"log",[Ue.INFO]:"info",[Ue.WARN]:"warn",[Ue.ERROR]:"error"},nC=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let Y0,X0;function iC(){return Y0||(Y0=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sC(){return X0||(X0=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const nb=new WeakMap,Kf=new WeakMap,rb=new WeakMap,Th=new WeakMap,Om=new WeakMap;function oC(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Di(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&nb.set(n,t)}).catch(()=>{}),Om.set(e,t),e}function aC(t){if(Kf.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});Kf.set(t,e)}let Qf={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Kf.get(t);if(e==="objectStoreNames")return t.objectStoreNames||rb.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Di(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function lC(t){Qf=t(Qf)}function uC(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(kh(this),e,...n);return rb.set(r,e.sort?e.sort():[e]),Di(r)}:sC().includes(t)?function(...e){return t.apply(kh(this),e),Di(nb.get(this))}:function(...e){return Di(t.apply(kh(this),e))}}function cC(t){return typeof t=="function"?uC(t):(t instanceof IDBTransaction&&aC(t),rC(t,iC())?new Proxy(t,Qf):t)}function Di(t){if(t instanceof IDBRequest)return oC(t);if(Th.has(t))return Th.get(t);const e=cC(t);return e!==t&&(Th.set(t,e),Om.set(e,t)),e}const kh=t=>Om.get(t);function dC(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Di(o);return r&&o.addEventListener("upgradeneeded",u=>{r(Di(o.result),u.oldVersion,u.newVersion,Di(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const hC=["get","getKey","getAll","getAllKeys","count"],fC=["put","add","delete","clear"],Ch=new Map;function J0(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Ch.get(e))return Ch.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=fC.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||hC.includes(n)))return;const s=async function(o,...a){const u=this.transaction(o,i?"readwrite":"readonly");let c=u.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&u.done]))[0]};return Ch.set(e,s),s}lC(t=>({...t,get:(e,n,r)=>J0(e,n)||t.get(e,n,r),has:(e,n)=>!!J0(e,n)||t.has(e,n)}));/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class pC{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(mC(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function mC(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Yf="@firebase/app",Z0="0.14.6";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Qr=new Lm("@firebase/app"),gC="@firebase/app-compat",yC="@firebase/analytics-compat",vC="@firebase/analytics",xC="@firebase/app-check-compat",wC="@firebase/app-check",_C="@firebase/auth",bC="@firebase/auth-compat",EC="@firebase/database",IC="@firebase/data-connect",SC="@firebase/database-compat",TC="@firebase/functions",kC="@firebase/functions-compat",CC="@firebase/installations",NC="@firebase/installations-compat",AC="@firebase/messaging",PC="@firebase/messaging-compat",RC="@firebase/performance",DC="@firebase/performance-compat",jC="@firebase/remote-config",LC="@firebase/remote-config-compat",OC="@firebase/storage",MC="@firebase/storage-compat",VC="@firebase/firestore",FC="@firebase/ai",UC="@firebase/firestore-compat",zC="firebase",BC="12.6.0";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Xf="[DEFAULT]",$C={[Yf]:"fire-core",[gC]:"fire-core-compat",[vC]:"fire-analytics",[yC]:"fire-analytics-compat",[wC]:"fire-app-check",[xC]:"fire-app-check-compat",[_C]:"fire-auth",[bC]:"fire-auth-compat",[EC]:"fire-rtdb",[IC]:"fire-data-connect",[SC]:"fire-rtdb-compat",[TC]:"fire-fn",[kC]:"fire-fn-compat",[CC]:"fire-iid",[NC]:"fire-iid-compat",[AC]:"fire-fcm",[PC]:"fire-fcm-compat",[RC]:"fire-perf",[DC]:"fire-perf-compat",[jC]:"fire-rc",[LC]:"fire-rc-compat",[OC]:"fire-gcs",[MC]:"fire-gcs-compat",[VC]:"fire-fst",[UC]:"fire-fst-compat",[FC]:"fire-vertex","fire-js":"fire-js",[zC]:"fire-js-all"};/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const xc=new Map,HC=new Map,Jf=new Map;function ev(t,e){try{t.container.addComponent(e)}catch(n){Qr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Is(t){const e=t.name;if(Jf.has(e))return Qr.debug(`There were multiple attempts to register component ${e}.`),!1;Jf.set(e,t);for(const n of xc.values())ev(n,t);for(const n of HC.values())ev(n,t);return!0}function ld(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function rr(t){return t==null?!1:t.settings!==void 0}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const qC={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},ji=new _l("app","Firebase",qC);/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class WC{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Fi("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ji.create("app-deleted",{appName:this._name})}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Ps=BC;function ib(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:Xf,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw ji.create("bad-app-name",{appName:String(i)});if(n||(n=Z1()),!n)throw ji.create("no-options");const s=xc.get(i);if(s){if(Es(n,s.options)&&Es(r,s.config))return s;throw ji.create("duplicate-app",{appName:i})}const o=new J2(i);for(const u of Jf.values())o.addComponent(u);const a=new WC(n,r,o);return xc.set(i,a),a}function Mm(t=Xf){const e=xc.get(t);if(!e&&t===Xf&&Z1())return ib();if(!e)throw ji.create("no-app",{appName:t});return e}function Er(t,e,n){let r=$C[t]??t;n&&(r+=`-${n}`);const i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){const o=[`Unable to register library "${r}" with version "${e}":`];i&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&o.push("and"),s&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Qr.warn(o.join(" "));return}Is(new Fi(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const GC="firebase-heartbeat-database",KC=1,rl="firebase-heartbeat-store";let Nh=null;function sb(){return Nh||(Nh=dC(GC,KC,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(rl)}catch(n){console.warn(n)}}}}).catch(t=>{throw ji.create("idb-open",{originalErrorMessage:t.message})})),Nh}async function QC(t){try{const n=(await sb()).transaction(rl),r=await n.objectStore(rl).get(ob(t));return await n.done,r}catch(e){if(e instanceof Dr)Qr.warn(e.message);else{const n=ji.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Qr.warn(n.message)}}}async function tv(t,e){try{const r=(await sb()).transaction(rl,"readwrite");await r.objectStore(rl).put(e,ob(t)),await r.done}catch(n){if(n instanceof Dr)Qr.warn(n.message);else{const r=ji.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Qr.warn(r.message)}}}function ob(t){return`${t.name}!${t.options.appId}`}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const YC=1024,XC=30;class JC{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new eN(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=nv();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>XC){const o=tN(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Qr.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=nv(),{heartbeatsToSend:r,unsentEntries:i}=ZC(this._heartbeatsCache.heartbeats),s=vc(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(n){return Qr.warn(n),""}}}function nv(){return new Date().toISOString().substring(0,10)}function ZC(t,e=YC){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),rv(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),rv(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class eN{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return U2()?z2().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await QC(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return tv(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return tv(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function rv(t){return vc(JSON.stringify({version:2,heartbeats:t})).length}function tN(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;rnew pC(e),"PRIVATE")),Is(new Fi("heartbeat",e=>new JC(e),"PRIVATE")),Er(Yf,Z0,t),Er(Yf,Z0,"esm2020"),Er("fire-js","")}nN("");var rN="firebase",iN="12.6.0";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */Er(rN,iN,"app");var iv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var Li,ab;(function(){var t;/** @license + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/function e(_,x){function E(){}E.prototype=x.prototype,_.F=x.prototype,_.prototype=new E,_.prototype.constructor=_,_.D=function(k,C,j){for(var A=Array(arguments.length-2),de=2;de>>25),A=j+(C^x&(E^C))+k[1]+3905402710&4294967295,j=x+(A<<12&4294967295|A>>>20),A=C+(E^j&(x^E))+k[2]+606105819&4294967295,C=j+(A<<17&4294967295|A>>>15),A=E+(x^C&(j^x))+k[3]+3250441966&4294967295,E=C+(A<<22&4294967295|A>>>10),A=x+(j^E&(C^j))+k[4]+4118548399&4294967295,x=E+(A<<7&4294967295|A>>>25),A=j+(C^x&(E^C))+k[5]+1200080426&4294967295,j=x+(A<<12&4294967295|A>>>20),A=C+(E^j&(x^E))+k[6]+2821735955&4294967295,C=j+(A<<17&4294967295|A>>>15),A=E+(x^C&(j^x))+k[7]+4249261313&4294967295,E=C+(A<<22&4294967295|A>>>10),A=x+(j^E&(C^j))+k[8]+1770035416&4294967295,x=E+(A<<7&4294967295|A>>>25),A=j+(C^x&(E^C))+k[9]+2336552879&4294967295,j=x+(A<<12&4294967295|A>>>20),A=C+(E^j&(x^E))+k[10]+4294925233&4294967295,C=j+(A<<17&4294967295|A>>>15),A=E+(x^C&(j^x))+k[11]+2304563134&4294967295,E=C+(A<<22&4294967295|A>>>10),A=x+(j^E&(C^j))+k[12]+1804603682&4294967295,x=E+(A<<7&4294967295|A>>>25),A=j+(C^x&(E^C))+k[13]+4254626195&4294967295,j=x+(A<<12&4294967295|A>>>20),A=C+(E^j&(x^E))+k[14]+2792965006&4294967295,C=j+(A<<17&4294967295|A>>>15),A=E+(x^C&(j^x))+k[15]+1236535329&4294967295,E=C+(A<<22&4294967295|A>>>10),A=x+(C^j&(E^C))+k[1]+4129170786&4294967295,x=E+(A<<5&4294967295|A>>>27),A=j+(E^C&(x^E))+k[6]+3225465664&4294967295,j=x+(A<<9&4294967295|A>>>23),A=C+(x^E&(j^x))+k[11]+643717713&4294967295,C=j+(A<<14&4294967295|A>>>18),A=E+(j^x&(C^j))+k[0]+3921069994&4294967295,E=C+(A<<20&4294967295|A>>>12),A=x+(C^j&(E^C))+k[5]+3593408605&4294967295,x=E+(A<<5&4294967295|A>>>27),A=j+(E^C&(x^E))+k[10]+38016083&4294967295,j=x+(A<<9&4294967295|A>>>23),A=C+(x^E&(j^x))+k[15]+3634488961&4294967295,C=j+(A<<14&4294967295|A>>>18),A=E+(j^x&(C^j))+k[4]+3889429448&4294967295,E=C+(A<<20&4294967295|A>>>12),A=x+(C^j&(E^C))+k[9]+568446438&4294967295,x=E+(A<<5&4294967295|A>>>27),A=j+(E^C&(x^E))+k[14]+3275163606&4294967295,j=x+(A<<9&4294967295|A>>>23),A=C+(x^E&(j^x))+k[3]+4107603335&4294967295,C=j+(A<<14&4294967295|A>>>18),A=E+(j^x&(C^j))+k[8]+1163531501&4294967295,E=C+(A<<20&4294967295|A>>>12),A=x+(C^j&(E^C))+k[13]+2850285829&4294967295,x=E+(A<<5&4294967295|A>>>27),A=j+(E^C&(x^E))+k[2]+4243563512&4294967295,j=x+(A<<9&4294967295|A>>>23),A=C+(x^E&(j^x))+k[7]+1735328473&4294967295,C=j+(A<<14&4294967295|A>>>18),A=E+(j^x&(C^j))+k[12]+2368359562&4294967295,E=C+(A<<20&4294967295|A>>>12),A=x+(E^C^j)+k[5]+4294588738&4294967295,x=E+(A<<4&4294967295|A>>>28),A=j+(x^E^C)+k[8]+2272392833&4294967295,j=x+(A<<11&4294967295|A>>>21),A=C+(j^x^E)+k[11]+1839030562&4294967295,C=j+(A<<16&4294967295|A>>>16),A=E+(C^j^x)+k[14]+4259657740&4294967295,E=C+(A<<23&4294967295|A>>>9),A=x+(E^C^j)+k[1]+2763975236&4294967295,x=E+(A<<4&4294967295|A>>>28),A=j+(x^E^C)+k[4]+1272893353&4294967295,j=x+(A<<11&4294967295|A>>>21),A=C+(j^x^E)+k[7]+4139469664&4294967295,C=j+(A<<16&4294967295|A>>>16),A=E+(C^j^x)+k[10]+3200236656&4294967295,E=C+(A<<23&4294967295|A>>>9),A=x+(E^C^j)+k[13]+681279174&4294967295,x=E+(A<<4&4294967295|A>>>28),A=j+(x^E^C)+k[0]+3936430074&4294967295,j=x+(A<<11&4294967295|A>>>21),A=C+(j^x^E)+k[3]+3572445317&4294967295,C=j+(A<<16&4294967295|A>>>16),A=E+(C^j^x)+k[6]+76029189&4294967295,E=C+(A<<23&4294967295|A>>>9),A=x+(E^C^j)+k[9]+3654602809&4294967295,x=E+(A<<4&4294967295|A>>>28),A=j+(x^E^C)+k[12]+3873151461&4294967295,j=x+(A<<11&4294967295|A>>>21),A=C+(j^x^E)+k[15]+530742520&4294967295,C=j+(A<<16&4294967295|A>>>16),A=E+(C^j^x)+k[2]+3299628645&4294967295,E=C+(A<<23&4294967295|A>>>9),A=x+(C^(E|~j))+k[0]+4096336452&4294967295,x=E+(A<<6&4294967295|A>>>26),A=j+(E^(x|~C))+k[7]+1126891415&4294967295,j=x+(A<<10&4294967295|A>>>22),A=C+(x^(j|~E))+k[14]+2878612391&4294967295,C=j+(A<<15&4294967295|A>>>17),A=E+(j^(C|~x))+k[5]+4237533241&4294967295,E=C+(A<<21&4294967295|A>>>11),A=x+(C^(E|~j))+k[12]+1700485571&4294967295,x=E+(A<<6&4294967295|A>>>26),A=j+(E^(x|~C))+k[3]+2399980690&4294967295,j=x+(A<<10&4294967295|A>>>22),A=C+(x^(j|~E))+k[10]+4293915773&4294967295,C=j+(A<<15&4294967295|A>>>17),A=E+(j^(C|~x))+k[1]+2240044497&4294967295,E=C+(A<<21&4294967295|A>>>11),A=x+(C^(E|~j))+k[8]+1873313359&4294967295,x=E+(A<<6&4294967295|A>>>26),A=j+(E^(x|~C))+k[15]+4264355552&4294967295,j=x+(A<<10&4294967295|A>>>22),A=C+(x^(j|~E))+k[6]+2734768916&4294967295,C=j+(A<<15&4294967295|A>>>17),A=E+(j^(C|~x))+k[13]+1309151649&4294967295,E=C+(A<<21&4294967295|A>>>11),A=x+(C^(E|~j))+k[4]+4149444226&4294967295,x=E+(A<<6&4294967295|A>>>26),A=j+(E^(x|~C))+k[11]+3174756917&4294967295,j=x+(A<<10&4294967295|A>>>22),A=C+(x^(j|~E))+k[2]+718787259&4294967295,C=j+(A<<15&4294967295|A>>>17),A=E+(j^(C|~x))+k[9]+3951481745&4294967295,_.g[0]=_.g[0]+x&4294967295,_.g[1]=_.g[1]+(C+(A<<21&4294967295|A>>>11))&4294967295,_.g[2]=_.g[2]+C&4294967295,_.g[3]=_.g[3]+j&4294967295}r.prototype.v=function(_,x){x===void 0&&(x=_.length);const E=x-this.blockSize,k=this.C;let C=this.h,j=0;for(;j>>k&255;return _};function s(_,x){var E=a;return Object.prototype.hasOwnProperty.call(E,_)?E[_]:E[_]=x(_)}function o(_,x){this.h=x;const E=[];let k=!0;for(let C=_.length-1;C>=0;C--){const j=_[C]|0;k&&j==x||(E[C]=j,k=!1)}this.g=E}var a={};function u(_){return-128<=_&&_<128?s(_,function(x){return new o([x|0],x<0?-1:0)}):new o([_|0],_<0?-1:0)}function c(_){if(isNaN(_)||!isFinite(_))return h;if(_<0)return P(c(-_));const x=[];let E=1;for(let k=0;_>=E;k++)x[k]=_/E|0,E*=4294967296;return new o(x,0)}function f(_,x){if(_.length==0)throw Error("number format error: empty string");if(x=x||10,x<2||36=0)throw Error('number format error: interior "-" character');const E=c(Math.pow(x,8));let k=h;for(let j=0;j<_.length;j+=8){var C=Math.min(8,_.length-j);const A=parseInt(_.substring(j,j+C),x);C<8?(C=c(Math.pow(x,C)),k=k.j(C).add(c(A))):(k=k.j(E),k=k.add(c(A)))}return k}var h=u(0),p=u(1),m=u(16777216);t=o.prototype,t.m=function(){if(S(this))return-P(this).m();let _=0,x=1;for(let E=0;E=0?k:4294967296+k)*x,x*=4294967296}return _},t.toString=function(_){if(_=_||10,_<2||36<_)throw Error("radix out of range: "+_);if(b(this))return"0";if(S(this))return"-"+P(this).toString(_);const x=c(Math.pow(_,6));var E=this;let k="";for(;;){const C=L(E,x).g;E=y(E,C.j(x));let j=((E.g.length>0?E.g[0]:E.h)>>>0).toString(_);if(E=C,b(E))return j+k;for(;j.length<6;)j="0"+j;k=j+k}},t.i=function(_){return _<0?0:_>>16)+(this.i(C)>>>16)+(_.i(C)>>>16);k=A>>>16,j&=65535,A&=65535,E[C]=A<<16|j}return new o(E,E[E.length-1]&-2147483648?-1:0)};function y(_,x){return _.add(P(x))}t.j=function(_){if(b(this)||b(_))return h;if(S(this))return S(_)?P(this).j(P(_)):P(P(this).j(_));if(S(_))return P(this.j(P(_)));if(this.l(m)<0&&_.l(m)<0)return c(this.m()*_.m());const x=this.g.length+_.g.length,E=[];for(var k=0;k<2*x;k++)E[k]=0;for(k=0;k>>16,A=this.i(k)&65535,de=_.i(C)>>>16,oe=_.i(C)&65535;E[2*k+2*C]+=A*oe,w(E,2*k+2*C),E[2*k+2*C+1]+=j*oe,w(E,2*k+2*C+1),E[2*k+2*C+1]+=A*de,w(E,2*k+2*C+1),E[2*k+2*C+2]+=j*de,w(E,2*k+2*C+2)}for(_=0;_>>16,_[x]&=65535,x++}function T(_,x){this.g=_,this.h=x}function L(_,x){if(b(x))throw Error("division by zero");if(b(_))return new T(h,h);if(S(_))return x=L(P(_),x),new T(P(x.g),P(x.h));if(S(x))return x=L(_,P(x)),new T(P(x.g),x.h);if(_.g.length>30){if(S(_)||S(x))throw Error("slowDivide_ only works with positive integers.");for(var E=p,k=x;k.l(_)<=0;)E=F(E),k=F(k);var C=D(E,1),j=D(k,1);for(k=D(k,2),E=D(E,2);!b(k);){var A=j.add(k);A.l(_)<=0&&(C=C.add(E),j=A),k=D(k,1),E=D(E,1)}return x=y(_,C.j(x)),new T(C,x)}for(C=h;_.l(x)>=0;){for(E=Math.max(1,Math.floor(_.m()/x.m())),k=Math.ceil(Math.log(E)/Math.LN2),k=k<=48?1:Math.pow(2,k-48),j=c(E),A=j.j(x);S(A)||A.l(_)>0;)E-=k,j=c(E),A=j.j(x);b(j)&&(j=p),C=C.add(j),_=y(_,A)}return new T(C,_)}t.B=function(_){return L(this,_).h},t.and=function(_){const x=Math.max(this.g.length,_.g.length),E=[];for(let k=0;k>>31;return new o(E,_.h)}function D(_,x){const E=x>>5;x%=32;const k=_.g.length-E,C=[];for(let j=0;j0?_.i(j+E)>>>x|_.i(j+E+1)<<32-x:_.i(j+E);return new o(C,_.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,ab=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.B,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=f,Li=o}).apply(typeof iv<"u"?iv:typeof self<"u"?self:typeof window<"u"?window:{});var uu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var lb,ya,ub,Du,Zf,cb,db,hb;(function(){var t,e=Object.defineProperty;function n(l){l=[typeof globalThis=="object"&&globalThis,l,typeof window=="object"&&window,typeof self=="object"&&self,typeof uu=="object"&&uu];for(var g=0;gl&&AsyncContext.Snapshot.wrap(l):l=>l;function m(l){const g=l.length;if(g>0){const v=Array(g);for(let I=0;I0?(this.h--,g=this.g,this.g=g.next,g.next=null):g=this.i(),g}}function P(l){o.setTimeout(()=>{throw l},0)}function y(){var l=_;let g=null;return l.g&&(g=l.g,l.g=l.g.next,l.g||(l.h=null),g.next=null),g}class w{constructor(){this.h=this.g=null}add(g,v){const I=T.get();I.set(g,v),this.h?this.h.next=I:this.g=I,this.h=I}}var T=new S(()=>new L,l=>l.reset());class L{constructor(){this.next=this.g=this.h=null}set(g,v){this.h=g,this.g=v,this.next=null}reset(){this.next=this.g=this.h=null}}let F,D=!1,_=new w,x=()=>{const l=Promise.resolve(void 0);F=()=>{l.then(E)}};function E(){for(var l;l=y();){try{l.h.call(l.g)}catch(v){P(v)}var g=T;g.j(l),g.h<100&&(g.h++,l.next=g.g,g.g=l)}D=!1}function k(){this.u=this.u,this.C=this.C}k.prototype.u=!1,k.prototype.dispose=function(){this.u||(this.u=!0,this.N())},k.prototype[Symbol.dispose]=function(){this.dispose()},k.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function C(l,g){this.type=l,this.g=this.target=g,this.defaultPrevented=!1}C.prototype.h=function(){this.defaultPrevented=!0};var j=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var l=!1,g=Object.defineProperty({},"passive",{get:function(){l=!0}});try{const v=()=>{};o.addEventListener("test",v,g),o.removeEventListener("test",v,g)}catch{}return l}();function A(l){return/^[\s\xa0]*$/.test(l)}function de(l,g){C.call(this,l?l.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,l&&this.init(l,g)}h(de,C),de.prototype.init=function(l,g){const v=this.type=l.type,I=l.changedTouches&&l.changedTouches.length?l.changedTouches[0]:null;this.target=l.target||l.srcElement,this.g=g,g=l.relatedTarget,g||(v=="mouseover"?g=l.fromElement:v=="mouseout"&&(g=l.toElement)),this.relatedTarget=g,I?(this.clientX=I.clientX!==void 0?I.clientX:I.pageX,this.clientY=I.clientY!==void 0?I.clientY:I.pageY,this.screenX=I.screenX||0,this.screenY=I.screenY||0):(this.clientX=l.clientX!==void 0?l.clientX:l.pageX,this.clientY=l.clientY!==void 0?l.clientY:l.pageY,this.screenX=l.screenX||0,this.screenY=l.screenY||0),this.button=l.button,this.key=l.key||"",this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.pointerId=l.pointerId||0,this.pointerType=l.pointerType,this.state=l.state,this.i=l,l.defaultPrevented&&de.Z.h.call(this)},de.prototype.h=function(){de.Z.h.call(this);const l=this.i;l.preventDefault?l.preventDefault():l.returnValue=!1};var oe="closure_listenable_"+(Math.random()*1e6|0),le=0;function ve(l,g,v,I,M){this.listener=l,this.proxy=null,this.src=g,this.type=v,this.capture=!!I,this.ha=M,this.key=++le,this.da=this.fa=!1}function K(l){l.da=!0,l.listener=null,l.proxy=null,l.src=null,l.ha=null}function ie(l,g,v){for(const I in l)g.call(v,l[I],I,l)}function N(l,g){for(const v in l)g.call(void 0,l[v],v,l)}function fe(l){const g={};for(const v in l)g[v]=l[v];return g}const ye="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function R(l,g){let v,I;for(let M=1;M-1?(g=l[ne],v||(g.fa=!1)):(g=new ve(g,this.src,U,!!I,M),g.fa=v,l.push(g)),g};function J(l,g){const v=g.type;if(v in l.g){var I=l.g[v],M=Array.prototype.indexOf.call(I,g,void 0),U;(U=M>=0)&&Array.prototype.splice.call(I,M,1),U&&(K(g),l.g[v].length==0&&(delete l.g[v],l.h--))}}function te(l,g,v,I){for(let M=0;M-1&&(K(g[v]),Array.prototype.splice.call(g,v,1),g.length==0&&(delete l.g[U],l.h--)))):l&&(l=Vt(l))&&(g=l.g[g.toString()],l=-1,g&&(l=te(g,v,I,M)),(v=l>-1?g[l]:null)&&mt(v))}function mt(l){if(typeof l!="number"&&l&&!l.da){var g=l.src;if(g&&g[oe])J(g.i,l);else{var v=l.type,I=l.proxy;g.removeEventListener?g.removeEventListener(v,I,l.capture):g.detachEvent?g.detachEvent(gt(v),I):g.addListener&&g.removeListener&&g.removeListener(I),(v=Vt(g))?(J(v,l),v.h==0&&(v.src=null,g[Ie]=null)):K(l)}}}function gt(l){return l in pe?pe[l]:pe[l]="on"+l}function Ht(l,g){if(l.da)l=!0;else{g=new de(g,this);const v=l.listener,I=l.ha||l.src;l.fa&&mt(l),l=v.call(I,g)}return l}function Vt(l){return l=l[Ie],l instanceof H?l:null}var Ze="__closure_events_fn_"+(Math.random()*1e9>>>0);function Nn(l){return typeof l=="function"?l:(l[Ze]||(l[Ze]=function(g){return l.handleEvent(g)}),l[Ze])}function W(){k.call(this),this.i=new H(this),this.M=this,this.G=null}h(W,k),W.prototype[oe]=!0,W.prototype.removeEventListener=function(l,g,v,I){bt(this,l,g,v,I)};function ue(l,g){var v,I=l.G;if(I)for(v=[];I;I=I.G)v.push(I);if(l=l.M,I=g.type||g,typeof g=="string")g=new C(g,l);else if(g instanceof C)g.target=g.target||l;else{var M=g;g=new C(I,l),R(g,M)}M=!0;let U,ne;if(v)for(ne=v.length-1;ne>=0;ne--)U=g.g=v[ne],M=Ce(U,I,!0,g)&&M;if(U=g.g=l,M=Ce(U,I,!0,g)&&M,M=Ce(U,I,!1,g)&&M,v)for(ne=0;ne2147483647?-1:o.setTimeout(l,g||0)}function He(l){l.g=we(()=>{l.g=null,l.i&&(l.i=!1,He(l))},l.l);const g=l.h;l.h=null,l.m.apply(null,g)}class Et extends k{constructor(g,v){super(),this.m=g,this.l=v,this.h=null,this.i=!1,this.g=null}j(g){this.h=arguments,this.g?this.i=!0:He(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ft(l){k.call(this),this.h=l,this.g={}}h(Ft,k);var z=[];function O(l){ie(l.g,function(g,v){this.g.hasOwnProperty(v)&&mt(g)},l),l.g={}}Ft.prototype.N=function(){Ft.Z.N.call(this),O(this)},Ft.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var B=o.JSON.stringify,Q=o.JSON.parse,Y=class{stringify(l){return o.JSON.stringify(l,void 0)}parse(l){return o.JSON.parse(l,void 0)}};function Ae(){}function Oe(){}var Ne={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function et(){C.call(this,"d")}h(et,C);function $(){C.call(this,"c")}h($,C);var Z={},he=null;function me(){return he=he||new W}Z.Ia="serverreachability";function Pe(l){C.call(this,Z.Ia,l)}h(Pe,C);function Ge(l){const g=me();ue(g,new Pe(g))}Z.STAT_EVENT="statevent";function It(l,g){C.call(this,Z.STAT_EVENT,l),this.stat=g}h(It,C);function Me(l){const g=me();ue(g,new It(g,l))}Z.Ja="timingevent";function Lr(l,g){C.call(this,Z.Ja,l),this.size=g}h(Lr,C);function xe(l,g){if(typeof l!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){l()},g)}function Te(){this.g=!0}Te.prototype.ua=function(){this.g=!1};function yt(l,g,v,I,M,U){l.info(function(){if(l.g)if(U){var ne="",Le=U.split("&");for(let tt=0;tt1){const Ut=jt[0];jt=jt[1];const hr=Ut.split("_");ne=hr.length>=2&&hr[1]=="type"?ne+(Ut+"="+jt+"&"):ne+(Ut+"=redacted&")}}}else ne=null;else ne=U;return"XMLHTTP REQ ("+I+") [attempt "+M+"]: "+g+` +`+v+` +`+ne})}function qt(l,g,v,I,M,U,ne){l.info(function(){return"XMLHTTP RESP ("+I+") [ attempt "+M+"]: "+g+` +`+v+` +`+U+" "+ne})}function An(l,g,v,I){l.info(function(){return"XMLHTTP TEXT ("+g+"): "+Wt(l,v)+(I?" "+I:"")})}function vt(l,g){l.info(function(){return"TIMEOUT: "+g})}Te.prototype.info=function(){};function Wt(l,g){if(!l.g)return g;if(!g)return null;try{const U=JSON.parse(g);if(U){for(l=0;l0&&l.length;)v.push(l.shift()),g--;return l.length&&v.push(l.join(":")),v}function si(l,g,v,I){this.j=l,this.i=g,this.l=v,this.S=I||1,this.V=new Ft(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Qg}function Qg(){this.i=null,this.g="",this.h=!1}var Yg={},Fd={};function Ud(l,g,v){l.M=1,l.A=Ol(dr(g)),l.u=v,l.R=!0,Xg(l,null)}function Xg(l,g){l.F=Date.now(),Ll(l),l.B=dr(l.A);var v=l.B,I=l.S;Array.isArray(I)||(I=[String(I)]),cy(v.i,"t",I),l.C=0,v=l.j.L,l.h=new Qg,l.g=Cy(l.j,v?g:null,!l.u),l.P>0&&(l.O=new Et(c(l.Y,l,l.g),l.P)),g=l.V,v=l.g,I=l.ba;var M="readystatechange";Array.isArray(M)||(M&&(z[0]=M.toString()),M=z);for(let U=0;U0&&!this.W){this.W=!0;var ne=this.j;ne.g==this&&ne.aa&&!ne.P&&(ne.j.info("Great, no buffering proxy detected. Bytes received: "+v.length),Yd(ne),ne.P=!0,Me(11))}}else An(this.i,this.l,v,null),Bd(this,v);Le==4&&es(this),this.o&&!this.K&&(Le==4?Iy(this.j,this):(this.o=!1,Ll(this)))}else kS(this.g),g==400&&v.indexOf("Unknown SID")>0?(this.m=3,Me(12)):(this.m=0,Me(13)),es(this),qo(this)}}}catch{}finally{}};function hS(l){if(!Jg(l))return l.g.la();const g=yy(l.g);if(g==="")return"";let v="";const I=g.length,M=li(l.g)==4;if(!l.h.i){if(typeof TextDecoder>"u")return es(l),qo(l),"";l.h.i=new o.TextDecoder}for(let U=0;Ug.length?Fd:(g=g.slice(I,I+v),l.C=I+v,g)))}si.prototype.cancel=function(){this.K=!0,es(this)};function Ll(l){l.T=Date.now()+l.H,Zg(l,l.H)}function Zg(l,g){if(l.D!=null)throw Error("WatchDog timer not null");l.D=xe(c(l.aa,l),g)}function zd(l){l.D&&(o.clearTimeout(l.D),l.D=null)}si.prototype.aa=function(){this.D=null;const l=Date.now();l-this.T>=0?(vt(this.i,this.B),this.M!=2&&(Ge(),Me(17)),es(this),this.m=2,qo(this)):Zg(this,this.T-l)};function qo(l){l.j.I==0||l.K||Iy(l.j,l)}function es(l){zd(l);var g=l.O;g&&typeof g.dispose=="function"&&g.dispose(),l.O=null,O(l.V),l.g&&(g=l.g,l.g=null,g.abort(),g.dispose())}function Bd(l,g){try{var v=l.j;if(v.I!=0&&(v.g==l||$d(v.h,l))){if(!l.L&&$d(v.h,l)&&v.I==3){try{var I=v.Ba.g.parse(g)}catch{I=null}if(Array.isArray(I)&&I.length==3){var M=I;if(M[0]==0){e:if(!v.v){if(v.g)if(v.g.F+3e30&&(I=1.5*ui,v.O=I,v.j.info("backChannelRequestTimeoutMs_="+I)),I=v;const ci=l.g;if(ci){const $l=ci.g?ci.g.getResponseHeader("X-Client-Wire-Protocol"):null;if($l){var U=I.h;U.g||$l.indexOf("spdy")==-1&&$l.indexOf("quic")==-1&&$l.indexOf("h2")==-1||(U.j=U.l,U.g=new Set,U.h&&(Hd(U,U.h),U.h=null))}if(I.G){const Xd=ci.g?ci.g.getResponseHeader("X-HTTP-Session-Id"):null;Xd&&(I.wa=Xd,ot(I.J,I.G,Xd))}}v.I=3,v.l&&v.l.ra(),v.aa&&(v.T=Date.now()-l.F,v.j.info("Handshake RTT: "+v.T+"ms")),I=v;var ne=l;if(I.na=ky(I,I.L?I.ba:null,I.W),ne.L){ry(I.h,ne);var Le=ne,jt=I.O;jt&&(Le.H=jt),Le.D&&(zd(Le),Ll(Le)),I.g=ne}else by(I);v.i.length>0&&Ul(v)}else tt[0]!="stop"&&tt[0]!="close"||ns(v,7);else v.I==3&&(tt[0]=="stop"||tt[0]=="close"?tt[0]=="stop"?ns(v,7):Kd(v):tt[0]!="noop"&&v.l&&v.l.qa(tt),v.A=0)}}Ge(4)}catch{}}var pS=class{constructor(l,g){this.g=l,this.map=g}};function ey(l){this.l=l||10,o.PerformanceNavigationTiming?(l=o.performance.getEntriesByType("navigation"),l=l.length>0&&(l[0].nextHopProtocol=="hq"||l[0].nextHopProtocol=="h2")):l=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=l?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function ty(l){return l.h?!0:l.g?l.g.size>=l.j:!1}function ny(l){return l.h?1:l.g?l.g.size:0}function $d(l,g){return l.h?l.h==g:l.g?l.g.has(g):!1}function Hd(l,g){l.g?l.g.add(g):l.h=g}function ry(l,g){l.h&&l.h==g?l.h=null:l.g&&l.g.has(g)&&l.g.delete(g)}ey.prototype.cancel=function(){if(this.i=iy(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const l of this.g.values())l.cancel();this.g.clear()}};function iy(l){if(l.h!=null)return l.i.concat(l.h.G);if(l.g!=null&&l.g.size!==0){let g=l.i;for(const v of l.g.values())g=g.concat(v.G);return g}return m(l.i)}var sy=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function mS(l,g){if(l){l=l.split("&");for(let v=0;v=0?(M=l[v].substring(0,I),U=l[v].substring(I+1)):M=l[v],g(M,U?decodeURIComponent(U.replace(/\+/g," ")):"")}}}function oi(l){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let g;l instanceof oi?(this.l=l.l,Wo(this,l.j),this.o=l.o,this.g=l.g,Go(this,l.u),this.h=l.h,qd(this,dy(l.i)),this.m=l.m):l&&(g=String(l).match(sy))?(this.l=!1,Wo(this,g[1]||"",!0),this.o=Ko(g[2]||""),this.g=Ko(g[3]||"",!0),Go(this,g[4]),this.h=Ko(g[5]||"",!0),qd(this,g[6]||"",!0),this.m=Ko(g[7]||"")):(this.l=!1,this.i=new Yo(null,this.l))}oi.prototype.toString=function(){const l=[];var g=this.j;g&&l.push(Qo(g,oy,!0),":");var v=this.g;return(v||g=="file")&&(l.push("//"),(g=this.o)&&l.push(Qo(g,oy,!0),"@"),l.push(Pn(v).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),v=this.u,v!=null&&l.push(":",String(v))),(v=this.h)&&(this.g&&v.charAt(0)!="/"&&l.push("/"),l.push(Qo(v,v.charAt(0)=="/"?vS:yS,!0))),(v=this.i.toString())&&l.push("?",v),(v=this.m)&&l.push("#",Qo(v,wS)),l.join("")},oi.prototype.resolve=function(l){const g=dr(this);let v=!!l.j;v?Wo(g,l.j):v=!!l.o,v?g.o=l.o:v=!!l.g,v?g.g=l.g:v=l.u!=null;var I=l.h;if(v)Go(g,l.u);else if(v=!!l.h){if(I.charAt(0)!="/")if(this.g&&!this.h)I="/"+I;else{var M=g.h.lastIndexOf("/");M!=-1&&(I=g.h.slice(0,M+1)+I)}if(M=I,M==".."||M==".")I="";else if(M.indexOf("./")!=-1||M.indexOf("/.")!=-1){I=M.lastIndexOf("/",0)==0,M=M.split("/");const U=[];for(let ne=0;ne1||U.length==1&&U[0]!="")&&U.pop(),I&&ne==M.length&&U.push("")):(U.push(Le),I=!0)}I=U.join("/")}else I=M}return v?g.h=I:v=l.i.toString()!=="",v?qd(g,dy(l.i)):v=!!l.m,v&&(g.m=l.m),g};function dr(l){return new oi(l)}function Wo(l,g,v){l.j=v?Ko(g,!0):g,l.j&&(l.j=l.j.replace(/:$/,""))}function Go(l,g){if(g){if(g=Number(g),isNaN(g)||g<0)throw Error("Bad port number "+g);l.u=g}else l.u=null}function qd(l,g,v){g instanceof Yo?(l.i=g,_S(l.i,l.l)):(v||(g=Qo(g,xS)),l.i=new Yo(g,l.l))}function ot(l,g,v){l.i.set(g,v)}function Ol(l){return ot(l,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),l}function Ko(l,g){return l?g?decodeURI(l.replace(/%25/g,"%2525")):decodeURIComponent(l):""}function Qo(l,g,v){return typeof l=="string"?(l=encodeURI(l).replace(g,gS),v&&(l=l.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),l):null}function gS(l){return l=l.charCodeAt(0),"%"+(l>>4&15).toString(16)+(l&15).toString(16)}var oy=/[#\/\?@]/g,yS=/[#\?:]/g,vS=/[#\?]/g,xS=/[#\?@]/g,wS=/#/g;function Yo(l,g){this.h=this.g=null,this.i=l||null,this.j=!!g}function ts(l){l.g||(l.g=new Map,l.h=0,l.i&&mS(l.i,function(g,v){l.add(decodeURIComponent(g.replace(/\+/g," ")),v)}))}t=Yo.prototype,t.add=function(l,g){ts(this),this.i=null,l=Os(this,l);let v=this.g.get(l);return v||this.g.set(l,v=[]),v.push(g),this.h+=1,this};function ay(l,g){ts(l),g=Os(l,g),l.g.has(g)&&(l.i=null,l.h-=l.g.get(g).length,l.g.delete(g))}function ly(l,g){return ts(l),g=Os(l,g),l.g.has(g)}t.forEach=function(l,g){ts(this),this.g.forEach(function(v,I){v.forEach(function(M){l.call(g,M,I,this)},this)},this)};function uy(l,g){ts(l);let v=[];if(typeof g=="string")ly(l,g)&&(v=v.concat(l.g.get(Os(l,g))));else for(l=Array.from(l.g.values()),g=0;g0?String(l[0]):g):g};function cy(l,g,v){ay(l,g),v.length>0&&(l.i=null,l.g.set(Os(l,g),m(v)),l.h+=v.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const l=[],g=Array.from(this.g.keys());for(let I=0;I{I.abort(),ai(v,"TestPingServer: timeout",!1,g)},1e4);fetch(l,{signal:I.signal}).then(U=>{clearTimeout(M),U.ok?ai(v,"TestPingServer: ok",!0,g):ai(v,"TestPingServer: server error",!1,g)}).catch(()=>{clearTimeout(M),ai(v,"TestPingServer: error",!1,g)})}function ai(l,g,v,I,M){try{M&&(M.onload=null,M.onerror=null,M.onabort=null,M.ontimeout=null),I(v)}catch{}}function IS(){this.g=new Y}function Wd(l){this.i=l.Sb||null,this.h=l.ab||!1}h(Wd,Ae),Wd.prototype.g=function(){return new Ml(this.i,this.h)};function Ml(l,g){W.call(this),this.H=l,this.o=g,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}h(Ml,W),t=Ml.prototype,t.open=function(l,g){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=l,this.D=g,this.readyState=1,Jo(this)},t.send=function(l){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const g={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};l&&(g.body=l),(this.H||o).fetch(new Request(this.D,g)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Xo(this)),this.readyState=0},t.Pa=function(l){if(this.g&&(this.l=l,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=l.headers,this.readyState=2,Jo(this)),this.g&&(this.readyState=3,Jo(this),this.g)))if(this.responseType==="arraybuffer")l.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in l){if(this.j=l.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;hy(this)}else l.text().then(this.Oa.bind(this),this.ga.bind(this))};function hy(l){l.j.read().then(l.Ma.bind(l)).catch(l.ga.bind(l))}t.Ma=function(l){if(this.g){if(this.o&&l.value)this.response.push(l.value);else if(!this.o){var g=l.value?l.value:new Uint8Array(0);(g=this.B.decode(g,{stream:!l.done}))&&(this.response=this.responseText+=g)}l.done?Xo(this):Jo(this),this.readyState==3&&hy(this)}},t.Oa=function(l){this.g&&(this.response=this.responseText=l,Xo(this))},t.Na=function(l){this.g&&(this.response=l,Xo(this))},t.ga=function(){this.g&&Xo(this)};function Xo(l){l.readyState=4,l.l=null,l.j=null,l.B=null,Jo(l)}t.setRequestHeader=function(l,g){this.A.append(l,g)},t.getResponseHeader=function(l){return this.h&&this.h.get(l.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const l=[],g=this.h.entries();for(var v=g.next();!v.done;)v=v.value,l.push(v[0]+": "+v[1]),v=g.next();return l.join(`\r +`)};function Jo(l){l.onreadystatechange&&l.onreadystatechange.call(l)}Object.defineProperty(Ml.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(l){this.m=l?"include":"same-origin"}});function fy(l){let g="";return ie(l,function(v,I){g+=I,g+=":",g+=v,g+=`\r +`}),g}function Gd(l,g,v){e:{for(I in v){var I=!1;break e}I=!0}I||(v=fy(v),typeof l=="string"?v!=null&&Pn(v):ot(l,g,v))}function xt(l){W.call(this),this.headers=new Map,this.L=l||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}h(xt,W);var SS=/^https?$/i,TS=["POST","PUT"];t=xt.prototype,t.Fa=function(l){this.H=l},t.ea=function(l,g,v,I){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+l);g=g?g.toUpperCase():"GET",this.D=l,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():je.g(),this.g.onreadystatechange=p(c(this.Ca,this));try{this.B=!0,this.g.open(g,String(l),!0),this.B=!1}catch(U){py(this,U);return}if(l=v||"",v=new Map(this.headers),I)if(Object.getPrototypeOf(I)===Object.prototype)for(var M in I)v.set(M,I[M]);else if(typeof I.keys=="function"&&typeof I.get=="function")for(const U of I.keys())v.set(U,I.get(U));else throw Error("Unknown input type for opt_headers: "+String(I));I=Array.from(v.keys()).find(U=>U.toLowerCase()=="content-type"),M=o.FormData&&l instanceof o.FormData,!(Array.prototype.indexOf.call(TS,g,void 0)>=0)||I||M||v.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[U,ne]of v)this.g.setRequestHeader(U,ne);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(l),this.v=!1}catch(U){py(this,U)}};function py(l,g){l.h=!1,l.g&&(l.j=!0,l.g.abort(),l.j=!1),l.l=g,l.o=5,my(l),Vl(l)}function my(l){l.A||(l.A=!0,ue(l,"complete"),ue(l,"error"))}t.abort=function(l){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=l||7,ue(this,"complete"),ue(this,"abort"),Vl(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Vl(this,!0)),xt.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?gy(this):this.Xa())},t.Xa=function(){gy(this)};function gy(l){if(l.h&&typeof s<"u"){if(l.v&&li(l)==4)setTimeout(l.Ca.bind(l),0);else if(ue(l,"readystatechange"),li(l)==4){l.h=!1;try{const U=l.ca();e:switch(U){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var g=!0;break e;default:g=!1}var v;if(!(v=g)){var I;if(I=U===0){let ne=String(l.D).match(sy)[1]||null;!ne&&o.self&&o.self.location&&(ne=o.self.location.protocol.slice(0,-1)),I=!SS.test(ne?ne.toLowerCase():"")}v=I}if(v)ue(l,"complete"),ue(l,"success");else{l.o=6;try{var M=li(l)>2?l.g.statusText:""}catch{M=""}l.l=M+" ["+l.ca()+"]",my(l)}}finally{Vl(l)}}}}function Vl(l,g){if(l.g){l.m&&(clearTimeout(l.m),l.m=null);const v=l.g;l.g=null,g||ue(l,"ready");try{v.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function li(l){return l.g?l.g.readyState:0}t.ca=function(){try{return li(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(l){if(this.g){var g=this.g.responseText;return l&&g.indexOf(l)==0&&(g=g.substring(l.length)),Q(g)}};function yy(l){try{if(!l.g)return null;if("response"in l.g)return l.g.response;switch(l.F){case"":case"text":return l.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in l.g)return l.g.mozResponseArrayBuffer}return null}catch{return null}}function kS(l){const g={};l=(l.g&&li(l)>=2&&l.g.getAllResponseHeaders()||"").split(`\r +`);for(let I=0;I0&&(this.ia=l.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=vy.prototype,t.ka=8,t.I=1,t.connect=function(l,g,v,I){Me(0),this.W=l,this.H=g||{},v&&I!==void 0&&(this.H.OSID=v,this.H.OAID=I),this.F=this.X,this.J=ky(this,null,this.W),Ul(this)};function Kd(l){if(xy(l),l.I==3){var g=l.V++,v=dr(l.J);if(ot(v,"SID",l.M),ot(v,"RID",g),ot(v,"TYPE","terminate"),ea(l,v),g=new si(l,l.j,g),g.M=2,g.A=Ol(dr(v)),v=!1,o.navigator&&o.navigator.sendBeacon)try{v=o.navigator.sendBeacon(g.A.toString(),"")}catch{}!v&&o.Image&&(new Image().src=g.A,v=!0),v||(g.g=Cy(g.j,null),g.g.ea(g.A)),g.F=Date.now(),Ll(g)}Ty(l)}function Fl(l){l.g&&(Yd(l),l.g.cancel(),l.g=null)}function xy(l){Fl(l),l.v&&(o.clearTimeout(l.v),l.v=null),zl(l),l.h.cancel(),l.m&&(typeof l.m=="number"&&o.clearTimeout(l.m),l.m=null)}function Ul(l){if(!ty(l.h)&&!l.m){l.m=!0;var g=l.Ea;F||x(),D||(F(),D=!0),_.add(g,l),l.D=0}}function CS(l,g){return ny(l.h)>=l.h.j-(l.m?1:0)?!1:l.m?(l.i=g.G.concat(l.i),!0):l.I==1||l.I==2||l.D>=(l.Sa?0:l.Ta)?!1:(l.m=xe(c(l.Ea,l,g),Sy(l,l.D)),l.D++,!0)}t.Ea=function(l){if(this.m)if(this.m=null,this.I==1){if(!l){this.V=Math.floor(Math.random()*1e5),l=this.V++;const M=new si(this,this.j,l);let U=this.o;if(this.U&&(U?(U=fe(U),R(U,this.U)):U=this.U),this.u!==null||this.R||(M.J=U,U=null),this.S)e:{for(var g=0,v=0;v4096){g=v;break e}if(g===4096||v===this.i.length-1){g=v+1;break e}}g=1e3}else g=1e3;g=_y(this,M,g),v=dr(this.J),ot(v,"RID",l),ot(v,"CVER",22),this.G&&ot(v,"X-HTTP-Session-Id",this.G),ea(this,v),U&&(this.R?g="headers="+Pn(fy(U))+"&"+g:this.u&&Gd(v,this.u,U)),Hd(this.h,M),this.Ra&&ot(v,"TYPE","init"),this.S?(ot(v,"$req",g),ot(v,"SID","null"),M.U=!0,Ud(M,v,null)):Ud(M,v,g),this.I=2}}else this.I==3&&(l?wy(this,l):this.i.length==0||ty(this.h)||wy(this))};function wy(l,g){var v;g?v=g.l:v=l.V++;const I=dr(l.J);ot(I,"SID",l.M),ot(I,"RID",v),ot(I,"AID",l.K),ea(l,I),l.u&&l.o&&Gd(I,l.u,l.o),v=new si(l,l.j,v,l.D+1),l.u===null&&(v.J=l.o),g&&(l.i=g.G.concat(l.i)),g=_y(l,v,1e3),v.H=Math.round(l.va*.5)+Math.round(l.va*.5*Math.random()),Hd(l.h,v),Ud(v,I,g)}function ea(l,g){l.H&&ie(l.H,function(v,I){ot(g,I,v)}),l.l&&ie({},function(v,I){ot(g,I,v)})}function _y(l,g,v){v=Math.min(l.i.length,v);const I=l.l?c(l.l.Ka,l.l,l):null;e:{var M=l.i;let Le=-1;for(;;){const jt=["count="+v];Le==-1?v>0?(Le=M[0].g,jt.push("ofs="+Le)):Le=0:jt.push("ofs="+Le);let tt=!0;for(let Ut=0;Ut=3?!1:(l.Y++,l.v=xe(c(l.Da,l),Sy(l,l.A)),l.A++,!0)}t.Da=function(){if(this.v=null,Ey(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var l=4*this.T;this.j.info("BP detection timer enabled: "+l),this.B=xe(c(this.Wa,this),l)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,Me(10),Fl(this),Ey(this))};function Yd(l){l.B!=null&&(o.clearTimeout(l.B),l.B=null)}function Ey(l){l.g=new si(l,l.j,"rpc",l.Y),l.u===null&&(l.g.J=l.o),l.g.P=0;var g=dr(l.na);ot(g,"RID","rpc"),ot(g,"SID",l.M),ot(g,"AID",l.K),ot(g,"CI",l.F?"0":"1"),!l.F&&l.ia&&ot(g,"TO",l.ia),ot(g,"TYPE","xmlhttp"),ea(l,g),l.u&&l.o&&Gd(g,l.u,l.o),l.O&&(l.g.H=l.O);var v=l.g;l=l.ba,v.M=1,v.A=Ol(dr(g)),v.u=null,v.R=!0,Xg(v,l)}t.Va=function(){this.C!=null&&(this.C=null,Fl(this),Qd(this),Me(19))};function zl(l){l.C!=null&&(o.clearTimeout(l.C),l.C=null)}function Iy(l,g){var v=null;if(l.g==g){zl(l),Yd(l),l.g=null;var I=2}else if($d(l.h,g))v=g.G,ry(l.h,g),I=1;else return;if(l.I!=0){if(g.o)if(I==1){v=g.u?g.u.length:0,g=Date.now()-g.F;var M=l.D;I=me(),ue(I,new Lr(I,v)),Ul(l)}else by(l);else if(M=g.m,M==3||M==0&&g.X>0||!(I==1&&CS(l,g)||I==2&&Qd(l)))switch(v&&v.length>0&&(g=l.h,g.i=g.i.concat(v)),M){case 1:ns(l,5);break;case 4:ns(l,10);break;case 3:ns(l,6);break;default:ns(l,2)}}}function Sy(l,g){let v=l.Qa+Math.floor(Math.random()*l.Za);return l.isActive()||(v*=2),v*g}function ns(l,g){if(l.j.info("Error code "+g),g==2){var v=c(l.bb,l),I=l.Ua;const M=!I;I=new oi(I||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Wo(I,"https"),Ol(I),M?bS(I.toString(),v):ES(I.toString(),v)}else Me(2);l.I=0,l.l&&l.l.pa(g),Ty(l),xy(l)}t.bb=function(l){l?(this.j.info("Successfully pinged google.com"),Me(2)):(this.j.info("Failed to ping google.com"),Me(1))};function Ty(l){if(l.I=0,l.ja=[],l.l){const g=iy(l.h);(g.length!=0||l.i.length!=0)&&(b(l.ja,g),b(l.ja,l.i),l.h.i.length=0,m(l.i),l.i.length=0),l.l.oa()}}function ky(l,g,v){var I=v instanceof oi?dr(v):new oi(v);if(I.g!="")g&&(I.g=g+"."+I.g),Go(I,I.u);else{var M=o.location;I=M.protocol,g=g?g+"."+M.hostname:M.hostname,M=+M.port;const U=new oi(null);I&&Wo(U,I),g&&(U.g=g),M&&Go(U,M),v&&(U.h=v),I=U}return v=l.G,g=l.wa,v&&g&&ot(I,v,g),ot(I,"VER",l.ka),ea(l,I),I}function Cy(l,g,v){if(g&&!l.L)throw Error("Can't create secondary domain capable XhrIo object.");return g=l.Aa&&!l.ma?new xt(new Wd({ab:v})):new xt(l.ma),g.Fa(l.L),g}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function Ny(){}t=Ny.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function Bl(){}Bl.prototype.g=function(l,g){return new Rn(l,g)};function Rn(l,g){W.call(this),this.g=new vy(g),this.l=l,this.h=g&&g.messageUrlParams||null,l=g&&g.messageHeaders||null,g&&g.clientProtocolHeaderRequired&&(l?l["X-Client-Protocol"]="webchannel":l={"X-Client-Protocol":"webchannel"}),this.g.o=l,l=g&&g.initMessageHeaders||null,g&&g.messageContentType&&(l?l["X-WebChannel-Content-Type"]=g.messageContentType:l={"X-WebChannel-Content-Type":g.messageContentType}),g&&g.sa&&(l?l["X-WebChannel-Client-Profile"]=g.sa:l={"X-WebChannel-Client-Profile":g.sa}),this.g.U=l,(l=g&&g.Qb)&&!A(l)&&(this.g.u=l),this.A=g&&g.supportsCrossDomainXhr||!1,this.v=g&&g.sendRawJson||!1,(g=g&&g.httpSessionIdParam)&&!A(g)&&(this.g.G=g,l=this.h,l!==null&&g in l&&(l=this.h,g in l&&delete l[g])),this.j=new Ms(this)}h(Rn,W),Rn.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Rn.prototype.close=function(){Kd(this.g)},Rn.prototype.o=function(l){var g=this.g;if(typeof l=="string"){var v={};v.__data__=l,l=v}else this.v&&(v={},v.__data__=B(l),l=v);g.i.push(new pS(g.Ya++,l)),g.I==3&&Ul(g)},Rn.prototype.N=function(){this.g.l=null,delete this.j,Kd(this.g),delete this.g,Rn.Z.N.call(this)};function Ay(l){et.call(this),l.__headers__&&(this.headers=l.__headers__,this.statusCode=l.__status__,delete l.__headers__,delete l.__status__);var g=l.__sm__;if(g){e:{for(const v in g){l=v;break e}l=void 0}(this.i=l)&&(l=this.i,g=g!==null&&l in g?g[l]:void 0),this.data=g}else this.data=l}h(Ay,et);function Py(){$.call(this),this.status=1}h(Py,$);function Ms(l){this.g=l}h(Ms,Ny),Ms.prototype.ra=function(){ue(this.g,"a")},Ms.prototype.qa=function(l){ue(this.g,new Ay(l))},Ms.prototype.pa=function(l){ue(this.g,new Py)},Ms.prototype.oa=function(){ue(this.g,"b")},Bl.prototype.createWebChannel=Bl.prototype.g,Rn.prototype.send=Rn.prototype.o,Rn.prototype.open=Rn.prototype.m,Rn.prototype.close=Rn.prototype.close,hb=function(){return new Bl},db=function(){return me()},cb=Z,Zf={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Bn.NO_ERROR=0,Bn.TIMEOUT=8,Bn.HTTP_ERROR=6,Du=Bn,Gt.COMPLETE="complete",ub=Gt,Oe.EventType=Ne,Ne.OPEN="a",Ne.CLOSE="b",Ne.ERROR="c",Ne.MESSAGE="d",W.prototype.listen=W.prototype.J,ya=Oe,xt.prototype.listenOnce=xt.prototype.K,xt.prototype.getLastError=xt.prototype.Ha,xt.prototype.getLastErrorCode=xt.prototype.ya,xt.prototype.getStatus=xt.prototype.ca,xt.prototype.getResponseJson=xt.prototype.La,xt.prototype.getResponseText=xt.prototype.la,xt.prototype.send=xt.prototype.ea,xt.prototype.setWithCredentials=xt.prototype.Fa,lb=xt}).apply(typeof uu<"u"?uu:typeof self<"u"?self:typeof window<"u"?window:{});const sv="@firebase/firestore",ov="4.9.2";/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class sn{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}sn.UNAUTHENTICATED=new sn(null),sn.GOOGLE_CREDENTIALS=new sn("google-credentials-uid"),sn.FIRST_PARTY=new sn("first-party-uid"),sn.MOCK_USER=new sn("mock-user");/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */let Mo="12.3.0";/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Ss=new Lm("@firebase/firestore");function Us(){return Ss.logLevel}function ae(t,...e){if(Ss.logLevel<=Ue.DEBUG){const n=e.map(Vm);Ss.debug(`Firestore (${Mo}): ${t}`,...n)}}function Yr(t,...e){if(Ss.logLevel<=Ue.ERROR){const n=e.map(Vm);Ss.error(`Firestore (${Mo}): ${t}`,...n)}}function To(t,...e){if(Ss.logLevel<=Ue.WARN){const n=e.map(Vm);Ss.warn(`Firestore (${Mo}): ${t}`,...n)}}function Vm(t){if(typeof t=="string")return t;try{/** +* @license +* Copyright 2020 Google LLC +* +* 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. +*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function _e(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,fb(t,r,n)}function fb(t,e,n){let r=`FIRESTORE (${Mo}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw Yr(r),new Error(r)}function Ye(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||fb(e,i,r)}function ke(t,e){return t}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const q={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class se extends Dr{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Hr{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class pb{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class sN{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(sn.UNAUTHENTICATED))}shutdown(){}}class oN{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class aN{constructor(e){this.t=e,this.currentUser=sn.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){Ye(this.o===void 0,42304);let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let s=new Hr;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Hr,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const u=s;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},a=u=>{ae("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(u=>a(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?a(u):(ae("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Hr)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(ae("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Ye(typeof r.accessToken=="string",31837,{l:r}),new pb(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Ye(e===null||typeof e=="string",2055,{h:e}),new sn(e)}}class lN{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=sn.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class uN{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new lN(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(sn.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class av{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class cN{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,rr(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){Ye(this.o===void 0,3512);const r=s=>{s.error!=null&&ae("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.m;return this.m=s.token,ae("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{ae("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.V.getImmediate({optional:!0});s?i(s):ae("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new av(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Ye(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new av(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function dN(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function ep(t,e){const n=Math.min(t.length,e.length);for(let r=0;r=hN&&e<=fN}function ko(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const lv="__name__";class yr{constructor(e,n,r){n===void 0?n=0:n>e.length&&_e(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&_e(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return yr.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof yr?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length=0)throw new se(q.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new rt(n)}static emptyPath(){return new rt([])}}const pN=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Yt extends yr{construct(e,n,r){return new Yt(e,n,r)}static isValidIdentifier(e){return pN.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Yt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===lv}static keyField(){return new Yt([lv])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new se(q.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&rt.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return rt.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ge(new rt(e.slice()))}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function mb(t,e,n){if(!n)throw new se(q.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function mN(t,e,n,r){if(e===!0&&r===!0)throw new se(q.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function uv(t){if(!ge.isDocumentKey(t))throw new se(q.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function cv(t){if(ge.isDocumentKey(t))throw new se(q.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function gb(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function ud(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":_e(12329,{type:typeof t})}function Sn(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new se(q.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=ud(t);throw new se(q.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** + * @license + * Copyright 2025 Google LLC + * + * 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. + */function Rt(t,e){const n={typeString:t};return e&&(n.value=e),n}function El(t,e){if(!gb(t))throw new se(q.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const i=e[r].typeString,s="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const o=t[r];if(i&&typeof o!==i){n=`JSON field '${r}' must be a ${i}.`;break}if(s!==void 0&&o!==s.value){n=`Expected '${r}' field to equal '${s.value}'`;break}}if(n)throw new se(q.INVALID_ARGUMENT,n);return!0}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const dv=-62135596800,hv=1e6;class Qe{static now(){return Qe.fromMillis(Date.now())}static fromDate(e){return Qe.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*hv);return new Qe(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new se(q.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new se(q.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e=253402300800)throw new se(q.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/hv}_compareTo(e){return this.seconds===e.seconds?ze(this.nanoseconds,e.nanoseconds):ze(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Qe._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(El(e,Qe._jsonSchema))return new Qe(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-dv;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Qe._jsonSchemaVersion="firestore/timestamp/1.0",Qe._jsonSchema={type:Rt("string",Qe._jsonSchemaVersion),seconds:Rt("number"),nanoseconds:Rt("number")};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Se{static fromTimestamp(e){return new Se(e)}static min(){return new Se(new Qe(0,0))}static max(){return new Se(new Qe(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const il=-1;function gN(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=Se.fromTimestamp(r===1e9?new Qe(n+1,0):new Qe(n,r));return new Ui(i,ge.empty(),e)}function yN(t){return new Ui(t.readTime,t.key,il)}class Ui{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new Ui(Se.min(),ge.empty(),il)}static max(){return new Ui(Se.max(),ge.empty(),il)}}function vN(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=ge.comparator(t.documentKey,e.documentKey),n!==0?n:ze(t.largestBatchId,e.largestBatchId))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const xN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class wN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */async function Vo(t){if(t.code!==q.FAILED_PRECONDITION||t.message!==xN)throw t;ae("LocalStore","Unexpectedly lost primary lease")}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class G{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&_e(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new G((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof G?n:G.resolve(n)}catch(n){return G.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):G.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):G.reject(n)}static resolve(e){return new G((n,r)=>{n(e)})}static reject(e){return new G((n,r)=>{r(e)})}static waitFor(e){return new G((n,r)=>{let i=0,s=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++s,o&&s===i&&n()},u=>r(u))}),o=!0,s===i&&n()})}static or(e){let n=G.resolve(!1);for(const r of e)n=n.next(i=>i?G.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new G((r,i)=>{const s=e.length,o=new Array(s);let a=0;for(let u=0;u{o[c]=f,++a,a===s&&r(o)},f=>i(f))}})}static doWhile(e,n){return new G((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function _N(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function Fo(t){return t.name==="IndexedDbTransactionError"}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */class cd{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>n.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}cd.ce=-1;/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Um=-1;function dd(t){return t==null}function wc(t){return t===0&&1/t==-1/0}function bN(t){return typeof t=="number"&&Number.isInteger(t)&&!wc(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const yb="";function EN(t){let e="";for(let n=0;n0&&(e=fv(e)),e=IN(t.get(n),e);return fv(e)}function IN(t,e){let n=e;const r=t.length;for(let i=0;i0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new cu(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new cu(this.root,e,this.comparator,!1)}getReverseIterator(){return new cu(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new cu(this.root,e,this.comparator,!0)}}class cu{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Qt{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??Qt.RED,this.left=i??Qt.EMPTY,this.right=s??Qt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new Qt(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Qt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Qt.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Qt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Qt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw _e(43730,{key:this.key,value:this.value});if(this.right.isRed())throw _e(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw _e(27949);return e+(this.isRed()?0:1)}}Qt.EMPTY=null,Qt.RED=!0,Qt.BLACK=!1;Qt.EMPTY=new class{constructor(){this.size=0}get key(){throw _e(57766)}get value(){throw _e(16141)}get color(){throw _e(16727)}get left(){throw _e(29726)}get right(){throw _e(36894)}copy(e,n,r,i,s){return this}insert(e,n,r){return new Qt(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Mt{constructor(e){this.comparator=e,this.data=new pt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new mv(this.data.getIterator())}getIteratorFrom(e){return new mv(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof Mt)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new Mt(this.comparator);return n.data=e,n}}class mv{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class On{constructor(e){this.fields=e,e.sort(Yt.comparator)}static empty(){return new On([])}unionWith(e){let n=new Mt(Yt.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new On(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return ko(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */class xb extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class en{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new xb("Invalid base64 string: "+s):s}}(e);return new en(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;oeAr(n,e))!==void 0}function Co(t,e){if(t===e)return 0;const n=$i(t),r=$i(e);if(n!==r)return ze(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return ze(t.booleanValue,e.booleanValue);case 2:return function(s,o){const a=St(s.integerValue||s.doubleValue),u=St(o.integerValue||o.doubleValue);return au?1:a===u?0:isNaN(a)?isNaN(u)?0:-1:1}(t,e);case 3:return gv(t.timestampValue,e.timestampValue);case 4:return gv(sl(t),sl(e));case 5:return ep(t.stringValue,e.stringValue);case 6:return function(s,o){const a=Bi(s),u=Bi(o);return a.compareTo(u)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const a=s.split("/"),u=o.split("/");for(let c=0;ci+ju(s),0)}(t.arrayValue);case 10:case 11:return function(r){let i=0;return Qi(r.fields,(s,o)=>{i+=s.length+ju(o)}),i}(t.mapValue);default:throw _e(13486,{value:t})}}function vv(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function np(t){return!!t&&"integerValue"in t}function Bm(t){return!!t&&"arrayValue"in t}function xv(t){return!!t&&"nullValue"in t}function wv(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Lu(t){return!!t&&"mapValue"in t}function CN(t){var n,r;return((r=(((n=t==null?void 0:t.mapValue)==null?void 0:n.fields)||{})[Ib])==null?void 0:r.stringValue)===Sb}function Pa(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return Qi(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=Pa(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Pa(t.arrayValue.values[n]);return e}return{...t}}function NN(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===kN}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class xn{constructor(e){this.value=e}static empty(){return new xn({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(a)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=Pa(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());Lu(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Ar(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[i]=s);for(const i of r)delete e[i]}clone(){return new xn(Pa(this.value))}}function Tb(t){const e=[];return Qi(t.fields,(n,r)=>{const i=new Yt([n]);if(Lu(r)){const s=Tb(r.mapValue).fields;if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new On(e)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class an{constructor(e,n,r,i,s,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=a}static newInvalidDocument(e){return new an(e,0,Se.min(),Se.min(),Se.min(),xn.empty(),0)}static newFoundDocument(e,n,r,i){return new an(e,1,n,Se.min(),r,i,0)}static newNoDocument(e,n){return new an(e,2,n,Se.min(),Se.min(),xn.empty(),0)}static newUnknownDocument(e,n){return new an(e,3,n,Se.min(),Se.min(),xn.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(Se.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=xn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=xn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Se.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof an&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new an(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class Ec{constructor(e,n){this.position=e,this.inclusive=n}}function _v(t,e,n){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return _e(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class cr extends kb{constructor(e,n){super(),this.filters=e,this.op=n,this.Pe=null}static create(e,n){return new cr(e,n)}matches(e){return Cb(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Cb(t){return t.op==="and"}function Nb(t){return PN(t)&&Cb(t)}function PN(t){for(const e of t.filters)if(e instanceof cr)return!1;return!0}function rp(t){if(t instanceof Pt)return t.field.canonicalString()+t.op.toString()+No(t.value);if(Nb(t))return t.filters.map(e=>rp(e)).join(",");{const e=t.filters.map(n=>rp(n)).join(",");return`${t.op}(${e})`}}function Ab(t,e){return t instanceof Pt?function(r,i){return i instanceof Pt&&r.op===i.op&&r.field.isEqual(i.field)&&Ar(r.value,i.value)}(t,e):t instanceof cr?function(r,i){return i instanceof cr&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&Ab(o,i.filters[a]),!0):!1}(t,e):void _e(19439)}function Pb(t){return t instanceof Pt?function(n){return`${n.field.canonicalString()} ${n.op} ${No(n.value)}`}(t):t instanceof cr?function(n){return n.op.toString()+" {"+n.getFilters().map(Pb).join(" ,")+"}"}(t):"Filter"}class RN extends Pt{constructor(e,n,r){super(e,n,r),this.key=ge.fromName(r.referenceValue)}matches(e){const n=ge.comparator(e.key,this.key);return this.matchesComparison(n)}}class DN extends Pt{constructor(e,n){super(e,"in",n),this.keys=Rb("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class jN extends Pt{constructor(e,n){super(e,"not-in",n),this.keys=Rb("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function Rb(t,e){var n;return(((n=e.arrayValue)==null?void 0:n.values)||[]).map(r=>ge.fromName(r.referenceValue))}class LN extends Pt{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return Bm(n)&&al(n.arrayValue,this.value)}}class ON extends Pt{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&al(this.value.arrayValue,n)}}class MN extends Pt{constructor(e,n){super(e,"not-in",n)}matches(e){if(al(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!al(this.value.arrayValue,n)}}class VN extends Pt{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!Bm(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>al(this.value.arrayValue,r))}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class FN{constructor(e,n=null,r=[],i=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.Te=null}}function Ev(t,e=null,n=[],r=[],i=null,s=null,o=null){return new FN(t,e,n,r,i,s,o)}function $m(t){const e=ke(t);if(e.Te===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>rp(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),dd(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>No(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>No(r)).join(",")),e.Te=n}return e.Te}function Hm(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Mt(Yt.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.Ie.push(new ll(s,r))}),n.has(Yt.keyField().canonicalString())||e.Ie.push(new ll(Yt.keyField(),r))}return e.Ie}function Ir(t){const e=ke(t);return e.Ee||(e.Ee=zN(e,Ra(t))),e.Ee}function zN(t,e){if(t.limitType==="F")return Ev(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new ll(i.field,s)});const n=t.endAt?new Ec(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Ec(t.startAt.position,t.startAt.inclusive):null;return Ev(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function sp(t,e){const n=t.filters.concat([e]);return new Uo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function op(t,e,n){return new Uo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function pd(t,e){return Hm(Ir(t),Ir(e))&&t.limitType===e.limitType}function jb(t){return`${$m(Ir(t))}|lt:${t.limitType}`}function zs(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>Pb(i)).join(", ")}]`),dd(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>No(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>No(i)).join(",")),`Target(${r})`}(Ir(t))}; limitType=${t.limitType})`}function md(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):ge.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of Ra(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,a,u){const c=_v(o,a,u);return o.inclusive?c<=0:c<0}(r.startAt,Ra(r),i)||r.endAt&&!function(o,a,u){const c=_v(o,a,u);return o.inclusive?c>=0:c>0}(r.endAt,Ra(r),i))}(t,e)}function BN(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function Lb(t){return(e,n)=>{let r=!1;for(const i of Ra(t)){const s=$N(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function $N(t,e,n){const r=t.field.isKeyField()?ge.comparator(e.key,n.key):function(s,o,a){const u=o.data.field(s),c=a.data.field(s);return u!==null&&c!==null?Co(u,c):_e(42886)}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return _e(19790,{direction:t.dir})}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Rs{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s{for(const[i,s]of r)e(i,s)})}isEmpty(){return vb(this.inner)}size(){return this.innerSize}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const HN=new pt(ge.comparator);function Xr(){return HN}const Ob=new pt(ge.comparator);function va(...t){let e=Ob;for(const n of t)e=e.insert(n.key,n);return e}function Mb(t){let e=Ob;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function ds(){return Da()}function Vb(){return Da()}function Da(){return new Rs(t=>t.toString(),(t,e)=>t.isEqual(e))}const qN=new pt(ge.comparator),WN=new Mt(ge.comparator);function Be(...t){let e=WN;for(const n of t)e=e.add(n);return e}const GN=new Mt(ze);function KN(){return GN}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function qm(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:wc(e)?"-0":e}}function Fb(t){return{integerValue:""+t}}function Ub(t,e){return bN(e)?Fb(e):qm(t,e)}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */class gd{constructor(){this._=void 0}}function QN(t,e,n){return t instanceof Ic?function(i,s){const o={fields:{[_b]:{stringValue:wb},[Eb]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&zm(s)&&(s=hd(s)),s&&(o.fields[bb]=s),{mapValue:o}}(n,e):t instanceof ul?Bb(t,e):t instanceof cl?$b(t,e):function(i,s){const o=zb(i,s),a=Sv(o)+Sv(i.Ae);return np(o)&&np(i.Ae)?Fb(a):qm(i.serializer,a)}(t,e)}function YN(t,e,n){return t instanceof ul?Bb(t,e):t instanceof cl?$b(t,e):n}function zb(t,e){return t instanceof dl?function(r){return np(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class Ic extends gd{}class ul extends gd{constructor(e){super(),this.elements=e}}function Bb(t,e){const n=Hb(e);for(const r of t.elements)n.some(i=>Ar(i,r))||n.push(r);return{arrayValue:{values:n}}}class cl extends gd{constructor(e){super(),this.elements=e}}function $b(t,e){let n=Hb(e);for(const r of t.elements)n=n.filter(i=>!Ar(i,r));return{arrayValue:{values:n}}}class dl extends gd{constructor(e,n){super(),this.serializer=e,this.Ae=n}}function Sv(t){return St(t.integerValue||t.doubleValue)}function Hb(t){return Bm(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class XN{constructor(e,n){this.field=e,this.transform=n}}function JN(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof ul&&i instanceof ul||r instanceof cl&&i instanceof cl?ko(r.elements,i.elements,Ar):r instanceof dl&&i instanceof dl?Ar(r.Ae,i.Ae):r instanceof Ic&&i instanceof Ic}(t.transform,e.transform)}class ZN{constructor(e,n){this.version=e,this.transformResults=n}}class Yn{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new Yn}static exists(e){return new Yn(void 0,e)}static updateTime(e){return new Yn(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Ou(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class yd{}function qb(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Wm(t.key,Yn.none()):new Il(t.key,t.data,Yn.none());{const n=t.data,r=xn.empty();let i=new Mt(Yt.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new Yi(t.key,r,new On(i.toArray()),Yn.none())}}function eA(t,e,n){t instanceof Il?function(i,s,o){const a=i.value.clone(),u=kv(i.fieldTransforms,s,o.transformResults);a.setAll(u),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof Yi?function(i,s,o){if(!Ou(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=kv(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(Wb(i)),u.setAll(a),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function ja(t,e,n,r){return t instanceof Il?function(s,o,a,u){if(!Ou(s.precondition,o))return a;const c=s.value.clone(),f=Cv(s.fieldTransforms,u,o);return c.setAll(f),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof Yi?function(s,o,a,u){if(!Ou(s.precondition,o))return a;const c=Cv(s.fieldTransforms,u,o),f=o.data;return f.setAll(Wb(s)),f.setAll(c),o.convertToFoundDocument(o.version,f).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(h=>h.field))}(t,e,n,r):function(s,o,a){return Ou(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function tA(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=zb(r.transform,i||null);s!=null&&(n===null&&(n=xn.empty()),n.set(r.field,s))}return n||null}function Tv(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&ko(r,i,(s,o)=>JN(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Il extends yd{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Yi extends yd{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function Wb(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function kv(t,e,n){const r=new Map;Ye(t.length===n.length,32656,{Re:n.length,Ve:t.length});for(let i=0;i{const s=e.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const u=qb(o,a);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(Se.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Be())}isEqual(e){return this.batchId===e.batchId&&ko(this.mutations,e.mutations,(n,r)=>Tv(n,r))&&ko(this.baseMutations,e.baseMutations,(n,r)=>Tv(n,r))}}class Gm{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){Ye(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let i=function(){return qN}();const s=e.mutations;for(let o=0;o=8)throw new xa(`Invalid padding: ${n}`);if(r<0)throw new xa(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new xa(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new xa(`Invalid padding when bitmap length is 0: ${n}`);this.ge=8*e.length-n,this.pe=Li.fromNumber(this.ge)}ye(e,n,r){let i=e.add(n.multiply(Li.fromNumber(r)));return i.compare(lA)===1&&(i=new Li([i.getBits(0),i.getBits(1)],0)),i.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<o.insert(a)),o}insert(e){if(this.ge===0)return;const n=Nv(e),[r,i]=Av(n);for(let s=0;s0&&(this.Oe=!0,this.Me=e)}ke(){let e=Be(),n=Be(),r=Be();return this.Fe.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:_e(38017,{changeType:s})}}),new Sl(this.Me,this.xe,e,n,r)}qe(){this.Oe=!1,this.Fe=Rv()}Qe(e,n){this.Oe=!0,this.Fe=this.Fe.insert(e,n)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,Ye(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class uA{constructor(e){this.Ge=e,this.ze=new Map,this.je=Xr(),this.Je=hu(),this.He=hu(),this.Ye=new pt(ze)}Ze(e){for(const n of e.be)e.De&&e.De.isFoundDocument()?this.Xe(n,e.De):this.et(n,e.key,e.De);for(const n of e.removedTargetIds)this.et(n,e.key,e.De)}tt(e){this.forEachTarget(e,n=>{const r=this.nt(n);switch(e.state){case 0:this.rt(n)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(n);break;case 3:this.rt(n)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(n)&&(this.it(n),r.Le(e.resumeToken));break;default:_e(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.ze.forEach((r,i)=>{this.rt(i)&&n(i)})}st(e){const n=e.targetId,r=e.Ce.count,i=this.ot(n);if(i){const s=i.target;if(ip(s))if(r===0){const o=new ge(s.path);this.et(n,o,an.newNoDocument(o,Se.min()))}else Ye(r===1,20013,{expectedCount:r});else{const o=this._t(n);if(o!==r){const a=this.ut(e),u=a?this.ct(a,e,o):1;if(u!==0){this.it(n);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(n,c)}}}}}ut(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=Bi(r).toUint8Array()}catch(u){if(u instanceof xb)return To("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new Km(o,i,s)}catch(u){return To(u instanceof xa?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.ge===0?null:a}ct(e,n,r){return n.Ce.count===r-this.Pt(e,n.targetId)?0:2}Pt(e,n){const r=this.Ge.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.et(n,s,null),i++)}),i}Tt(e){const n=new Map;this.ze.forEach((s,o)=>{const a=this.ot(o);if(a){if(s.current&&ip(a.target)){const u=new ge(a.target.path);this.It(u).has(o)||this.Et(o,u)||this.et(o,u,an.newNoDocument(u,e))}s.Be&&(n.set(o,s.ke()),s.qe())}});let r=Be();this.He.forEach((s,o)=>{let a=!0;o.forEachWhile(u=>{const c=this.ot(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(s))}),this.je.forEach((s,o)=>o.setReadTime(e));const i=new vd(e,n,this.Ye,this.je,r);return this.je=Xr(),this.Je=hu(),this.He=hu(),this.Ye=new pt(ze),i}Xe(e,n){if(!this.rt(e))return;const r=this.Et(e,n.key)?2:0;this.nt(e).Qe(n.key,r),this.je=this.je.insert(n.key,n),this.Je=this.Je.insert(n.key,this.It(n.key).add(e)),this.He=this.He.insert(n.key,this.dt(n.key).add(e))}et(e,n,r){if(!this.rt(e))return;const i=this.nt(e);this.Et(e,n)?i.Qe(n,1):i.$e(n),this.He=this.He.insert(n,this.dt(n).delete(e)),this.He=this.He.insert(n,this.dt(n).add(e)),r&&(this.je=this.je.insert(n,r))}removeTarget(e){this.ze.delete(e)}_t(e){const n=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let n=this.ze.get(e);return n||(n=new Pv,this.ze.set(e,n)),n}dt(e){let n=this.He.get(e);return n||(n=new Mt(ze),this.He=this.He.insert(e,n)),n}It(e){let n=this.Je.get(e);return n||(n=new Mt(ze),this.Je=this.Je.insert(e,n)),n}rt(e){const n=this.ot(e)!==null;return n||ae("WatchChangeAggregator","Detected inactive target",e),n}ot(e){const n=this.ze.get(e);return n&&n.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new Pv),this.Ge.getRemoteKeysForTarget(e).forEach(n=>{this.et(e,n,null)})}Et(e,n){return this.Ge.getRemoteKeysForTarget(e).has(n)}}function hu(){return new pt(ge.comparator)}function Rv(){return new pt(ge.comparator)}const cA={asc:"ASCENDING",desc:"DESCENDING"},dA={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},hA={and:"AND",or:"OR"};class fA{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function ap(t,e){return t.useProto3Json||dd(e)?e:{value:e}}function Sc(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Yb(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function pA(t,e){return Sc(t,e.toTimestamp())}function Sr(t){return Ye(!!t,49232),Se.fromTimestamp(function(n){const r=zi(n);return new Qe(r.seconds,r.nanos)}(t))}function Qm(t,e){return lp(t,e).canonicalString()}function lp(t,e){const n=function(i){return new rt(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function Xb(t){const e=rt.fromString(t);return Ye(nE(e),10190,{key:e.toString()}),e}function up(t,e){return Qm(t.databaseId,e.path)}function Ph(t,e){const n=Xb(e);if(n.get(1)!==t.databaseId.projectId)throw new se(q.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new se(q.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ge(Zb(n))}function Jb(t,e){return Qm(t.databaseId,e)}function mA(t){const e=Xb(t);return e.length===4?rt.emptyPath():Zb(e)}function cp(t){return new rt(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Zb(t){return Ye(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function Dv(t,e,n){return{name:up(t,e),fields:n.value.mapValue.fields}}function gA(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:_e(39313,{state:c})}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(c,f){return c.useProto3Json?(Ye(f===void 0||typeof f=="string",58123),en.fromBase64String(f||"")):(Ye(f===void 0||f instanceof Buffer||f instanceof Uint8Array,16193),en.fromUint8Array(f||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const f=c.code===void 0?q.UNKNOWN:Gb(c.code);return new se(f,c.message||"")}(o);n=new Qb(r,i,s,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=Ph(t,r.document.name),s=Sr(r.document.updateTime),o=r.document.createTime?Sr(r.document.createTime):Se.min(),a=new xn({mapValue:{fields:r.document.fields}}),u=an.newFoundDocument(i,s,o,a),c=r.targetIds||[],f=r.removedTargetIds||[];n=new Mu(c,f,u.key,u)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=Ph(t,r.document),s=r.readTime?Sr(r.readTime):Se.min(),o=an.newNoDocument(i,s),a=r.removedTargetIds||[];n=new Mu([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=Ph(t,r.document),s=r.removedTargetIds||[];n=new Mu([],s,i,null)}else{if(!("filter"in e))return _e(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new sA(i,s),a=r.targetId;n=new Kb(a,o)}}return n}function yA(t,e){let n;if(e instanceof Il)n={update:Dv(t,e.key,e.value)};else if(e instanceof Wm)n={delete:up(t,e.key)};else if(e instanceof Yi)n={update:Dv(t,e.key,e.data),updateMask:TA(e.fieldMask)};else{if(!(e instanceof nA))return _e(16599,{Vt:e.type});n={verify:up(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof Ic)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof ul)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof cl)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof dl)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw _e(20930,{transform:o.transform})}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:pA(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:_e(27497)}(t,e.precondition)),n}function vA(t,e){return t&&t.length>0?(Ye(e!==void 0,14353),t.map(n=>function(i,s){let o=i.updateTime?Sr(i.updateTime):Sr(s);return o.isEqual(Se.min())&&(o=Sr(s)),new ZN(o,i.transformResults||[])}(n,e))):[]}function xA(t,e){return{documents:[Jb(t,e.path)]}}function wA(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=Jb(t,i);const s=function(c){if(c.length!==0)return tE(cr.create(c,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(f=>function(p){return{field:Bs(p.field),direction:EA(p.dir)}}(f))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=ap(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{ft:n,parent:i}}function _A(t){let e=mA(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Ye(r===1,65062);const f=n.from[0];f.allDescendants?i=f.collectionId:e=e.child(f.collectionId)}let s=[];n.where&&(s=function(h){const p=eE(h);return p instanceof cr&&Nb(p)?p.getFilters():[p]}(n.where));let o=[];n.orderBy&&(o=function(h){return h.map(p=>function(b){return new ll($s(b.field),function(P){switch(P){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(b.direction))}(p))}(n.orderBy));let a=null;n.limit&&(a=function(h){let p;return p=typeof h=="object"?h.value:h,dd(p)?null:p}(n.limit));let u=null;n.startAt&&(u=function(h){const p=!!h.before,m=h.values||[];return new Ec(m,p)}(n.startAt));let c=null;return n.endAt&&(c=function(h){const p=!h.before,m=h.values||[];return new Ec(m,p)}(n.endAt)),UN(e,i,o,s,a,"F",u,c)}function bA(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return _e(28987,{purpose:i})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function eE(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=$s(n.unaryFilter.field);return Pt.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=$s(n.unaryFilter.field);return Pt.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=$s(n.unaryFilter.field);return Pt.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=$s(n.unaryFilter.field);return Pt.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return _e(61313);default:return _e(60726)}}(t):t.fieldFilter!==void 0?function(n){return Pt.create($s(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return _e(58110);default:return _e(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return cr.create(n.compositeFilter.filters.map(r=>eE(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return _e(1026)}}(n.compositeFilter.op))}(t):_e(30097,{filter:t})}function EA(t){return cA[t]}function IA(t){return dA[t]}function SA(t){return hA[t]}function Bs(t){return{fieldPath:t.canonicalString()}}function $s(t){return Yt.fromServerFormat(t.fieldPath)}function tE(t){return t instanceof Pt?function(n){if(n.op==="=="){if(wv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NAN"}};if(xv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(wv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NOT_NAN"}};if(xv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Bs(n.field),op:IA(n.op),value:n.value}}}(t):t instanceof cr?function(n){const r=n.getFilters().map(i=>tE(i));return r.length===1?r[0]:{compositeFilter:{op:SA(n.op),filters:r}}}(t):_e(54877,{filter:t})}function TA(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function nE(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ei{constructor(e,n,r,i,s=Se.min(),o=Se.min(),a=en.EMPTY_BYTE_STRING,u=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=u}withSequenceNumber(e){return new Ei(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Ei(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ei(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ei(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class kA{constructor(e){this.yt=e}}function CA(t){const e=_A({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?op(e,e.limit,"L"):e}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class NA{constructor(){this.Cn=new AA}addToCollectionParentIndex(e,n){return this.Cn.add(n),G.resolve()}getCollectionParents(e,n){return G.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return G.resolve()}deleteFieldIndex(e,n){return G.resolve()}deleteAllFieldIndexes(e){return G.resolve()}createTargetIndexes(e,n){return G.resolve()}getDocumentsMatchingTarget(e,n){return G.resolve(null)}getIndexType(e,n){return G.resolve(0)}getFieldIndexes(e,n){return G.resolve([])}getNextCollectionGroupToUpdate(e){return G.resolve(null)}getMinOffset(e,n){return G.resolve(Ui.min())}getMinOffsetFromCollectionGroup(e,n){return G.resolve(Ui.min())}updateCollectionGroup(e,n,r){return G.resolve()}updateIndexEntries(e,n){return G.resolve()}}class AA{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new Mt(rt.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new Mt(rt.comparator)).toArray()}}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */const jv={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},rE=41943040;class yn{static withCacheSize(e){return new yn(e,yn.DEFAULT_COLLECTION_PERCENTILE,yn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */yn.DEFAULT_COLLECTION_PERCENTILE=10,yn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,yn.DEFAULT=new yn(rE,yn.DEFAULT_COLLECTION_PERCENTILE,yn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),yn.DISABLED=new yn(-1,0,0);/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ao{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new Ao(0)}static cr(){return new Ao(-1)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Lv="LruGarbageCollector",PA=1048576;function Ov([t,e],[n,r]){const i=ze(t,n);return i===0?ze(e,r):i}class RA{constructor(e){this.Ir=e,this.buffer=new Mt(Ov),this.Er=0}dr(){return++this.Er}Ar(e){const n=[e,this.dr()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){Fo(n)?ae(Lv,"Ignoring IndexedDB error during garbage collection: ",n):await Vo(n)}await this.Vr(3e5)})}}class jA{constructor(e,n){this.mr=e,this.params=n}calculateTargetCount(e,n){return this.mr.gr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return G.resolve(cd.ce);const r=new RA(n);return this.mr.forEachTarget(e,i=>r.Ar(i.sequenceNumber)).next(()=>this.mr.pr(e,i=>r.Ar(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.mr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.mr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(ae("LruGarbageCollector","Garbage collection skipped; disabled"),G.resolve(jv)):this.getCacheSize(e).next(r=>r(h>this.params.maximumSequenceNumbersToCollect?(ae("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),i=this.params.maximumSequenceNumbersToCollect):i=h,o=Date.now(),this.nthSequenceNumber(e,i))).next(h=>(r=h,a=Date.now(),this.removeTargets(e,r,n))).next(h=>(s=h,u=Date.now(),this.removeOrphanedDocuments(e,r))).next(h=>(c=Date.now(),Us()<=Ue.DEBUG&&ae("LruGarbageCollector",`LRU Garbage Collection + Counted targets in ${o-f}ms + Determined least recently used ${i} in `+(a-o)+`ms + Removed ${s} targets in `+(u-a)+`ms + Removed ${h} documents in `+(c-u)+`ms +Total Duration: ${c-f}ms`),G.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:s,documentsRemoved:h})))}}function LA(t,e){return new jA(t,e)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class OA{constructor(){this.changes=new Rs(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,an.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?G.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + *//** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class MA{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class VA{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&ja(r.mutation,i,On.empty(),Qe.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Be()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Be()){const i=ds();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=va();return s.forEach((a,u)=>{o=o.insert(a,u.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=ds();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Be()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,r,i){let s=Xr();const o=Da(),a=function(){return Da()}();return n.forEach((u,c)=>{const f=r.get(c.key);i.has(c.key)&&(f===void 0||f.mutation instanceof Yi)?s=s.insert(c.key,c):f!==void 0?(o.set(c.key,f.mutation.getFieldMask()),ja(f.mutation,c,f.mutation.getFieldMask(),Qe.now())):o.set(c.key,On.empty())}),this.recalculateAndSaveOverlays(e,s).next(u=>(u.forEach((c,f)=>o.set(c,f)),n.forEach((c,f)=>a.set(c,new MA(f,o.get(c)??null))),a))}recalculateAndSaveOverlays(e,n){const r=Da();let i=new pt((o,a)=>o-a),s=Be();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(u=>{const c=n.get(u);if(c===null)return;let f=r.get(u)||On.empty();f=a.applyToLocalView(c,f),r.set(u,f);const h=(i.get(a.batchId)||Be()).add(u);i=i.insert(a.batchId,h)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),c=u.key,f=u.value,h=Vb();f.forEach(p=>{if(!s.has(p)){const m=qb(n.get(p),r.get(p));m!==null&&h.set(p,m),s=s.add(p)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,h))}return G.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return ge.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):Db(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):G.resolve(ds());let a=il,u=s;return o.next(c=>G.forEach(c,(f,h)=>(a{u=u.insert(f,p)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,u,c,Be())).next(f=>({batchId:a,changes:Mb(f)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new ge(n)).next(r=>{let i=va();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=va();return this.indexManager.getCollectionParents(e,s).next(a=>G.forEach(a,u=>{const c=function(h,p){return new Uo(p,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(f=>{f.forEach((h,p)=>{o=o.insert(h,p)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((u,c)=>{const f=c.getKey();o.get(f)===null&&(o=o.insert(f,an.newInvalidDocument(f)))});let a=va();return o.forEach((u,c)=>{const f=s.get(u);f!==void 0&&ja(f.mutation,c,On.empty(),Qe.now()),md(n,c)&&(a=a.insert(u,c))}),a})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class FA{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,n){return G.resolve(this.Lr.get(n))}saveBundleMetadata(e,n){return this.Lr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Sr(i.createTime)}}(n)),G.resolve()}getNamedQuery(e,n){return G.resolve(this.kr.get(n))}saveNamedQuery(e,n){return this.kr.set(n.name,function(i){return{name:i.name,query:CA(i.bundledQuery),readTime:Sr(i.readTime)}}(n)),G.resolve()}}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class UA{constructor(){this.overlays=new pt(ge.comparator),this.qr=new Map}getOverlay(e,n){return G.resolve(this.overlays.get(n))}getOverlays(e,n){const r=ds();return G.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.St(e,n,s)}),G.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.qr.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.qr.delete(r)),G.resolve()}getOverlaysForCollection(e,n,r){const i=ds(),s=n.length+1,o=new ge(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const u=a.getNext().value,c=u.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===s&&u.largestBatchId>r&&i.set(u.getKey(),u)}return G.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new pt((c,f)=>c-f);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let f=s.get(c.largestBatchId);f===null&&(f=ds(),s=s.insert(c.largestBatchId,f)),f.set(c.getKey(),c)}}const a=ds(),u=s.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((c,f)=>a.set(c,f)),!(a.size()>=i)););return G.resolve(a)}St(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.qr.get(i.largestBatchId).delete(r.key);this.qr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new iA(n,r));let s=this.qr.get(n);s===void 0&&(s=Be(),this.qr.set(n,s)),this.qr.set(n,s.add(r.key))}}/** + * @license + * Copyright 2024 Google LLC + * + * 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. + */class zA{constructor(){this.sessionToken=en.EMPTY_BYTE_STRING}getSessionToken(e){return G.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,G.resolve()}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ym{constructor(){this.Qr=new Mt(zt.$r),this.Ur=new Mt(zt.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,n){const r=new zt(e,n);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Gr(new zt(e,n))}zr(e,n){e.forEach(r=>this.removeReference(r,n))}jr(e){const n=new ge(new rt([])),r=new zt(n,e),i=new zt(n,e+1),s=[];return this.Ur.forEachInRange([r,i],o=>{this.Gr(o),s.push(o.key)}),s}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const n=new ge(new rt([])),r=new zt(n,e),i=new zt(n,e+1);let s=Be();return this.Ur.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new zt(e,0),r=this.Qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class zt{constructor(e,n){this.key=e,this.Yr=n}static $r(e,n){return ge.comparator(e.key,n.key)||ze(e.Yr,n.Yr)}static Kr(e,n){return ze(e.Yr,n.Yr)||ge.comparator(e.key,n.key)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class BA{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.tr=1,this.Zr=new Mt(zt.$r)}checkEmpty(e){return G.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new rA(s,n,r,i);this.mutationQueue.push(o);for(const a of i)this.Zr=this.Zr.add(new zt(a.key,s)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return G.resolve(o)}lookupMutationBatch(e,n){return G.resolve(this.Xr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.ei(r),s=i<0?0:i;return G.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return G.resolve(this.mutationQueue.length===0?Um:this.tr-1)}getAllMutationBatches(e){return G.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new zt(n,0),i=new zt(n,Number.POSITIVE_INFINITY),s=[];return this.Zr.forEachInRange([r,i],o=>{const a=this.Xr(o.Yr);s.push(a)}),G.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Mt(ze);return n.forEach(i=>{const s=new zt(i,0),o=new zt(i,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([s,o],a=>{r=r.add(a.Yr)})}),G.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;ge.isDocumentKey(s)||(s=s.child(""));const o=new zt(new ge(s),0);let a=new Mt(ze);return this.Zr.forEachWhile(u=>{const c=u.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(u.Yr)),!0)},o),G.resolve(this.ti(a))}ti(e){const n=[];return e.forEach(r=>{const i=this.Xr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Ye(this.ni(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return G.forEach(n.mutations,i=>{const s=new zt(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,n){const r=new zt(n,0),i=this.Zr.firstAfterOrEqual(r);return G.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,G.resolve()}ni(e,n){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const n=this.ei(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class $A{constructor(e){this.ri=e,this.docs=function(){return new pt(ge.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.ri(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return G.resolve(r?r.document.mutableCopy():an.newInvalidDocument(n))}getEntries(e,n){let r=Xr();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():an.newInvalidDocument(i))}),G.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=Xr();const o=n.path,a=new ge(o.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(a);for(;u.hasNext();){const{key:c,value:{document:f}}=u.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||vN(yN(f),r)<=0||(i.has(f.key)||md(n,f))&&(s=s.insert(f.key,f.mutableCopy()))}return G.resolve(s)}getAllFromCollectionGroup(e,n,r,i){_e(9500)}ii(e,n){return G.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new HA(this)}getSize(e){return G.resolve(this.size)}}class HA extends OA{constructor(e){super(),this.Nr=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Nr.addEntry(e,i)):this.Nr.removeEntry(r)}),G.waitFor(n)}getFromCache(e,n){return this.Nr.getEntry(e,n)}getAllFromCache(e,n){return this.Nr.getEntries(e,n)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class qA{constructor(e){this.persistence=e,this.si=new Rs(n=>$m(n),Hm),this.lastRemoteSnapshotVersion=Se.min(),this.highestTargetId=0,this.oi=0,this._i=new Ym,this.targetCount=0,this.ai=Ao.ur()}forEachTarget(e,n){return this.si.forEach((r,i)=>n(i)),G.resolve()}getLastRemoteSnapshotVersion(e){return G.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return G.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),G.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.oi&&(this.oi=n),G.resolve()}Pr(e){this.si.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ai=new Ao(n),this.highestTargetId=n),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,n){return this.Pr(n),this.targetCount+=1,G.resolve()}updateTargetData(e,n){return this.Pr(n),G.resolve()}removeTargetData(e,n){return this.si.delete(n.target),this._i.jr(n.targetId),this.targetCount-=1,G.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.si.forEach((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.si.delete(o),s.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),G.waitFor(s).next(()=>i)}getTargetCount(e){return G.resolve(this.targetCount)}getTargetData(e,n){const r=this.si.get(n)||null;return G.resolve(r)}addMatchingKeys(e,n,r){return this._i.Wr(n,r),G.resolve()}removeMatchingKeys(e,n,r){this._i.zr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),G.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this._i.jr(n),G.resolve()}getMatchingKeysForTargetId(e,n){const r=this._i.Hr(n);return G.resolve(r)}containsKey(e,n){return G.resolve(this._i.containsKey(n))}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class iE{constructor(e,n){this.ui={},this.overlays={},this.ci=new cd(0),this.li=!1,this.li=!0,this.hi=new zA,this.referenceDelegate=e(this),this.Pi=new qA(this),this.indexManager=new NA,this.remoteDocumentCache=function(i){return new $A(i)}(r=>this.referenceDelegate.Ti(r)),this.serializer=new kA(n),this.Ii=new FA(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new UA,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ui[e.toKey()];return r||(r=new BA(n,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,n,r){ae("MemoryPersistence","Starting transaction:",e);const i=new WA(this.ci.next());return this.referenceDelegate.Ei(),r(i).next(s=>this.referenceDelegate.di(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Ai(e,n){return G.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,n)))}}class WA extends wN{constructor(e){super(),this.currentSequenceNumber=e}}class Xm{constructor(e){this.persistence=e,this.Ri=new Ym,this.Vi=null}static mi(e){return new Xm(e)}get fi(){if(this.Vi)return this.Vi;throw _e(60996)}addReference(e,n,r){return this.Ri.addReference(r,n),this.fi.delete(r.toString()),G.resolve()}removeReference(e,n,r){return this.Ri.removeReference(r,n),this.fi.add(r.toString()),G.resolve()}markPotentiallyOrphaned(e,n){return this.fi.add(n.toString()),G.resolve()}removeTarget(e,n){this.Ri.jr(n.targetId).forEach(i=>this.fi.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.fi.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}Ei(){this.Vi=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return G.forEach(this.fi,r=>{const i=ge.fromPath(r);return this.gi(e,i).next(s=>{s||n.removeEntry(i,Se.min())})}).next(()=>(this.Vi=null,n.apply(e)))}updateLimboDocument(e,n){return this.gi(e,n).next(r=>{r?this.fi.delete(n.toString()):this.fi.add(n.toString())})}Ti(e){return 0}gi(e,n){return G.or([()=>G.resolve(this.Ri.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ai(e,n)])}}class Tc{constructor(e,n){this.persistence=e,this.pi=new Rs(r=>EN(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=LA(this,n)}static mi(e,n){return new Tc(e,n)}Ei(){}di(e){return G.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}gr(e){const n=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}wr(e){let n=0;return this.pr(e,r=>{n++}).next(()=>n)}pr(e,n){return G.forEach(this.pi,(r,i)=>this.br(e,r,i).next(s=>s?G.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const i=this.persistence.getRemoteDocumentCache(),s=i.newChangeBuffer();return i.ii(e,o=>this.br(e,o,n).next(a=>{a||(r++,s.removeEntry(o,Se.min()))})).next(()=>s.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.pi.set(n,e.currentSequenceNumber),G.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),G.resolve()}removeReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),G.resolve()}updateLimboDocument(e,n){return this.pi.set(n,e.currentSequenceNumber),G.resolve()}Ti(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=ju(e.data.value)),n}br(e,n,r){return G.or([()=>this.persistence.Ai(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const i=this.pi.get(n);return G.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Jm{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.Es=r,this.ds=i}static As(e,n){let r=Be(),i=Be();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new Jm(e,n.fromCache,r,i)}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */class GA{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class KA{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){return F2()?8:_N(un())>0?6:4}()}initialize(e,n){this.ps=e,this.indexManager=n,this.Rs=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.ys(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.ws(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new GA;return this.Ss(e,n,o).next(a=>{if(s.result=a,this.Vs)return this.bs(e,n,o,a.size)})}).next(()=>s.result)}bs(e,n,r,i){return r.documentReadCountthis.gs*i?(Us()<=Ue.DEBUG&&ae("QueryEngine","The SDK decides to create cache indexes for query:",zs(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Ir(n))):G.resolve())}ys(e,n){if(Iv(n))return G.resolve(null);let r=Ir(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=op(n,null,"F"),r=Ir(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=Be(...s);return this.ps.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,r).next(u=>{const c=this.Ds(n,a);return this.Cs(n,c,o,u.readTime)?this.ys(e,op(n,null,"F")):this.vs(e,c,n,u)}))})))}ws(e,n,r,i){return Iv(n)||i.isEqual(Se.min())?G.resolve(null):this.ps.getDocuments(e,r).next(s=>{const o=this.Ds(n,s);return this.Cs(n,o,r,i)?G.resolve(null):(Us()<=Ue.DEBUG&&ae("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),zs(n)),this.vs(e,o,n,gN(i,il)).next(a=>a))})}Ds(e,n){let r=new Mt(Lb(e));return n.forEach((i,s)=>{md(e,s)&&(r=r.add(s))}),r}Cs(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Ss(e,n,r){return Us()<=Ue.DEBUG&&ae("QueryEngine","Using full collection scan to execute query:",zs(n)),this.ps.getDocumentsMatchingQuery(e,n,Ui.min(),r)}vs(e,n,r,i){return this.ps.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Zm="LocalStore",QA=3e8;class YA{constructor(e,n,r,i){this.persistence=e,this.Fs=n,this.serializer=i,this.Ms=new pt(ze),this.xs=new Rs(s=>$m(s),Hm),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new VA(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.Ms))}}function XA(t,e,n,r){return new YA(t,e,n,r)}async function sE(t,e){const n=ke(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.Bs(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let u=Be();for(const c of i){o.push(c.batchId);for(const f of c.mutations)u=u.add(f.key)}for(const c of s){a.push(c.batchId);for(const f of c.mutations)u=u.add(f.key)}return n.localDocuments.getDocuments(r,u).next(c=>({Ls:c,removedBatchIds:o,addedBatchIds:a}))})})}function JA(t,e){const n=ke(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.Ns.newChangeBuffer({trackRemovals:!0});return function(a,u,c,f){const h=c.batch,p=h.keys();let m=G.resolve();return p.forEach(b=>{m=m.next(()=>f.getEntry(u,b)).next(S=>{const P=c.docVersions.get(b);Ye(P!==null,48541),S.version.compareTo(P)<0&&(h.applyToRemoteDocument(S,c),S.isValidDocument()&&(S.setReadTime(c.commitVersion),f.addEntry(S)))})}),m.next(()=>a.mutationQueue.removeMutationBatch(u,h))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let u=Be();for(let c=0;c0&&(u=u.add(a.batch.mutations[c].key));return u}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function oE(t){const e=ke(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Pi.getLastRemoteSnapshotVersion(n))}function ZA(t,e){const n=ke(t),r=e.snapshotVersion;let i=n.Ms;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.Ns.newChangeBuffer({trackRemovals:!0});i=n.Ms;const a=[];e.targetChanges.forEach((f,h)=>{const p=i.get(h);if(!p)return;a.push(n.Pi.removeMatchingKeys(s,f.removedDocuments,h).next(()=>n.Pi.addMatchingKeys(s,f.addedDocuments,h)));let m=p.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(h)!==null?m=m.withResumeToken(en.EMPTY_BYTE_STRING,Se.min()).withLastLimboFreeSnapshotVersion(Se.min()):f.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(f.resumeToken,r)),i=i.insert(h,m),function(S,P,y){return S.resumeToken.approximateByteSize()===0||P.snapshotVersion.toMicroseconds()-S.snapshotVersion.toMicroseconds()>=QA?!0:y.addedDocuments.size+y.modifiedDocuments.size+y.removedDocuments.size>0}(p,m,f)&&a.push(n.Pi.updateTargetData(s,m))});let u=Xr(),c=Be();if(e.documentUpdates.forEach(f=>{e.resolvedLimboDocuments.has(f)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,f))}),a.push(eP(s,o,e.documentUpdates).next(f=>{u=f.ks,c=f.qs})),!r.isEqual(Se.min())){const f=n.Pi.getLastRemoteSnapshotVersion(s).next(h=>n.Pi.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(f)}return G.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,c)).next(()=>u)}).then(s=>(n.Ms=i,s))}function eP(t,e,n){let r=Be(),i=Be();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=Xr();return n.forEach((a,u)=>{const c=s.get(a);u.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),u.isNoDocument()&&u.version.isEqual(Se.min())?(e.removeEntry(a,u.readTime),o=o.insert(a,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(a,u)):ae(Zm,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",u.version)}),{ks:o,qs:i}})}function tP(t,e){const n=ke(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=Um),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function nP(t,e){const n=ke(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Pi.getTargetData(r,e).next(s=>s?(i=s,G.resolve(i)):n.Pi.allocateTargetId(r).next(o=>(i=new Ei(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Pi.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.Ms.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(r.targetId,r),n.xs.set(e,r.targetId)),r})}async function dp(t,e,n){const r=ke(t),i=r.Ms.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!Fo(o))throw o;ae(Zm,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Ms=r.Ms.remove(e),r.xs.delete(i.target)}function Mv(t,e,n){const r=ke(t);let i=Se.min(),s=Be();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,c,f){const h=ke(u),p=h.xs.get(f);return p!==void 0?G.resolve(h.Ms.get(p)):h.Pi.getTargetData(c,f)}(r,o,Ir(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(o,a.targetId).next(u=>{s=u})}).next(()=>r.Fs.getDocumentsMatchingQuery(o,e,n?i:Se.min(),n?s:Be())).next(a=>(rP(r,BN(e),a),{documents:a,Qs:s})))}function rP(t,e,n){let r=t.Os.get(e)||Se.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.Os.set(e,r)}class Vv{constructor(){this.activeTargetIds=KN()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class iP{constructor(){this.Mo=new Vv,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,n,r){this.xo[e]=n}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new Vv,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class sP{Oo(e){}shutdown(){}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Fv="ConnectivityMonitor";class Uv{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){ae(Fv,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){ae(Fv,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */let fu=null;function hp(){return fu===null?fu=function(){return 268435456+Math.round(2147483648*Math.random())}():fu++,"0x"+fu.toString(16)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Rh="RestConnection",oP={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class aP{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Uo=n+"://"+e.host,this.Ko=`projects/${r}/databases/${i}`,this.Wo=this.databaseId.database===_c?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Go(e,n,r,i,s){const o=hp(),a=this.zo(e,n.toUriEncodedString());ae(Rh,`Sending RPC '${e}' ${o}:`,a,r);const u={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(u,i,s);const{host:c}=new URL(a),f=As(c);return this.Jo(e,a,u,r,f).then(h=>(ae(Rh,`Received RPC '${e}' ${o}: `,h),h),h=>{throw To(Rh,`RPC '${e}' ${o} failed with error: `,h,"url: ",a,"request:",r),h})}Ho(e,n,r,i,s,o){return this.Go(e,n,r,i,s)}jo(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Mo}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,s)=>e[s]=i),r&&r.headers.forEach((i,s)=>e[s]=i)}zo(e,n){const r=oP[e];return`${this.Uo}/v1/${n}:${r}`}terminate(){}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class lP{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const rn="WebChannelConnection";class uP extends aP{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,i,s){const o=hp();return new Promise((a,u)=>{const c=new lb;c.setWithCredentials(!0),c.listenOnce(ub.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Du.NO_ERROR:const h=c.getResponseJson();ae(rn,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(h)),a(h);break;case Du.TIMEOUT:ae(rn,`RPC '${e}' ${o} timed out`),u(new se(q.DEADLINE_EXCEEDED,"Request time out"));break;case Du.HTTP_ERROR:const p=c.getStatus();if(ae(rn,`RPC '${e}' ${o} failed with status:`,p,"response text:",c.getResponseText()),p>0){let m=c.getResponseJson();Array.isArray(m)&&(m=m[0]);const b=m==null?void 0:m.error;if(b&&b.status&&b.message){const S=function(y){const w=y.toLowerCase().replace(/_/g,"-");return Object.values(q).indexOf(w)>=0?w:q.UNKNOWN}(b.status);u(new se(S,b.message))}else u(new se(q.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new se(q.UNAVAILABLE,"Connection failed."));break;default:_e(9055,{l_:e,streamId:o,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{ae(rn,`RPC '${e}' ${o} completed.`)}});const f=JSON.stringify(i);ae(rn,`RPC '${e}' ${o} sending request:`,i),c.send(n,"POST",f,r,15)})}T_(e,n,r){const i=hp(),s=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=hb(),a=db(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(u.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(u.useFetchStreams=!0),this.jo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const f=s.join("");ae(rn,`Creating RPC '${e}' stream ${i}: ${f}`,u);const h=o.createWebChannel(f,u);this.I_(h);let p=!1,m=!1;const b=new lP({Yo:P=>{m?ae(rn,`Not sending because RPC '${e}' stream ${i} is closed:`,P):(p||(ae(rn,`Opening RPC '${e}' stream ${i} transport.`),h.open(),p=!0),ae(rn,`RPC '${e}' stream ${i} sending:`,P),h.send(P))},Zo:()=>h.close()}),S=(P,y,w)=>{P.listen(y,T=>{try{w(T)}catch(L){setTimeout(()=>{throw L},0)}})};return S(h,ya.EventType.OPEN,()=>{m||(ae(rn,`RPC '${e}' stream ${i} transport opened.`),b.o_())}),S(h,ya.EventType.CLOSE,()=>{m||(m=!0,ae(rn,`RPC '${e}' stream ${i} transport closed`),b.a_(),this.E_(h))}),S(h,ya.EventType.ERROR,P=>{m||(m=!0,To(rn,`RPC '${e}' stream ${i} transport errored. Name:`,P.name,"Message:",P.message),b.a_(new se(q.UNAVAILABLE,"The operation could not be completed")))}),S(h,ya.EventType.MESSAGE,P=>{var y;if(!m){const w=P.data[0];Ye(!!w,16349);const T=w,L=(T==null?void 0:T.error)||((y=T[0])==null?void 0:y.error);if(L){ae(rn,`RPC '${e}' stream ${i} received error:`,L);const F=L.status;let D=function(E){const k=kt[E];if(k!==void 0)return Gb(k)}(F),_=L.message;D===void 0&&(D=q.INTERNAL,_="Unknown error status: "+F+" with message "+L.message),m=!0,b.a_(new se(D,_)),h.close()}else ae(rn,`RPC '${e}' stream ${i} received:`,w),b.u_(w)}}),S(a,cb.STAT_EVENT,P=>{P.stat===Zf.PROXY?ae(rn,`RPC '${e}' stream ${i} detected buffering proxy`):P.stat===Zf.NOPROXY&&ae(rn,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{b.__()},0),b}terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(n=>n===e)}}function Dh(){return typeof document<"u"?document:null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function xd(t){return new fA(t,!0)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class aE{constructor(e,n,r=1e3,i=1.5,s=6e4){this.Mi=e,this.timerId=n,this.d_=r,this.A_=i,this.R_=s,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const n=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),i=Math.max(0,n-r);i>0&&ae("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.V_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const zv="PersistentStream";class lE{constructor(e,n,r,i,s,o,a,u){this.Mi=e,this.S_=r,this.b_=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new aE(e,n)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():n&&n.code===q.RESOURCE_EXHAUSTED?(Yr(n.toString()),Yr("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):n&&n.code===q.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(n)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),n=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.D_===n&&this.G_(r,i)},r=>{e(()=>{const i=new se(q.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(i)})})}G_(e,n){const r=this.W_(this.D_);this.stream=this.j_(e,n),this.stream.Xo(()=>{r(()=>this.listener.Xo())}),this.stream.t_(()=>{r(()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.t_()))}),this.stream.r_(i=>{r(()=>this.z_(i))}),this.stream.onMessage(i=>{r(()=>++this.F_==1?this.J_(i):this.onNext(i))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return ae(zv,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return n=>{this.Mi.enqueueAndForget(()=>this.D_===e?n():(ae(zv,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class cP extends lE{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}j_(e,n){return this.connection.T_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const n=gA(this.serializer,e),r=function(s){if(!("targetChange"in s))return Se.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?Se.min():o.readTime?Sr(o.readTime):Se.min()}(e);return this.listener.H_(n,r)}Y_(e){const n={};n.database=cp(this.serializer),n.addTarget=function(s,o){let a;const u=o.target;if(a=ip(u)?{documents:xA(s,u)}:{query:wA(s,u).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=Yb(s,o.resumeToken);const c=ap(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(Se.min())>0){a.readTime=Sc(s,o.snapshotVersion.toTimestamp());const c=ap(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const r=bA(this.serializer,e);r&&(n.labels=r),this.q_(n)}Z_(e){const n={};n.database=cp(this.serializer),n.removeTarget=e,this.q_(n)}}class dP extends lE{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}get X_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}K_(){this.X_&&this.ea([])}j_(e,n){return this.connection.T_("Write",e,n)}J_(e){return Ye(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Ye(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){Ye(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const n=vA(e.writeResults,e.commitTime),r=Sr(e.commitTime);return this.listener.na(r,n)}ra(){const e={};e.database=cp(this.serializer),this.q_(e)}ea(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>yA(this.serializer,r))};this.q_(n)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class hP{}class fP extends hP{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new se(q.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,n,r,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Go(e,lp(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===q.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new se(q.UNKNOWN,s.toString())})}Ho(e,n,r,i,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Ho(e,lp(n,r),i,o,a,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===q.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new se(q.UNKNOWN,o.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class pP{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const n=`Could not reach Cloud Firestore backend. ${e} +This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(Yr(n),this.aa=!1):ae("OnlineStateTracker",n)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Ts="RemoteStore";class mP{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=s,this.Aa.Oo(o=>{r.enqueueAndForget(async()=>{Ds(this)&&(ae(Ts,"Restarting streams for network reachability change."),await async function(u){const c=ke(u);c.Ea.add(4),await Tl(c),c.Ra.set("Unknown"),c.Ea.delete(4),await wd(c)}(this))})}),this.Ra=new pP(r,i)}}async function wd(t){if(Ds(t))for(const e of t.da)await e(!0)}async function Tl(t){for(const e of t.da)await e(!1)}function uE(t,e){const n=ke(t);n.Ia.has(e.targetId)||(n.Ia.set(e.targetId,e),rg(n)?ng(n):zo(n).O_()&&tg(n,e))}function eg(t,e){const n=ke(t),r=zo(n);n.Ia.delete(e),r.O_()&&cE(n,e),n.Ia.size===0&&(r.O_()?r.L_():Ds(n)&&n.Ra.set("Unknown"))}function tg(t,e){if(t.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Se.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}zo(t).Y_(e)}function cE(t,e){t.Va.Ue(e),zo(t).Z_(e)}function ng(t){t.Va=new uA({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),At:e=>t.Ia.get(e)||null,ht:()=>t.datastore.serializer.databaseId}),zo(t).start(),t.Ra.ua()}function rg(t){return Ds(t)&&!zo(t).x_()&&t.Ia.size>0}function Ds(t){return ke(t).Ea.size===0}function dE(t){t.Va=void 0}async function gP(t){t.Ra.set("Online")}async function yP(t){t.Ia.forEach((e,n)=>{tg(t,e)})}async function vP(t,e){dE(t),rg(t)?(t.Ra.ha(e),ng(t)):t.Ra.set("Unknown")}async function xP(t,e,n){if(t.Ra.set("Online"),e instanceof Qb&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.Ia.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.Ia.delete(a),i.Va.removeTarget(a))}(t,e)}catch(r){ae(Ts,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await kc(t,r)}else if(e instanceof Mu?t.Va.Ze(e):e instanceof Kb?t.Va.st(e):t.Va.tt(e),!n.isEqual(Se.min()))try{const r=await oE(t.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.Va.Tt(o);return a.targetChanges.forEach((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const f=s.Ia.get(c);f&&s.Ia.set(c,f.withResumeToken(u.resumeToken,o))}}),a.targetMismatches.forEach((u,c)=>{const f=s.Ia.get(u);if(!f)return;s.Ia.set(u,f.withResumeToken(en.EMPTY_BYTE_STRING,f.snapshotVersion)),cE(s,u);const h=new Ei(f.target,u,c,f.sequenceNumber);tg(s,h)}),s.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(r){ae(Ts,"Failed to raise snapshot:",r),await kc(t,r)}}async function kc(t,e,n){if(!Fo(e))throw e;t.Ea.add(1),await Tl(t),t.Ra.set("Offline"),n||(n=()=>oE(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{ae(Ts,"Retrying IndexedDB access"),await n(),t.Ea.delete(1),await wd(t)})}function hE(t,e){return e().catch(n=>kc(t,n,e))}async function _d(t){const e=ke(t),n=Hi(e);let r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Um;for(;wP(e);)try{const i=await tP(e.localStore,r);if(i===null){e.Ta.length===0&&n.L_();break}r=i.batchId,_P(e,i)}catch(i){await kc(e,i)}fE(e)&&pE(e)}function wP(t){return Ds(t)&&t.Ta.length<10}function _P(t,e){t.Ta.push(e);const n=Hi(t);n.O_()&&n.X_&&n.ea(e.mutations)}function fE(t){return Ds(t)&&!Hi(t).x_()&&t.Ta.length>0}function pE(t){Hi(t).start()}async function bP(t){Hi(t).ra()}async function EP(t){const e=Hi(t);for(const n of t.Ta)e.ea(n.mutations)}async function IP(t,e,n){const r=t.Ta.shift(),i=Gm.from(r,e,n);await hE(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await _d(t)}async function SP(t,e){e&&Hi(t).X_&&await async function(r,i){if(function(o){return oA(o)&&o!==q.ABORTED}(i.code)){const s=r.Ta.shift();Hi(r).B_(),await hE(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await _d(r)}}(t,e),fE(t)&&pE(t)}async function Bv(t,e){const n=ke(t);n.asyncQueue.verifyOperationInProgress(),ae(Ts,"RemoteStore received new credentials");const r=Ds(n);n.Ea.add(3),await Tl(n),r&&n.Ra.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ea.delete(3),await wd(n)}async function TP(t,e){const n=ke(t);e?(n.Ea.delete(2),await wd(n)):e||(n.Ea.add(2),await Tl(n),n.Ra.set("Unknown"))}function zo(t){return t.ma||(t.ma=function(n,r,i){const s=ke(n);return s.sa(),new cP(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Xo:gP.bind(null,t),t_:yP.bind(null,t),r_:vP.bind(null,t),H_:xP.bind(null,t)}),t.da.push(async e=>{e?(t.ma.B_(),rg(t)?ng(t):t.Ra.set("Unknown")):(await t.ma.stop(),dE(t))})),t.ma}function Hi(t){return t.fa||(t.fa=function(n,r,i){const s=ke(n);return s.sa(),new dP(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Xo:()=>Promise.resolve(),t_:bP.bind(null,t),r_:SP.bind(null,t),ta:EP.bind(null,t),na:IP.bind(null,t)}),t.da.push(async e=>{e?(t.fa.B_(),await _d(t)):(await t.fa.stop(),t.Ta.length>0&&(ae(Ts,`Stopping write stream with ${t.Ta.length} pending writes`),t.Ta=[]))})),t.fa}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ig{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new Hr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,a=new ig(e,n,o,i,s);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new se(q.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function sg(t,e){if(Yr("AsyncQueue",`${e}: ${t}`),Fo(t))return new se(q.UNAVAILABLE,`${e}: ${t}`);throw t}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ho{static emptySet(e){return new ho(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||ge.comparator(n.key,r.key):(n,r)=>ge.comparator(n.key,r.key),this.keyedMap=va(),this.sortedSet=new pt(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof ho)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( + `+e.join(` +`)+` +)`}copy(e,n){const r=new ho;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class $v{constructor(){this.ga=new pt(ge.comparator)}track(e){const n=e.doc.key,r=this.ga.get(n);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(n,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(n):e.type===1&&r.type===2?this.ga=this.ga.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):_e(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(n,e)}ya(){const e=[];return this.ga.inorderTraversal((n,r)=>{e.push(r)}),e}}class Po{constructor(e,n,r,i,s,o,a,u,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new Po(e,n,ho.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&pd(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;ie.Da())}}class CP{constructor(){this.queries=Hv(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const i=ke(n),s=i.queries;i.queries=Hv(),s.forEach((o,a)=>{for(const u of a.Sa)u.onError(r)})})(this,new se(q.ABORTED,"Firestore shutting down"))}}function Hv(){return new Rs(t=>jb(t),pd)}async function og(t,e){const n=ke(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.ba()&&e.Da()&&(r=2):(s=new kP,r=e.Da()?0:1);try{switch(r){case 0:s.wa=await n.onListen(i,!0);break;case 1:s.wa=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const a=sg(o,`Initialization of query '${zs(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,s),s.Sa.push(e),e.va(n.onlineState),s.wa&&e.Fa(s.wa)&&lg(n)}async function ag(t,e){const n=ke(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.Sa.indexOf(e);o>=0&&(s.Sa.splice(o,1),s.Sa.length===0?i=e.Da()?0:1:!s.ba()&&e.Da()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function NP(t,e){const n=ke(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.Sa)a.Fa(i)&&(r=!0);o.wa=i}}r&&lg(n)}function AP(t,e,n){const r=ke(t),i=r.queries.get(e);if(i)for(const s of i.Sa)s.onError(n);r.queries.delete(e)}function lg(t){t.Ca.forEach(e=>{e.next()})}var fp,qv;(qv=fp||(fp={})).Ma="default",qv.Cache="cache";class ug{constructor(e,n,r){this.query=e,this.xa=n,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new Po(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),n=!0):this.La(e,this.onlineState)&&(this.ka(e),n=!0),this.Na=e,n}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let n=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),n=!0),n}La(e,n){if(!e.fromCache||!this.Da())return!0;const r=n!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const n=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}ka(e){e=Po.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==fp.Cache}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class mE{constructor(e){this.key=e}}class gE{constructor(e){this.key=e}}class PP{constructor(e,n){this.query=e,this.Ya=n,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=Be(),this.mutatedKeys=Be(),this.eu=Lb(e),this.tu=new ho(this.eu)}get nu(){return this.Ya}ru(e,n){const r=n?n.iu:new $v,i=n?n.tu:this.tu;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((f,h)=>{const p=i.get(f),m=md(this.query,h)?h:null,b=!!p&&this.mutatedKeys.has(p.key),S=!!m&&(m.hasLocalMutations||this.mutatedKeys.has(m.key)&&m.hasCommittedMutations);let P=!1;p&&m?p.data.isEqual(m.data)?b!==S&&(r.track({type:3,doc:m}),P=!0):this.su(p,m)||(r.track({type:2,doc:m}),P=!0,(u&&this.eu(m,u)>0||c&&this.eu(m,c)<0)&&(a=!0)):!p&&m?(r.track({type:0,doc:m}),P=!0):p&&!m&&(r.track({type:1,doc:p}),P=!0,(u||c)&&(a=!0)),P&&(m?(o=o.add(m),s=S?s.add(f):s.delete(f)):(o=o.delete(f),s=s.delete(f)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const f=this.query.limitType==="F"?o.last():o.first();o=o.delete(f.key),s=s.delete(f.key),r.track({type:1,doc:f})}return{tu:o,iu:r,Cs:a,mutatedKeys:s}}su(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort((f,h)=>function(m,b){const S=P=>{switch(P){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return _e(20277,{Rt:P})}};return S(m)-S(b)}(f.type,h.type)||this.eu(f.doc,h.doc)),this.ou(r),i=i??!1;const a=n&&!i?this._u():[],u=this.Xa.size===0&&this.current&&!i?1:0,c=u!==this.Za;return this.Za=u,o.length!==0||c?{snapshot:new Po(this.query,e.tu,s,o,e.mutatedKeys,u===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new $v,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach(n=>this.Ya=this.Ya.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ya=this.Ya.delete(n)),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=Be(),this.tu.forEach(r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))});const n=[];return e.forEach(r=>{this.Xa.has(r)||n.push(new gE(r))}),this.Xa.forEach(r=>{e.has(r)||n.push(new mE(r))}),n}cu(e){this.Ya=e.Qs,this.Xa=Be();const n=this.ru(e.documents);return this.applyChanges(n,!0)}lu(){return Po.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const cg="SyncEngine";class RP{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class DP{constructor(e){this.key=e,this.hu=!1}}class jP{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new Rs(a=>jb(a),pd),this.Iu=new Map,this.Eu=new Set,this.du=new pt(ge.comparator),this.Au=new Map,this.Ru=new Ym,this.Vu={},this.mu=new Map,this.fu=Ao.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function LP(t,e,n=!0){const r=bE(t);let i;const s=r.Tu.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.lu()):i=await yE(r,e,n,!0),i}async function OP(t,e){const n=bE(t);await yE(n,e,!0,!1)}async function yE(t,e,n,r){const i=await nP(t.localStore,Ir(e)),s=i.targetId,o=t.sharedClientState.addLocalQueryTarget(s,n);let a;return r&&(a=await MP(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&uE(t.remoteStore,i),a}async function MP(t,e,n,r,i){t.pu=(h,p,m)=>async function(S,P,y,w){let T=P.view.ru(y);T.Cs&&(T=await Mv(S.localStore,P.query,!1).then(({documents:_})=>P.view.ru(_,T)));const L=w&&w.targetChanges.get(P.targetId),F=w&&w.targetMismatches.get(P.targetId)!=null,D=P.view.applyChanges(T,S.isPrimaryClient,L,F);return Gv(S,P.targetId,D.au),D.snapshot}(t,h,p,m);const s=await Mv(t.localStore,e,!0),o=new PP(e,s.Qs),a=o.ru(s.documents),u=Sl.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=o.applyChanges(a,t.isPrimaryClient,u);Gv(t,n,c.au);const f=new RP(e,n,o);return t.Tu.set(e,f),t.Iu.has(n)?t.Iu.get(n).push(e):t.Iu.set(n,[e]),c.snapshot}async function VP(t,e,n){const r=ke(t),i=r.Tu.get(e),s=r.Iu.get(i.targetId);if(s.length>1)return r.Iu.set(i.targetId,s.filter(o=>!pd(o,e))),void r.Tu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await dp(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&eg(r.remoteStore,i.targetId),pp(r,i.targetId)}).catch(Vo)):(pp(r,i.targetId),await dp(r.localStore,i.targetId,!0))}async function FP(t,e){const n=ke(t),r=n.Tu.get(e),i=n.Iu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),eg(n.remoteStore,r.targetId))}async function UP(t,e,n){const r=GP(t);try{const i=await function(o,a){const u=ke(o),c=Qe.now(),f=a.reduce((m,b)=>m.add(b.key),Be());let h,p;return u.persistence.runTransaction("Locally write mutations","readwrite",m=>{let b=Xr(),S=Be();return u.Ns.getEntries(m,f).next(P=>{b=P,b.forEach((y,w)=>{w.isValidDocument()||(S=S.add(y))})}).next(()=>u.localDocuments.getOverlayedDocuments(m,b)).next(P=>{h=P;const y=[];for(const w of a){const T=tA(w,h.get(w.key).overlayedDocument);T!=null&&y.push(new Yi(w.key,T,Tb(T.value.mapValue),Yn.exists(!0)))}return u.mutationQueue.addMutationBatch(m,c,y,a)}).next(P=>{p=P;const y=P.applyToLocalDocumentSet(h,S);return u.documentOverlayCache.saveOverlays(m,P.batchId,y)})}).then(()=>({batchId:p.batchId,changes:Mb(h)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,u){let c=o.Vu[o.currentUser.toKey()];c||(c=new pt(ze)),c=c.insert(a,u),o.Vu[o.currentUser.toKey()]=c}(r,i.batchId,n),await kl(r,i.changes),await _d(r.remoteStore)}catch(i){const s=sg(i,"Failed to persist write");n.reject(s)}}async function vE(t,e){const n=ke(t);try{const r=await ZA(n.localStore,e);e.targetChanges.forEach((i,s)=>{const o=n.Au.get(s);o&&(Ye(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?o.hu=!0:i.modifiedDocuments.size>0?Ye(o.hu,14607):i.removedDocuments.size>0&&(Ye(o.hu,42227),o.hu=!1))}),await kl(n,r,e)}catch(r){await Vo(r)}}function Wv(t,e,n){const r=ke(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.Tu.forEach((s,o)=>{const a=o.view.va(e);a.snapshot&&i.push(a.snapshot)}),function(o,a){const u=ke(o);u.onlineState=a;let c=!1;u.queries.forEach((f,h)=>{for(const p of h.Sa)p.va(a)&&(c=!0)}),c&&lg(u)}(r.eventManager,e),i.length&&r.Pu.H_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function zP(t,e,n){const r=ke(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Au.get(e),s=i&&i.key;if(s){let o=new pt(ge.comparator);o=o.insert(s,an.newNoDocument(s,Se.min()));const a=Be().add(s),u=new vd(Se.min(),new Map,new pt(ze),o,a);await vE(r,u),r.du=r.du.remove(s),r.Au.delete(e),dg(r)}else await dp(r.localStore,e,!1).then(()=>pp(r,e,n)).catch(Vo)}async function BP(t,e){const n=ke(t),r=e.batch.batchId;try{const i=await JA(n.localStore,e);wE(n,r,null),xE(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await kl(n,i)}catch(i){await Vo(i)}}async function $P(t,e,n){const r=ke(t);try{const i=await function(o,a){const u=ke(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let f;return u.mutationQueue.lookupMutationBatch(c,a).next(h=>(Ye(h!==null,37113),f=h.keys(),u.mutationQueue.removeMutationBatch(c,h))).next(()=>u.mutationQueue.performConsistencyCheck(c)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(c,f,a)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,f)).next(()=>u.localDocuments.getDocuments(c,f))})}(r.localStore,e);wE(r,e,n),xE(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await kl(r,i)}catch(i){await Vo(i)}}function xE(t,e){(t.mu.get(e)||[]).forEach(n=>{n.resolve()}),t.mu.delete(e)}function wE(t,e,n){const r=ke(t);let i=r.Vu[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.Vu[r.currentUser.toKey()]=i}}function pp(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Iu.get(e))t.Tu.delete(r),n&&t.Pu.yu(r,n);t.Iu.delete(e),t.isPrimaryClient&&t.Ru.jr(e).forEach(r=>{t.Ru.containsKey(r)||_E(t,r)})}function _E(t,e){t.Eu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(eg(t.remoteStore,n),t.du=t.du.remove(e),t.Au.delete(n),dg(t))}function Gv(t,e,n){for(const r of n)r instanceof mE?(t.Ru.addReference(r.key,e),HP(t,r)):r instanceof gE?(ae(cg,"Document no longer in limbo: "+r.key),t.Ru.removeReference(r.key,e),t.Ru.containsKey(r.key)||_E(t,r.key)):_e(19791,{wu:r})}function HP(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Eu.has(r)||(ae(cg,"New document in limbo: "+n),t.Eu.add(r),dg(t))}function dg(t){for(;t.Eu.size>0&&t.du.size{o.push(r.pu(u,e,n).then(c=>{var f;if((c||n)&&r.isPrimaryClient){const h=c?!c.fromCache:(f=n==null?void 0:n.targetChanges.get(u.targetId))==null?void 0:f.current;r.sharedClientState.updateQueryState(u.targetId,h?"current":"not-current")}if(c){i.push(c);const h=Jm.As(u.targetId,c);s.push(h)}}))}),await Promise.all(o),r.Pu.H_(i),await async function(u,c){const f=ke(u);try{await f.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>G.forEach(c,p=>G.forEach(p.Es,m=>f.persistence.referenceDelegate.addReference(h,p.targetId,m)).next(()=>G.forEach(p.ds,m=>f.persistence.referenceDelegate.removeReference(h,p.targetId,m)))))}catch(h){if(!Fo(h))throw h;ae(Zm,"Failed to update sequence numbers: "+h)}for(const h of c){const p=h.targetId;if(!h.fromCache){const m=f.Ms.get(p),b=m.snapshotVersion,S=m.withLastLimboFreeSnapshotVersion(b);f.Ms=f.Ms.insert(p,S)}}}(r.localStore,s))}async function qP(t,e){const n=ke(t);if(!n.currentUser.isEqual(e)){ae(cg,"User change. New user:",e.toKey());const r=await sE(n.localStore,e);n.currentUser=e,function(s,o){s.mu.forEach(a=>{a.forEach(u=>{u.reject(new se(q.CANCELLED,o))})}),s.mu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await kl(n,r.Ls)}}function WP(t,e){const n=ke(t),r=n.Au.get(e);if(r&&r.hu)return Be().add(r.key);{let i=Be();const s=n.Iu.get(e);if(!s)return i;for(const o of s){const a=n.Tu.get(o);i=i.unionWith(a.view.nu)}return i}}function bE(t){const e=ke(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=vE.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=WP.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=zP.bind(null,e),e.Pu.H_=NP.bind(null,e.eventManager),e.Pu.yu=AP.bind(null,e.eventManager),e}function GP(t){const e=ke(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=BP.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=$P.bind(null,e),e}class Cc{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=xd(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,n){return null}Mu(e,n){return null}vu(e){return XA(this.persistence,new KA,e.initialUser,this.serializer)}Cu(e){return new iE(Xm.mi,this.serializer)}Du(e){return new iP}async terminate(){var e,n;(e=this.gcScheduler)==null||e.stop(),(n=this.indexBackfillerScheduler)==null||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Cc.provider={build:()=>new Cc};class KP extends Cc{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,n){Ye(this.persistence.referenceDelegate instanceof Tc,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new DA(r,e.asyncQueue,n)}Cu(e){const n=this.cacheSizeBytes!==void 0?yn.withCacheSize(this.cacheSizeBytes):yn.DEFAULT;return new iE(r=>Tc.mi(r,n),this.serializer)}}class mp{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>Wv(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=qP.bind(null,this.syncEngine),await TP(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new CP}()}createDatastore(e){const n=xd(e.databaseInfo.databaseId),r=function(s){return new uP(s)}(e.databaseInfo);return function(s,o,a,u){return new fP(s,o,a,u)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,a){return new mP(r,i,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>Wv(this.syncEngine,n,0),function(){return Uv.v()?new Uv:new sP}())}createSyncEngine(e,n){return function(i,s,o,a,u,c,f){const h=new jP(i,s,o,a,u,c);return f&&(h.gu=!0),h}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const s=ke(i);ae(Ts,"RemoteStore shutting down."),s.Ea.add(5),await Tl(s),s.Aa.shutdown(),s.Ra.set("Unknown")}(this.remoteStore),(e=this.datastore)==null||e.terminate(),(n=this.eventManager)==null||n.terminate()}}mp.provider={build:()=>new mp};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + *//** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class hg{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):Yr("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const qi="FirestoreClient";class QP{constructor(e,n,r,i,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=sn.UNAUTHENTICATED,this.clientId=Fm.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async o=>{ae(qi,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(ae(qi,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Hr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=sg(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function jh(t,e){t.asyncQueue.verifyOperationInProgress(),ae(qi,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await sE(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function Kv(t,e){t.asyncQueue.verifyOperationInProgress();const n=await YP(t);ae(qi,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>Bv(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>Bv(e.remoteStore,i)),t._onlineComponents=e}async function YP(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){ae(qi,"Using user provided OfflineComponentProvider");try{await jh(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===q.FAILED_PRECONDITION||i.code===q.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;To("Error using user provided cache. Falling back to memory cache: "+n),await jh(t,new Cc)}}else ae(qi,"Using default OfflineComponentProvider"),await jh(t,new KP(void 0));return t._offlineComponents}async function EE(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(ae(qi,"Using user provided OnlineComponentProvider"),await Kv(t,t._uninitializedComponentsProvider._online)):(ae(qi,"Using default OnlineComponentProvider"),await Kv(t,new mp))),t._onlineComponents}function XP(t){return EE(t).then(e=>e.syncEngine)}async function Nc(t){const e=await EE(t),n=e.eventManager;return n.onListen=LP.bind(null,e.syncEngine),n.onUnlisten=VP.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=OP.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=FP.bind(null,e.syncEngine),n}function JP(t,e,n={}){const r=new Hr;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,c){const f=new hg({next:p=>{f.Nu(),o.enqueueAndForget(()=>ag(s,h));const m=p.docs.has(a);!m&&p.fromCache?c.reject(new se(q.UNAVAILABLE,"Failed to get document because the client is offline.")):m&&p.fromCache&&u&&u.source==="server"?c.reject(new se(q.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(p)},error:p=>c.reject(p)}),h=new ug(fd(a.path),f,{includeMetadataChanges:!0,qa:!0});return og(s,h)}(await Nc(t),t.asyncQueue,e,n,r)),r.promise}function ZP(t,e,n={}){const r=new Hr;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,c){const f=new hg({next:p=>{f.Nu(),o.enqueueAndForget(()=>ag(s,h)),p.fromCache&&u.source==="server"?c.reject(new se(q.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(p)},error:p=>c.reject(p)}),h=new ug(a,f,{includeMetadataChanges:!0,qa:!0});return og(s,h)}(await Nc(t),t.asyncQueue,e,n,r)),r.promise}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */function IE(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Qv=new Map;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const SE="firestore.googleapis.com",Yv=!0;class Xv{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new se(q.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=SE,this.ssl=Yv}else this.host=e.host,this.ssl=e.ssl??Yv;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=rE;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new se(q.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class bd{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Xv({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new se(q.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new se(q.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Xv(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new sN;switch(r.type){case"firstParty":return new uN(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new se(q.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=Qv.get(n);r&&(ae("ComponentProvider","Removing Datastore"),Qv.delete(n),r.terminate())}(this),Promise.resolve()}}function eR(t,e,n,r={}){var c;t=Sn(t,bd);const i=As(e),s=t._getSettings(),o={...s,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;i&&(Dm(`https://${a}`),jm("Firestore",!0)),s.host!==SE&&s.host!==a&&To("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u={...s,host:a,ssl:i,emulatorOptions:r};if(!Es(u,o)&&(t._setSettings(u),r.mockUserToken)){let f,h;if(typeof r.mockUserToken=="string")f=r.mockUserToken,h=sn.MOCK_USER;else{f=tb(r.mockUserToken,(c=t._app)==null?void 0:c.options.projectId);const p=r.mockUserToken.sub||r.mockUserToken.user_id;if(!p)throw new se(q.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new sn(p)}t._authCredentials=new oN(new pb(f,h))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Xi{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Xi(this.firestore,e,this._query)}}class _t{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Oi(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new _t(this.firestore,e,this._key)}toJSON(){return{type:_t._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(El(n,_t._jsonSchema))return new _t(e,r||null,new ge(rt.fromString(n.referencePath)))}}_t._jsonSchemaVersion="firestore/documentReference/1.0",_t._jsonSchema={type:Rt("string",_t._jsonSchemaVersion),referencePath:Rt("string")};class Oi extends Xi{constructor(e,n,r){super(e,n,fd(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new _t(this.firestore,null,new ge(e))}withConverter(e){return new Oi(this.firestore,e,this._path)}}function Tn(t,e,...n){if(t=Zt(t),mb("collection","path",e),t instanceof bd){const r=rt.fromString(e,...n);return cv(r),new Oi(t,null,r)}{if(!(t instanceof _t||t instanceof Oi))throw new se(q.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(rt.fromString(e,...n));return cv(r),new Oi(t.firestore,null,r)}}function Dt(t,e,...n){if(t=Zt(t),arguments.length===1&&(e=Fm.newId()),mb("doc","path",e),t instanceof bd){const r=rt.fromString(e,...n);return uv(r),new _t(t,null,new ge(r))}{if(!(t instanceof _t||t instanceof Oi))throw new se(q.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(rt.fromString(e,...n));return uv(r),new _t(t.firestore,t instanceof Oi?t.converter:null,new ge(r))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Jv="AsyncQueue";class Zv{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new aE(this,"async_queue_retry"),this._c=()=>{const r=Dh();r&&ae(Jv,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const n=Dh();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const n=Dh();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const n=new Hr;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!Fo(e))throw e;ae(Jv,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){const n=this.ac.then(()=>(this.rc=!0,e().catch(r=>{throw this.nc=r,this.rc=!1,Yr("INTERNAL UNHANDLED ERROR: ",ex(r)),r}).then(r=>(this.rc=!1,r))));return this.ac=n,n}enqueueAfterDelay(e,n,r){this.uc(),this.oc.indexOf(e)>-1&&(n=0);const i=ig.createAndSchedule(this,e,n,r,s=>this.hc(s));return this.tc.push(i),i}uc(){this.nc&&_e(47125,{Pc:ex(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const n of this.tc)if(n.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.tc)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){const n=this.tc.indexOf(e);this.tc.splice(n,1)}}function ex(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+` +`+t.stack),e}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function tx(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class Jr extends bd{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new Zv,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Zv(e),this._firestoreClient=void 0,await e}}}function tR(t,e){const n=typeof t=="object"?t:Mm(),r=typeof t=="string"?t:_c,i=ld(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=J1("firestore");s&&eR(i,...s)}return i}function Ed(t){if(t._terminated)throw new se(q.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||nR(t),t._firestoreClient}function nR(t){var r,i,s;const e=t._freezeSettings(),n=function(a,u,c,f){return new TN(a,u,c,f.host,f.ssl,f.experimentalForceLongPolling,f.experimentalAutoDetectLongPolling,IE(f.experimentalLongPollingOptions),f.useFetchStreams,f.isUsingEmulator)}(t._databaseId,((r=t._app)==null?void 0:r.options.appId)||"",t._persistenceKey,e);t._componentsProvider||(i=e.localCache)!=null&&i._offlineComponentProvider&&((s=e.localCache)!=null&&s._onlineComponentProvider)&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new QP(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&function(a){const u=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(u),_online:u}}(t._componentsProvider))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Wn{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Wn(en.fromBase64String(e))}catch(n){throw new se(q.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new Wn(en.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Wn._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(El(e,Wn._jsonSchema))return Wn.fromBase64String(e.bytes)}}Wn._jsonSchemaVersion="firestore/bytes/1.0",Wn._jsonSchema={type:Rt("string",Wn._jsonSchemaVersion),bytes:Rt("string")};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Id{constructor(...e){for(let n=0;n90)throw new se(q.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new se(q.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return ze(this._lat,e._lat)||ze(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Tr._jsonSchemaVersion}}static fromJSON(e){if(El(e,Tr._jsonSchema))return new Tr(e.latitude,e.longitude)}}Tr._jsonSchemaVersion="firestore/geoPoint/1.0",Tr._jsonSchema={type:Rt("string",Tr._jsonSchemaVersion),latitude:Rt("number"),longitude:Rt("number")};/** + * @license + * Copyright 2024 Google LLC + * + * 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. + */class kr{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let s=0;stypeof n=="number"))return new kr(e.vectorValues);throw new se(q.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}kr._jsonSchemaVersion="firestore/vectorValue/1.0",kr._jsonSchema={type:Rt("string",kr._jsonSchemaVersion),vectorValues:Rt("object")};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const rR=/^__.*__$/;class iR{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Yi(e,this.data,this.fieldMask,n,this.fieldTransforms):new Il(e,this.data,n,this.fieldTransforms)}}class TE{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new Yi(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function kE(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw _e(40011,{Ac:t})}}class fg{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Rc(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new fg({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){var i;const n=(i=this.path)==null?void 0:i.child(e),r=this.Vc({path:n,fc:!1});return r.gc(e),r}yc(e){var i;const n=(i=this.path)==null?void 0:i.child(e),r=this.Vc({path:n,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return Ac(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Rc(){if(this.path)for(let e=0;eu.covers(h.field))}else u=null,c=o.fieldTransforms;return new iR(new xn(a),u,c)}class kd extends Sd{_toFieldTransform(e){if(e.Ac!==2)throw e.Ac===1?e.Sc(`${this._methodName}() can only appear at the top level of your update data`):e.Sc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof kd}}class pg extends Sd{constructor(e,n){super(e),this.Fc=n}_toFieldTransform(e){const n=new dl(e.serializer,Ub(e.serializer,this.Fc));return new XN(e.path,n)}isEqual(e){return e instanceof pg&&this.Fc===e.Fc}}function oR(t,e,n,r){const i=t.Cc(1,e,n);mg("Data must be an object, but it was:",i,r);const s=[],o=xn.empty();Qi(r,(u,c)=>{const f=gg(e,u,n);c=Zt(c);const h=i.yc(f);if(c instanceof kd)s.push(f);else{const p=Cl(c,h);p!=null&&(s.push(f),o.set(f,p))}});const a=new On(s);return new TE(o,a,i.fieldTransforms)}function aR(t,e,n,r,i,s){const o=t.Cc(1,e,n),a=[gp(e,r,n)],u=[i];if(s.length%2!=0)throw new se(q.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let p=0;p=0;--p)if(!PE(c,a[p])){const m=a[p];let b=u[p];b=Zt(b);const S=o.yc(m);if(b instanceof kd)c.push(m);else{const P=Cl(b,S);P!=null&&(c.push(m),f.set(m,P))}}const h=new On(c);return new TE(f,h,o.fieldTransforms)}function lR(t,e,n,r=!1){return Cl(n,t.Cc(r?4:3,e))}function Cl(t,e){if(AE(t=Zt(t)))return mg("Unsupported field value:",e,t),NE(t,e);if(t instanceof Sd)return function(r,i){if(!kE(i.Ac))throw i.Sc(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Sc(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.fc&&e.Ac!==4)throw e.Sc("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let u=Cl(a,i.wc(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=Zt(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return Ub(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=Qe.fromDate(r);return{timestampValue:Sc(i.serializer,s)}}if(r instanceof Qe){const s=new Qe(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:Sc(i.serializer,s)}}if(r instanceof Tr)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Wn)return{bytesValue:Yb(i.serializer,r._byteString)};if(r instanceof _t){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.Sc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:Qm(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof kr)return function(o,a){return{mapValue:{fields:{[Ib]:{stringValue:Sb},[bc]:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw a.Sc("VectorValues must only contain numeric values.");return qm(a.serializer,c)})}}}}}}(r,i);throw i.Sc(`Unsupported field value: ${ud(r)}`)}(t,e)}function NE(t,e){const n={};return vb(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Qi(t,(r,i)=>{const s=Cl(i,e.mc(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function AE(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Qe||t instanceof Tr||t instanceof Wn||t instanceof _t||t instanceof Sd||t instanceof kr)}function mg(t,e,n){if(!AE(n)||!gb(n)){const r=ud(n);throw r==="an object"?e.Sc(t+" a custom object"):e.Sc(t+" "+r)}}function gp(t,e,n){if((e=Zt(e))instanceof Id)return e._internalPath;if(typeof e=="string")return gg(t,e);throw Ac("Field path arguments must be of type string or ",t,!1,void 0,n)}const uR=new RegExp("[~\\*/\\[\\]]");function gg(t,e,n){if(e.search(uR)>=0)throw Ac(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Id(...e.split("."))._internalPath}catch{throw Ac(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function Ac(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new se(q.INVALID_ARGUMENT,a+t+u)}function PE(t,e){return t.some(n=>n.isEqual(e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class RE{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new _t(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new cR(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(Cd("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class cR extends RE{data(){return super.data()}}function Cd(t,e){return typeof e=="string"?gg(t,e):e instanceof Id?e._internalPath:e._delegate._internalPath}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function DE(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new se(q.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class yg{}class jE extends yg{}function Zr(t,e,...n){let r=[];e instanceof yg&&r.push(e),r=r.concat(n),function(s){const o=s.filter(u=>u instanceof vg).length,a=s.filter(u=>u instanceof Nd).length;if(o>1||o>0&&a>0)throw new se(q.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)t=i._apply(t);return t}class Nd extends jE{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new Nd(e,n,r)}_apply(e){const n=this._parse(e);return LE(e._query,n),new Xi(e.firestore,e.converter,sp(e._query,n))}_parse(e){const n=Td(e.firestore);return function(s,o,a,u,c,f,h){let p;if(c.isKeyField()){if(f==="array-contains"||f==="array-contains-any")throw new se(q.INVALID_ARGUMENT,`Invalid Query. You can't perform '${f}' queries on documentId().`);if(f==="in"||f==="not-in"){rx(h,f);const b=[];for(const S of h)b.push(nx(u,s,S));p={arrayValue:{values:b}}}else p=nx(u,s,h)}else f!=="in"&&f!=="not-in"&&f!=="array-contains-any"||rx(h,f),p=lR(a,o,h,f==="in"||f==="not-in");return Pt.create(c,f,p)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function js(t,e,n){const r=e,i=Cd("where",t);return Nd._create(i,r,n)}class vg extends yg{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new vg(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:cr.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,s){let o=i;const a=s.getFlattenedFilters();for(const u of a)LE(o,u),o=sp(o,u)}(e._query,n),new Xi(e.firestore,e.converter,sp(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class xg extends jE{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new xg(e,n)}_apply(e){const n=function(i,s,o){if(i.startAt!==null)throw new se(q.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new se(q.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new ll(s,o)}(e._query,this._field,this._direction);return new Xi(e.firestore,e.converter,function(i,s){const o=i.explicitOrderBy.concat([s]);return new Uo(i.path,i.collectionGroup,o,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function dR(t,e="asc"){const n=e,r=Cd("orderBy",t);return xg._create(r,n)}function nx(t,e,n){if(typeof(n=Zt(n))=="string"){if(n==="")throw new se(q.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Db(e)&&n.indexOf("/")!==-1)throw new se(q.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(rt.fromString(n));if(!ge.isDocumentKey(r))throw new se(q.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return vv(t,new ge(r))}if(n instanceof _t)return vv(t,n._key);throw new se(q.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ud(n)}.`)}function rx(t,e){if(!Array.isArray(t)||t.length===0)throw new se(q.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function LE(t,e){const n=function(i,s){for(const o of i)for(const a of o.getFlattenedFilters())if(s.indexOf(a.op)>=0)return a.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new se(q.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new se(q.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class hR{convertValue(e,n="none"){switch($i(e)){case 0:return null;case 1:return e.booleanValue;case 2:return St(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Bi(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw _e(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Qi(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertVectorValue(e){var r,i,s;const n=(s=(i=(r=e.fields)==null?void 0:r[bc].arrayValue)==null?void 0:i.values)==null?void 0:s.map(o=>St(o.doubleValue));return new kr(n)}convertGeoPoint(e){return new Tr(St(e.latitude),St(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=hd(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(sl(e));default:return null}}convertTimestamp(e){const n=zi(e);return new Qe(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=rt.fromString(e);Ye(nE(r),9688,{name:e});const i=new ol(r.get(1),r.get(3)),s=new ge(r.popFirst(5));return i.isEqual(n)||Yr(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function OE(t,e,n){let r;return r=t?t.toFirestore(e):e,r}class wa{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class ps extends RE{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Vu(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(Cd("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new se(q.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=ps._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}ps._jsonSchemaVersion="firestore/documentSnapshot/1.0",ps._jsonSchema={type:Rt("string",ps._jsonSchemaVersion),bundleSource:Rt("string","DocumentSnapshot"),bundleName:Rt("string"),bundle:Rt("string")};class Vu extends ps{data(e={}){return super.data(e)}}class ms{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new wa(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Vu(this._firestore,this._userDataWriter,r.key,r,new wa(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new se(q.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const u=new Vu(i._firestore,i._userDataWriter,a.doc.key,a.doc,new wa(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const u=new Vu(i._firestore,i._userDataWriter,a.doc.key,a.doc,new wa(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,f=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),f=o.indexOf(a.doc.key)),{type:fR(a.type),doc:u,oldIndex:c,newIndex:f}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new se(q.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=ms._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Fm.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],i=[];return this.docs.forEach(s=>{s._document!==null&&(n.push(s._document),r.push(this._userDataWriter.convertObjectMap(s._document.data.value.mapValue.fields,"previous")),i.push(s.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function fR(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return _e(61501,{type:t})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function ei(t){t=Sn(t,_t);const e=Sn(t.firestore,Jr);return JP(Ed(e),t._key).then(n=>VE(e,t,n))}ms._jsonSchemaVersion="firestore/querySnapshot/1.0",ms._jsonSchema={type:Rt("string",ms._jsonSchemaVersion),bundleSource:Rt("string","QuerySnapshot"),bundleName:Rt("string"),bundle:Rt("string")};class wg extends hR{constructor(e){super(),this.firestore=e}convertBytes(e){return new Wn(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new _t(this.firestore,null,n)}}function lr(t){t=Sn(t,Xi);const e=Sn(t.firestore,Jr),n=Ed(e),r=new wg(e);return DE(t._query),ZP(n,t._query).then(i=>new ms(e,r,t,i))}function ME(t,e,n){t=Sn(t,_t);const r=Sn(t.firestore,Jr),i=OE(t.converter,e);return Ad(r,[CE(Td(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,Yn.none())])}function Ji(t,e,n,...r){t=Sn(t,_t);const i=Sn(t.firestore,Jr),s=Td(i);let o;return o=typeof(e=Zt(e))=="string"||e instanceof Id?aR(s,"updateDoc",t._key,e,n,r):oR(s,"updateDoc",t._key,e),Ad(i,[o.toMutation(t._key,Yn.exists(!0))])}function yp(t){return Ad(Sn(t.firestore,Jr),[new Wm(t._key,Yn.none())])}function _g(t,e){const n=Sn(t.firestore,Jr),r=Dt(t),i=OE(t.converter,e);return Ad(n,[CE(Td(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,Yn.exists(!1))]).then(()=>r)}function bg(t,...e){var u,c,f;t=Zt(t);let n={includeMetadataChanges:!1,source:"default"},r=0;typeof e[r]!="object"||tx(e[r])||(n=e[r++]);const i={includeMetadataChanges:n.includeMetadataChanges,source:n.source};if(tx(e[r])){const h=e[r];e[r]=(u=h.next)==null?void 0:u.bind(h),e[r+1]=(c=h.error)==null?void 0:c.bind(h),e[r+2]=(f=h.complete)==null?void 0:f.bind(h)}let s,o,a;if(t instanceof _t)o=Sn(t.firestore,Jr),a=fd(t._key.path),s={next:h=>{e[r]&&e[r](VE(o,t,h))},error:e[r+1],complete:e[r+2]};else{const h=Sn(t,Xi);o=Sn(h.firestore,Jr),a=h._query;const p=new wg(o);s={next:m=>{e[r]&&e[r](new ms(o,p,h,m))},error:e[r+1],complete:e[r+2]},DE(t._query)}return function(p,m,b,S){const P=new hg(S),y=new ug(m,P,b);return p.asyncQueue.enqueueAndForget(async()=>og(await Nc(p),y)),()=>{P.Nu(),p.asyncQueue.enqueueAndForget(async()=>ag(await Nc(p),y))}}(Ed(o),a,i,s)}function Ad(t,e){return function(r,i){const s=new Hr;return r.asyncQueue.enqueueAndForget(async()=>UP(await XP(r),i,s)),s.promise}(Ed(t),e)}function VE(t,e,n){const r=n.docs.get(e._key),i=new wg(t);return new ps(t,i,e._key,r,new wa(n.hasPendingWrites,n.fromCache),e.converter)}function pR(t){return new pg("increment",t)}(function(e,n=!0){(function(i){Mo=i})(Ps),Is(new Fi("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new Jr(new aN(r.getProvider("auth-internal")),new cN(o,r.getProvider("app-check-internal")),function(c,f){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new se(q.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ol(c.options.projectId,f)}(o,i),o);return s={useFetchStreams:n,...s},a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Er(sv,ov,e),Er(sv,ov,"esm2020")})();/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const FE="firebasestorage.googleapis.com",mR="storageBucket",gR=2*60*1e3,yR=10*60*1e3;/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class jr extends Dr{constructor(e,n,r=0){super(Lh(e),`Firebase Storage: ${n} (${Lh(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,jr.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Lh(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} +${this.customData.serverResponse}`:this.message=this._baseMessage}}var Pr;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Pr||(Pr={}));function Lh(t){return"storage/"+t}function vR(){const t="An unknown error occurred, please check the error payload for server response.";return new jr(Pr.UNKNOWN,t)}function xR(){return new jr(Pr.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function wR(){return new jr(Pr.CANCELED,"User canceled the upload/download.")}function _R(t){return new jr(Pr.INVALID_URL,"Invalid URL '"+t+"'.")}function bR(t){return new jr(Pr.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function ix(t){return new jr(Pr.INVALID_ARGUMENT,t)}function UE(){return new jr(Pr.APP_DELETED,"The Firebase app was deleted.")}function ER(t){return new jr(Pr.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ir{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=ir.makeFromUrl(e,n)}catch{return new ir(e,"")}if(r.path==="")return r;throw bR(e)}static makeFromUrl(e,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(L){L.path.charAt(L.path.length-1)==="/"&&(L.path_=L.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),u={bucket:1,path:3};function c(L){L.path_=decodeURIComponent(L.path)}const f="v[A-Za-z0-9_]+",h=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",m=new RegExp(`^https?://${h}/${f}/b/${i}/o${p}`,"i"),b={bucket:1,path:3},S=n===FE?"(?:storage.googleapis.com|storage.cloud.google.com)":n,P="([^?#]*)",y=new RegExp(`^https?://${S}/${i}/${P}`,"i"),T=[{regex:a,indices:u,postModify:s},{regex:m,indices:b,postModify:c},{regex:y,indices:{bucket:1,path:2},postModify:c}];for(let L=0;L{i=null,t(m,u())},P)}function p(){s&&clearTimeout(s)}function m(P,...y){if(c){p();return}if(P){p(),f.call(null,P,...y);return}if(u()||o){p(),f.call(null,P,...y);return}r<64&&(r*=2);let T;a===1?(a=2,T=0):T=(r+Math.random())*1e3,h(T)}let b=!1;function S(P){b||(b=!0,p(),!c&&(i!==null?(P||(a=2),clearTimeout(i),h(0)):P||(a=1)))}return h(0),s=setTimeout(()=>{o=!0,S(!0)},n),S}function TR(t){t(!1)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function kR(t){return t!==void 0}function sx(t,e,n,r){if(rn)throw ix(`Invalid value for '${t}'. Expected ${n} or less.`)}function CR(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n}var Pc;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Pc||(Pc={}));/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */function NR(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return n||i||s}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class AR{constructor(e,n,r,i,s,o,a,u,c,f,h,p=!0,m=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=u,this.timeout_=c,this.progressCallback_=f,this.connectionFactory_=h,this.retry=p,this.isUsingEmulator=m,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((b,S)=>{this.resolve_=b,this.reject_=S,this.start_()})}start_(){const e=(r,i)=>{if(i){r(!1,new pu(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const u=a.loaded,c=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(u,c)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===Pc.NO_ERROR,u=s.getStatus();if(!a||NR(u,this.additionalRetryCodes_)&&this.retry){const f=s.getErrorCode()===Pc.ABORT;r(!1,new pu(!1,null,f));return}const c=this.successCodes_.indexOf(u)!==-1;r(!0,new pu(c,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const u=this.callback_(a,a.getResponse());kR(u)?s(u):s()}catch(u){o(u)}else if(a!==null){const u=vR();u.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,u)):o(u)}else if(i.canceled){const u=this.appDelete_?UE():wR();o(u)}else{const u=xR();o(u)}};this.canceled_?n(!1,new pu(!1,null,!0)):this.backoffId_=SR(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&TR(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class pu{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function PR(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function RR(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function DR(t,e){e&&(t["X-Firebase-GMPID"]=e)}function jR(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function LR(t,e,n,r,i,s,o=!0,a=!1){const u=CR(t.urlParams),c=t.url+u,f=Object.assign({},t.headers);return DR(f,e),PR(f,n),RR(f,s),jR(f,r),new AR(c,t.method,f,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o,a)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function OR(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function MR(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Rc{constructor(e,n){this._service=e,n instanceof ir?this._location=n:this._location=ir.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Rc(e,n)}get root(){const e=new ir(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return MR(this._location.path)}get storage(){return this._service}get parent(){const e=OR(this._location.path);if(e===null)return null;const n=new ir(this._location.bucket,e);return new Rc(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw ER(e)}}function ox(t,e){const n=e==null?void 0:e[mR];return n==null?null:ir.makeFromBucketSpec(n,t)}function VR(t,e,n,r={}){t.host=`${e}:${n}`;const i=As(e);i&&(Dm(`https://${t.host}/b`),jm("Storage",!0)),t._isUsingEmulator=!0,t._protocol=i?"https":"http";const{mockUserToken:s}=r;s&&(t._overrideAuthToken=typeof s=="string"?s:tb(s,t.app.options.projectId))}class FR{constructor(e,n,r,i,s,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._isUsingEmulator=o,this._bucket=null,this._host=FE,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=gR,this._maxUploadRetryTime=yR,this._requests=new Set,i!=null?this._bucket=ir.makeFromBucketSpec(i,this._host):this._bucket=ox(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=ir.makeFromBucketSpec(this._url,e):this._bucket=ox(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){sx("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){sx("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(rr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Rc(this,e)}_makeRequest(e,n,r,i,s=!0){if(this._deleted)return new IR(UE());{const o=LR(e,this._appId,r,i,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,i).getPromise()}}const ax="@firebase/storage",lx="0.14.0";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const zE="storage";function UR(t=Mm(),e){t=Zt(t);const r=ld(t,zE).getImmediate({identifier:e}),i=J1("storage");return i&&zR(r,...i),r}function zR(t,e,n,r={}){VR(t,e,n,r)}function BR(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new FR(n,r,i,e,Ps)}function $R(){Is(new Fi(zE,BR,"PUBLIC").setMultipleInstances(!0)),Er(ax,lx,""),Er(ax,lx,"esm2020")}$R();function BE(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const HR=BE,$E=new _l("auth","Firebase",BE());/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Dc=new Lm("@firebase/auth");function qR(t,...e){Dc.logLevel<=Ue.WARN&&Dc.warn(`Auth (${Ps}): ${t}`,...e)}function Fu(t,...e){Dc.logLevel<=Ue.ERROR&&Dc.error(`Auth (${Ps}): ${t}`,...e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function ti(t,...e){throw Eg(t,...e)}function Cr(t,...e){return Eg(t,...e)}function HE(t,e,n){const r={...HR(),[e]:n};return new _l("auth","Firebase",r).create(e,{appName:t.name})}function gs(t){return HE(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Eg(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return $E.create(t,...e)}function Ee(t,e,...n){if(!t)throw Eg(e,...n)}function zr(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Fu(e),new Error(e)}function ni(t,e){t||zr(e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function vp(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.href)||""}function WR(){return ux()==="http:"||ux()==="https:"}function ux(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.protocol)||null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function GR(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(WR()||O2()||"connection"in navigator)?navigator.onLine:!0}function KR(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Nl{constructor(e,n){this.shortDelay=e,this.longDelay=n,ni(n>e,"Short delay should be less than long delay!"),this.isMobile=D2()||M2()}get(){return GR()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Ig(t,e){ni(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class qE{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;zr("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;zr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;zr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const QR={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const YR=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],XR=new Nl(3e4,6e4);function Sg(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function Bo(t,e,n,r,i={}){return WE(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=bl({key:t.config.apiKey,...o}).slice(1),u=await t._getAdditionalHeaders();u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode);const c={method:e,headers:u,...s};return L2()||(c.referrerPolicy="no-referrer"),t.emulatorConfig&&As(t.emulatorConfig.host)&&(c.credentials="include"),qE.fetch()(await GE(t,t.config.apiHost,n,a),c)})}async function WE(t,e,n){t._canInitEmulator=!1;const r={...QR,...e};try{const i=new ZR(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw mu(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[u,c]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw mu(t,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw mu(t,"email-already-in-use",o);if(u==="USER_DISABLED")throw mu(t,"user-disabled",o);const f=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw HE(t,f,c);ti(t,f)}}catch(i){if(i instanceof Dr)throw i;ti(t,"network-request-failed",{message:String(i)})}}async function JR(t,e,n,r,i={}){const s=await Bo(t,e,n,r,i);return"mfaPendingCredential"in s&&ti(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function GE(t,e,n,r){const i=`${e}${n}?${r}`,s=t,o=s.config.emulator?Ig(t.config,i):`${t.config.apiScheme}://${i}`;return YR.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}class ZR{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Cr(this.auth,"network-request-failed")),XR.get())})}}function mu(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Cr(t,e,r);return i.customData._tokenResponse=n,i}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function e4(t,e){return Bo(t,"POST","/v1/accounts:delete",e)}async function jc(t,e){return Bo(t,"POST","/v1/accounts:lookup",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function La(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function t4(t,e=!1){const n=Zt(t),r=await n.getIdToken(e),i=Tg(r);Ee(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:La(Oh(i.auth_time)),issuedAtTime:La(Oh(i.iat)),expirationTime:La(Oh(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function Oh(t){return Number(t)*1e3}function Tg(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Fu("JWT malformed, contained fewer than 3 sections"),null;try{const i=Y1(n);return i?JSON.parse(i):(Fu("Failed to decode base64 JWT payload"),null)}catch(i){return Fu("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function cx(t){const e=Tg(t);return Ee(e,"internal-error"),Ee(typeof e.exp<"u","internal-error"),Ee(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function hl(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Dr&&n4(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function n4({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class r4{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class xp{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=La(this.lastLoginAt),this.creationTime=La(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */async function Lc(t){var h;const e=t.auth,n=await t.getIdToken(),r=await hl(t,jc(e,{idToken:n}));Ee(r==null?void 0:r.users.length,e,"internal-error");const i=r.users[0];t._notifyReloadListener(i);const s=(h=i.providerUserInfo)!=null&&h.length?KE(i.providerUserInfo):[],o=s4(t.providerData,s),a=t.isAnonymous,u=!(t.email&&i.passwordHash)&&!(o!=null&&o.length),c=a?u:!1,f={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new xp(i.createdAt,i.lastLoginAt),isAnonymous:c};Object.assign(t,f)}async function i4(t){const e=Zt(t);await Lc(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function s4(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function KE(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function o4(t,e){const n=await WE(t,{},async()=>{const r=bl({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=await GE(t,i,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const u={method:"POST",headers:a,body:r};return t.emulatorConfig&&As(t.emulatorConfig.host)&&(u.credentials="include"),qE.fetch()(o,u)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function a4(t,e){return Bo(t,"POST","/v2/accounts:revokeToken",Sg(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class fo{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Ee(e.idToken,"internal-error"),Ee(typeof e.idToken<"u","internal-error"),Ee(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):cx(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){Ee(e.length!==0,"internal-error");const n=cx(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Ee(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await o4(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new fo;return r&&(Ee(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(Ee(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(Ee(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new fo,this.toJSON())}_performRefresh(){return zr("not implemented")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function hi(t,e){Ee(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class sr{constructor({uid:e,auth:n,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new r4(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new xp(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const n=await hl(this,this.stsTokenManager.getToken(this.auth,e));return Ee(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return t4(this,e)}reload(){return i4(this)}_assign(e){this!==e&&(Ee(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new sr({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){Ee(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Lc(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(rr(this.auth.app))return Promise.reject(gs(this.auth));const e=await this.getIdToken();return await hl(this,e4(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){const r=n.displayName??void 0,i=n.email??void 0,s=n.phoneNumber??void 0,o=n.photoURL??void 0,a=n.tenantId??void 0,u=n._redirectEventId??void 0,c=n.createdAt??void 0,f=n.lastLoginAt??void 0,{uid:h,emailVerified:p,isAnonymous:m,providerData:b,stsTokenManager:S}=n;Ee(h&&S,e,"internal-error");const P=fo.fromJSON(this.name,S);Ee(typeof h=="string",e,"internal-error"),hi(r,e.name),hi(i,e.name),Ee(typeof p=="boolean",e,"internal-error"),Ee(typeof m=="boolean",e,"internal-error"),hi(s,e.name),hi(o,e.name),hi(a,e.name),hi(u,e.name),hi(c,e.name),hi(f,e.name);const y=new sr({uid:h,auth:e,email:i,emailVerified:p,displayName:r,isAnonymous:m,photoURL:o,phoneNumber:s,tenantId:a,stsTokenManager:P,createdAt:c,lastLoginAt:f});return b&&Array.isArray(b)&&(y.providerData=b.map(w=>({...w}))),u&&(y._redirectEventId=u),y}static async _fromIdTokenResponse(e,n,r=!1){const i=new fo;i.updateFromServerResponse(n);const s=new sr({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Lc(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];Ee(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?KE(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new fo;a.updateFromIdToken(r);const u=new sr({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new xp(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(u,c),u}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const dx=new Map;function Br(t){ni(t instanceof Function,"Expected a class definition");let e=dx.get(t);return e?(ni(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,dx.set(t,e),e)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class QE{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}QE.type="NONE";const hx=QE;/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */function Uu(t,e,n){return`firebase:${t}:${e}:${n}`}class po{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=Uu(this.userKey,i.apiKey,s),this.fullPersistenceKey=Uu("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await jc(this.auth,{idToken:e}).catch(()=>{});return n?sr._fromGetAccountInfoResponse(this.auth,n,e):null}return sr._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new po(Br(hx),e,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||Br(hx);const o=Uu(r,e.config.apiKey,e.name);let a=null;for(const c of n)try{const f=await c._get(o);if(f){let h;if(typeof f=="string"){const p=await jc(e,{idToken:f}).catch(()=>{});if(!p)break;h=await sr._fromGetAccountInfoResponse(e,p,f)}else h=sr._fromJSON(e,f);c!==s&&(a=h),s=c;break}}catch{}const u=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new po(s,e,r):(s=u[0],a&&await s._set(o,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new po(s,e,r))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function fx(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(ZE(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(YE(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(tI(e))return"Blackberry";if(nI(e))return"Webos";if(XE(e))return"Safari";if((e.includes("chrome/")||JE(e))&&!e.includes("edge/"))return"Chrome";if(eI(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function YE(t=un()){return/firefox\//i.test(t)}function XE(t=un()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function JE(t=un()){return/crios\//i.test(t)}function ZE(t=un()){return/iemobile/i.test(t)}function eI(t=un()){return/android/i.test(t)}function tI(t=un()){return/blackberry/i.test(t)}function nI(t=un()){return/webos/i.test(t)}function kg(t=un()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function l4(t=un()){var e;return kg(t)&&!!((e=window.navigator)!=null&&e.standalone)}function u4(){return V2()&&document.documentMode===10}function rI(t=un()){return kg(t)||eI(t)||nI(t)||tI(t)||/windows phone/i.test(t)||ZE(t)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function iI(t,e=[]){let n;switch(t){case"Browser":n=fx(un());break;case"Worker":n=`${fx(un())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ps}/${r}`}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class c4{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,a)=>{try{const u=e(s);o(u)}catch(u){a(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */async function d4(t,e={}){return Bo(t,"GET","/v2/passwordPolicy",Sg(t,e))}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */const h4=6;class f4{constructor(e){var r;const n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??h4,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=e.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class p4{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new px(this),this.idTokenSubscription=new px(this),this.beforeStateQueue=new c4(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=$E,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Br(n)),this._initializationPromise=this.queue(async()=>{var r,i,s;if(!this._deleted&&(this.persistenceManager=await po.create(this,e),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((i=this._popupRedirectResolver)!=null&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((s=this.currentUser)==null?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await jc(this,{idToken:e}),r=await sr._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var s;if(rr(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(s=this.redirectUser)==null?void 0:s._redirectEventId,a=r==null?void 0:r._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===a)&&(u!=null&&u.user)&&(r=u.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Ee(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Lc(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=KR()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(rr(this.app))return Promise.reject(gs(this));const n=e?Zt(e):null;return n&&Ee(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&Ee(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return rr(this.app)?Promise.reject(gs(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return rr(this.app)?Promise.reject(gs(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Br(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await d4(this),n=new f4(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new _l("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await a4(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Br(e)||this._popupRedirectResolver;Ee(n,this,"argument-error"),this.redirectPersistenceManager=await po.create(this,[Br(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ee(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=e.addObserver(n);return()=>{o=!0,u()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Ee(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=iI(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var i;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await((i=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getHeartbeatsHeader());n&&(e["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){var n;if(rr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return e!=null&&e.error&&qR(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function Cg(t){return Zt(t)}class px{constructor(e){this.auth=e,this.observer=null,this.addObserver=W2(n=>this.observer=n)}get next(){return Ee(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */let Ng={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function m4(t){Ng=t}function g4(t){return Ng.loadJS(t)}function y4(){return Ng.gapiScript}function v4(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function x4(t,e){const n=ld(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Es(s,e??{}))return i;ti(i,"already-initialized")}return n.initialize({options:e})}function w4(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Br);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function _4(t,e,n){const r=Cg(t);Ee(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=sI(e),{host:o,port:a}=b4(e),u=a===null?"":`:${a}`,c={url:`${s}//${o}${u}/`},f=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){Ee(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Ee(Es(c,r.config.emulator)&&Es(f,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=c,r.emulatorConfig=f,r.settings.appVerificationDisabledForTesting=!0,As(o)?(Dm(`${s}//${o}${u}`),jm("Auth",!0)):E4()}function sI(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function b4(t){const e=sI(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:mx(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:mx(o)}}}function mx(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function E4(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class oI{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return zr("not implemented")}_getIdTokenResponse(e){return zr("not implemented")}_linkToIdToken(e,n){return zr("not implemented")}_getReauthenticationResolver(e){return zr("not implemented")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function mo(t,e){return JR(t,"POST","/v1/accounts:signInWithIdp",Sg(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const I4="http://localhost";class ks extends oI{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new ks(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):ti("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=n;if(!r||!i)return null;const o=new ks(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return mo(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,mo(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,mo(e,n)}buildRequest(){const e={requestUri:I4,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=bl(n)}return e}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class aI{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Al extends aI{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class vi extends Al{constructor(){super("facebook.com")}static credential(e){return ks._fromParams({providerId:vi.PROVIDER_ID,signInMethod:vi.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return vi.credentialFromTaggedObject(e)}static credentialFromError(e){return vi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return vi.credential(e.oauthAccessToken)}catch{return null}}}vi.FACEBOOK_SIGN_IN_METHOD="facebook.com";vi.PROVIDER_ID="facebook.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Vr extends Al{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return ks._fromParams({providerId:Vr.PROVIDER_ID,signInMethod:Vr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Vr.credentialFromTaggedObject(e)}static credentialFromError(e){return Vr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Vr.credential(n,r)}catch{return null}}}Vr.GOOGLE_SIGN_IN_METHOD="google.com";Vr.PROVIDER_ID="google.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class xi extends Al{constructor(){super("github.com")}static credential(e){return ks._fromParams({providerId:xi.PROVIDER_ID,signInMethod:xi.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return xi.credentialFromTaggedObject(e)}static credentialFromError(e){return xi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return xi.credential(e.oauthAccessToken)}catch{return null}}}xi.GITHUB_SIGN_IN_METHOD="github.com";xi.PROVIDER_ID="github.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class wi extends Al{constructor(){super("twitter.com")}static credential(e,n){return ks._fromParams({providerId:wi.PROVIDER_ID,signInMethod:wi.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return wi.credentialFromTaggedObject(e)}static credentialFromError(e){return wi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return wi.credential(n,r)}catch{return null}}}wi.TWITTER_SIGN_IN_METHOD="twitter.com";wi.PROVIDER_ID="twitter.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Ro{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await sr._fromIdTokenResponse(e,r,i),o=gx(r);return new Ro({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=gx(r);return new Ro({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function gx(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Oc extends Dr{constructor(e,n,r,i){super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Oc.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new Oc(e,n,r,i)}}function lI(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Oc._fromErrorAndOperation(t,s,e,r):s})}async function S4(t,e,n=!1){const r=await hl(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ro._forOperation(t,"link",r)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */async function T4(t,e,n=!1){const{auth:r}=t;if(rr(r.app))return Promise.reject(gs(r));const i="reauthenticate";try{const s=await hl(t,lI(r,i,e,t),n);Ee(s.idToken,r,"internal-error");const o=Tg(s.idToken);Ee(o,r,"internal-error");const{sub:a}=o;return Ee(t.uid===a,r,"user-mismatch"),Ro._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&ti(r,"user-mismatch"),s}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function k4(t,e,n=!1){if(rr(t.app))return Promise.reject(gs(t));const r="signIn",i=await lI(t,r,e),s=await Ro._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}function C4(t,e,n,r){return Zt(t).onIdTokenChanged(e,n,r)}function N4(t,e,n){return Zt(t).beforeAuthStateChanged(e,n)}const Mc="__sak";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class uI{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Mc,"1"),this.storage.removeItem(Mc),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const A4=1e3,P4=10;class cI extends uI{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=rI(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,u)=>{this.notifyListeners(o,u)});return}const r=e.key;n?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);u4()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,P4):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},A4)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}cI.type="LOCAL";const R4=cI;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class dI extends uI{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}dI.type="SESSION";const hI=dI;/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */function D4(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Pd{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new Pd(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async c=>c(n.origin,s)),u=await D4(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Pd.receivers=[];/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Ag(t="",e=10){let n="";for(let r=0;r{const c=Ag("",20);i.port1.start();const f=setTimeout(()=>{u(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(h){const p=h;if(p.data.eventId===c)switch(p.data.status){case"ack":clearTimeout(f),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(p.data.response);break;default:clearTimeout(f),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Nr(){return window}function L4(t){Nr().location.href=t}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */function fI(){return typeof Nr().WorkerGlobalScope<"u"&&typeof Nr().importScripts=="function"}async function O4(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function M4(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)==null?void 0:t.controller)||null}function V4(){return fI()?self:null}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const pI="firebaseLocalStorageDb",F4=1,Vc="firebaseLocalStorage",mI="fbase_key";class Pl{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Rd(t,e){return t.transaction([Vc],e?"readwrite":"readonly").objectStore(Vc)}function U4(){const t=indexedDB.deleteDatabase(pI);return new Pl(t).toPromise()}function wp(){const t=indexedDB.open(pI,F4);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Vc,{keyPath:mI})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Vc)?e(r):(r.close(),await U4(),e(await wp()))})})}async function yx(t,e,n){const r=Rd(t,!0).put({[mI]:e,value:n});return new Pl(r).toPromise()}async function z4(t,e){const n=Rd(t,!1).get(e),r=await new Pl(n).toPromise();return r===void 0?null:r.value}function vx(t,e){const n=Rd(t,!0).delete(e);return new Pl(n).toPromise()}const B4=800,$4=3;class gI{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await wp(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>$4)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return fI()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Pd._getInstance(V4()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await O4(),!this.activeServiceWorker)return;this.sender=new j4(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(n=e[0])!=null&&n.fulfilled&&(r=e[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||M4()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await wp();return await yx(e,Mc,"1"),await vx(e,Mc),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>yx(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>z4(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>vx(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Rd(i,!1).getAll();return new Pl(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),B4)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}gI.type="LOCAL";const H4=gI;new Nl(3e4,6e4);/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function q4(t,e){return e?Br(e):(Ee(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Pg extends oI{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return mo(e,this._buildIdpRequest())}_linkToIdToken(e,n){return mo(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return mo(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function W4(t){return k4(t.auth,new Pg(t),t.bypassAuthState)}function G4(t){const{auth:e,user:n}=t;return Ee(n,e,"internal-error"),T4(n,new Pg(t),t.bypassAuthState)}async function K4(t){const{auth:e,user:n}=t;return Ee(n,e,"internal-error"),S4(n,new Pg(t),t.bypassAuthState)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class yI{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(u))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return W4;case"linkViaPopup":case"linkViaRedirect":return K4;case"reauthViaPopup":case"reauthViaRedirect":return G4;default:ti(this.auth,"internal-error")}}resolve(e){ni(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ni(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Q4=new Nl(2e3,1e4);class no extends yI{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,no.currentPopupAction&&no.currentPopupAction.cancel(),no.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Ee(e,this.auth,"internal-error"),e}async onExecution(){ni(this.filter.length===1,"Popup operations only handle one event");const e=Ag();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Cr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(Cr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,no.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Cr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Q4.get())};e()}}no.currentPopupAction=null;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Y4="pendingRedirect",zu=new Map;class X4 extends yI{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=zu.get(this.auth._key());if(!e){try{const r=await J4(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}zu.set(this.auth._key(),e)}return this.bypassAuthState||zu.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function J4(t,e){const n=tD(e),r=eD(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function Z4(t,e){zu.set(t._key(),e)}function eD(t){return Br(t._redirectPersistence)}function tD(t){return Uu(Y4,t.config.apiKey,t.name)}async function nD(t,e,n=!1){if(rr(t.app))return Promise.reject(gs(t));const r=Cg(t),i=q4(r,e),o=await new X4(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const rD=10*60*1e3;class iD{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!sD(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!vI(e)){const i=((r=e.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(Cr(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=rD&&this.cachedEventUids.clear(),this.cachedEventUids.has(xx(e))}saveEventToCache(e){this.cachedEventUids.add(xx(e)),this.lastProcessedEventTime=Date.now()}}function xx(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function vI({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function sD(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return vI(t);default:return!1}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function oD(t,e={}){return Bo(t,"GET","/v1/projects",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const aD=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,lD=/^https?/;async function uD(t){if(t.config.emulator)return;const{authorizedDomains:e}=await oD(t);for(const n of e)try{if(cD(n))return}catch{}ti(t,"unauthorized-domain")}function cD(t){const e=vp(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!lD.test(n))return!1;if(aD.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const dD=new Nl(3e4,6e4);function wx(){const t=Nr().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var i,s,o;function r(){wx(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{wx(),n(Cr(t,"network-request-failed"))},timeout:dD.get()})}if((s=(i=Nr().gapi)==null?void 0:i.iframes)!=null&&s.Iframe)e(gapi.iframes.getContext());else if((o=Nr().gapi)!=null&&o.load)r();else{const a=v4("iframefcb");return Nr()[a]=()=>{gapi.load?r():n(Cr(t,"network-request-failed"))},g4(`${y4()}?onload=${a}`).catch(u=>n(u))}}).catch(e=>{throw Bu=null,e})}let Bu=null;function fD(t){return Bu=Bu||hD(t),Bu}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const pD=new Nl(5e3,15e3),mD="__/auth/iframe",gD="emulator/auth/iframe",yD={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},vD=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function xD(t){const e=t.config;Ee(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Ig(e,gD):`https://${t.config.authDomain}/${mD}`,r={apiKey:e.apiKey,appName:t.name,v:Ps},i=vD.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${bl(r).slice(1)}`}async function wD(t){const e=await fD(t),n=Nr().gapi;return Ee(n,t,"internal-error"),e.open({where:document.body,url:xD(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:yD,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=Cr(t,"network-request-failed"),a=Nr().setTimeout(()=>{s(o)},pD.get());function u(){Nr().clearTimeout(a),i(r)}r.ping(u).then(u,()=>{s(o)})}))}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const _D={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},bD=500,ED=600,ID="_blank",SD="http://localhost";class _x{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function TD(t,e,n,r=bD,i=ED){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u={..._D,width:r.toString(),height:i.toString(),top:s,left:o},c=un().toLowerCase();n&&(a=JE(c)?ID:n),YE(c)&&(e=e||SD,u.scrollbars="yes");const f=Object.entries(u).reduce((p,[m,b])=>`${p}${m}=${b},`,"");if(l4(c)&&a!=="_self")return kD(e||"",a),new _x(null);const h=window.open(e||"",a,f);Ee(h,t,"popup-blocked");try{h.focus()}catch{}return new _x(h)}function kD(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const CD="__/auth/handler",ND="emulator/auth/handler",AD=encodeURIComponent("fac");async function bx(t,e,n,r,i,s){Ee(t.config.authDomain,t,"auth-domain-config-required"),Ee(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Ps,eventId:i};if(e instanceof aI){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",q2(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[f,h]of Object.entries({}))o[f]=h}if(e instanceof Al){const f=e.getScopes().filter(h=>h!=="");f.length>0&&(o.scopes=f.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const f of Object.keys(a))a[f]===void 0&&delete a[f];const u=await t._getAppCheckToken(),c=u?`#${AD}=${encodeURIComponent(u)}`:"";return`${PD(t)}?${bl(a).slice(1)}${c}`}function PD({config:t}){return t.emulator?Ig(t,ND):`https://${t.authDomain}/${CD}`}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Mh="webStorageSupport";class RD{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=hI,this._completeRedirectFn=nD,this._overrideRedirectResult=Z4}async _openPopup(e,n,r,i){var o;ni((o=this.eventManagers[e._key()])==null?void 0:o.manager,"_initialize() not called before _openPopup()");const s=await bx(e,n,r,vp(),i);return TD(e,s,Ag())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await bx(e,n,r,vp(),i);return L4(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(ni(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await wD(e),r=new iD(e);return n.register("authEvent",i=>(Ee(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Mh,{type:Mh},i=>{var o;const s=(o=i==null?void 0:i[0])==null?void 0:o[Mh];s!==void 0&&n(!!s),ti(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=uD(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return rI()||XE()||kg()}}const DD=RD;var Ex="@firebase/auth",Ix="1.11.1";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class jD{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Ee(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function LD(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function OD(t){Is(new Fi("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;Ee(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:iI(t)},c=new p4(r,i,s,u);return w4(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Is(new Fi("auth-internal",e=>{const n=Cg(e.getProvider("auth").getImmediate());return(r=>new jD(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Er(Ex,Ix,LD(t)),Er(Ex,Ix,"esm2020")}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const MD=5*60,VD=eb("authIdTokenMaxAge")||MD;let Sx=null;const FD=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>VD)return;const i=n==null?void 0:n.token;Sx!==i&&(Sx=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function UD(t=Mm()){const e=ld(t,"auth");if(e.isInitialized())return e.getImmediate();const n=x4(t,{popupRedirectResolver:DD,persistence:[H4,R4,hI]}),r=eb("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=FD(s.toString());N4(n,o,()=>o(n.currentUser)),C4(n,a=>o(a))}}const i=X1("auth");return i&&_4(n,`http://${i}`),n}function zD(){var t;return((t=document.getElementsByTagName("head"))==null?void 0:t[0])??document}m4({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=Cr("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",zD().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});OD("Browser");const BD={apiKey:"AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE",authDomain:"twistedbrody-9d163.firebaseapp.com",projectId:"twistedbrody-9d163",storageBucket:"twistedbrody-9d163.firebasestorage.app",messagingSenderId:"733213514129",appId:"1:733213514129:web:e9694684f5c3994ed06230",measurementId:"G-N8TQ7MY42W"},Rg=ib(BD),We=tR(Rg);UR(Rg);UD(Rg);new Vr;function fl(t){if(t!=null){if(Array.isArray(t)){const e=t.map(n=>fl(n)).filter(n=>n!=null&&n!=="");return e.length>0?e:void 0}if(typeof t=="object"&&!(t instanceof Qe)){const e={};for(const n in t)if(t.hasOwnProperty(n)){const r=fl(t[n]);r!=null&&(e[n]=r)}return Object.keys(e).length>0?e:void 0}return t}}const Rl={MANGA_PREFIX:"mangalib_detail_v2_"};function Dd(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(n){console.warn(`Error saving ${t} to localStorage`,n)}}function $D(t){try{localStorage.removeItem(t)}catch(e){console.warn(`Error removing ${t} from localStorage`,e)}}async function jd(){const t=Zr(Tn(We,"mangas"),dR("created_at","desc")),e=await lr(t),r=(await lr(Tn(We,"categories"))).docs.reduce((o,a)=>(o[a.id]={id:a.id,...a.data()},o),{}),i=await Promise.all(e.docs.map(async o=>{var a,u;try{const c=o.data();let f=new Date().toISOString();(a=c.created_at)!=null&&a.toDate?f=c.created_at.toDate().toISOString():c.created_at&&(f=new Date(c.created_at).toISOString());let h=f;(u=c.updated_at)!=null&&u.toDate&&(h=c.updated_at.toDate().toISOString());const p=Zr(Tn(We,"chapters"),js("manga_id","==",o.id)),b=(await lr(p)).docs.map(y=>{var F,D;const w=y.data(),T=(F=w.created_at)!=null&&F.toDate?w.created_at.toDate().toISOString():new Date().toISOString(),L=(D=w.updated_at)!=null&&D.toDate?w.updated_at.toDate().toISOString():new Date().toISOString();return{id:y.id,manga_id:w.manga_id,number:w.number,title:w.title,pages:w.pages||[],page_formats:w.page_formats||[],original_pages:w.original_pages||[],created_at:T,updated_at:L}}).sort((y,w)=>y.number-w.number),P=(c.categories||[]).map(y=>r[y]).filter(y=>y!==void 0);return{id:o.id,...c,created_at:f,updated_at:h,categories:P,chapters:b}}catch(c){return console.error(`[DATA ERROR] Skipping corrupt manga ${o.id}:`,c),null}})),s=i.filter(o=>o!==null);return console.log(`[DATA] Loaded ${s.length} mangas (Skipped ${i.length-s.length} corrupt)`),s}const Do=new Map;async function xI(t){var f,h;const e=Dt(We,"mangas",t),n=await ei(e);if(!n.exists())return null;const r=n.data(),i=Zr(Tn(We,"chapters"),js("manga_id","==",t)),o=(await lr(i)).docs.map(p=>{const m=p.data();return{id:p.id,manga_id:m.manga_id,number:m.number,title:m.title,pages:m.pages||[],page_formats:m.page_formats||[],original_pages:m.original_pages||[],created_at:m.created_at.toDate().toISOString(),updated_at:m.updated_at.toDate().toISOString()}}).sort((p,m)=>p.number-m.number),a=r.categories||[],u=[];for(const p of a){const m=Dt(We,"categories",p),b=await ei(m);b.exists()&&u.push({id:b.id,...b.data(),created_at:((h=(f=b.data().created_at)==null?void 0:f.toDate)==null?void 0:h.call(f).toISOString())||new Date().toISOString()})}const c={id:n.id,...r,created_at:r.created_at.toDate().toISOString(),categories:u,chapters:o,updated_at:r.updated_at?r.updated_at.toDate().toISOString():r.created_at.toDate().toISOString()};return Do.set(t,c),Dd(`${Rl.MANGA_PREFIX}${t}`,c),c}function HD(t,e){const n=Dt(We,"mangas",t);return bg(n,async r=>{if(!r.exists()){e(null);return}const i=r.data();let s=Do.get(t),o=(s==null?void 0:s.chapters)||[],a=(s==null?void 0:s.categories)||[];if(!s){const c=Zr(Tn(We,"chapters"),js("manga_id","==",t));o=(await lr(c)).docs.map(p=>({id:p.id,...p.data(),created_at:p.data().created_at.toDate().toISOString(),updated_at:p.data().updated_at.toDate().toISOString()})).sort((p,m)=>p.number-m.number);const h=i.categories||[];a=[];for(const p of h){const m=await ei(Dt(We,"categories",p));m.exists()&&a.push({id:m.id,...m.data()})}}const u={id:r.id,...i,chapters:o,categories:a,created_at:i.created_at.toDate().toISOString(),updated_at:i.updated_at?i.updated_at.toDate().toISOString():i.created_at.toDate().toISOString()};Do.set(t,u),Dd(`${Rl.MANGA_PREFIX}${t}`,u),e(u)})}async function qD(t){const e=Qe.now(),n={title:t.title,author:t.author,description:t.description||"",status:t.status||"En curso",categories:t.categoryIds||[],views:0,rating:0,created_at:e,updated_at:e};t.thumbnail_url&&(n.thumbnail_url=t.thumbnail_url),t.cover_url&&(n.cover_url=t.cover_url);const r=await _g(Tn(We,"mangas"),n),i=new Date().toISOString(),s={id:r.id,title:t.title,author:t.author,description:t.description||"",status:t.status||"En curso",categories:t.categoryIds||[],chapters:[],views:0,rating:0,created_at:i,updated_at:i};return t.thumbnail_url&&(s.thumbnail_url=t.thumbnail_url),t.cover_url&&(s.cover_url=t.cover_url),Do.set(s.id,s),Dd(`${Rl.MANGA_PREFIX}${s.id}`,s),s}async function wI(){return(await lr(Tn(We,"categories"))).docs.map(e=>({id:e.id,...e.data()}))}async function _I(t,e="genre"){const n=await _g(Tn(We,"categories"),{name:t,type:e}),r=await ei(n);return{id:r.id,...r.data()}}async function bI(t){const e=Dt(We,"categories",t);await yp(e);const n=Zr(Tn(We,"mangas"),js("categories","array-contains",t)),i=(await lr(n)).docs.map(s=>{const u=(s.data().categories||[]).filter(c=>c!==t);return Ji(Dt(We,"mangas",s.id),{categories:u})});await Promise.all(i)}async function Tx(t){const e=Qe.now(),n=await _g(Tn(We,"chapters"),{manga_id:t.manga_id,number:t.number,title:t.title,pages:t.pages,page_formats:t.page_formats||[],original_pages:t.original_pages||[],created_at:e,updated_at:e}),r=await ei(n),i=r.data();return{id:r.id,manga_id:i.manga_id,number:i.number,title:i.title,pages:i.pages||[],page_formats:i.page_formats||[],original_pages:i.original_pages||[],created_at:i.created_at.toDate().toISOString(),updated_at:i.updated_at.toDate().toISOString()}}async function WD(){const e=(await jd()).map(n=>{const r=Dt(We,"mangas",n.id);return Ji(r,{views:0})});await Promise.all(e)}async function GD(t){const e=Dt(We,"mangas",t);await Ji(e,{views:pR(1)})}async function EI(t,e){var b,S;const n=Dt(We,"mangas",t),r=Qe.now(),i={title:e.title,author:e.author,categories:e.categoryIds||[],updated_at:r};e.status&&(i.status=e.status),e.description!==void 0&&e.description!==null&&(i.description=e.description),e.thumbnail_url&&(i.thumbnail_url=e.thumbnail_url),e.cover_url&&(i.cover_url=e.cover_url);const s=fl(i);await Ji(n,s);const o=await ei(n);if(!o.exists())throw new Error("Manga no encontrado");const a=o.data(),u=Zr(Tn(We,"chapters"),js("manga_id","==",t)),f=(await lr(u)).docs.map(P=>{const y=P.data();return{id:P.id,manga_id:y.manga_id,number:y.number,title:y.title,pages:y.pages||[],page_formats:y.page_formats||[],original_pages:y.original_pages||[],created_at:y.created_at.toDate().toISOString(),updated_at:y.updated_at.toDate().toISOString()}}).sort((P,y)=>P.number-y.number),h=a.categories||[],p=[];for(const P of h){const y=Dt(We,"categories",P),w=await ei(y);w.exists()&&p.push({id:w.id,...w.data(),created_at:((S=(b=w.data().created_at)==null?void 0:b.toDate)==null?void 0:S.call(b).toISOString())||new Date().toISOString()})}const m={id:o.id,...a,created_at:a.created_at.toDate().toISOString(),categories:p,chapters:f,updated_at:a.updated_at.toDate().toISOString()};return Do.set(m.id,m),Dd(`${Rl.MANGA_PREFIX}${m.id}`,m),m}async function KD(t){const e=Dt(We,"mangas",t),n=Zr(Tn(We,"chapters"),js("manga_id","==",t)),r=await lr(n);for(const i of r.docs)await yp(i.ref);await yp(e),Do.delete(t),$D(`${Rl.MANGA_PREFIX}${t}`)}async function QD(t,e){const n=Dt(We,"mangas",t),r=await ei(n);if(!r.exists())throw new Error("Manga no encontrado");const s={external_links:[...r.data().external_links||[],e]},o=fl(s);await Ji(n,o)}async function YD(t,e){const n=Dt(We,"mangas",t),r=await ei(n);if(!r.exists())throw new Error("Manga no encontrado");const s={external_links:(r.data().external_links||[]).filter((a,u)=>u!==e)},o=fl(s);await Ji(n,o)}async function XD(t,e,n,r){const s=(await jd()).filter(o=>o.id!==t).map(o=>{var S,P;let a=0;const u=((S=o.categories)==null?void 0:S.map(y=>y.id))||[],c=e.filter(y=>u.includes(y));a+=c.length*10;const f=n.toLowerCase().split(/\s+/).filter(y=>y.length>2),h=o.title.toLowerCase().split(/\s+/).filter(y=>y.length>2),p=f.filter(y=>h.includes(y));a+=p.length*5;const m=((P=o.author)==null?void 0:P.toLowerCase().split(/\s+/).filter(y=>y.length>2))||[],b=f.filter(y=>m.includes(y));return a+=b.length*3,{manga:o,score:a}}).filter(o=>o.score>0).sort((o,a)=>{const u=o.manga.title.toLowerCase(),c=a.manga.title.toLowerCase();return u.localeCompare(c)}).map(o=>o.manga);return r?s.slice(0,r):s}async function JD(t){const e=Zr(Tn(We,"mangas"),js("author","==",t)),r=(await lr(e)).docs.map(i=>Ji(Dt(We,"mangas",i.id),{author:""}));await Promise.all(r)}async function ZD(){const t=Zr(Tn(We,"mangas")),e=await lr(t),n=new Set;return e.forEach(r=>{const i=r.data();i&&i.author&&typeof i.author=="string"&&i.author.trim()!==""&&n.add(i.author.trim())}),Array.from(n).sort()}function ej(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const tj=t=>{switch(t){case"success":return ij;case"info":return oj;case"warning":return sj;case"error":return aj;default:return null}},nj=Array(12).fill(0),rj=({visible:t,className:e})=>re.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},re.createElement("div",{className:"sonner-spinner"},nj.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),ij=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),sj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),oj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),aj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),uj=()=>{const[t,e]=re.useState(document.hidden);return re.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let _p=1;class cj{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:_p++,o=this.toasts.find(u=>u.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...e,id:s,title:r}),{...u,...e,id:s,dismissible:a,title:r}):u):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],re.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(hj(c)&&!c.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,b=typeof h=="object"&&!re.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...b})}else if(c instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,b=typeof h=="object"&&!re.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...b})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,b=typeof h=="object"&&!re.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:p,...b})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(c):n.error,h=typeof n.description=="function"?await n.description(c):n.description,m=typeof f=="object"&&!re.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...m})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((c,f)=>a.then(()=>o[0]==="reject"?f(o[1]):c(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||_p++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gn=new cj,dj=(t,e)=>{const n=(e==null?void 0:e.id)||_p++;return gn.addToast({title:t,...e,id:n}),n},hj=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",fj=dj,pj=()=>gn.toasts,mj=()=>gn.getActiveToasts(),Nt=Object.assign(fj,{success:gn.success,info:gn.info,warning:gn.warning,error:gn.error,custom:gn.custom,message:gn.message,promise:gn.promise,dismiss:gn.dismiss,loading:gn.loading},{getHistory:pj,getToasts:mj});ej("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function gu(t){return t.label!==void 0}const gj=3,yj="24px",vj="16px",kx=4e3,xj=356,wj=14,_j=45,bj=200;function pr(...t){return t.filter(Boolean).join(" ")}function Ej(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const Ij=t=>{var e,n,r,i,s,o,a,u,c;const{invert:f,toast:h,unstyled:p,interacting:m,setHeights:b,visibleToasts:S,heights:P,index:y,toasts:w,expanded:T,removeToast:L,defaultRichColors:F,closeButton:D,style:_,cancelButtonStyle:x,actionButtonStyle:E,className:k="",descriptionClassName:C="",duration:j,position:A,gap:de,expandByDefault:oe,classNames:le,icons:ve,closeButtonAriaLabel:K="Close toast"}=t,[ie,N]=re.useState(null),[fe,ye]=re.useState(null),[R,H]=re.useState(!1),[J,te]=re.useState(!1),[Ie,pe]=re.useState(!1),[Fe,ut]=re.useState(!1),[Je,bt]=re.useState(!1),[mt,gt]=re.useState(0),[Ht,Vt]=re.useState(0),Ze=re.useRef(h.duration||j||kx),Nn=re.useRef(null),W=re.useRef(null),ue=y===0,Ce=y+1<=S,we=h.type,He=h.dismissible!==!1,Et=h.className||"",Ft=h.descriptionClassName||"",z=re.useMemo(()=>P.findIndex(xe=>xe.toastId===h.id)||0,[P,h.id]),O=re.useMemo(()=>{var xe;return(xe=h.closeButton)!=null?xe:D},[h.closeButton,D]),B=re.useMemo(()=>h.duration||j||kx,[h.duration,j]),Q=re.useRef(0),Y=re.useRef(0),Ae=re.useRef(0),Oe=re.useRef(null),[Ne,et]=A.split("-"),$=re.useMemo(()=>P.reduce((xe,Te,yt)=>yt>=z?xe:xe+Te.height,0),[P,z]),Z=uj(),he=h.invert||f,me=we==="loading";Y.current=re.useMemo(()=>z*de+$,[z,$]),re.useEffect(()=>{Ze.current=B},[B]),re.useEffect(()=>{H(!0)},[]),re.useEffect(()=>{const xe=W.current;if(xe){const Te=xe.getBoundingClientRect().height;return Vt(Te),b(yt=>[{toastId:h.id,height:Te,position:h.position},...yt]),()=>b(yt=>yt.filter(qt=>qt.toastId!==h.id))}},[b,h.id]),re.useLayoutEffect(()=>{if(!R)return;const xe=W.current,Te=xe.style.height;xe.style.height="auto";const yt=xe.getBoundingClientRect().height;xe.style.height=Te,Vt(yt),b(qt=>qt.find(vt=>vt.toastId===h.id)?qt.map(vt=>vt.toastId===h.id?{...vt,height:yt}:vt):[{toastId:h.id,height:yt,position:h.position},...qt])},[R,h.title,h.description,b,h.id,h.jsx,h.action,h.cancel]);const Pe=re.useCallback(()=>{te(!0),gt(Y.current),b(xe=>xe.filter(Te=>Te.toastId!==h.id)),setTimeout(()=>{L(h)},bj)},[h,L,b,Y]);re.useEffect(()=>{if(h.promise&&we==="loading"||h.duration===1/0||h.type==="loading")return;let xe;return T||m||Z?(()=>{if(Ae.current{Ze.current!==1/0&&(Q.current=new Date().getTime(),xe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Pe()},Ze.current))})(),()=>clearTimeout(xe)},[T,m,h,we,Z,Pe]),re.useEffect(()=>{h.delete&&(Pe(),h.onDismiss==null||h.onDismiss.call(h,h))},[Pe,h.delete]);function Ge(){var xe;if(ve!=null&&ve.loading){var Te;return re.createElement("div",{className:pr(le==null?void 0:le.loader,h==null||(Te=h.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":we==="loading"},ve.loading)}return re.createElement(rj,{className:pr(le==null?void 0:le.loader,h==null||(xe=h.classNames)==null?void 0:xe.loader),visible:we==="loading"})}const It=h.icon||(ve==null?void 0:ve[we])||tj(we);var Me,Lr;return re.createElement("li",{tabIndex:0,ref:W,className:pr(k,Et,le==null?void 0:le.toast,h==null||(e=h.classNames)==null?void 0:e.toast,le==null?void 0:le.default,le==null?void 0:le[we],h==null||(n=h.classNames)==null?void 0:n[we]),"data-sonner-toast":"","data-rich-colors":(Me=h.richColors)!=null?Me:F,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":R,"data-promise":!!h.promise,"data-swiped":Je,"data-removed":J,"data-visible":Ce,"data-y-position":Ne,"data-x-position":et,"data-index":y,"data-front":ue,"data-swiping":Ie,"data-dismissible":He,"data-type":we,"data-invert":he,"data-swipe-out":Fe,"data-swipe-direction":fe,"data-expanded":!!(T||oe&&R),"data-testid":h.testId,style:{"--index":y,"--toasts-before":y,"--z-index":w.length-y,"--offset":`${J?mt:Y.current}px`,"--initial-height":oe?"auto":`${Ht}px`,..._,...h.style},onDragEnd:()=>{pe(!1),N(null),Oe.current=null},onPointerDown:xe=>{xe.button!==2&&(me||!He||(Nn.current=new Date,gt(Y.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(pe(!0),Oe.current={x:xe.clientX,y:xe.clientY})))},onPointerUp:()=>{var xe,Te,yt;if(Fe||!He)return;Oe.current=null;const qt=Number(((xe=W.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),An=Number(((Te=W.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vt=new Date().getTime()-((yt=Nn.current)==null?void 0:yt.getTime()),Wt=ie==="x"?qt:An,Bn=Math.abs(Wt)/vt;if(Math.abs(Wt)>=_j||Bn>.11){gt(Y.current),h.onDismiss==null||h.onDismiss.call(h,h),ye(ie==="x"?qt>0?"right":"left":An>0?"down":"up"),Pe(),ut(!0);return}else{var Gt,je;(Gt=W.current)==null||Gt.style.setProperty("--swipe-amount-x","0px"),(je=W.current)==null||je.style.setProperty("--swipe-amount-y","0px")}bt(!1),pe(!1),N(null)},onPointerMove:xe=>{var Te,yt,qt;if(!Oe.current||!He||((Te=window.getSelection())==null?void 0:Te.toString().length)>0)return;const vt=xe.clientY-Oe.current.y,Wt=xe.clientX-Oe.current.x;var Bn;const Gt=(Bn=t.swipeDirections)!=null?Bn:Ej(A);!ie&&(Math.abs(Wt)>1||Math.abs(vt)>1)&&N(Math.abs(Wt)>Math.abs(vt)?"x":"y");let je={x:0,y:0};const ii=Pn=>1/(1.5+Math.abs(Pn)/20);if(ie==="y"){if(Gt.includes("top")||Gt.includes("bottom"))if(Gt.includes("top")&&vt<0||Gt.includes("bottom")&&vt>0)je.y=vt;else{const Pn=vt*ii(vt);je.y=Math.abs(Pn)0)je.x=Wt;else{const Pn=Wt*ii(Wt);je.x=Math.abs(Pn)0||Math.abs(je.y)>0)&&bt(!0),(yt=W.current)==null||yt.style.setProperty("--swipe-amount-x",`${je.x}px`),(qt=W.current)==null||qt.style.setProperty("--swipe-amount-y",`${je.y}px`)}},O&&!h.jsx&&we!=="loading"?re.createElement("button",{"aria-label":K,"data-disabled":me,"data-close-button":!0,onClick:me||!He?()=>{}:()=>{Pe(),h.onDismiss==null||h.onDismiss.call(h,h)},className:pr(le==null?void 0:le.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Lr=ve==null?void 0:ve.close)!=null?Lr:lj):null,(we||h.icon||h.promise)&&h.icon!==null&&((ve==null?void 0:ve[we])!==null||h.icon)?re.createElement("div",{"data-icon":"",className:pr(le==null?void 0:le.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Ge():null,h.type!=="loading"?It:null):null,re.createElement("div",{"data-content":"",className:pr(le==null?void 0:le.content,h==null||(s=h.classNames)==null?void 0:s.content)},re.createElement("div",{"data-title":"",className:pr(le==null?void 0:le.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?re.createElement("div",{"data-description":"",className:pr(C,Ft,le==null?void 0:le.description,h==null||(a=h.classNames)==null?void 0:a.description)},typeof h.description=="function"?h.description():h.description):null),re.isValidElement(h.cancel)?h.cancel:h.cancel&&gu(h.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||x,onClick:xe=>{gu(h.cancel)&&He&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,xe),Pe())},className:pr(le==null?void 0:le.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,re.isValidElement(h.action)?h.action:h.action&&gu(h.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||E,onClick:xe=>{gu(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,xe),!xe.defaultPrevented&&Pe())},className:pr(le==null?void 0:le.actionButton,h==null||(c=h.classNames)==null?void 0:c.actionButton)},h.action.label):null)};function Cx(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Sj(t,e){const n={};return[t,e].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?vj:yj;function u(c){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(a)}),n}const Tj=re.forwardRef(function(e,n){const{id:r,invert:i,position:s="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:u,className:c,offset:f,mobileOffset:h,theme:p="light",richColors:m,duration:b,style:S,visibleToasts:P=gj,toastOptions:y,dir:w=Cx(),gap:T=wj,icons:L,containerAriaLabel:F="Notifications"}=e,[D,_]=re.useState([]),x=re.useMemo(()=>r?D.filter(R=>R.toasterId===r):D.filter(R=>!R.toasterId),[D,r]),E=re.useMemo(()=>Array.from(new Set([s].concat(x.filter(R=>R.position).map(R=>R.position)))),[x,s]),[k,C]=re.useState([]),[j,A]=re.useState(!1),[de,oe]=re.useState(!1),[le,ve]=re.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=re.useRef(null),ie=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=re.useRef(null),fe=re.useRef(!1),ye=re.useCallback(R=>{_(H=>{var J;return(J=H.find(te=>te.id===R.id))!=null&&J.delete||gn.dismiss(R.id),H.filter(({id:te})=>te!==R.id)})},[]);return re.useEffect(()=>gn.subscribe(R=>{if(R.dismiss){requestAnimationFrame(()=>{_(H=>H.map(J=>J.id===R.id?{...J,delete:!0}:J))});return}setTimeout(()=>{e2.flushSync(()=>{_(H=>{const J=H.findIndex(te=>te.id===R.id);return J!==-1?[...H.slice(0,J),{...H[J],...R},...H.slice(J+1)]:[R,...H]})})})}),[D]),re.useEffect(()=>{if(p!=="system"){ve(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ve("dark"):ve("light")),typeof window>"u")return;const R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:H})=>{ve(H?"dark":"light")})}catch{R.addListener(({matches:J})=>{try{ve(J?"dark":"light")}catch(te){console.error(te)}})}},[p]),re.useEffect(()=>{D.length<=1&&A(!1)},[D]),re.useEffect(()=>{const R=H=>{var J;if(o.every(pe=>H[pe]||H.code===pe)){var Ie;A(!0),(Ie=K.current)==null||Ie.focus()}H.code==="Escape"&&(document.activeElement===K.current||(J=K.current)!=null&&J.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o]),re.useEffect(()=>{if(K.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,fe.current=!1)}},[K.current]),re.createElement("section",{ref:n,"aria-label":`${F} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((R,H)=>{var J;const[te,Ie]=R.split("-");return x.length?re.createElement("ol",{key:R,dir:w==="auto"?Cx():w,tabIndex:-1,ref:K,className:c,"data-sonner-toaster":!0,"data-sonner-theme":le,"data-y-position":te,"data-x-position":Ie,style:{"--front-toast-height":`${((J=k[0])==null?void 0:J.height)||0}px`,"--width":`${xj}px`,"--gap":`${T}px`,...S,...Sj(f,h)},onBlur:pe=>{fe.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(fe.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||fe.current||(fe.current=!0,N.current=pe.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{de||A(!1)},onDragEnd:()=>A(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||oe(!0)},onPointerUp:()=>oe(!1)},x.filter(pe=>!pe.position&&H===0||pe.position===R).map((pe,Fe)=>{var ut,Je;return re.createElement(Ij,{key:pe.id,icons:L,index:Fe,toast:pe,defaultRichColors:m,duration:(ut=y==null?void 0:y.duration)!=null?ut:b,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:i,visibleToasts:P,closeButton:(Je=y==null?void 0:y.closeButton)!=null?Je:u,interacting:de,position:R,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:ye,toasts:x.filter(bt=>bt.position==pe.position),heights:k.filter(bt=>bt.position==pe.position),setHeights:C,expandByDefault:a,gap:T,expanded:j,swipeDirections:e.swipeDirections})})):null}))});function Ii({label:t,type:e,categories:n,selectedIds:r,onSelect:i,onRemove:s,onCreate:o,onDeleteCategory:a,colorClass:u,placeholder:c="Añadir..."}){const[f,h]=V.useState(""),[p,m]=V.useState(!1),b=V.useRef(null),S=V.useMemo(()=>n.filter(D=>D.type===e||!D.type&&e==="genre"),[n,e]),P=V.useMemo(()=>f.trim()?S.filter(D=>D.name.toLowerCase().includes(f.toLowerCase())):S,[S,f]);V.useEffect(()=>{const D=_=>{b.current&&!b.current.contains(_.target)&&m(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const y=D=>{D.key==="Enter"&&(D.preventDefault(),w())},w=()=>{if(!f.trim())return;const D=S.find(_=>_.name.toLowerCase()===f.trim().toLowerCase());D?r.includes(D.id)||i(D.id):o(f.trim()),h(""),m(!1)},T=(D,_)=>{D.stopPropagation(),Nt("¿Eliminar esta categoría permanentemente?",{description:"Esta acción no se puede deshacer.",action:{label:"Eliminar",onClick:()=>a(_)},cancel:{label:"Cancelar",onClick:()=>{}},duration:5e3})},F=u.includes("blue")?{bg:"bg-blue-500/20",text:"text-blue-300",border:"border-blue-500/30"}:u.includes("green")?{bg:"bg-green-500/20",text:"text-green-300",border:"border-green-500/30"}:u.includes("purple")?{bg:"bg-purple-500/20",text:"text-purple-300",border:"border-purple-500/30"}:u.includes("pink")?{bg:"bg-pink-500/20",text:"text-pink-300",border:"border-pink-500/30"}:{bg:"bg-gray-500/20",text:"text-gray-300",border:"border-gray-500/30"};return d.jsxs("div",{className:"space-y-3 mb-6",ref:b,children:[d.jsx("label",{className:`text-xs uppercase font-bold tracking-wider ${u}`,children:t}),d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:"text",value:f,onChange:D=>{h(D.target.value),m(!0)},onFocus:()=>m(!0),onKeyDown:y,placeholder:c,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all"}),f&&d.jsx("button",{onClick:()=>h(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white",children:d.jsx(In,{className:"w-3 h-3"})})]}),d.jsx("button",{onClick:w,disabled:!f.trim(),className:"bg-[#bb86fc]/20 hover:bg-[#bb86fc]/30 text-[#bb86fc] px-3 rounded-lg transition-all",children:d.jsx(co,{className:"w-5 h-5"})})]}),p&&(P.length>0||f)&&d.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#1a1a1a] border border-gray-700/50 rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto w-full custom-scrollbar",children:P.length>0?P.map(D=>{const _=r.includes(D.id);return d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 hover:bg-white/5 cursor-pointer group",onClick:()=>{_||(i(D.id),h(""),m(!1))},children:[d.jsx("span",{className:`text-sm ${_?"text-[#bb86fc]":"text-gray-300"}`,children:D.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[_&&d.jsx(wl,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsx("button",{onClick:x=>T(x,D.id),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-500/20 text-gray-500 hover:text-red-400 rounded transition-all",title:"Eliminar permanentemente",children:d.jsx(wr,{className:"w-3.5 h-3.5"})})]})]},D.id)}):d.jsxs("div",{className:"px-4 py-3 text-center",children:[d.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"No encontrado."}),d.jsxs("button",{onClick:w,className:"text-xs text-[#bb86fc] hover:underline font-semibold",children:['Crear "',f,'"']})]})})]}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:r.map(D=>{const _=n.find(x=>x.id===D);return!_||_.type!==e&&!(e==="genre"&&!_.type)?null:d.jsxs("span",{className:`px-3 py-1 ${F.bg} ${F.text} text-xs rounded-full border ${F.border} flex items-center gap-2`,children:[_.name,d.jsx("button",{onClick:()=>s(D),className:"hover:text-white",children:d.jsx(In,{className:"w-3 h-3"})})]},D)})})]})}function ys({size:t=40,borderWidth:e=2,className:n=""}){return d.jsx("div",{className:`flex items-center justify-center ${n}`,children:d.jsx("div",{className:"relative",style:{width:`${t}px`,height:`${t}px`},children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:`${t}px`,height:`${t}px`,borderWidth:`${e}px`,borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.3)",borderTopColor:"#bb86fc",animation:"spin 1.2s linear infinite",boxShadow:"0 0 20px rgba(139, 92, 246, 0.2)"}})})})}function kj({isOpen:t,onClose:e,onMangaCreated:n,editingManga:r,onDelete:i}){const[s,o]=V.useState({title:"",name:"",description:"",selectedCategories:[]}),[a,u]=V.useState(null),[c,f]=V.useState(!1),[h,p]=V.useState(null),[m,b]=V.useState([]),[S,P]=V.useState(!1),[y,w]=V.useState([]),[T,L]=V.useState(!1),[F,D]=V.useState(null),[_,x]=V.useState(0),[E,k]=V.useState(!1),[C,j]=V.useState(0),[A,de]=V.useState(0),[oe,le]=V.useState(0),[ve,K]=V.useState(0),[ie,N]=V.useState(0),[fe,ye]=V.useState(!1),[R,H]=V.useState(null),[J,te]=V.useState(null),[Ie,pe]=V.useState(!1),[Fe,ut]=V.useState(G1()),Je=!!r;V.useEffect(()=>{var O,B;if(t&&(bt(),r)){o({title:r.title,name:r.author,description:r.description||"",selectedCategories:((O=r.categories)==null?void 0:O.map(Y=>typeof Y=="string"?Y:Y.id))||[]}),r.thumbnail_url&&p(r.thumbnail_url);const Q=(B=r.chapters)==null?void 0:B[0];if(Q!=null&&Q.pages&&Q.pages.length>0){const Y=Q.pages,Ae=Q.original_pages||[],Oe=Y.map((Ne,et)=>{var $;return{thumbnail:Ne,original:Ae[et]||Ne,webpDisplay:Ne,webpCover:Ne,originalFormat:(($=Q.page_formats)==null?void 0:$[et])||"jpg",originalBase64:"",originalUnmodified:""}});w(Oe)}}},[t,r]);async function bt(){try{const O=await wI();b(O)}catch(O){console.error("Error loading categories:",O)}}const mt=async O=>{const{name:B,value:Q}=O.target;o(Y=>({...Y,[B]:Q}))},gt=O=>{o(B=>({...B,selectedCategories:B.selectedCategories.filter(Q=>Q!==O)}))},Ht=async(O,B)=>{if(O.trim()){if(B==="tag"){const Q=O.split(" ").map(Y=>Y.trim()).filter(Y=>Y.length>0);for(const Y of Q)await Vt(Y,B);return}await Vt(O,B)}},Vt=async(O,B)=>{try{const Q=m.find(Y=>Y.name.toLowerCase()===O.trim().toLowerCase()&&Y.type===B);if(Q)o(Y=>Y.selectedCategories.includes(Q.id)?Y:{...Y,selectedCategories:[...Y.selectedCategories,Q.id]});else{const Y=await _I(O.trim(),B);b(Ae=>Ae.find(Oe=>Oe.id===Y.id)?Ae:[...Ae,Y]),o(Ae=>Ae.selectedCategories.includes(Y.id)?Ae:{...Ae,selectedCategories:[...Ae.selectedCategories,Y.id]})}}catch(Q){console.error("Error creating category:",Q)}},Ze=async O=>{try{await bI(O),b(B=>B.filter(Q=>Q.id!==O)),o(B=>({...B,selectedCategories:B.selectedCategories.filter(Q=>Q!==O)}))}catch(B){console.error("Error deleting category:",B),alert("Error al eliminar la categoría")}},Nn=async O=>{var Q;const B=(Q=O.target.files)==null?void 0:Q[0];if(B){f(!0);try{const Y=await q0(B);u(Y),p(Y.originalUnmodified)}catch(Y){console.error("Error processing image:",Y),alert("Error al procesar la imagen. Intenta con otro archivo.")}finally{f(!1)}}},W=async O=>{const B=O.target.files;if(!(!B||B.length===0)){L(!0),le(0),K(0),N(B.length);try{const Q=Array.from(B);let Y=0;const Ae=10,Oe=[];let Ne=0;const et=async()=>{if(Ne>=Q.length)return;const me=Ne++,Pe=Q[me];try{const Ge=await q0(Pe,me+1,Q.length);Oe[me]=Ge}catch(Ge){console.error(`Error processing image ${Pe.name}:`,Ge),Oe[me]=null}finally{Y++,le(Math.round(Y/Q.length*100)),K(Y),await et()}},$=[];for(let me=0;meme!==null);w(me=>[...me,...he])}catch(Q){console.error("Error processing pages:",Q),alert("Error al procesar algunas imágenes.")}finally{L(!1),le(0),K(0),N(0),O.target.value=""}}},ue=O=>{w(B=>B.filter((Q,Y)=>Y!==O))},Ce=O=>{D(O)},we=(O,B)=>{if(O.preventDefault(),F===null||F===B)return;const Q=[...y],Y=Q[F];Q.splice(F,1),Q.splice(B,0,Y),w(Q),D(B)},He=()=>{D(null)},Et=async()=>{var O,B,Q,Y,Ae;if(!s.title||!s.title.trim()){alert("El título es requerido");return}P(!0);try{let Oe=[...s.selectedCategories],Ne=(r==null?void 0:r.thumbnail_url)||void 0,et=(r==null?void 0:r.cover_url)||void 0;if(J)Ne=J.thumbnail,et=J.original;else if(a)try{k(!0),de(2),j(1),x(0);const $=await yc(a.thumbnail,`${s.title}_thumb`);x(50),j(2);const Z=await yc(a.originalUnmodified,`${s.title}_cover`);x(100),Ne=$.data.url,et=Z.data.url}catch($){console.error("Error uploading cover images:",$),$.message==="API_BURNED"?alert("⚠️ API QUEMADA: La API de ImgBB ha alcanzado su límite. Por favor, usa otra API o intenta más tarde."):$.message==="API_INVALID_KEY"?alert("❌ Clave API inválida: La clave API que estás usando no es válida."):alert("Error al subir la portada. Continuar sin portada.")}finally{k(!1),x(0)}if(Je&&r){const $={title:s.title.trim(),author:((O=s.name)==null?void 0:O.trim())||"",description:((B=s.description)==null?void 0:B.trim())||"",categoryIds:Oe};if(Ne&&($.thumbnail_url=Ne),et&&($.cover_url=et),await EI(r.id,$),y.length>0){const Z=y.some(he=>he.originalBase64!=="");if(y.length>0)try{k(!0);const he=y.filter(je=>je.originalBase64!=="");de(he.length*2),j(0),x(0);const me=he.map(je=>je.webpDisplay),Pe=he.map(je=>je.originalUnmodified),Ge=he.map(je=>je.originalFormat),It=await lu(me,`${s.title}_updated_webp`,(je,ii)=>{j(je),x(Math.round(je/(he.length*2)*100))}),Me=await lu(Pe,`${s.title}_updated_original`,(je,ii)=>{j(he.length+je),x(Math.round((he.length+je)/(he.length*2)*100))}),Lr=It.map(je=>je.data.url),xe=Me.map(je=>je.data.url),Te=y.filter(je=>je.originalBase64===""),yt=Te.map(je=>je.webpDisplay),qt=Te.map(je=>je.original),An=Te.map(je=>je.originalFormat),vt=[...yt,...Lr],Wt=[...qt,...xe],Bn=[...An,...Ge];k(!1),x(0);const Gt=(Q=r.chapters)==null?void 0:Q[0];Gt?await Ji(Dt(We,"chapters",Gt.id),{pages:vt,page_formats:Bn,original_pages:Wt,updated_at:Qe.now()}):await Tx({manga_id:r.id,number:1,title:"Páginas",pages:vt,page_formats:Bn,original_pages:Wt})}catch(he){console.error("Error updating chapter:",he),he.message==="API_BURNED"?alert("⚠️ API QUEMADA: La API de ImgBB ha alcanzado su límite. Por favor, usa otra API o intenta más tarde."):he.message==="API_INVALID_KEY"?alert("❌ Clave API inválida: La clave API que estás usando no es válida."):alert("Error al actualizar las páginas.")}}n(r.id)}else{const $={title:s.title.trim(),author:((Y=s.name)==null?void 0:Y.trim())||"",categoryIds:Oe};(Ae=s.description)!=null&&Ae.trim()&&($.description=s.description.trim()),Ne&&($.thumbnail_url=Ne),et&&($.cover_url=et);const Z=await qD($);if(!Z.id)throw new Error("No se pudo obtener el ID del manga creado");const he=Z.id;if(y.length>0)try{k(!0),de(y.length*2),j(0),x(0);const me=y.map(Te=>Te.webpDisplay),Pe=y.map(Te=>Te.originalUnmodified),Ge=y.map(Te=>Te.originalFormat),It=await lu(me,`${s.title}_ch1_webp`,(Te,yt)=>{j(Te),x(Math.round(Te/(y.length*2)*100))}),Me=await lu(Pe,`${s.title}_ch1_original`,(Te,yt)=>{j(y.length+Te),x(Math.round((y.length+Te)/(y.length*2)*100))}),Lr=It.map(Te=>Te.data.url),xe=Me.map(Te=>Te.data.url);k(!1),x(0),await Tx({manga_id:he,number:1,title:"Páginas",pages:Lr,page_formats:Ge,original_pages:xe})}catch(me){console.error("Error creating chapter:",me),me.message==="API_BURNED"?alert("⚠️ API QUEMADA: La API de ImgBB ha alcanzado su límite. Por favor, usa otra API o intenta más tarde."):me.message==="API_INVALID_KEY"?alert("❌ Clave API inválida: La clave API que estás usando no es válida."):alert("Error al crear el capítulo. Por favor intenta de nuevo.")}n(he)}z()}catch(Oe){console.error("Error creating/updating manga:",Oe);let Ne="Error al guardar el manga. ";if(Oe.message)Ne+=Oe.message;else if(Oe.code)switch(Oe.code){case"permission-denied":Ne+="No tienes permisos para realizar esta operación.";break;case"unavailable":Ne+="El servicio no está disponible. Verifica tu conexión.";break;case"invalid-argument":Ne+="Algunos datos no son válidos. Revisa el formulario.";break;default:Ne+=`Código de error: ${Oe.code}`}else Ne+="Por favor intenta de nuevo.";alert(Ne)}finally{P(!1),k(!1),x(0)}},Ft=O=>{const B=y[O];if(!B.originalBase64)te({thumbnail:B.thumbnail,original:B.original}),u(null);else{const Y={thumbnail:B.thumbnail,original:B.originalUnmodified,webpDisplay:B.originalUnmodified,webpCover:B.originalUnmodified,originalFormat:B.originalFormat,originalBase64:B.originalBase64,originalUnmodified:B.originalUnmodified};u(Y),te(null)}p(B.thumbnail),H(O),ye(!1)},z=()=>{o({title:"",name:"",description:"",selectedCategories:[]}),u(null),te(null),p(null),w([]),x(0),k(!1),j(0),de(0),le(0),K(0),ye(!1),H(null),e()};return t?d.jsxs("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-2xl max-h-[90vh] overflow-y-auto shadow-2xl",children:[d.jsxs("div",{className:"sticky top-0 bg-gradient-to-b from-[#2a2a2a] to-[#1f1f1f] border-b border-gray-700/30 px-8 py-6 flex items-center justify-between z-10",children:[d.jsxs("div",{children:[d.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-lg shadow-lg shadow-[#bb86fc]/30",children:d.jsx(nl,{className:"w-5 h-5 text-white"})}),Je?"Editar Manga":"Crear Manga"]}),d.jsx("p",{className:"text-sm text-gray-400 mt-1.5",children:Je?"Actualiza los detalles de tu obra":"Comparte tu historia con el mundo"})]}),d.jsx("button",{onClick:z,className:"text-gray-500 hover:text-white hover:bg-white/10 transition-all p-2 rounded-lg",children:d.jsx(In,{className:"w-6 h-6"})})]}),d.jsxs("div",{className:"p-8 space-y-5",children:[d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Información Principal"})]}),d.jsxs("div",{className:"space-y-3.5",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Título del Manga ",d.jsx("span",{className:"text-red-400 font-bold",children:"*"})]}),d.jsx("input",{type:"text",name:"title",placeholder:"El nombre de tu obra maestra",value:s.title,onChange:mt,onKeyPress:O=>O.key==="Enter"&&Je&&!S&&Et(),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Autor ",d.jsx("span",{className:"text-gray-500 font-normal",children:"(opcional)"})]}),d.jsx("input",{type:"text",name:"name",placeholder:"Tu nombre o seudónimo",value:s.name,onChange:mt,onKeyPress:O=>O.key==="Enter"&&Je&&!S&&Et(),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Sinopsis ",d.jsx("span",{className:"text-gray-500 font-normal",children:"(opcional)"})]}),d.jsx("textarea",{name:"description",placeholder:"Cuéntanos de qué trata tu manga, qué lo hace especial...",value:s.description,onChange:mt,onKeyDown:O=>O.key==="Enter"&&O.ctrlKey&&Je&&!S&&Et(),rows:3,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70 resize-none"})]})]})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Clasificación"})]}),d.jsx(Ii,{label:"Personajes",type:"character",categories:m,selectedIds:s.selectedCategories,onSelect:O=>{s.selectedCategories.includes(O)||o(B=>({...B,selectedCategories:[...B.selectedCategories,O]}))},onRemove:gt,onCreate:O=>Ht(O,"character"),onDeleteCategory:Ze,colorClass:"text-blue-400",placeholder:"Añadir personaje..."}),d.jsx(Ii,{label:"Series",type:"series",categories:m,selectedIds:s.selectedCategories,onSelect:O=>{s.selectedCategories.includes(O)||o(B=>({...B,selectedCategories:[...B.selectedCategories,O]}))},onRemove:gt,onCreate:O=>Ht(O,"series"),onDeleteCategory:Ze,colorClass:"text-green-400",placeholder:"Añadir serie..."}),d.jsx(Ii,{label:"Géneros",type:"genre",categories:m,selectedIds:s.selectedCategories,onSelect:O=>{s.selectedCategories.includes(O)||o(B=>({...B,selectedCategories:[...B.selectedCategories,O]}))},onRemove:gt,onCreate:O=>Ht(O,"genre"),onDeleteCategory:Ze,colorClass:"text-purple-400",placeholder:"Añadir género..."}),d.jsx(Ii,{label:"Etiquetas",type:"tag",categories:m,selectedIds:s.selectedCategories,onSelect:O=>{s.selectedCategories.includes(O)||o(B=>({...B,selectedCategories:[...B.selectedCategories,O]}))},onRemove:gt,onCreate:O=>Ht(O,"tag"),onDeleteCategory:Ze,colorClass:"text-pink-400",placeholder:"Añadir etiqueta..."})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Portada"}),d.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:"Opcional"})]}),c&&d.jsxs("div",{className:"mb-4",children:[d.jsx("div",{className:"flex items-center justify-between mb-2",children:d.jsx("span",{className:"text-xs font-semibold text-[#bb86fc]",children:"Procesando portada..."})}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out animate-pulse",style:{width:"100%"}})})]}),h&&!c&&d.jsxs("div",{className:"mb-4 relative group max-w-xs mx-auto",children:[d.jsx(Kn,{src:h,alt:"Preview",aspectRatio:"3/4",objectFit:"cover",loading:"eager",className:"rounded-xl border border-gray-600 shadow-2xl shadow-[#bb86fc]/20"}),d.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:d.jsx("button",{onClick:()=>{u(null),p(null),H(null)},className:"bg-red-600/80 hover:bg-red-600 text-white p-2 rounded-lg transition-all shadow-lg",children:d.jsx(wr,{className:"w-4 h-4"})})}),R!==null&&d.jsxs("div",{className:"absolute bottom-2 left-2 bg-green-600/90 text-white text-xs px-2.5 py-1 rounded-lg font-semibold",children:["Página ",R+1]})]}),d.jsxs("div",{className:"flex gap-3 mb-4",children:[d.jsxs("label",{className:"flex-1 border-2 border-dashed border-gray-600/50 rounded-xl p-6 cursor-pointer hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all block group",children:[d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl flex items-center justify-center shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:c?d.jsx(ys,{size:24,borderWidth:2}):d.jsx(co,{className:"w-6 h-6 text-white"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-xs font-semibold text-white mb-0.5",children:c?"Procesando...":"Subir portada"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Archivo"})]})]}),d.jsx("input",{type:"file",accept:"image/*",onChange:Nn,disabled:c,className:"hidden"})]}),y.length>0&&d.jsxs("button",{onClick:()=>ye(!fe),className:"flex-1 border-2 border-dashed border-gray-600/50 rounded-xl p-6 hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all group flex flex-col items-center justify-center gap-2 bg-gradient-to-br from-[#1a1a1a] to-[#0f0f0f]",children:[d.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-[#9966dd] to-[#bb86fc] rounded-xl flex items-center justify-center shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:d.jsx($0,{className:"w-6 h-6 text-white"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-xs font-semibold text-white mb-0.5",children:"Elegir página"}),d.jsxs("p",{className:"text-xs text-gray-400",children:[y.length," disponibles"]})]})]})]})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Páginas del Capítulo"}),d.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:"Opcional"}),d.jsxs("button",{onClick:()=>pe(!0),className:"bg-[#1a1a1a] hover:bg-[#242424] border border-gray-600/50 hover:border-[#bb86fc]/50 text-gray-300 hover:text-[#bb86fc] p-2 rounded-lg transition-all flex items-center gap-1.5 text-xs font-medium",title:"Configurar tamaño de lote de subida",children:[d.jsx(H0,{className:"w-3.5 h-3.5"}),d.jsxs("span",{className:"hidden sm:inline",children:["Subida: ",Fe===0?"Sin límite":`${Fe} por lote`]})]})]}),T&&d.jsxs("div",{className:"mb-5",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("span",{className:"text-xs font-semibold text-[#bb86fc]",children:["Procesadas ",ve," de ",ie]}),d.jsxs("span",{className:"text-xs font-bold text-[#bb86fc]",children:[oe,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${oe}%`}})})]}),y.length>0&&!T&&d.jsxs("div",{className:"mb-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(B0,{className:"w-3.5 h-3.5 text-gray-500"}),d.jsxs("p",{className:"text-xs text-gray-400",children:[y.length," página",y.length!==1?"s":""," • Arrastra para reordenar"]})]}),d.jsx("div",{className:"grid grid-cols-4 gap-2",children:y.map((O,B)=>d.jsxs("div",{draggable:!0,onDragStart:()=>Ce(B),onDragOver:Q=>we(Q,B),onDragEnd:He,style:{animationDelay:`${B*40}ms`},className:`relative group cursor-move opacity-0 animate-[fadeIn_0.7s_ease-out_forwards] ${F===B?"opacity-50 scale-95":"hover:scale-105"} transition-all duration-200`,children:[d.jsxs("div",{className:"relative overflow-hidden w-full aspect-[3/4] rounded-lg border border-gray-600/50 shadow-md bg-black",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"24px",height:"24px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})}),d.jsx("img",{src:O.thumbnail,alt:`Página ${B+1}`,className:"w-full h-full object-cover transition-all duration-700 ease-out transform-gpu group-hover:scale-[1.08] group-hover:shadow-[#bb86fc]/30 opacity-0 scale-95",onLoad:Q=>{var Ae;Q.currentTarget.classList.remove("opacity-0","scale-95"),Q.currentTarget.classList.add("opacity-100","scale-100");const Y=(Ae=Q.currentTarget.parentElement)==null?void 0:Ae.querySelector("div:nth-child(1)");Y&&Y.classList.add("opacity-0","pointer-events-none")}})]}),d.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity rounded-lg flex items-center justify-center gap-2",children:[d.jsx(B0,{className:"w-4 h-4 text-white/70"}),d.jsx("button",{onClick:()=>ue(B),className:"bg-red-600/80 hover:bg-red-600 text-white p-1.5 rounded-lg transition-all shadow-lg",children:d.jsx(wr,{className:"w-3.5 h-3.5"})})]}),d.jsx("div",{className:"absolute top-1.5 left-1.5 bg-black/80 text-white text-xs px-2 py-0.5 rounded-md font-semibold",children:B+1})]},B))})]}),d.jsxs("label",{className:"border-2 border-dashed border-gray-600/50 rounded-xl p-8 text-center cursor-pointer hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all block group",children:[d.jsx("div",{className:"w-14 h-14 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl flex items-center justify-center mx-auto mb-2.5 shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:T?d.jsx(ys,{size:24,borderWidth:2}):d.jsx($0,{className:"w-7 h-7 text-white"})}),d.jsx("p",{className:"text-sm font-semibold text-white mb-1",children:T?`Procesando ${ve}...`:y.length>0?"Agregar más páginas":"Sube tus páginas"}),d.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"Arrastra o selecciona múltiples imágenes"}),d.jsx("p",{className:"text-xs text-gray-500",children:"Se optimizan automáticamente para mejor rendimiento"}),d.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:W,disabled:T,className:"hidden"})]})]}),E&&d.jsxs("div",{className:"mb-6 bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-5 border border-[#bb86fc]/30 shadow-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ys,{size:16,borderWidth:2}),d.jsxs("span",{className:"text-sm font-semibold text-white",children:["Subiendo imagen ",C," de ",A]})]}),d.jsxs("span",{className:"text-sm font-bold text-[#bb86fc]",children:[_,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-3 overflow-hidden border border-[#bb86fc]/40 shadow-inner",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] via-[#9966dd] to-[#bb86fc] h-full transition-all duration-500 ease-out relative overflow-hidden",style:{width:`${_}%`},children:d.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-pulse"})})}),d.jsx("p",{className:"text-xs text-gray-400 mt-2 text-center",children:"Por favor no cierres esta ventana..."})]}),d.jsxs("div",{className:"flex gap-3 pt-6 border-t border-gray-700/50",children:[Je&&i&&d.jsxs("button",{onClick:()=>{window.confirm("¿Estás seguro de que deseas eliminar este manga? Esta acción no se puede deshacer.")&&r&&(i(r.id),e())},className:"bg-red-500/10 border border-red-500/30 hover:bg-red-500/20 text-red-500 px-4 py-3 rounded-lg font-semibold text-sm transition-all flex items-center gap-2 mr-auto",children:[d.jsx(wr,{className:"w-4 h-4"}),"Eliminar"]}),d.jsx("button",{onClick:z,disabled:S||E,className:"flex-1 bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-5 py-3 rounded-lg font-semibold text-sm transition-all shadow-md disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancelar"}),d.jsx("button",{onClick:Et,className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-5 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60 disabled:opacity-50 disabled:cursor-not-allowed active:scale-95",disabled:c||S||E||!s.title.trim(),children:E?"Subiendo imágenes...":S?Je?"Actualizando...":"Creando...":Je?"Guardar Cambios":"Crear Manga"})]})]})]}),fe&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-2xl max-h-[80vh] shadow-2xl overflow-hidden flex flex-col",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between flex-shrink-0",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Selecciona portada"}),d.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Elige una página para usar como portada del manga"})]}),d.jsx("button",{onClick:()=>ye(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10 flex-shrink-0",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"overflow-y-auto flex-1 p-6",children:d.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-3",children:y.map((O,B)=>d.jsxs("button",{onClick:()=>Ft(B),className:`group relative aspect-[3/4] rounded-lg overflow-hidden transition-all duration-300 hover:scale-105 border-2 ${R===B?"border-green-500 shadow-lg shadow-green-500/40":"border-gray-600/50 hover:border-[#bb86fc]/50"}`,children:[d.jsxs("div",{className:"absolute inset-0 overflow-hidden bg-black flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"20px",height:"20px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})}),d.jsx("img",{src:O.thumbnail,alt:`Página ${B+1}`,className:"w-full h-full object-cover transition-all duration-700 ease-out transform-gpu group-hover:scale-[1.10] opacity-0 scale-95",onLoad:Q=>{var Ae;Q.currentTarget.classList.remove("opacity-0","scale-95"),Q.currentTarget.classList.add("opacity-100","scale-100");const Y=(Ae=Q.currentTarget.parentElement)==null?void 0:Ae.querySelector("div:nth-child(1)");Y&&Y.classList.add("opacity-0","pointer-events-none")}})]}),d.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:d.jsx("div",{className:"bg-[#bb86fc]/90 text-white px-3 py-1.5 rounded-lg font-semibold text-sm",children:"Seleccionar"})}),d.jsx("div",{className:"absolute bottom-2 left-2 bg-black/80 text-white text-xs px-2 py-1 rounded-md font-semibold",children:B+1}),R===B&&d.jsxs("div",{className:"absolute top-2 right-2 bg-green-600/90 text-white px-2.5 py-1.5 rounded-lg flex items-center gap-1.5 font-semibold text-xs",children:[d.jsx("div",{className:"w-2 h-2 bg-white rounded-full"}),"Seleccionado"]})]},B))})}),d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f]/80 to-[#1a1a1a]/80 border-t border-gray-700/30 px-6 py-4 flex items-center justify-end gap-3 flex-shrink-0",children:[d.jsx("button",{onClick:()=>ye(!1),className:"bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-4 py-2 rounded-lg font-semibold text-sm transition-all",children:"Cancelar"}),d.jsx("button",{onClick:()=>ye(!1),className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-4 py-2 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Confirmar"})]})]})}),Ie&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-md shadow-2xl",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-lg shadow-lg shadow-[#bb86fc]/30",children:d.jsx(H0,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Configurar Subida"}),d.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Tamaño de lote de imágenes"})]})]}),d.jsx("button",{onClick:()=>pe(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border border-gray-700/40 rounded-lg p-4 mb-4",children:[d.jsx("h3",{className:"text-xs font-semibold text-gray-300 mb-2",children:"Opciones disponibles:"}),d.jsxs("ul",{className:"text-xs text-gray-400 space-y-1.5",children:[d.jsx("li",{children:"• 1 por lote: Más lento pero más estable"}),d.jsx("li",{children:"• 10 por lote: Balance entre velocidad y estabilidad (predeterminado)"}),d.jsx("li",{children:"• 50 por lote: Más rápido para muchas imágenes"}),d.jsx("li",{children:"• Sin límite: Sube todas las imágenes simultáneamente"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx("button",{onClick:()=>{ut(1),au(1)},className:`p-4 rounded-lg border-2 transition-all ${Fe===1?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"1"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{ut(10),au(10)},className:`p-4 rounded-lg border-2 transition-all ${Fe===10?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"10"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{ut(50),au(50)},className:`p-4 rounded-lg border-2 transition-all ${Fe===50?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"50"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{ut(0),au(999999)},className:`p-4 rounded-lg border-2 transition-all ${Fe===0||Fe>=999999?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"∞"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin límite"})]})})]}),d.jsx("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-3",children:d.jsxs("p",{className:"text-green-400 text-xs font-semibold",children:["Configuración guardada: ",Fe===0||Fe>=999999?"Sin límite":`${Fe} imagen${Fe!==1?"es":""} por lote`]})}),d.jsx("button",{onClick:()=>pe(!1),className:"w-full bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Cerrar"})]})]})})]}):null}const II="settings",SI="announcement";async function Nx(t,e){const n=Dt(We,II,SI),r=new Date;let i=null;e&&(i=new Date(r.getTime()+e).toISOString());const s={text:t,updatedAt:r.toISOString(),expiresAt:i};await ME(n,s)}function Cj(t){const e=Dt(We,II,SI);return bg(e,n=>{n.exists()?t(n.data()):t(null)})}function Nj({isOpen:t,onClose:e,isAdmin:n,isCategoryPlusEnabled:r,onCategoryPlusChange:i}){const[s,o]=V.useState(""),[a,u]=V.useState(!1),[c,f]=V.useState(""),[h,p]=V.useState(24),[m,b]=V.useState("hours"),[S,P]=V.useState(!1),[y,w]=V.useState(!1);V.useEffect(()=>{if(t){const x=q1();x?(o(x),u(!0)):(o(""),u(!1))}},[t]);const T=()=>{if(!s.trim()){Nt.error("Por favor ingresa una API válida");return}y2(s.trim()),u(!0),Nt.success("API guardada exitosamente.")},L=()=>{v2(),o(""),u(!1),w(!1),Nt.success("API eliminada.")},F=()=>{w(!0)},D=async()=>{if(!c.trim()){Nt.error("El texto del anuncio no puede estar vacío");return}let x=0;m==="seconds"&&(x=h*1e3),m==="minutes"&&(x=h*60*1e3),m==="hours"&&(x=h*60*60*1e3),m==="days"&&(x=h*24*60*60*1e3);try{await Nx(c,x),Nt.success("Anuncio publicado exitosamente"),f(""),e()}catch(E){console.error(E),Nt.error("Error al publicar el anuncio")}},_=async()=>{try{await Nx("",null),f(""),P(!1),Nt.success("Anuncio eliminado.")}catch(x){console.error(x),Nt.error("Error al eliminar")}};return t?d.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-lg shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-[#bb86fc]/10 rounded-lg text-[#bb86fc]",children:d.jsx($1,{className:"w-5 h-5"})}),d.jsx("h2",{className:"text-xl font-bold text-white",children:"Ajustes de Administrador"})]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-8 overflow-y-auto custom-scrollbar",children:[d.jsx("section",{className:"space-y-4",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`p-2 rounded-lg ${r?"bg-purple-500/10 text-purple-400":"bg-gray-800 text-gray-400"}`,children:d.jsx(U1,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-white",children:"Categorías Plus"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Habilitar selección múltiple y edición masiva"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",className:"sr-only peer",checked:r,onChange:x=>i(x.target.checked)}),d.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-purple-300 dark:peer-focus:ring-purple-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[#bb86fc]"})]})]})}),d.jsxs("section",{className:"space-y-4 pt-4 border-t border-gray-800",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-red-500/10 rounded-lg text-red-500",children:d.jsx(Hf,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Gestión de Vistas"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Restablecer contadores de visualización"})]})]}),d.jsx("button",{onClick:async()=>{if(window.confirm("¿Seguro que quieres reiniciar las vistas de TODOS los mangas a 0? Esta acción no se puede deshacer."))try{await WD(),Nt.success("Vistas reiniciadas correctamente.")}catch(x){console.error(x),Nt.error("Error al reiniciar vistas.")}},className:"w-full bg-red-500/10 hover:bg-red-500/20 text-red-500 py-2.5 rounded-lg font-semibold text-sm transition-all border border-red-500/20 hover:border-red-500/40",children:"Reiniciar Vistas a 0"})]}),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-px bg-gray-800"}),d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-purple-500/10 rounded-lg text-purple-400",children:d.jsx(z1,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Publicar Anuncio"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Visible para todos los usuarios"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("textarea",{value:c,onChange:x=>f(x.target.value),placeholder:"Escribe el mensaje del anuncio...",className:"w-full bg-[#1a1a1a] border border-gray-700 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-[#bb86fc] min-h-[100px] resize-none"}),d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("div",{className:"flex-1 bg-[#1a1a1a] border border-gray-700 rounded-lg px-3 py-2 flex items-center gap-2",children:[d.jsx(a2,{className:"w-4 h-4 text-gray-400"}),d.jsx("input",{type:"number",min:"1",value:h,onChange:x=>p(Number(x.target.value)),className:"bg-transparent text-white text-sm w-full focus:outline-none"})]}),d.jsxs("select",{value:m,onChange:x=>b(x.target.value),className:"bg-[#1a1a1a] border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-[#bb86fc]",children:[d.jsx("option",{value:"seconds",children:"Segundos"}),d.jsx("option",{value:"minutes",children:"Minutos"}),d.jsx("option",{value:"hours",children:"Horas"}),d.jsx("option",{value:"days",children:"Días"})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>P(!0),className:"px-4 py-2.5 rounded-lg font-semibold text-sm bg-red-500/10 text-red-500 border border-red-500/20 hover:bg-red-500/20 transition-colors",title:"Eliminar anuncio",children:d.jsx(wr,{className:"w-5 h-5"})}),d.jsx("button",{onClick:D,className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white py-2.5 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/20",children:"Publicar Anuncio"})]})]})]})]}),d.jsx("div",{className:"h-px bg-gray-800"}),d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg text-blue-400",children:d.jsx(l2,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Configuración de API"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Gestiona tu clave personal de ImgBB"})]})]}),a&&d.jsx("div",{className:"bg-green-500/10 border border-green-500/20 rounded-lg p-3",children:d.jsxs("p",{className:"text-green-400 text-xs font-medium flex items-center gap-2",children:[d.jsx(d2,{className:"w-3 h-3"}),"API personal activa"]})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("input",{type:"text",placeholder:"Pega tu API Key de ImgBB aquí...",value:s,onChange:x=>o(x.target.value),className:"w-full bg-[#1a1a1a] border border-gray-700 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-[#bb86fc] focus:ring-1 focus:ring-[#bb86fc] transition-all font-mono"}),d.jsxs("p",{className:"text-xs text-gray-500",children:["Obtén tu API key gratuitamente en ",d.jsx("a",{href:"https://api.imgbb.com/",target:"_blank",rel:"noopener noreferrer",className:"text-[#bb86fc] hover:underline",children:"api.imgbb.com"})]})]}),d.jsxs("div",{className:"flex gap-3",children:[a&&d.jsxs("button",{onClick:F,className:"flex-1 bg-red-500/10 border border-red-500/30 hover:bg-red-500/20 text-red-500 px-4 py-2.5 rounded-lg font-medium text-sm transition-colors flex items-center justify-center gap-2",children:[d.jsx(wr,{className:"w-4 h-4"}),"Eliminar"]}),d.jsxs("button",{onClick:T,disabled:!s.trim(),className:"flex-1 bg-[#1a1a1a] border border-gray-700 hover:border-[#bb86fc] hover:text-[#bb86fc] disabled:opacity-50 disabled:hover:border-gray-700 disabled:hover:text-gray-500 text-gray-300 px-4 py-2.5 rounded-lg font-medium text-sm transition-all flex items-center justify-center gap-2 group",children:[d.jsx(Cm,{className:"w-4 h-4 group-hover:scale-110 transition-transform"}),"Guardar Cambios"]})]})]})]}),S&&d.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-6 animate-in fade-in duration-200",children:d.jsx("div",{className:"bg-[#1a1a1a] border border-gray-700 w-full max-w-sm rounded-xl shadow-2xl p-6 transform scale-100 animate-in zoom-in-95 duration-200",children:d.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[d.jsx("div",{className:"p-3 bg-red-500/10 rounded-full text-red-500",children:d.jsx(wr,{className:"w-8 h-8"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"¿Eliminar anuncio?"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Esta acción eliminará el anuncio actual inmediatamente. No se puede deshacer."})]}),d.jsxs("div",{className:"flex gap-3 w-full mt-2",children:[d.jsx("button",{onClick:()=>P(!1),className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:bg-gray-800 transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:_,className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold bg-red-500 hover:bg-red-600 text-white transition-colors shadow-lg shadow-red-500/20",children:"Eliminar"})]})]})})}),y&&d.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-6 animate-in fade-in duration-200",children:d.jsx("div",{className:"bg-[#1a1a1a] border border-gray-700 w-full max-w-sm rounded-xl shadow-2xl p-6 transform scale-100 animate-in zoom-in-95 duration-200",children:d.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[d.jsx("div",{className:"p-3 bg-red-500/10 rounded-full text-red-500",children:d.jsx(wr,{className:"w-8 h-8"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"¿Eliminar API personal?"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Perderás el acceso a tus subidas privadas hasta que ingreses una clave válida."})]}),d.jsxs("div",{className:"flex gap-3 w-full mt-2",children:[d.jsx("button",{onClick:()=>w(!1),className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:bg-gray-800 transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:L,className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold bg-red-500 hover:bg-red-600 text-white transition-colors shadow-lg shadow-red-500/20",children:"Eliminar"})]})]})})})]})}):null}function Aj({isAdmin:t}){const[e,n]=V.useState(""),[r,i]=V.useState(null),[s,o]=V.useState(""),[a,u]=V.useState(!0);return V.useEffect(()=>{const c=Cj(f=>{f?(n(f.text),i(f.expiresAt)):(n(""),i(null)),u(!1)});return()=>c()},[]),V.useEffect(()=>{if(!r){o("");return}const c=setInterval(()=>{const f=new Date().getTime(),p=new Date(r).getTime()-f;if(p<=0)n(""),i(null),clearInterval(c);else{const m=Math.floor(p/864e5),b=Math.floor(p%(1e3*60*60*24)/(1e3*60*60)),S=Math.floor(p%(1e3*60*60)/(1e3*60)),P=Math.floor(p%(1e3*60)/1e3);let y="";m>0&&(y+=`${m}d `),y+=`${b.toString().padStart(2,"0")}h ${S.toString().padStart(2,"0")}m ${P.toString().padStart(2,"0")}s`,o(y)}},1e3);return()=>clearInterval(c)},[r]),!e&&!a||!e?null:d.jsx("div",{className:"w-full max-w-[1800px] mx-auto px-4 sm:px-6 md:px-12 mt-6 mb-8 animate-in fade-in slide-in-from-top-4 duration-500 flex justify-center",children:d.jsxs("div",{className:"bg-gradient-to-r from-[#bb86fc]/20 to-[#121212] border border-[#bb86fc]/30 rounded-xl p-6 flex flex-col items-center gap-4 shadow-lg shadow-[#bb86fc]/10 relative group backdrop-blur-sm max-w-2xl w-full text-center",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2.5 bg-[#bb86fc]/20 rounded-lg animate-pulse",children:d.jsx(z1,{className:"w-6 h-6 text-[#bb86fc]"})}),d.jsxs("h3",{className:"text-sm font-bold text-[#bb86fc] uppercase tracking-wider flex items-center gap-2",children:["Información Importante",d.jsx("span",{className:"w-2 h-2 rounded-full bg-[#bb86fc] animate-ping"})]})]}),d.jsx("div",{className:"text-base text-gray-200 leading-relaxed whitespace-pre-wrap font-medium max-w-lg",children:e}),s&&d.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-gray-400 bg-black/30 px-3 py-1.5 rounded-full border border-gray-800",children:[d.jsx(h2,{className:"w-3.5 h-3.5"}),d.jsxs("span",{children:["Expira en: ",s]})]})]})})}const TI=()=>"",Pj=t=>{if(!t)return;if(t.startsWith("blob:")||t.startsWith("data:"))return t;const e=TI(),n=new URLSearchParams({url:t,width:"600",quality:"85",format:"webp"});return`${e}/api/image-proxy?${n.toString()}`},Rj=(t,e)=>{if(!t)return"";if(t.startsWith("blob:")||t.startsWith("data:"))return t;const n=TI(),r=new URLSearchParams({url:t});return`${n}/api/image-proxy?${r.toString()}`};function kI({id:t,title:e,author:n,pageCount:r,thumbnail:i,manga:s,onSelect:o,onEdit:a,onDelete:u,isCategoryPlusEnabled:c,isSelected:f,onToggleSelect:h}){const[p,m]=V.useState(!1),b=i?Pj(i):void 0,S=w=>{w.stopPropagation(),m(!0)},P=w=>{w.stopPropagation(),u==null||u(t),m(!1)},y=w=>{w.stopPropagation(),s&&(a==null||a(s))};return d.jsxs("div",{className:"group cursor-pointer flex flex-col w-full max-w-xs",children:[d.jsxs("div",{onClick:()=>{c&&h?h():(GD(t),o==null||o(t))},className:`relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02] aspect-[2/3] ${f?"ring-4 ring-[#bb86fc]":""}`,children:[b?d.jsxs(d.Fragment,{children:[d.jsx(Kn,{src:b,alt:e,aspectRatio:"2/3",objectFit:"cover",loading:"lazy",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-gradient-to-br from-gray-800 to-gray-900 rounded-lg group-hover:text-white/60",children:d.jsx(nl,{className:"w-12 h-12"})}),d.jsxs("div",{className:"absolute bottom-2 left-2 bg-black/70 text-white text-xs px-2 py-1 rounded-md font-semibold opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[r," paginas"]}),c&&d.jsx("div",{className:`absolute top-2 left-2 w-6 h-6 rounded-md border-2 flex items-center justify-center transition-all ${f?"bg-[#bb86fc] border-[#bb86fc]":"bg-black/50 border-white/50 hover:border-white"}`,children:f&&d.jsx(wl,{className:"w-4 h-4 text-white"})}),!c&&d.jsxs("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex gap-1",children:[s&&a&&d.jsx("button",{onClick:y,className:"bg-black/60 hover:bg-purple-600 text-white p-1.5 rounded-full transition-colors backdrop-blur-sm",title:"Editar manga",children:d.jsx(B1,{className:"w-3 h-3"})}),u&&d.jsx("button",{onClick:S,className:"bg-black/60 hover:bg-red-600 text-white p-1.5 rounded-full transition-colors backdrop-blur-sm",title:"Eliminar manga",children:d.jsx(wr,{className:"w-3 h-3"})})]}),p&&d.jsxs("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex flex-col items-center justify-center gap-3 rounded-lg z-20 animate-in fade-in duration-200",children:[d.jsx("p",{className:"text-white text-sm font-semibold text-center px-3",children:"Eliminar manga?"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:w=>{w.stopPropagation(),m(!1)},className:"bg-gray-600 hover:bg-gray-700 text-white px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200 transform hover:scale-105 active:scale-95",children:"Cancelar"}),d.jsx("button",{onClick:P,className:"bg-red-600 hover:bg-red-700 text-white px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200 transform hover:scale-105 active:scale-95",children:"Eliminar"})]})]})]}),d.jsxs("div",{className:"mt-1 sm:mt-2 flex flex-col gap-0.5 text-center mb-2",children:[d.jsx("h3",{onClick:()=>o==null?void 0:o(t),className:"font-semibold text-xs sm:text-sm text-white line-clamp-2 cursor-pointer text-center group-hover:text-purple-400 transition-colors duration-300 ease-out",children:e}),n&&n.trim()!==""&&n.toLowerCase()!=="anónimo"&&n.toLowerCase()!=="anonimo"&&d.jsx("p",{className:"text-xs text-gray-400 text-center group-hover:text-gray-300 transition-colors duration-300 ease-out",children:n})]})]})}function Dj({id:t,onBack:e,onNavigateToManga:n,onMangaLoaded:r,onSelectCategory:i,onSelectAuthor:s,isAdmin:o=!1}){var Y,Ae,Oe,Ne,et;const[a,u]=V.useState(null),[c,f]=V.useState(!0),[h,p]=V.useState(!1),[m,b]=V.useState(0),[S,P]=V.useState(!1),[y,w]=V.useState(!1),[T,L]=V.useState(!1),[F,D]=V.useState(0),[_,x]=V.useState(!1),[E,k]=V.useState({name:"",url:""}),[C,j]=V.useState([]),[A,de]=V.useState("portrait"),[oe,le]=V.useState("vertical"),[ve,K]=V.useState(!1),[ie,N]=V.useState(0),[fe,ye]=V.useState([]),[R,H]=V.useState(!1),[J,te]=V.useState(""),[Ie,pe]=V.useState([]),[Fe,ut]=V.useState(!1),[Je,bt]=V.useState(!1),[mt,gt]=V.useState(1),[Ht,Vt]=V.useState(1),Ze=6,Nn=()=>Vt($=>Math.min($+.25,3)),W=()=>Vt($=>Math.max($-.25,.5)),ue=()=>Vt(1);V.useEffect(()=>{Ft();const $=HD(t,he=>{he&&(u(()=>he),f(!1))});Ce(),te("");const Z=localStorage.getItem("manga-view-mode");return(Z==="vertical"||Z==="gallery"||Z==="grid")&&le(Z),()=>$()},[t]);async function Ce(){try{ut(!0);const $=await jd();pe($)}catch($){console.error("Error loading all mangas:",$)}finally{ut(!1)}}V.useEffect(()=>{function $(Z){const he=Z.target;S&&!he.closest(".download-menu-container")&&P(!1),y&&!he.closest(".pdf-menu-container")&&w(!1)}return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[S,y]);const we=async()=>{if(E.name.trim()&&E.url.trim()&&a)try{await QD(a.id,E),j([...C,E]),k({name:"",url:""}),x(!1)}catch($){console.error("Error al guardar el enlace:",$),alert("Error al guardar el enlace")}},He=async $=>{if(a)try{await YD(a.id,$),j(C.filter((Z,he)=>he!==$))}catch(Z){console.error("Error al eliminar el enlace:",Z),alert("Error al eliminar el enlace")}},Et=$=>{le($),localStorage.setItem("manga-view-mode",$)};async function Ft(){try{f(!0);const $=await xI(t);if($){if(u($),j($.external_links||[]),$.cover_url)try{const Z=await g2($.cover_url);de(Z)}catch(Z){console.warn("Failed to detect image orientation:",Z),de("portrait")}z($)}}catch($){console.error("Error loading manga:",$)}finally{}}async function z($){var Z;try{H(!0);const he=((Z=$.categories)==null?void 0:Z.map(Pe=>Pe.id))||[],me=await XD($.id,he,$.title);ye(me),gt(1)}catch(he){console.error("Error loading recommendations:",he)}finally{H(!1)}}async function O($){const Z=(a==null?void 0:a.id)||t;if(!Z){alert("Error: ID no encontrado.");return}const he=Z;console.log(`🚀 [CLIENTE] Suscribiendo a progreso: ${he}`);const me=new EventSource(`/api/download/progress/${he}`);me.onmessage=Pe=>{const Ge=JSON.parse(Pe.data);b(Ge.progress),Ge.progress>=100&&me.close()};try{console.log("🚀 [CLIENTE] Iniciando descarga para ID:",Z),p(!0),P(!1),b(0);const Pe=await fetch("/api/download/zip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mangaId:Z,mangaTitle:(a==null?void 0:a.title)||"Descarga",format:$,jobId:he})});if(!Pe.ok)throw new Error("Error en el servidor");const Ge=await Pe.blob(),It=window.URL.createObjectURL(Ge),Me=document.createElement("a");Me.href=It,Me.download=`${(a==null?void 0:a.title)||"manga"}.zip`,document.body.appendChild(Me),Me.click(),Me.remove(),window.URL.revokeObjectURL(It),console.log("✅ [CLIENTE] Descarga disparada con éxito")}catch(Pe){console.error("❌ Error en la descarga:",Pe),alert("Hubo un fallo en la matriz de descarga.")}finally{p(!1),me.close()}}async function B($){const Z=(a==null?void 0:a.id)||t;if(!Z){alert("Error: ID no encontrado.");return}const he=Z;console.log(`🚀 [CLIENTE] Suscribiendo a progreso PDF: ${he}`);const me=new EventSource(`/api/download/progress/${he}`);me.onmessage=Pe=>{const Ge=JSON.parse(Pe.data);Ge.progress&&D(Ge.progress),Ge.progress>=100&&me.close()};try{console.log("🚀 [CLIENTE] Iniciando PDF para ID:",Z),L(!0),D(0),w(!1);const Pe=await fetch("/api/download/pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mangaId:Z,mangaTitle:(a==null?void 0:a.title)||"Descarga",format:$,jobId:he})});if(!Pe.ok)throw new Error("Error en el servidor al generar PDF");const Ge=await Pe.blob(),It=window.URL.createObjectURL(Ge),Me=document.createElement("a");Me.href=It,Me.download=`${(a==null?void 0:a.title)||"manga"}.pdf`,document.body.appendChild(Me),Me.click(),Me.remove(),window.URL.revokeObjectURL(It),console.log("✅ [CLIENTE] PDF descargado con éxito")}catch(Pe){console.error("Error initiating PDF generation:",Pe),alert("Error al generar PDF (puede que el archivo sea muy grande o Python falló).")}finally{L(!1),me.close()}}if(c)return d.jsxs("div",{className:"h-screen bg-[#121212] flex flex-col items-center justify-center gap-4",children:[d.jsx(ys,{size:40,borderWidth:2}),d.jsx("div",{className:"text-gray-400 text-sm",children:"Cargando..."})]});if(!a)return d.jsx("div",{className:"h-screen bg-[#121212] flex items-center justify-center",children:d.jsx("div",{className:"text-gray-400 text-lg",children:"Manga no encontrado"})});const Q=J.trim()?Ie.filter($=>{var Ge;if(!$.id||!$.title||$.id===a.id)return!1;const Z=J.toLowerCase(),he=$.title.toLowerCase().includes(Z),me=$.author?$.author.toLowerCase().includes(Z):!1,Pe=((Ge=$.categories)==null?void 0:Ge.some(It=>{var Me;return(Me=It==null?void 0:It.name)==null?void 0:Me.toLowerCase().includes(Z)}))||!1;return he||me||Pe}):[];return d.jsxs("div",{className:"h-screen flex flex-col bg-[#121212] overflow-hidden",children:[d.jsx("header",{className:"border-b border-gray-800 z-40 bg-[#121212] flex-shrink-0",children:d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-3 sm:py-4 flex items-center gap-3 sm:gap-4",children:[d.jsx("button",{onClick:e,className:"p-2 hover:bg-[#333] rounded-lg transition-colors text-gray-300 hover:text-white flex-shrink-0",children:d.jsx(So,{className:"w-5 h-5"})}),d.jsx("h1",{className:"text-base sm:text-lg font-bold text-white truncate flex-shrink-0",children:a.title}),d.jsx("div",{className:"flex-1 max-w-md ml-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx(gc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),d.jsx("input",{type:"text",placeholder:"Buscar comics…",value:J,onChange:$=>te($.target.value),className:"w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-3 py-2 text-sm placeholder-gray-400 focus:ring-2 focus:ring-[#bb86fc] focus:outline-none transition-all border border-gray-700/50 focus:border-[#bb86fc]"})]})})]})}),d.jsxs("main",{className:"flex-1 overflow-y-auto bg-[#121212]",children:[d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-4 sm:py-8",children:[!J.trim()&&d.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-6",children:[d.jsx("div",{className:"flex-shrink-0 mx-auto sm:mx-0",children:d.jsx("div",{className:"group w-56 sm:w-64",children:d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",children:a.cover_url?d.jsxs(d.Fragment,{children:[d.jsx(Kn,{src:a.cover_url,alt:a.title,aspectRatio:"2/3",objectFit:"cover",loading:"eager",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-black",children:d.jsx(z0,{className:"w-16 h-16"})})})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h2",{className:"text-2xl sm:text-4xl font-bold text-white mb-3 sm:mb-4",children:a.title}),d.jsx("div",{className:"mb-4",children:d.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.author&&a.author.toLowerCase()!=="anónimo"&&a.author.toLowerCase()!=="anonimo"&&d.jsxs(d.Fragment,{children:[d.jsx(Nm,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsx("button",{onClick:()=>s==null?void 0:s(a.author),className:"text-sm hover:text-[#bb86fc] hover:underline transition-colors",children:a.author}),d.jsx("div",{className:"w-1 h-1 bg-gray-600 rounded-full mx-2"})]}),d.jsx(Hf,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsxs("span",{className:"text-sm",children:[((Y=a.views)==null?void 0:Y.toLocaleString())||0," vistas"]})]})}),d.jsxs("div",{className:"mb-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Categorías"}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:(Ae=a.categories)==null?void 0:Ae.sort(($,Z)=>{const he={series:1,character:2,genre:3,tag:4,other:5},me=$.type||"genre",Pe=Z.type||"genre";return(he[me]||5)-(he[Pe]||5)}).map($=>{let Z="bg-[#bb86fc]/20 text-[#bb86fc] border-[#bb86fc]/40";return $.type==="character"?Z="bg-blue-500/20 text-blue-300 border-blue-500/30":$.type==="series"?Z="bg-green-500/20 text-green-300 border-green-500/30":$.type==="tag"&&(Z="bg-pink-500/20 text-pink-300 border-pink-500/30"),d.jsx("button",{onClick:()=>i==null?void 0:i($.name),className:`px-3 py-1.5 text-xs rounded-full border ${Z} hover:opacity-80 transition-opacity cursor-pointer`,children:$.name},$.id)})})]}),a.description&&a.description.trim()!==""&&d.jsxs("div",{className:"mb-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Sinopsis"}),d.jsx("p",{className:"text-sm text-gray-400 leading-relaxed whitespace-pre-wrap",children:a.description})]}),d.jsx("div",{className:"flex flex-col gap-3 sm:gap-4",children:a.chapters&&a.chapters.length>0&&a.chapters[0].pages&&a.chapters[0].pages.length>0&&d.jsxs(d.Fragment,{children:[h&&d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs sm:text-sm font-semibold text-[#bb86fc]",children:"Descargando ZIP"}),d.jsxs("span",{className:"text-xs sm:text-sm font-bold text-[#bb86fc]",children:[m,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${m}%`}})})]}),T&&d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs sm:text-sm font-semibold text-[#bb86fc]",children:"Generando PDF"}),d.jsxs("span",{className:"text-xs sm:text-sm font-bold text-[#bb86fc]",children:[F,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${F}%`}})})]}),d.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[d.jsxs("div",{className:"relative download-menu-container",children:[d.jsxs("button",{onClick:()=>P(!S),disabled:h,className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx(ua,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:h?`Descargando (${m}%)`:"ZIP"}),d.jsx("span",{className:"sm:hidden",children:"ZIP"})]}),S&&!h&&d.jsxs("div",{className:"absolute top-full mt-2 left-0 bg-[#1f1f1f] border border-gray-700/60 rounded-lg shadow-2xl shadow-black/50 overflow-hidden z-50 min-w-[200px]",children:[d.jsxs("button",{onClick:()=>O("original"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"Original"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin cambios"})]})]}),d.jsxs("button",{onClick:()=>O("webp"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"WebP"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Optimizado"})]})]}),d.jsxs("button",{onClick:()=>O("png"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"PNG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin pérdida"})]})]}),d.jsxs("button",{onClick:()=>O("jpg"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"JPG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Comprimido"})]})]})]})]}),d.jsxs("div",{className:"relative pdf-menu-container",children:[d.jsxs("button",{onClick:()=>w(!y),disabled:T,className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx(ca,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:T?`Generando (${F}%)`:"PDF"}),d.jsx("span",{className:"sm:hidden",children:"PDF"})]}),y&&!T&&d.jsxs("div",{className:"absolute top-full mt-2 left-0 bg-[#1f1f1f] border border-gray-700/60 rounded-lg shadow-2xl shadow-black/50 overflow-hidden z-50 min-w-[200px]",children:[d.jsxs("button",{onClick:()=>B("original"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"Original"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin cambios"})]})]}),d.jsxs("button",{onClick:()=>B("webp"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"WebP"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Optimizado"})]})]}),d.jsxs("button",{onClick:()=>B("png"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"PNG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin pérdida"})]})]}),d.jsxs("button",{onClick:()=>B("jpg"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"JPG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Comprimido"})]})]})]})]}),d.jsxs("button",{onClick:()=>{a!=null&&a.id&&(window.location.hash=`manga/${a.id}/hd`)},className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200",children:[d.jsx(Hf,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:"Ver HD"}),d.jsx("span",{className:"sm:hidden",children:"HD"})]}),d.jsxs("button",{onClick:async()=>{try{await navigator.clipboard.writeText(a.id),bt(!0),setTimeout(()=>bt(!1),2e3),window.open("https://t.me/waifuofbrodybot","_blank")}catch($){console.error("Failed to copy:",$)}},className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200",children:[Je?d.jsx(wl,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}):d.jsx(c2,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:Je?"ID Copiado":"Bot Telegram"}),d.jsx("span",{className:"sm:hidden",children:Je?"Copiado":"Bot"})]}),C.map(($,Z)=>d.jsxs("a",{href:$.url,target:"_blank",rel:"noopener noreferrer",className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1.5 font-semibold text-xs sm:text-sm transition-all duration-200 group",children:[d.jsx(u2,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"truncate max-w-[150px]",children:$.name}),o&&d.jsx("button",{onClick:he=>{he.preventDefault(),he.stopPropagation(),He(Z)},className:"opacity-0 group-hover:opacity-100 hover:text-red-400 transition-all flex-shrink-0",children:d.jsx(In,{className:"w-3 h-3 sm:w-4 sm:h-4"})})]},Z)),o&&d.jsx("button",{onClick:()=>x(!0),className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] p-1.5 sm:p-2 rounded-lg transition-all duration-200 flex items-center justify-center",title:"Añadir enlace externo",children:d.jsx(co,{className:"w-4 h-4 sm:w-5 sm:h-5"})})]})]})})]})]}),J.trim()?d.jsxs("div",{className:"mt-2",children:[d.jsxs("h3",{className:"text-lg font-semibold text-white mb-4",children:["Resultados de búsqueda",Q.length>0&&d.jsxs("span",{className:"text-sm text-gray-400 ml-2",children:["(",Q.length," ",Q.length===1?"resultado":"resultados",")"]})]}),Fe?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(ys,{size:40,borderWidth:2})}):Q.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[d.jsx(gc,{className:"w-12 h-12 text-gray-600 mb-3"}),d.jsxs("p",{className:"text-gray-400 text-sm",children:['No se encontraron comics que coincidan con "',J,'"']})]}):d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3",children:Q.map($=>{var he,me;if(!$.id||!$.title)return null;(he=$.chapters)!=null&&he.length;const Z=((me=$.chapters)==null?void 0:me.reduce((Pe,Ge)=>{var It;return Pe+(((It=Ge.pages)==null?void 0:It.length)||0)},0))||0;return d.jsx(kI,{id:$.id,title:$.title,author:$.author||"Desconocido",pageCount:Z,thumbnail:$.cover_url||$.thumbnail_url||void 0,manga:$,onSelect:Pe=>{n&&(window.scrollTo({top:0,behavior:"smooth"}),n(Pe))}},$.id)})})]}):a.chapters&&a.chapters.length>0&&a.chapters[0].pages&&a.chapters[0].pages.length>0&&d.jsxs("div",{className:"mt-6 sm:mt-8 border-t border-gray-800 pt-6 sm:pt-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4 sm:mb-6",children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:"Páginas"}),d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsxs("button",{onClick:()=>Et("vertical"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${oe==="vertical"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista vertical",children:[d.jsx(Gf,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Vertical"})]}),d.jsxs("button",{onClick:()=>Et("gallery"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${oe==="gallery"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista galería",children:[d.jsx(qf,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Galería"})]}),d.jsxs("button",{onClick:()=>Et("grid"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${oe==="grid"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista cuadrícula",children:[d.jsx(Wf,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Cuadrícula"})]}),oe==="vertical"&&d.jsxs("div",{className:"flex items-center gap-1 ml-2 border-l border-gray-700 pl-2",children:[d.jsx("button",{onClick:W,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Reducir",children:d.jsx(Pm,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-xs text-gray-300 w-8 text-center hidden sm:inline-block",children:[Math.round(Ht*100),"%"]}),d.jsx("button",{onClick:Nn,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Aumentar",children:d.jsx(Am,{className:"w-4 h-4"})}),d.jsx("button",{onClick:ue,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Restablecer",children:d.jsx(km,{className:"w-3 h-3"})})]})]})]}),d.jsx("div",{className:`bg-[#121212] rounded-lg p-2 sm:p-4 transition-all duration-150 ease-out ${oe==="vertical"?"flex flex-col items-center gap-4":oe==="gallery"?"masonry-container":"grid grid-cols-3 md:grid-cols-5 gap-2"}`,children:oe==="gallery"?a.chapters[0].pages.map(($,Z)=>({pageUrl:$,index:Z})).map(({pageUrl:$,index:Z})=>d.jsx("div",{className:"masonry-item group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",onClick:()=>{N(Z),K(!0)},children:d.jsx(Kn,{src:$,alt:`Página ${Z+1}`,aspectRatio:"auto",objectFit:"contain",loading:Z>2?"lazy":"eager",className:"rounded-lg",imgClassName:"group-hover:scale-110"})},Z)):a.chapters[0].pages.map(($,Z)=>({pageUrl:$,index:Z})).map(({pageUrl:$,index:Z})=>d.jsx("div",{className:oe==="vertical"?"relative transition-all duration-200 mx-auto":"group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",style:oe==="vertical"?{width:`${Math.min(100*Ht,100)}%`,maxWidth:Ht>1?"none":void 0}:void 0,onClick:()=>{oe==="grid"&&(N(Z),K(!0))},children:d.jsx(Kn,{src:$,alt:`Página ${Z+1}`,aspectRatio:oe==="vertical"?"auto":"1/1",objectFit:oe==="vertical"?"contain":"cover",loading:Z>2?"lazy":"eager",className:oe==="vertical"?"rounded-lg shadow-2xl w-full":"rounded-lg",imgClassName:oe==="vertical"?"w-full":"group-hover:scale-110"})},Z))})]}),!J.trim()&&fe.length>0&&d.jsxs("div",{className:"mt-8 sm:mt-12 border-t border-gray-800 pt-8 sm:pt-12",children:[d.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-white mb-6",children:"Recomendaciones"}),R?d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3",children:Array.from({length:6}).map(($,Z)=>d.jsxs("div",{className:"animate-pulse",children:[d.jsx("div",{className:"bg-gray-800 rounded-lg aspect-[2/3] w-full mb-2"}),d.jsx("div",{className:"h-3 bg-gray-800 rounded w-3/4 mx-auto mb-1"}),d.jsx("div",{className:"h-2 bg-gray-800 rounded w-1/2 mx-auto"})]},Z))}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 mb-6 animate-slide-in-right",children:fe.slice((mt-1)*Ze,mt*Ze).map(($,Z)=>d.jsx("div",{children:d.jsxs("div",{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"}),n&&n($.id)},className:"group cursor-pointer flex flex-col",children:[d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",children:$.cover_url||$.thumbnail_url?d.jsxs(d.Fragment,{children:[d.jsx(Kn,{src:$.cover_url||$.thumbnail_url||"",alt:$.title,aspectRatio:"2/3",objectFit:"cover",loading:"lazy",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-black",children:d.jsx(z0,{className:"w-8 h-8"})})}),d.jsxs("div",{className:"mt-2 flex flex-col gap-0.5",children:[d.jsx("h4",{className:"font-semibold text-xs text-white line-clamp-2 text-center group-hover:text-[#bb86fc] transition-colors duration-300",children:$.title}),$.categories&&$.categories.length>0&&d.jsx("p",{className:"text-xs text-gray-500 text-center truncate",children:($.categories.find(he=>he.type==="series")||$.categories[0]).name})]})]})},$.id))},mt),fe.length>Ze&&d.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4 flex-wrap",children:[d.jsx("button",{onClick:()=>gt(1),disabled:mt===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(O1,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>gt($=>Math.max(1,$-1)),disabled:mt===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(id,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-sm text-gray-400 px-2",children:["Página ",mt," de ",Math.ceil(fe.length/Ze)]}),d.jsx("button",{onClick:()=>gt($=>Math.min(Math.ceil(fe.length/Ze),$+1)),disabled:mt===Math.ceil(fe.length/Ze),className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(sd,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>gt(Math.ceil(fe.length/Ze)),disabled:mt===Math.ceil(fe.length/Ze),className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(M1,{className:"w-4 h-4"})})]})]})]})]}),d.jsx(od,{})]}),ve&&((Ne=(Oe=a.chapters)==null?void 0:Oe[0])==null?void 0:Ne.pages)&&d.jsx(H1,{images:((et=a.chapters)==null?void 0:et[0].pages)||[],initialIndex:ie,onClose:()=>K(!1)}),_&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-md shadow-2xl",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between",children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Añadir Enlace Externo"}),d.jsx("button",{onClick:()=>x(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-200 mb-2",children:"Nombre del Enlace"}),d.jsx("input",{type:"text",placeholder:"Ej: Servidor Alternativo",value:E.name,onChange:$=>k({...E,name:$.target.value}),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-200 mb-2",children:"URL del Enlace"}),d.jsx("input",{type:"url",placeholder:"https://ejemplo.com/descarga",value:E.url,onChange:$=>k({...E,url:$.target.value}),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all"})]}),d.jsxs("div",{className:"flex gap-3 pt-2",children:[d.jsx("button",{onClick:()=>x(!1),className:"flex-1 bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all",children:"Cancelar"}),d.jsx("button",{onClick:we,disabled:!E.name.trim()||!E.url.trim(),className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] disabled:opacity-50 disabled:cursor-not-allowed text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Añadir Enlace"})]})]})]})})]})}function jj({manga:t,chapter:e,onBack:n}){const[r,i]=V.useState(0);if(!e.pages||e.pages.length===0)return d.jsxs("div",{className:"h-screen bg-[#121212] flex flex-col items-center justify-center",children:[d.jsx("button",{onClick:n,className:"absolute top-6 left-6 p-2 hover:bg-[#333] rounded-lg transition-colors text-gray-300 hover:text-white",children:d.jsx(So,{className:"w-5 h-5"})}),d.jsx("div",{className:"text-gray-400 text-lg",children:"No hay páginas disponibles"})]});const s=()=>{r>0&&i(r-1)},o=()=>{r{const c=u<2,f=Rj(a);return d.jsx("div",{className:"w-full flex justify-center",children:d.jsx(Kn,{src:f,alt:`Página ${u+1}`,aspectRatio:"auto",objectFit:"contain",loading:c?"eager":"lazy",className:"max-w-full shadow-2xl",showPlaceholder:u>0})},u)}),d.jsx("div",{className:"w-full mt-8",children:d.jsx(od,{})})]})}),d.jsx("div",{className:"border-t border-gray-700/60 bg-gradient-to-r from-[#2a2a2a] to-[#252525] px-6 py-6 flex-shrink-0",children:d.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[d.jsxs("button",{onClick:s,disabled:r===0,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-all",children:[d.jsx(id,{className:"w-5 h-5"}),"Anterior"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"range",min:"0",max:e.pages.length-1,value:r,onChange:a=>i(parseInt(a.target.value)),className:"w-64 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-[#bb86fc]"}),d.jsxs("span",{className:"text-sm text-gray-400 w-12 text-right",children:[r+1,"/",e.pages.length]})]}),d.jsxs("button",{onClick:o,disabled:r===e.pages.length-1,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-all",children:["Siguiente",d.jsx(sd,{className:"w-5 h-5"})]})]})})]})}const CI="settings",NI="info",Lj=`# Bienvenid@ a Twisted Brody MangaFlow +¡Tu plataforma definitiva para la gestión y lectura de mangas! + +Este proyecto nació con la misión de ofrecer una experiencia de lectura fluida, moderna y sin interrupciones, diseñada por fans para fans. + +## 🌟 Características Principales + +* **⚡ Lectura sin límites:** Disfruta de una interfaz optimizada, rápida y responsiva. +* **📥 Descargas Flexibles:** Baja tus capítulos favoritos en formato **ZIP** o **PDF** para leer offline. +* **🔄 Conversión Inteligente:** Nuestro servidor procesa las imágenes para darte la mejor calidad y compatibilidad. + +## 🤝 Comunidad y Apoyo + +Este es un proyecto **sin fines de lucro**, desarrollado por pura pasión. + +Sin embargo, si valoras mi trabajo y quieres apoyarme para mantener el proyecto vivo, puedes suscribirte a mi **Patreon**. ¡Tu apoyo significa mucho! + +* [**💜 Apóyame en Patreon**](https://www.patreon.com/cw/Twistedbrody) + +### 💡 ¿Tienes nuevas ideas? +¡Quiero escucharlas! Si tienes sugerencias, feedback o ideas locas, háblame directamente: + +* **Telegram:** [@twistedbrodyoficial](https://t.me/twistedbrodyoficial) + +También puedes unirte a nuestros canales: +* [Canal Principal](https://t.me/twistedbrody) +* [Canal Hub](https://t.me/+CmmZFHM9hpViYzMx) +* [X (Twitter)](https://x.com/TwistedBrody) + +--- +> **Disclaimer:** Todo el contenido es propiedad de sus respectivos autores. Apoya el material original siempre que sea posible. + + +`;async function Oj(t){const e=Dt(We,CI,NI),n={content:t,updatedAt:new Date().toISOString()};await ME(e,n)}function Mj(t){const e=Dt(We,CI,NI);return bg(e,n=>{n.exists()?t(n.data()):t({content:Lj,updatedAt:new Date().toISOString()})})}function Vj(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Fj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zj={};function Ax(t,e){return(zj.jsx?Uj:Fj).test(t)}const Bj=/[ \t\n\f\r]/g;function $j(t){return typeof t=="object"?t.type==="text"?Px(t.value):!1:Px(t)}function Px(t){return t.replace(Bj,"")===""}class Dl{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Dl.prototype.normal={};Dl.prototype.property={};Dl.prototype.space=void 0;function AI(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Dl(n,r,e)}function bp(t){return t.toLowerCase()}class Cn{constructor(e,n){this.attribute=n,this.property=e}}Cn.prototype.attribute="";Cn.prototype.booleanish=!1;Cn.prototype.boolean=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.defined=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.number=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.property="";Cn.prototype.spaceSeparated=!1;Cn.prototype.space=void 0;let Hj=0;const De=Ls(),Ct=Ls(),Ep=Ls(),ee=Ls(),nt=Ls(),go=Ls(),Dn=Ls();function Ls(){return 2**++Hj}const Ip=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ct,commaOrSpaceSeparated:Dn,commaSeparated:go,number:ee,overloadedBoolean:Ep,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),Vh=Object.keys(Ip);class Dg extends Cn{constructor(e,n,r,i){let s=-1;if(super(e,n),Rx(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&Qj.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Dx,Jj);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Dx.test(s)){let o=s.replace(Kj,Xj);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=Dg}return new i(r,e)}function Xj(t){return"-"+t.toLowerCase()}function Jj(t){return t.charAt(1).toUpperCase()}const Zj=AI([PI,qj,jI,LI,OI],"html"),jg=AI([PI,Wj,jI,LI,OI],"svg");function e3(t){return t.join(" ").trim()}var Lg={},jx=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t3=/\n/g,n3=/^\s*/,r3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i3=/^:\s*/,s3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o3=/^[;\s]*/,a3=/^\s+|\s+$/g,l3=` +`,Lx="/",Ox="*",as="",u3="comment",c3="declaration";function d3(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(b){var S=b.match(t3);S&&(n+=S.length);var P=b.lastIndexOf(l3);r=~P?b.length-P:r+b.length}function s(){var b={line:n,column:r};return function(S){return S.position=new o(b),c(),S}}function o(b){this.start=b,this.end={line:n,column:r},this.source=e.source}o.prototype.content=t;function a(b){var S=new Error(e.source+":"+n+":"+r+": "+b);if(S.reason=b,S.filename=e.source,S.line=n,S.column=r,S.source=t,!e.silent)throw S}function u(b){var S=b.exec(t);if(S){var P=S[0];return i(P),t=t.slice(P.length),S}}function c(){u(n3)}function f(b){var S;for(b=b||[];S=h();)S!==!1&&b.push(S);return b}function h(){var b=s();if(!(Lx!=t.charAt(0)||Ox!=t.charAt(1))){for(var S=2;as!=t.charAt(S)&&(Ox!=t.charAt(S)||Lx!=t.charAt(S+1));)++S;if(S+=2,as===t.charAt(S-1))return a("End of comment missing");var P=t.slice(2,S-2);return r+=2,i(P),t=t.slice(S),r+=2,b({type:u3,comment:P})}}function p(){var b=s(),S=u(r3);if(S){if(h(),!u(i3))return a("property missing ':'");var P=u(s3),y=b({type:c3,property:Mx(S[0].replace(jx,as)),value:P?Mx(P[0].replace(jx,as)):as});return u(o3),y}}function m(){var b=[];f(b);for(var S;S=p();)S!==!1&&(b.push(S),f(b));return b}return c(),m()}function Mx(t){return t?t.replace(a3,as):as}var h3=d3,f3=qu&&qu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lg,"__esModule",{value:!0});Lg.default=m3;const p3=f3(h3);function m3(t,e){let n=null;if(!t||typeof t!="string")return n;const r=(0,p3.default)(t),i=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?e(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Ld={};Object.defineProperty(Ld,"__esModule",{value:!0});Ld.camelCase=void 0;var g3=/^--[a-zA-Z0-9_-]+$/,y3=/-([a-z])/g,v3=/^[^-]+$/,x3=/^-(webkit|moz|ms|o|khtml)-/,w3=/^-(ms)-/,_3=function(t){return!t||v3.test(t)||g3.test(t)},b3=function(t,e){return e.toUpperCase()},Vx=function(t,e){return"".concat(e,"-")},E3=function(t,e){return e===void 0&&(e={}),_3(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(w3,Vx):t=t.replace(x3,Vx),t.replace(y3,b3))};Ld.camelCase=E3;var I3=qu&&qu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},S3=I3(Lg),T3=Ld;function Sp(t,e){var n={};return!t||typeof t!="string"||(0,S3.default)(t,function(r,i){r&&i&&(n[(0,T3.camelCase)(r,e)]=i)}),n}Sp.default=Sp;var k3=Sp;const C3=zc(k3),MI=VI("end"),Og=VI("start");function VI(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function N3(t){const e=Og(t),n=MI(t);if(e&&n)return{start:e,end:n}}function Oa(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Fx(t.position):"start"in t||"end"in t?Fx(t):"line"in t||"column"in t?Tp(t):""}function Tp(t){return Ux(t&&t.line)+":"+Ux(t&&t.column)}function Fx(t){return Tp(t&&t.start)+"-"+Tp(t&&t.end)}function Ux(t){return t&&typeof t=="number"?t:1}class cn extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Oa(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}cn.prototype.file="";cn.prototype.name="";cn.prototype.reason="";cn.prototype.message="";cn.prototype.stack="";cn.prototype.column=void 0;cn.prototype.line=void 0;cn.prototype.ancestors=void 0;cn.prototype.cause=void 0;cn.prototype.fatal=void 0;cn.prototype.place=void 0;cn.prototype.ruleId=void 0;cn.prototype.source=void 0;const Mg={}.hasOwnProperty,A3=new Map,P3=/[A-Z]/g,R3=new Set(["table","tbody","thead","tfoot","tr"]),D3=new Set(["td","th"]),FI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function j3(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=B3(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=z3(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?jg:Zj,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=UI(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function UI(t,e,n){if(e.type==="element")return L3(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return O3(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return V3(t,e,n);if(e.type==="mdxjsEsm")return M3(t,e);if(e.type==="root")return F3(t,e,n);if(e.type==="text")return U3(t,e)}function L3(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=jg,t.schema=i),t.ancestors.push(e);const s=BI(t,e.tagName,!1),o=$3(t,e);let a=Fg(t,e);return R3.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!$j(u):!0})),zI(t,o,s,e),Vg(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function O3(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}pl(t,e.position)}function M3(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);pl(t,e.position)}function V3(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=jg,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:BI(t,e.name,!0),o=H3(t,e),a=Fg(t,e);return zI(t,o,s,e),Vg(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function F3(t,e,n){const r={};return Vg(r,Fg(t,e)),t.create(e,t.Fragment,r,n)}function U3(t,e){return e.value}function zI(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Vg(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function z3(t,e,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:e;return a?c(s,o,a):c(s,o)}}function B3(t,e){return n;function n(r,i,s,o){const a=Array.isArray(s.children),u=Og(r);return e(i,s,o,a,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function $3(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Mg.call(e.properties,i)){const s=q3(t,i,e.properties[i]);if(s){const[o,a]=s;t.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&D3.has(e.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function H3(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else pl(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,s=t.evaluater.evaluateExpression(a.expression)}else pl(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Fg(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:A3;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s0?(Rr(t,t.length,0,e),t):e}const $x={}.hasOwnProperty;function Z3(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yo(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xr=Zi(/[A-Za-z]/),Mn=Zi(/[\dA-Za-z]/),n5=Zi(/[#-'*+\--9=?A-Z^-~]/);function kp(t){return t!==null&&(t<32||t===127)}const Cp=Zi(/\d/),r5=Zi(/[\dA-Fa-f]/),i5=Zi(/[!-/:-@[-`{-~]/);function be(t){return t!==null&&t<-2}function kn(t){return t!==null&&(t<0||t===32)}function Ke(t){return t===-2||t===-1||t===32}const s5=Zi(new RegExp("\\p{P}|\\p{S}","u")),o5=Zi(/\s/);function Zi(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Ho(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function st(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return Ke(u)?(t.enter(n),a(u)):e(u)}function a(u){return Ke(u)&&s++o))return;const _=e.events.length;let x=_,E,k;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){if(E){k=e.events[x][1].end;break}E=!0}for(y(r),D=_;DT;){const F=n[L];e.containerState=F[1],F[0].exit.call(e,t)}n.length=T}function w(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function d5(t,e,n){return st(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qx(t){if(t===null||kn(t)||o5(t))return 1;if(s5(t))return 2}function zg(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[r][1].end},p={...t[n][1].start};Wx(h,-u),Wx(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...t[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[r][1].end={...o.start},t[n][1].start={...a.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=qn(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=qn(c,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=qn(c,zg(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=qn(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,c=qn(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,Rr(t,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n0&&Ke(D)?st(t,w,"linePrefix",s+1)(D):w(D)}function w(D){return D===null||be(D)?t.check(Gx,S,L)(D):(t.enter("codeFlowValue"),T(D))}function T(D){return D===null||be(D)?(t.exit("codeFlowValue"),w(D)):(t.consume(D),T)}function L(D){return t.exit("codeFenced"),e(D)}function F(D,_,x){let E=0;return k;function k(oe){return D.enter("lineEnding"),D.consume(oe),D.exit("lineEnding"),C}function C(oe){return D.enter("codeFencedFence"),Ke(oe)?st(D,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(oe):j(oe)}function j(oe){return oe===a?(D.enter("codeFencedFenceSequence"),A(oe)):x(oe)}function A(oe){return oe===a?(E++,D.consume(oe),A):E>=o?(D.exit("codeFencedFenceSequence"),Ke(oe)?st(D,de,"whitespace")(oe):de(oe)):x(oe)}function de(oe){return oe===null||be(oe)?(D.exit("codeFencedFence"),_(oe)):x(oe)}}}function E5(t,e,n){const r=this;return i;function i(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const Uh={name:"codeIndented",tokenize:S5},I5={partial:!0,tokenize:T5};function S5(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),st(t,s,"linePrefix",5)(c)}function s(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):be(c)?t.attempt(I5,o,u)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||be(c)?(t.exit("codeFlowValue"),o(c)):(t.consume(c),a)}function u(c){return t.exit("codeIndented"),e(c)}}function T5(t,e,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):be(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):st(t,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):be(o)?i(o):n(o)}}const k5={name:"codeText",previous:N5,resolve:C5,tokenize:A5};function C5(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&da(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),da(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),da(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(o):t.interrupt(r.parser.constructs.flow,n,e)(o)}}function QI(t,e,n,r,i,s,o,a,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return h;function h(y){return y===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(y),t.exit(s),p):y===null||y===32||y===41||kp(y)?n(y):(t.enter(r),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),S(y))}function p(y){return y===62?(t.enter(s),t.consume(y),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(t.exit("chunkString"),t.exit(a),p(y)):y===null||y===60||be(y)?n(y):(t.consume(y),y===92?b:m)}function b(y){return y===60||y===62||y===92?(t.consume(y),m):m(y)}function S(y){return!f&&(y===null||y===41||kn(y))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(r),e(y)):f999||m===null||m===91||m===93&&!u||m===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(t.exit(s),t.enter(i),t.consume(m),t.exit(i),t.exit(r),e):be(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||be(m)||a++>999?(t.exit("chunkString"),f(m)):(t.consume(m),u||(u=!Ke(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(t.consume(m),a++,h):h(m)}}function XI(t,e,n,r,i,s){let o;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),o=p===40?41:p,u):n(p)}function u(p){return p===o?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(s),c(p))}function c(p){return p===o?(t.exit(s),u(o)):p===null?n(p):be(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),st(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===o||p===null||be(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?h:f)}function h(p){return p===o||p===92?(t.consume(p),f):f(p)}}function Ma(t,e){let n;return r;function r(i){return be(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ke(i)?st(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const V5={name:"definition",tokenize:U5},F5={partial:!0,tokenize:z5};function U5(t,e,n){const r=this;let i;return s;function s(m){return t.enter("definition"),o(m)}function o(m){return YI.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=yo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),u):n(m)}function u(m){return kn(m)?Ma(t,c)(m):c(m)}function c(m){return QI(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return t.attempt(F5,h,h)(m)}function h(m){return Ke(m)?st(t,p,"whitespace")(m):p(m)}function p(m){return m===null||be(m)?(t.exit("definition"),r.parser.defined.push(i),e(m)):n(m)}}function z5(t,e,n){return r;function r(a){return kn(a)?Ma(t,i)(a):n(a)}function i(a){return XI(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Ke(a)?st(t,o,"whitespace")(a):o(a)}function o(a){return a===null||be(a)?e(a):n(a)}}const B5={name:"hardBreakEscape",tokenize:$5};function $5(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return be(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const H5={name:"headingAtx",resolve:q5,tokenize:W5};function q5(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Rr(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function W5(t,e,n){let r=0;return i;function i(f){return t.enter("atxHeading"),s(f)}function s(f){return t.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(t.consume(f),o):f===null||kn(f)?(t.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(t.enter("atxHeadingSequence"),u(f)):f===null||be(f)?(t.exit("atxHeading"),e(f)):Ke(f)?st(t,a,"whitespace")(f):(t.enter("atxHeadingText"),c(f))}function u(f){return f===35?(t.consume(f),u):(t.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||kn(f)?(t.exit("atxHeadingText"),a(f)):(t.consume(f),c)}}const G5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Qx=["pre","script","style","textarea"],K5={concrete:!0,name:"htmlFlow",resolveTo:X5,tokenize:J5},Q5={partial:!0,tokenize:e6},Y5={partial:!0,tokenize:Z5};function X5(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function J5(t,e,n){const r=this;let i,s,o,a,u;return c;function c(R){return f(R)}function f(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),h}function h(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),s=!0,S):R===63?(t.consume(R),i=3,r.interrupt?e:N):xr(R)?(t.consume(R),o=String.fromCharCode(R),P):n(R)}function p(R){return R===45?(t.consume(R),i=2,m):R===91?(t.consume(R),i=5,a=0,b):xr(R)?(t.consume(R),i=4,r.interrupt?e:N):n(R)}function m(R){return R===45?(t.consume(R),r.interrupt?e:N):n(R)}function b(R){const H="CDATA[";return R===H.charCodeAt(a++)?(t.consume(R),a===H.length?r.interrupt?e:j:b):n(R)}function S(R){return xr(R)?(t.consume(R),o=String.fromCharCode(R),P):n(R)}function P(R){if(R===null||R===47||R===62||kn(R)){const H=R===47,J=o.toLowerCase();return!H&&!s&&Qx.includes(J)?(i=1,r.interrupt?e(R):j(R)):G5.includes(o.toLowerCase())?(i=6,H?(t.consume(R),y):r.interrupt?e(R):j(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):s?w(R):T(R))}return R===45||Mn(R)?(t.consume(R),o+=String.fromCharCode(R),P):n(R)}function y(R){return R===62?(t.consume(R),r.interrupt?e:j):n(R)}function w(R){return Ke(R)?(t.consume(R),w):k(R)}function T(R){return R===47?(t.consume(R),k):R===58||R===95||xr(R)?(t.consume(R),L):Ke(R)?(t.consume(R),T):k(R)}function L(R){return R===45||R===46||R===58||R===95||Mn(R)?(t.consume(R),L):F(R)}function F(R){return R===61?(t.consume(R),D):Ke(R)?(t.consume(R),F):T(R)}function D(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),u=R,_):Ke(R)?(t.consume(R),D):x(R)}function _(R){return R===u?(t.consume(R),u=null,E):R===null||be(R)?n(R):(t.consume(R),_)}function x(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||kn(R)?F(R):(t.consume(R),x)}function E(R){return R===47||R===62||Ke(R)?T(R):n(R)}function k(R){return R===62?(t.consume(R),C):n(R)}function C(R){return R===null||be(R)?j(R):Ke(R)?(t.consume(R),C):n(R)}function j(R){return R===45&&i===2?(t.consume(R),le):R===60&&i===1?(t.consume(R),ve):R===62&&i===4?(t.consume(R),fe):R===63&&i===3?(t.consume(R),N):R===93&&i===5?(t.consume(R),ie):be(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Q5,ye,A)(R)):R===null||be(R)?(t.exit("htmlFlowData"),A(R)):(t.consume(R),j)}function A(R){return t.check(Y5,de,ye)(R)}function de(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),oe}function oe(R){return R===null||be(R)?A(R):(t.enter("htmlFlowData"),j(R))}function le(R){return R===45?(t.consume(R),N):j(R)}function ve(R){return R===47?(t.consume(R),o="",K):j(R)}function K(R){if(R===62){const H=o.toLowerCase();return Qx.includes(H)?(t.consume(R),fe):j(R)}return xr(R)&&o.length<8?(t.consume(R),o+=String.fromCharCode(R),K):j(R)}function ie(R){return R===93?(t.consume(R),N):j(R)}function N(R){return R===62?(t.consume(R),fe):R===45&&i===2?(t.consume(R),N):j(R)}function fe(R){return R===null||be(R)?(t.exit("htmlFlowData"),ye(R)):(t.consume(R),fe)}function ye(R){return t.exit("htmlFlow"),e(R)}}function Z5(t,e,n){const r=this;return i;function i(o){return be(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}function e6(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Od,e,n)}}const t6={name:"htmlText",tokenize:n6};function n6(t,e,n){const r=this;let i,s,o;return a;function a(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),u}function u(N){return N===33?(t.consume(N),c):N===47?(t.consume(N),F):N===63?(t.consume(N),T):xr(N)?(t.consume(N),x):n(N)}function c(N){return N===45?(t.consume(N),f):N===91?(t.consume(N),s=0,b):xr(N)?(t.consume(N),w):n(N)}function f(N){return N===45?(t.consume(N),m):n(N)}function h(N){return N===null?n(N):N===45?(t.consume(N),p):be(N)?(o=h,ve(N)):(t.consume(N),h)}function p(N){return N===45?(t.consume(N),m):h(N)}function m(N){return N===62?le(N):N===45?p(N):h(N)}function b(N){const fe="CDATA[";return N===fe.charCodeAt(s++)?(t.consume(N),s===fe.length?S:b):n(N)}function S(N){return N===null?n(N):N===93?(t.consume(N),P):be(N)?(o=S,ve(N)):(t.consume(N),S)}function P(N){return N===93?(t.consume(N),y):S(N)}function y(N){return N===62?le(N):N===93?(t.consume(N),y):S(N)}function w(N){return N===null||N===62?le(N):be(N)?(o=w,ve(N)):(t.consume(N),w)}function T(N){return N===null?n(N):N===63?(t.consume(N),L):be(N)?(o=T,ve(N)):(t.consume(N),T)}function L(N){return N===62?le(N):T(N)}function F(N){return xr(N)?(t.consume(N),D):n(N)}function D(N){return N===45||Mn(N)?(t.consume(N),D):_(N)}function _(N){return be(N)?(o=_,ve(N)):Ke(N)?(t.consume(N),_):le(N)}function x(N){return N===45||Mn(N)?(t.consume(N),x):N===47||N===62||kn(N)?E(N):n(N)}function E(N){return N===47?(t.consume(N),le):N===58||N===95||xr(N)?(t.consume(N),k):be(N)?(o=E,ve(N)):Ke(N)?(t.consume(N),E):le(N)}function k(N){return N===45||N===46||N===58||N===95||Mn(N)?(t.consume(N),k):C(N)}function C(N){return N===61?(t.consume(N),j):be(N)?(o=C,ve(N)):Ke(N)?(t.consume(N),C):E(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,A):be(N)?(o=j,ve(N)):Ke(N)?(t.consume(N),j):(t.consume(N),de)}function A(N){return N===i?(t.consume(N),i=void 0,oe):N===null?n(N):be(N)?(o=A,ve(N)):(t.consume(N),A)}function de(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||kn(N)?E(N):(t.consume(N),de)}function oe(N){return N===47||N===62||kn(N)?E(N):n(N)}function le(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function ve(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),K}function K(N){return Ke(N)?st(t,ie,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):ie(N)}function ie(N){return t.enter("htmlTextData"),o(N)}}const Bg={name:"labelEnd",resolveAll:o6,resolveTo:a6,tokenize:l6},r6={tokenize:u6},i6={tokenize:c6},s6={tokenize:d6};function o6(t){let e=-1;const n=[];for(;++e=3&&(c===null||be(c))?(t.exit("thematicBreak"),e(c)):n(c)}function u(c){return c===i?(t.consume(c),r++,u):(t.exit("thematicBreakSequence"),Ke(c)?st(t,a,"whitespace")(c):a(c))}}const mn={continuation:{tokenize:_6},exit:E6,name:"list",tokenize:w6},v6={partial:!0,tokenize:I6},x6={partial:!0,tokenize:b6};function w6(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(m){const b=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Cp(m)){if(r.containerState.type||(r.containerState.type=b,t.enter(b,{_container:!0})),b==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check($u,n,c)(m):c(m);if(!r.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(m)}return n(m)}function u(m){return Cp(m)&&++o<10?(t.consume(m),u):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):n(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,t.check(Od,r.interrupt?n:f,t.attempt(v6,p,h))}function f(m){return r.containerState.initialBlankLine=!0,s++,p(m)}function h(m){return Ke(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function _6(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Od,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(t,e,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Ke(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(x6,e,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(t,t.attempt(mn,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function b6(t,e,n){const r=this;return st(t,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?e(s):n(s)}}function E6(t){t.exit(this.containerState.type)}function I6(t,e,n){const r=this;return st(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Ke(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const Yx={name:"setextUnderline",resolveTo:S6,tokenize:T6};function S6(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",o,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=o,t.push(["exit",o,e]),t}function T6(t,e,n){const r=this;let i;return s;function s(c){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),Ke(c)?st(t,u,"lineSuffix")(c):u(c))}function u(c){return c===null||be(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const k6={tokenize:C6};function C6(t){const e=this,n=t.attempt(Od,r,t.attempt(this.parser.constructs.flowInitial,i,st(t,t.attempt(this.parser.constructs.flow,i,t.attempt(D5,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const N6={resolveAll:ZI()},A6=JI("string"),P6=JI("text");function JI(t){return{resolveAll:ZI(t==="text"?R6:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,o,a);return o;function o(f){return c(f)?s(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),s(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const h=i[f];let p=-1;if(h)for(;++p-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(t[i].slice(0,s))}return o}function q6(t,e){let n=-1;const r=[];let i;for(;++n0){const Ae=B.tokenStack[B.tokenStack.length-1];(Ae[1]||Jx).call(B,void 0,Ae[0])}for(O.position={start:fi(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:fi(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},Y=-1;++Y0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function sL(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function oL(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function aL(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Ho(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let o,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),o=t.footnoteOrder.length):o=s+1,a+=1,t.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,c),t.applyData(e,c)}function lL(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function uL(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function nS(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function cL(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return nS(t,e);const i={src:Ho(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function dL(t,e){const n={src:Ho(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function hL(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function fL(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return nS(t,e);const i={href:Ho(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function pL(t,e){const n={href:Ho(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function mL(t,e,n){const r=t.all(e),i=n?gL(n):rS(e),s={},o=[];if(typeof e.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a1}function yL(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=Og(e.children[1]),u=MI(e.children[e.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function bL(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:e.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(tw(e.slice(i),i>0,!1)),s.join("")}function tw(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===Zx||s===ew;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===Zx||s===ew;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function SL(t,e){const n={type:"text",value:IL(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function TL(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const kL={blockquote:nL,break:rL,code:iL,delete:sL,emphasis:oL,footnoteReference:aL,heading:lL,html:uL,imageReference:cL,image:dL,inlineCode:hL,linkReference:fL,link:pL,listItem:mL,list:yL,paragraph:vL,root:xL,strong:wL,table:_L,tableCell:EL,tableRow:bL,text:SL,thematicBreak:TL,toml:yu,yaml:yu,definition:yu,footnoteDefinition:yu};function yu(){}const iS=-1,Md=0,Va=1,Fc=2,$g=3,Hg=4,qg=5,Wg=6,sS=7,oS=8,nw=typeof self=="object"?self:globalThis,CL=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,o]=e[i];switch(s){case Md:case iS:return n(o,i);case Va:{const a=n([],i);for(const u of o)a.push(r(u));return a}case Fc:{const a=n({},i);for(const[u,c]of o)a[r(u)]=r(c);return a}case $g:return n(new Date(o),i);case Hg:{const{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case qg:{const a=n(new Map,i);for(const[u,c]of o)a.set(r(u),r(c));return a}case Wg:{const a=n(new Set,i);for(const u of o)a.add(r(u));return a}case sS:{const{name:a,message:u}=o;return n(new nw[a](u),i)}case oS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new nw[s](o),i)};return r},rw=t=>CL(new Map,t)(0),Fs="",{toString:NL}={},{keys:AL}=Object,ha=t=>{const e=typeof t;if(e!=="object"||!t)return[Md,e];const n=NL.call(t).slice(8,-1);switch(n){case"Array":return[Va,Fs];case"Object":return[Fc,Fs];case"Date":return[$g,Fs];case"RegExp":return[Hg,Fs];case"Map":return[qg,Fs];case"Set":return[Wg,Fs];case"DataView":return[Va,n]}return n.includes("Array")?[Va,n]:n.includes("Error")?[sS,n]:[Fc,n]},vu=([t,e])=>t===Md&&(e==="function"||e==="symbol"),PL=(t,e,n,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return n.set(a,u),u},s=o=>{if(n.has(o))return n.get(o);let[a,u]=ha(o);switch(a){case Md:{let f=o;switch(u){case"bigint":a=oS,f=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([iS],o)}return i([a,f],o)}case Va:{if(u){let p=o;return u==="DataView"?p=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(o)),i([u,[...p]],o)}const f=[],h=i([a,f],o);for(const p of o)f.push(s(p));return h}case Fc:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const f=[],h=i([a,f],o);for(const p of AL(o))(t||!vu(ha(o[p])))&&f.push([s(p),s(o[p])]);return h}case $g:return i([a,o.toISOString()],o);case Hg:{const{source:f,flags:h}=o;return i([a,{source:f,flags:h}],o)}case qg:{const f=[],h=i([a,f],o);for(const[p,m]of o)(t||!(vu(ha(p))||vu(ha(m))))&&f.push([s(p),s(m)]);return h}case Wg:{const f=[],h=i([a,f],o);for(const p of o)(t||!vu(ha(p)))&&f.push(s(p));return h}}const{message:c}=o;return i([a,{name:u,message:c}],o)};return s},iw=(t,{json:e,lossy:n}={})=>{const r=[];return PL(!(e||n),!!e,new Map,r)(t),r},Uc=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?rw(iw(t,e)):structuredClone(t):(t,e)=>rw(iw(t,e));function RL(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function DL(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function jL(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||RL,r=t.options.footnoteBackLabel||DL,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&b.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,m);typeof w=="string"&&(w={type:"text",value:w}),b.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const P=f[f.length-1];if(P&&P.type==="element"&&P.tagName==="p"){const w=P.children[P.children.length-1];w&&w.type==="text"?w.value+=" ":P.children.push({type:"text",value:" "}),P.children.push(...b)}else f.push(...b);const y={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(f,!0)};t.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Uc(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` +`}]}}const aS=function(t){if(t==null)return VL;if(typeof t=="function")return Vd(t);if(typeof t=="object")return Array.isArray(t)?LL(t):OL(t);if(typeof t=="string")return ML(t);throw new Error("Expected function, string, or object as test")};function LL(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=lS,b,S,P;if((!e||s(u,c,f[f.length-1]||void 0))&&(m=$L(n(u,f)),m[0]===sw))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==zL)for(S=(r?y.children.length:-1)+o,P=f.concat(y);S>-1&&S0&&n.push({type:"text",value:` +`}),n}function ow(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function aw(t,e){const n=qL(t,e),r=n.one(t,void 0),i=jL(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` +`},i),s}function YL(t,e){return t&&"run"in t?async function(n,r){const i=aw(n,{file:r,...e});await t.run(i,r)}:function(n,r){return aw(n,{file:r,...t||e})}}function lw(t){if(t)throw t}var Hu=Object.prototype.hasOwnProperty,cS=Object.prototype.toString,uw=Object.defineProperty,cw=Object.getOwnPropertyDescriptor,dw=function(e){return typeof Array.isArray=="function"?Array.isArray(e):cS.call(e)==="[object Array]"},hw=function(e){if(!e||cS.call(e)!=="[object Object]")return!1;var n=Hu.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Hu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||Hu.call(e,i)},fw=function(e,n){uw&&n.name==="__proto__"?uw(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},pw=function(e,n){if(n==="__proto__")if(Hu.call(e,n)){if(cw)return cw(e,n).value}else return;return e[n]},XL=function t(){var e,n,r,i,s,o,a=arguments[0],u=1,c=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=t.apply(this,o)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){n||(n=!0,e(o,...a))}function s(o){i(null,o)}}const gr={basename:eO,dirname:tO,extname:nO,join:rO,sep:"/"};function eO(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');jl(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=t.length),t.slice(n,r)}function tO(t){if(jl(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function nO(t){jl(t);let e=t.length,n=-1,r=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){r=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function rO(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function sO(t,e){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=t.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,o):n=t.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function jl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const oO={cwd:aO};function aO(){return"/"}function Rp(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function lO(t){if(typeof t=="string")t=new URL(t);else if(!Rp(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return uO(t)}function uO(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[m,...b]=f;const S=r[p][1];Pp(S)&&Pp(m)&&(m=Bh(!0,S,m)),r[p]=[c,m,...b]}}}}const fO=new Gg().freeze();function Wh(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Gh(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Kh(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gw(t){if(!Pp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function yw(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function xu(t){return pO(t)?t:new dS(t)}function pO(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function mO(t){return typeof t=="string"||gO(t)}function gO(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const yO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vw=[],xw={allowDangerousHtml:!0},vO=/^(https?|ircs?|mailto|xmpp)$/i,xO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wO(t){const e=_O(t),n=bO(t);return EO(e.runSync(e.parse(n),n),t)}function _O(t){const e=t.rehypePlugins||vw,n=t.remarkPlugins||vw,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...xw}:xw;return fO().use(tL).use(n).use(YL,r).use(e)}function bO(t){const e=t.children||"",n=new dS;return typeof e=="string"&&(n.value=e),n}function EO(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,o=e.skipHtml,a=e.unwrapDisallowed,u=e.urlTransform||IO;for(const f of xO)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+yO+f.id,void 0);return uS(t,c),j3(t,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(f,h,p){if(f.type==="raw"&&p&&typeof h=="number")return o?p.children.splice(h,1):p.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let m;for(m in Fh)if(Object.hasOwn(Fh,m)&&Object.hasOwn(f.properties,m)){const b=f.properties[m],S=Fh[m];(S===null||S.includes(f.tagName))&&(f.properties[m]=u(String(b||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):s?s.includes(f.tagName):!1;if(!m&&r&&typeof h=="number"&&(m=!r(f,h,p)),m&&p&&typeof h=="number")return a&&f.children?p.children.splice(h,1,...f.children):p.children.splice(h,1),h}}}function IO(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||vO.test(t.slice(0,e))?t:""}function SO({onBack:t,isAdmin:e}){const[n,r]=V.useState(""),[i,s]=V.useState(!1),[o,a]=V.useState(""),[u,c]=V.useState(!0);V.useEffect(()=>{const p=Mj(m=>{m&&r(m.content),c(!1)});return()=>p()},[]);const f=async()=>{try{await Oj(o),s(!1)}catch(p){console.error("Error saving info:",p),alert("Error al guardar la información.")}},h=()=>{a(n),s(!0)};return d.jsx("div",{className:"min-h-screen bg-[#0a0a0a] text-white p-4 sm:p-6 md:p-12 animate-in fade-in slide-in-from-bottom-4 duration-300",children:d.jsxs("div",{className:"max-w-4xl mx-auto",children:[d.jsxs("button",{onClick:t,className:"flex items-center gap-2 text-gray-400 hover:text-white transition-colors mb-8 group",children:[d.jsx(So,{className:"w-5 h-5 group-hover:-translate-x-1 transition-transform"}),d.jsx("span",{className:"font-medium",children:"Volver al inicio"})]}),d.jsxs("div",{className:"bg-[#1a1a1a] rounded-2xl border border-gray-800 p-8 sm:p-12 shadow-2xl relative",children:[e&&!i&&d.jsx("button",{onClick:h,className:"absolute top-8 right-8 p-2 rounded-lg bg-gray-800 text-gray-400 hover:text-[#bb86fc] hover:bg-[#bb86fc]/10 transition-colors",title:"Editar información",children:d.jsx(B1,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex items-center gap-4 mb-8 border-b border-gray-800 pb-8",children:[d.jsx("div",{className:"p-3 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl shadow-lg shadow-[#bb86fc]/20",children:d.jsx(F1,{className:"w-8 h-8 text-white"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-white to-gray-400 bg-clip-text text-transparent",children:"Información"}),d.jsx("p",{className:"text-gray-400 mt-1",children:"Sobre Twisted Brody MangaFlow"})]})]}),i?d.jsxs("div",{className:"space-y-4",children:[d.jsx("textarea",{value:o,onChange:p=>a(p.target.value),className:"w-full h-[500px] bg-black/50 border border-[#bb86fc]/50 rounded-lg p-4 text-sm text-white focus:outline-none focus:border-[#bb86fc] font-mono",placeholder:"Escribe el contenido en Markdown..."}),d.jsxs("div",{className:"flex gap-3 justify-end",children:[d.jsxs("button",{onClick:()=>s(!1),className:"px-4 py-2 rounded-lg font-semibold text-gray-400 hover:text-white hover:bg-white/10 transition-colors flex items-center gap-2",children:[d.jsx(In,{className:"w-4 h-4"}),"Cancelar"]}),d.jsxs("button",{onClick:f,className:"px-4 py-2 rounded-lg font-semibold bg-[#bb86fc] hover:bg-[#9966dd] text-white transition-colors shadow-lg shadow-[#bb86fc]/20 flex items-center gap-2",children:[d.jsx(Cm,{className:"w-4 h-4"}),"Guardar Cambios"]})]})]}):d.jsx("div",{className:"prose prose-invert prose-p:text-gray-300 prose-headings:text-white prose-a:no-underline max-w-none",children:d.jsx(wO,{components:{h1:({node:p,...m})=>d.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-[#bb86fc] to-[#7744cc] bg-clip-text text-transparent mb-6 pb-2 border-b border-gray-800",...m}),h2:({node:p,...m})=>d.jsx("h2",{className:"text-xl font-semibold text-white mt-8 mb-4 flex items-center gap-2",...m}),p:({node:p,...m})=>d.jsx("p",{className:"text-gray-300 leading-relaxed mb-4",...m}),ul:({node:p,...m})=>d.jsx("ul",{className:"space-y-2 mb-6",...m}),li:({node:p,...m})=>d.jsx("li",{className:"flex items-start gap-2 text-gray-300",...m}),a:({node:p,href:m,children:b,...S})=>{const P=m==null?void 0:m.startsWith("http");if((m==null?void 0:m.includes("t.me"))||(m==null?void 0:m.includes("patreon.com"))||(m==null?void 0:m.includes("x.com"))){let w="bg-[#1a1a1a] border border-gray-700 hover:border-gray-500",T="text-gray-300 hover:text-white";return m!=null&&m.includes("patreon")&&(w="bg-[#1a1a1a] border border-gray-700 hover:border-[#FF424D] hover:text-[#FF424D]"),m!=null&&m.includes("t.me")&&(w="bg-[#1a1a1a] border border-gray-700 hover:border-[#24A1DE] hover:text-[#24A1DE]"),m!=null&&m.includes("x.com")&&(w="bg-[#1a1a1a] border border-gray-700 hover:border-white hover:text-white"),d.jsx("a",{href:m,target:P?"_blank":void 0,rel:P?"noopener noreferrer":void 0,className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all transform hover:scale-105 shadow-sm my-1 mr-2 no-underline text-xs sm:text-sm font-medium ${w} ${T}`,...S,children:b})}return d.jsx("a",{href:m,className:"text-[#bb86fc] hover:underline",target:P?"_blank":void 0,rel:P?"noopener noreferrer":void 0,...S,children:b})},blockquote:({node:p,...m})=>d.jsx("blockquote",{className:"border-l-4 border-[#bb86fc] pl-4 py-2 bg-[#bb86fc]/10 rounded-r-lg italic text-gray-400 my-6",...m}),hr:({node:p,...m})=>d.jsx("hr",{className:"border-gray-800 my-8",...m}),img:()=>null},children:n})}),!i&&d.jsxs("div",{className:"pt-8 border-t border-gray-800 text-center text-sm text-gray-500 mt-8",children:["© ",new Date().getFullYear()," Twisted Brody. Todos los derechos reservados."]})]})]})})}function TO({label:t,authors:e,value:n,onChange:r,onDelete:i,placeholder:s="Añadir autor...",colorClass:o="text-gray-400"}){const[a,u]=V.useState(""),[c,f]=V.useState(!1),h=V.useRef(null);V.useEffect(()=>{n&&n!==a&&!c?u(n):!n&&!c&&u("")},[n]);const p=V.useMemo(()=>a.trim()?e.filter(y=>y.toLowerCase().includes(a.toLowerCase())):e,[e,a]);V.useEffect(()=>{const y=w=>{h.current&&!h.current.contains(w.target)&&f(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[]);const m=y=>{y.key==="Enter"&&(y.preventDefault(),b(a))},b=y=>{const w=y.trim();w&&(r(w),u(w),f(!1))},S=()=>{r(""),u(""),f(!1)},P=(y,w)=>{y.stopPropagation(),y.preventDefault(),i&&i(w)};return d.jsxs("div",{className:"space-y-3 mb-6",ref:h,children:[d.jsx("label",{className:`text-xs uppercase font-bold tracking-wider ${o}`,children:t}),d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:d.jsx(Nm,{className:"h-4 w-4 text-gray-500"})}),d.jsx("input",{type:"text",value:a,onChange:y=>{u(y.target.value),f(!0)},onFocus:()=>f(!0),onKeyDown:m,placeholder:s,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg pl-10 pr-10 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all"}),a&&d.jsx("button",{onClick:S,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white",children:d.jsx(In,{className:"w-3.5 h-3.5"})})]}),c&&p.length>0&&d.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#1a1a1a] border border-gray-700/50 rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto w-full custom-scrollbar",children:p.map((y,w)=>{const T=n===y;return d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 hover:bg-white/5 cursor-pointer group",onMouseDown:L=>{L.preventDefault(),b(y)},children:[d.jsx("span",{className:`text-sm ${T?"text-[#bb86fc]":"text-gray-300"}`,children:y}),d.jsxs("div",{className:"flex items-center gap-2",children:[T&&d.jsx(wl,{className:"w-4 h-4 text-[#bb86fc]"}),i&&d.jsx("button",{onMouseDown:L=>P(L,y),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-500/20 text-gray-500 hover:text-red-400 rounded transition-all",title:"Eliminar autor de todos los mangas",children:d.jsx(wr,{className:"w-3.5 h-3.5"})})]})]},w)})})]}),d.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:n?`Se actualizará el autor a: "${n}"`:"Deja en blanco para no modificar el autor."})]})}function kO({isOpen:t,onClose:e,selectedMangaIds:n,onSaveComplete:r}){const[i,s]=V.useState([]),[o,a]=V.useState([]),[u,c]=V.useState([]),[f,h]=V.useState(""),[p,m]=V.useState(!1),[b,S]=V.useState(!1);V.useEffect(()=>{t&&(P(),a([]),h(""))},[t]);const P=async()=>{try{S(!0);const _=await wI();s(_);const x=await ZD();c(x)}catch(_){console.error("Error loading categories:",_)}finally{S(!1)}},y=async(_,x)=>{if(_.trim()){if(x==="tag"){const E=_.split(" ").map(k=>k.trim()).filter(k=>k.length>0);for(const k of E)await w(k,x);return}await w(_,x)}},w=async(_,x)=>{try{const E=i.find(k=>k.name.toLowerCase()===_.trim().toLowerCase()&&k.type===x);if(E)a(k=>k.includes(E.id)?k:[...k,E.id]);else{const k=await _I(_.trim(),x);s(C=>C.find(j=>j.id===k.id)?C:[...C,k]),a(C=>C.includes(k.id)?C:[...C,k.id])}}catch(E){console.error("Error creating category:",E)}},T=_=>{a(x=>x.filter(E=>E!==_))},L=async _=>{try{await bI(_),s(x=>x.filter(E=>E.id!==_)),a(x=>x.filter(E=>E!==_))}catch(x){console.error("Error deleting category:",x),Nt.error("Error al eliminar la categoría")}},F=_=>{Nt(`¿Eliminar al autor "${_}" permanentemente?`,{description:"Se eliminará este autor de TODOS los mangas. Esta acción no se puede deshacer.",action:{label:"Eliminar",onClick:async()=>{try{S(!0),await JD(_),Nt.success(`Autor "${_}" eliminado correctamente.`),c(x=>x.filter(E=>E!==_)),f===_&&h("")}catch(x){console.error("Error deleting author:",x),Nt.error("Error al eliminar el autor.")}finally{S(!1)}}},cancel:{label:"Cancelar",onClick:()=>{}},duration:5e3})},D=async()=>{if(o.length===0&&!f.trim()){Nt.error("Selecciona al menos una categoría o un autor para aplicar.");return}m(!0);try{const _=n.map(async x=>{var E;try{const k=await xI(x);if(!k)return;const C=((E=k.categories)==null?void 0:E.map(de=>de.id))||[],j=Array.from(new Set([...C,...o])),A={title:k.title,author:k.author,categoryIds:j};f.trim()&&(A.author=f.trim()),await EI(x,A)}catch(k){console.error(`Error updating manga ${x}`,k)}});await Promise.all(_),Nt.success("Categorías aplicadas correctamente."),r(),e()}catch(_){console.error("Error bulk updating mangas:",_),Nt.error("Error al aplicar cambios.")}finally{m(!1)}};return t?d.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-2xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10",children:[d.jsxs("h2",{className:"text-xl font-bold text-white",children:["Aplicar Categorías a ",n.length," Mangas"]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar flex-1",children:b?d.jsx("div",{className:"flex justify-center p-8",children:d.jsx(ys,{size:32})}):d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"bg-[#1f1f1f] p-4 rounded-xl border border-gray-800",children:d.jsx(TO,{label:"Autor",authors:u,value:f,onChange:h,onDelete:F,placeholder:"Seleccionar o escribir autor..."})}),d.jsx(Ii,{label:"Personajes",type:"character",categories:i,selectedIds:o,onSelect:_=>{o.includes(_)||a(x=>[...x,_])},onRemove:T,onCreate:_=>y(_,"character"),onDeleteCategory:L,colorClass:"text-blue-400",placeholder:"Añadir personaje..."}),d.jsx(Ii,{label:"Series",type:"series",categories:i,selectedIds:o,onSelect:_=>{o.includes(_)||a(x=>[...x,_])},onRemove:T,onCreate:_=>y(_,"series"),onDeleteCategory:L,colorClass:"text-green-400",placeholder:"Añadir serie..."}),d.jsx(Ii,{label:"Géneros",type:"genre",categories:i,selectedIds:o,onSelect:_=>{o.includes(_)||a(x=>[...x,_])},onRemove:T,onCreate:_=>y(_,"genre"),onDeleteCategory:L,colorClass:"text-purple-400",placeholder:"Añadir género..."}),d.jsx(Ii,{label:"Etiquetas",type:"tag",categories:i,selectedIds:o,onSelect:_=>{o.includes(_)||a(x=>[...x,_])},onRemove:T,onCreate:_=>y(_,"tag"),onDeleteCategory:L,colorClass:"text-pink-400",placeholder:"Añadir etiqueta..."})]})}),d.jsxs("div",{className:"p-6 border-t border-gray-800 flex justify-end gap-3 bg-[#1a1a1a]",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:text-white transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:D,disabled:p||o.length===0&&!f.trim(),className:"bg-[#bb86fc] hover:bg-[#9966dd] text-white px-6 py-2 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/20 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:p?d.jsxs(d.Fragment,{children:[d.jsx(ys,{size:16}),"Guardando..."]}):d.jsxs(d.Fragment,{children:[d.jsx(Cm,{className:"w-4 h-4"}),"Aplicar Cambios"]})})]})]})}):null}const ww=["series","character","genre","tag","other"],CO={series:"Series",character:"Personajes",genre:"Géneros",tag:"Etiquetas",other:"Otros"};function NO({isOpen:t,onClose:e,categories:n,selectedCategories:r,onToggleCategory:i,onClearFilters:s}){const[o,a]=V.useState(""),u=V.useMemo(()=>{const c=n.filter(h=>h.name.toLowerCase().includes(o.toLowerCase())),f={};return ww.forEach(h=>{f[h]=[]}),f.other=[],c.forEach(h=>{const p=h.type||"other";f[p]||(f[p]=[]),f[p].push(h)}),f},[n,o]);return t?d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#1a1a1a] w-full max-w-4xl max-h-[85vh] rounded-2xl border border-gray-800 shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-200",onClick:c=>c.stopPropagation(),children:[d.jsxs("div",{className:"p-4 sm:p-6 border-b border-gray-800 flex items-center justify-between bg-[#1a1a1a]",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"bg-purple-500/20 p-2 rounded-lg",children:d.jsx(V1,{className:"w-5 h-5 text-purple-400"})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Filtrar por Categorías"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Selecciona múltiples opciones para refinar tu búsqueda"})]})]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white hover:bg-gray-800 p-2 rounded-lg transition-all",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"p-4 border-b border-gray-800 bg-[#151515]",children:d.jsxs("div",{className:"relative",children:[d.jsx(gc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),d.jsx("input",{type:"text",placeholder:"Buscar categorías...",value:o,onChange:c=>a(c.target.value),className:"w-full bg-[#0f0f0f] border border-gray-700/50 rounded-lg pl-10 pr-4 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-purple-500/50 focus:ring-1 focus:ring-purple-500/50 transition-all"})]})}),d.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-8 custom-scrollbar",children:ww.map(c=>{const f=u[c];return!f||f.length===0?null:d.jsxs("div",{className:"animate-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("h3",{className:"text-sm font-bold text-purple-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[d.jsx("span",{className:"w-1 h-4 bg-purple-500 rounded-full"}),CO[c]||c]}),d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2",children:f.sort((h,p)=>h.name.localeCompare(p.name)).map(h=>{const p=r.includes(h.name);return d.jsxs("button",{onClick:()=>i(h.name),className:` + relative group flex items-center justify-between px-3 py-2 rounded-lg text-sm text-left transition-all duration-200 border + ${p?"bg-purple-500/20 border-purple-500/50 text-purple-100 shadow-[0_0_15px_-3px_rgba(168,85,247,0.3)]":"bg-[#252525] border-transparent text-gray-300 hover:bg-[#2a2a2a] hover:border-gray-700"} + `,children:[d.jsx("span",{className:"truncate mr-2 font-medium",children:h.name}),p&&d.jsx("div",{className:"bg-purple-500 rounded-full p-0.5 animate-in zoom-in duration-200",children:d.jsx(wl,{className:"w-3 h-3 text-white"})})]},h.id)})})]},c)})}),d.jsxs("div",{className:"p-4 border-t border-gray-800 bg-[#1a1a1a] flex items-center justify-between",children:[d.jsxs("div",{className:"text-sm text-gray-400",children:[r.length," seleccionada",r.length!==1?"s":""]}),d.jsxs("div",{className:"flex items-center gap-3",children:[r.length>0&&d.jsx("button",{onClick:s,className:"px-4 py-2 text-sm text-gray-400 hover:text-white transition-colors",children:"Limpiar todo"}),d.jsx("button",{onClick:e,className:"px-6 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg text-sm font-semibold shadow-lg shadow-purple-900/20 transition-all hover:scale-105 active:scale-95",children:"Listo"})]})]})]})}):null}const _w={random:"Aleatorio",name:"Nombre",date:"Fecha de creación",modified:"Última modificación",pages:"Páginas",views:"Vistas"};function AO({value:t,onChange:e,placeholder:n="Buscar manga...",sortType:r="random",onSortTypeChange:i,sortDirection:s="asc",onSortDirectionChange:o,onOpenFilter:a}){const[u,c]=V.useState(!1),f=()=>{e("")},h=()=>{const b=["modified","name","date","pages","views","random"],P=(b.indexOf(r)+1)%b.length,y=b[P];i==null||i(y),window.innerWidth<640&&Nt.success(`Ordenado por: ${_w[y]}`,{position:"top-center",duration:1500,className:"bg-purple-900/90 text-white border-purple-500/50"})},p=()=>{const b=s==="asc"?"desc":"asc";if(o==null||o(b),window.innerWidth<640){let S=b==="asc"?"Ascendente (A-Z)":"Descendente (Z-A)";r==="views"?S=b==="asc"?"Menos vistos primero":"Más vistos primero":r==="date"||r==="modified"?S=b==="asc"?"Más antiguos primero":"Más recientes primero":r==="pages"&&(S=b==="asc"?"Menos páginas":"Más páginas"),Nt.success(`Orden: ${S}`,{position:"top-center",duration:1500,className:"bg-purple-900/90 text-white border-purple-500/50"})}},m=()=>r==="views"?s==="asc"?"Menos vistos":"Más vistos":s==="asc"?"ASC":"DESC";return d.jsxs("div",{className:"w-full flex gap-2 items-center",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(gc,{className:`absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 pointer-events-none ${u?"text-purple-400":"text-gray-400"}`}),d.jsx("input",{type:"text",placeholder:n,value:t,onChange:b=>e(b.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),className:"w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-10 py-2.5 text-sm placeholder-gray-400 border border-gray-700/50 focus:border-purple-500 focus:outline-none"}),t&&d.jsx("button",{onClick:f,className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-purple-400 transition-all p-1 hover:scale-125 hover:rotate-90 duration-300",title:"Limpiar búsqueda",children:d.jsx(In,{className:"w-4 h-4"})})]}),d.jsx("button",{onClick:a,className:"bg-gray-800 hover:bg-gray-700 border border-gray-700 hover:border-purple-500/50 text-white p-2.5 rounded-lg transition-all duration-300 hover:shadow-lg hover:shadow-purple-500/10 group",title:"Filtrar por categorías",children:d.jsx(V1,{className:"w-4 h-4 text-gray-400 group-hover:text-purple-400 transition-colors"})}),d.jsxs("button",{onClick:h,className:"bg-gradient-to-r from-gray-700/40 to-gray-600/40 hover:from-gray-700/60 hover:to-gray-600/60 border border-gray-600/50 hover:border-purple-500/50 text-white px-2.5 py-2.5 rounded-lg flex items-center justify-center gap-1.5 font-medium text-xs transition-all duration-300 active:scale-95 whitespace-nowrap hover:scale-110 hover:shadow-lg hover:shadow-purple-500/20 hover:border-purple-500",title:"Cambiar tipo de ordenamiento",children:[d.jsx(o2,{className:"w-3.5 h-3.5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:_w[r]})]}),d.jsxs("button",{onClick:p,className:"bg-gradient-to-r from-gray-700/40 to-gray-600/40 hover:from-gray-700/60 hover:to-gray-600/60 border border-gray-600/50 hover:border-purple-500/50 text-white px-2.5 py-2.5 rounded-lg flex items-center justify-center gap-1.5 font-medium text-xs transition-all duration-300 active:scale-95 whitespace-nowrap hover:scale-110 hover:shadow-lg hover:shadow-purple-500/20 hover:border-purple-500",title:s==="asc"?"Cambiar a descendente":"Cambiar a ascendente",children:[d.jsx(i2,{className:`w-3.5 h-3.5 transition-all duration-500 ${s==="desc"?"rotate-180":""} hover:scale-125`}),d.jsx("span",{className:"hidden sm:inline text-[10px]",children:m()})]})]})}function PO(){return d.jsxs("div",{className:"flex flex-col w-full max-w-xs",children:[d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden aspect-[2/3] mb-2",children:d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"30px",height:"30px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})})}),d.jsxs("div",{className:"flex flex-col gap-2 items-center animate-pulse",children:[d.jsx("div",{className:"h-4 bg-gray-800 rounded w-3/4"}),d.jsx("div",{className:"h-3 bg-gray-800 rounded w-1/2"})]})]})}const Qh=24;function RO({items:t,searchTerm:e,isSearching:n,onSelectComic:r,onEditManga:i,onDeleteManga:s,isLoading:o=!1,isCategoryPlusEnabled:a=!1,selectedMangaIds:u=[],onToggleSelectManga:c}){const[f,h]=V.useState(()=>{const y=new URLSearchParams(window.location.search).get("page");return y?Math.max(1,Number(y)):1});V.useEffect(()=>{const P=()=>{const w=new URLSearchParams(window.location.search).get("page");h(w?Math.max(1,Number(w)):1)};return window.addEventListener("popstate",P),()=>window.removeEventListener("popstate",P)},[]);const p=Math.ceil(t.length/Qh);V.useEffect(()=>{if(p>0&&f>p){h(p);const P=new URL(window.location.href);P.searchParams.set("page",String(p)),window.history.replaceState({},"",P)}},[p,f]),V.useEffect(()=>{if(e){h(1);const P=new URL(window.location.href);P.searchParams.delete("page"),window.history.replaceState({},"",P)}},[e]);const m=t.slice((f-1)*Qh,f*Qh),b=P=>{h(P);const y=new URL(window.location.href);y.searchParams.set("page",String(P)),window.history.pushState({},"",y),window.scrollTo({top:0,behavior:"smooth"})},S=()=>{if(p<=1)return null;const P=[],y=5;let w=Math.max(1,f-Math.floor(y/2)),T=Math.min(p,w+y-1);T-w+1b(1),disabled:f===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Primera página",children:d.jsx(O1,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>b(f-1),disabled:f===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Anterior",children:d.jsx(id,{className:"w-4 h-4"})}),w>1&&d.jsx("span",{className:"text-gray-500 px-1",children:"..."}),P.map(L=>d.jsx("button",{onClick:()=>b(L),className:`w-8 h-8 rounded-lg text-sm font-medium transition-colors ${f===L?"bg-[#bb86fc] text-white":"bg-[#1a1a1a] text-gray-400 hover:bg-[#333] hover:text-white"}`,children:L},L)),Tb(f+1),disabled:f===p,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Siguiente",children:d.jsx(sd,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>b(p),disabled:f===p,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Última página",children:d.jsx(M1,{className:"w-4 h-4"})})]})};return n&&e?d.jsx("div",{className:"flex flex-col items-center justify-center py-16 animate-in fade-in duration-300",children:d.jsxs("div",{className:"text-gray-400 text-sm animate-pulse",children:['Buscando "',e,'"...']})}):o?d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 justify-center items-start animate-in fade-in duration-300",children:Array.from({length:12}).map((P,y)=>d.jsx(PO,{},y))}):e&&t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 animate-in fade-in duration-300",children:[d.jsx(nl,{className:"w-16 h-16 text-gray-600 mb-4 animate-bounce"}),d.jsx("p",{className:"text-gray-400 text-lg mb-2",children:"No se encontraron resultados"}),d.jsx("p",{className:"text-gray-500 text-sm",children:"Intenta con otros términos de búsqueda"})]}):!e&&t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-20 animate-in fade-in duration-300",children:[d.jsx(nl,{className:"w-16 h-16 text-gray-600 mb-4 animate-bounce"}),d.jsx("p",{className:"text-gray-400 text-lg mb-2",children:"No hay mangas disponibles"}),d.jsx("p",{className:"text-gray-500 text-sm",children:'Crea tu primer manga usando el botón "Nuevo"'})]}):d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 justify-center items-start",children:m.map(P=>d.jsx("div",{children:d.jsx(kI,{id:P.id,title:P.title,author:P.author,pageCount:P.pageCount,thumbnail:P.thumbnail,manga:P.manga,onSelect:()=>r(P.id),onEdit:i,onDelete:s?()=>s(P.id):void 0,isCategoryPlusEnabled:a,isSelected:u.includes(P.id),onToggleSelect:c?()=>c(P.id):void 0})},P.id))}),S()]})}function ro(t){return t.toLowerCase().trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Yh(t,e){const n=ro(t),r=ro(e);if(n===r)return 1;if(n.length<2||r.length<2)return n.includes(r)?.8:0;const i=n.length>r.length?n:r,s=n.length>r.length?r:n,o=DO(s,i);return(i.length-o)/i.length}function DO(t,e){const n=[];for(let r=0;r<=t.length;r++){let i=r;for(let s=0;s<=e.length;s++)if(r===0)n[s]=s;else if(s>0){let o=n[s-1];t.charAt(r-1)!==e.charAt(s-1)&&(o=Math.min(Math.min(o,i),n[s])+1),n[s-1]=i,i=o}r>0&&(n[e.length]=i)}return n[e.length]}function jO(t,e,n={}){const{minChars:r=1,fuzzyMatch:i=!0}=n;if(!e.trim()||e.length{let u=0;const c=Yh(a.title,e),f=Yh(a.author,e),h=ro(a.title).includes(s)?.3:0,p=ro(a.author).includes(s)?.2:0;let m=0,b=0;if(a.categories&&a.categories.length>0){const S=a.categories.map(y=>Yh(y,e));m=Math.max(...S),b=a.categories.some(y=>ro(y).includes(s))?.3:0}return u=Math.max(c*.6+h,f*.4+p,m*.5+b),{item:a,score:u}}).filter(a=>i?a.score>.3:a.score>.7).sort((a,u)=>u.score-a.score).map(a=>a.item);return{items:o,query:e,resultCount:o.length}}function LO(){const[t,e]=V.useState(!1),[n,r]=V.useState(!1),[i,s]=V.useState(!1),[o,a]=V.useState(!1),[u,c]=V.useState(null),[f,h]=V.useState(!1),[p,m]=V.useState([]),[b,S]=V.useState(!1),[P,y]=V.useState(null),[w,T]=V.useState([]),[L,F]=V.useState(null),[D,_]=V.useState([]),[x,E]=V.useState(!1),[k,C]=V.useState(!1),[j,A]=V.useState(!0),[de,oe]=V.useState(""),[le,ve]=V.useState([]),[K,ie]=V.useState([]),[N,fe]=V.useState(()=>localStorage.getItem("sortType")||"modified"),[ye,R]=V.useState(()=>localStorage.getItem("sortDirection")||"desc");V.useEffect(()=>{const ue=new URLSearchParams(window.location.search).get("admin")==="true";a(ue)},[]),V.useEffect(()=>{localStorage.setItem("sortType",N)},[N]),V.useEffect(()=>{localStorage.setItem("sortDirection",ye)},[ye]),V.useEffect(()=>{var Ce;(Ce=window.Telegram)!=null&&Ce.WebApp&&window.Telegram.WebApp.ready(),H();const W=window.location.hash.slice(1);if(W&&W.startsWith("manga/"))if(W.endsWith("/hd")){const we=W.replace("manga/","").replace("/hd","");y(we),E(!0)}else{const we=W.replace("manga/","");y(we),E(!1)}else W==="info"&&C(!0);const ue=()=>{const we=window.location.hash.slice(1);if(!we)y(null),F(null),C(!1),E(!1);else if(we.startsWith("manga/")){if(we.endsWith("/hd")){const He=we.replace("manga/","").replace("/hd","");y(He),E(!0)}else{const He=we.replace("manga/","");y(He),E(!1)}F(null),C(!1)}else we==="info"&&(C(!0),y(null),F(null))};return window.addEventListener("hashchange",ue),()=>window.removeEventListener("hashchange",ue)},[]),V.useEffect(()=>{f||m([])},[f]);async function H(){try{A(!0);const W=await jd();_(W)}catch(W){console.error("Error loading mangas:",W)}finally{A(!1)}}const J=V.useMemo(()=>{const W=new Map;return D.forEach(ue=>{var Ce;(Ce=ue.categories)==null||Ce.forEach(we=>{W.has(we.id)||W.set(we.id,we)})}),Array.from(W.values())},[D]),te=V.useMemo(()=>de.trim()?jO(D.map(W=>({id:W.id,title:W.title,author:W.author,categories:W.categories?W.categories.map(ue=>ue.name):[]})),de,{fuzzyMatch:!0,minChars:1}):{items:D,query:"",resultCount:D.length},[D,de]),Ie=V.useMemo(()=>{let W=te.items.length>0?te.items.map(Ce=>D.find(we=>we.id===Ce.id)).filter(Boolean):[];le.length>0&&(W=W.filter(Ce=>le.some(we=>{var He;return(He=Ce.categories)==null?void 0:He.some(Et=>Et.name===we)}))),K.length>0&&(W=W.filter(Ce=>K.includes(Ce.author)));const ue=[...W];return N==="random"?ue.sort(()=>Math.random()-.5):(ue.sort((Ce,we)=>{var Et,Ft;let He=0;if(N==="name")He=Ce.title.localeCompare(we.title);else if(N==="date"){const z=new Date(Ce.created_at||0).getTime(),O=new Date(we.created_at||0).getTime();He=z-O}else if(N==="modified"){const z=new Date(Ce.updated_at||Ce.created_at||0).getTime(),O=new Date(we.updated_at||we.created_at||0).getTime();He=z-O}else if(N==="pages"){const z=((Et=Ce.chapters)==null?void 0:Et.reduce((B,Q)=>{var Y;return B+(((Y=Q.pages)==null?void 0:Y.length)||0)},0))||0,O=((Ft=we.chapters)==null?void 0:Ft.reduce((B,Q)=>{var Y;return B+(((Y=Q.pages)==null?void 0:Y.length)||0)},0))||0;He=z-O}else N==="views"&&(He=(Ce.views||0)-(we.views||0));return ye==="asc"?He:-He}),ue)},[D,de,te.items,N,ye,le,K]),pe=W=>{c(W),e(!0)},Fe=async W=>{try{await KD(W),await H()}catch(ue){console.error("Error deleting manga:",ue),alert("Error al eliminar el manga. Por favor intenta de nuevo.")}},ut=W=>{m(ue=>ue.includes(W)?ue.filter(Ce=>Ce!==W):[...ue,W])},Je=W=>{if(f){ut(W);return}window.location.hash=`manga/${W}`,y(W),E(!1)},bt=()=>{window.location.hash="",y(null),C(!1)},mt=W=>{P&&T([...w,P]),window.location.hash=`manga / ${W} `,y(W)},gt=W=>{ve(ue=>ue.includes(W)?ue.filter(Ce=>Ce!==W):[...ue,W]),bt()},Ht=W=>{ve(ue=>ue.filter(Ce=>Ce!==W))},Vt=W=>{ie(ue=>ue.includes(W)?ue.filter(Ce=>Ce!==W):[...ue,W]),bt()},Ze=W=>{ie(ue=>ue.filter(Ce=>Ce!==W))},Nn=V.useMemo(()=>Ie.map(W=>{var we,He;const ue=((we=W.chapters)==null?void 0:we.length)||0,Ce=((He=W.chapters)==null?void 0:He.reduce((Et,Ft)=>{var z;return Et+(((z=Ft.pages)==null?void 0:z.length)||0)},0))||0;return{id:W.id,title:W.title,author:W.author,chapterCount:ue,pageCount:Ce,thumbnail:W.cover_url||W.thumbnail_url||void 0,manga:W}}),[Ie]);if(L)return d.jsx(jj,{manga:L.manga,chapter:L.chapter,onBack:()=>F(null)});if(k)return d.jsx(SO,{onBack:bt,isAdmin:o});if(P!==null){let W=D.find(ue=>ue.id===P);return x&&W?d.jsx(f2,{manga:W,onBack:()=>{window.history.back()}}):d.jsx(Dj,{id:P,onBack:()=>{if(w.length>0){const ue=w[w.length-1];T(w.slice(0,-1)),window.location.hash=`manga / ${ue} `,y(ue)}else bt()},onReadChapter:ue=>{W&&F({manga:W,chapter:ue})},onMangaLoaded:ue=>{W||(W=ue)},onNavigateToManga:mt,onSelectCategory:gt,onSelectAuthor:Vt,isAdmin:o})}return d.jsxs("div",{className:"min-h-screen bg-[#121212] text-white flex flex-col",children:[d.jsx("header",{className:"border-b border-gray-800/50 px-3 sm:px-6 md:px-12 py-4 sm:py-6 flex-shrink-0 transition-all duration-300",children:d.jsxs("div",{className:"max-w-[1800px] mx-auto flex items-center justify-between gap-2 sm:gap-0",children:[d.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 group cursor-pointer",children:[d.jsx("img",{src:"/icons/icones.png",alt:"Twisted Brody Logo",className:"w-10 h-10 sm:w-14 sm:h-14 object-contain transition-all duration-300 group-hover:rotate-12 group-hover:scale-110"}),d.jsx("h1",{className:"text-lg sm:text-2xl font-bold text-white transition-colors duration-300 group-hover:text-[#bb86fc]",children:"Twisted Brody MangaFlow"})]}),d.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3",children:[f&&d.jsxs("div",{className:"hidden sm:flex items-center gap-2 mr-2 px-3 py-1.5 bg-purple-500/10 rounded-lg border border-purple-500/20",children:[d.jsx(U1,{className:"w-4 h-4 text-purple-400"}),d.jsx("span",{className:"text-xs font-semibold text-purple-300",children:"Modo Plus Activo"}),d.jsx("span",{className:"text-xs bg-purple-500/20 px-2 py-0.5 rounded text-purple-200",children:p.length})]}),o&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>r(!0),className:"bg-gray-800 hover:bg-gray-700 active:scale-95 text-white px-2 py-2 sm:px-4 sm:py-2.5 rounded-lg flex items-center gap-1.5 sm:gap-2 font-semibold transition-all duration-300 border border-gray-700/50 hover:border-gray-600 text-xs sm:text-sm hover:scale-110 hover:shadow-lg hover:shadow-700/50",title:"Ajustes y Admin",children:[d.jsx($1,{className:"w-4 h-4 sm:w-5 sm:h-5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:"Ajustes"})]}),d.jsxs("button",{onClick:()=>e(!0),className:"bg-purple-600 hover:bg-purple-700 active:scale-95 text-white px-2 py-2 sm:px-4 sm:py-2.5 rounded-lg flex items-center gap-1.5 sm:gap-2 font-semibold transition-all duration-300 shadow-lg shadow-purple-600/30 hover:shadow-purple-600/50 text-xs sm:text-sm hover:scale-110",children:[d.jsx(co,{className:"w-4 h-4 sm:w-5 sm:h-5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:"Nuevo Manga"})]})]})]})]})}),d.jsxs("main",{className:"flex-1 px-4 sm:px-6 md:px-12 py-8",children:[d.jsx(Aj,{isAdmin:o}),d.jsxs("div",{className:"max-w-[1800px] mx-auto mb-8 flex-shrink-0",children:[d.jsx(AO,{value:de,onChange:oe,placeholder:"Buscar por título, autor...",sortType:N,onSortTypeChange:fe,sortDirection:ye,onSortDirectionChange:R,onOpenFilter:()=>s(!0)}),de&&d.jsxs("div",{className:"mt-2 text-sm text-gray-400",children:[te.resultCount," resultado",te.resultCount!==1?"s":""," encontrado",te.resultCount!==1?"s":""]}),(le.length>0||K.length>0)&&d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2 animate-in fade-in slide-in-from-top-2 duration-300",children:[d.jsx("span",{className:"text-sm text-gray-400",children:"Filtrado por:"}),le.map(W=>d.jsxs("button",{onClick:()=>Ht(W),className:"bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 px-3 py-1 rounded-full text-sm font-medium flex items-center gap-2 border border-purple-500/30 hover:border-purple-500/50 transition-all group",children:[W,d.jsx("div",{className:"bg-purple-500/20 rounded-full p-0.5 group-hover:bg-purple-500/40 transition-colors",children:d.jsx(co,{className:"w-3 h-3 transform rotate-45"})})]},W)),K.map(W=>d.jsxs("button",{onClick:()=>Ze(W),className:"bg-[#bb86fc]/20 hover:bg-[#bb86fc]/30 text-[#bb86fc] px-3 py-1 rounded-full text-sm font-medium flex items-center gap-2 border border-[#bb86fc]/30 hover:border-[#bb86fc]/50 transition-all group",children:[d.jsx(Nm,{size:14}),W,d.jsx("div",{className:"bg-[#bb86fc]/20 rounded-full p-0.5 group-hover:bg-[#bb86fc]/40 transition-colors",children:d.jsx(co,{className:"w-3 h-3 transform rotate-45"})})]},W)),(le.length>0||K.length>0)&&d.jsx("button",{onClick:()=>{ve([]),ie([])},className:"text-xs text-gray-400 hover:text-white underline decoration-gray-600 hover:decoration-white transition-colors ml-2",children:"Limpiar todo"})]})]}),d.jsx("div",{className:"max-w-[1800px] mx-auto",children:d.jsxs(d.Fragment,{children:[d.jsx("link",{rel:"preconnect",href:"https://i.ibb.co"}),d.jsx(RO,{items:Nn,searchTerm:de,isSearching:!1,isLoading:j,onSelectComic:Je,onEditManga:o?pe:void 0,onDeleteManga:o?Fe:void 0,isCategoryPlusEnabled:f,selectedMangaIds:p,onToggleSelectManga:ut})]})})]}),f&&p.length>0&&d.jsx("div",{className:"fixed bottom-6 left-1/2 transform -translate-x-1/2 z-40 animate-in slide-in-from-bottom-4 duration-200",children:d.jsxs("div",{className:"bg-[#1a1a1a] border border-gray-700/50 shadow-2xl rounded-xl px-6 py-3 flex items-center gap-4",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsxs("span",{className:"text-sm font-bold text-white",children:[p.length," seleccionados"]}),d.jsx("span",{className:"text-xs text-gray-400",children:"Listos para editar"})]}),d.jsx("div",{className:"h-8 w-px bg-gray-700"}),d.jsx("button",{onClick:()=>m([]),className:"text-gray-400 hover:text-white text-sm font-semibold transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:()=>S(!0),className:"bg-[#bb86fc] hover:bg-[#9966dd] text-white px-4 py-2 rounded-lg text-sm font-bold shadow-lg shadow-purple-500/20 transition-all transform hover:scale-105 active:scale-95",children:"Aplicar Categorías"})]})}),d.jsx(od,{}),d.jsx(kj,{isOpen:t,onClose:()=>{e(!1),c(null)},editingManga:u,onMangaCreated:W=>{H(),c(null),W&&!u&&setTimeout(()=>{Je(W)},500)},onDelete:o?Fe:void 0}),d.jsx(kO,{isOpen:b,onClose:()=>S(!1),selectedMangaIds:p,onSaveComplete:()=>{H(),m([])}}),d.jsx(Nj,{isOpen:n,onClose:()=>r(!1),isAdmin:o,onAdminChange:a,isCategoryPlusEnabled:f,onCategoryPlusChange:h}),d.jsx(NO,{isOpen:i,onClose:()=>s(!1),categories:J,selectedCategories:le,onToggleCategory:gt,onClearFilters:()=>ve([])}),d.jsx(Tj,{position:"top-center",richColors:!0,theme:"dark"})]})}L1(document.getElementById("root")).render(d.jsx(V.StrictMode,{children:d.jsx(LO,{})})); diff --git a/dist/assets/index-B_R5IU3M.css b/dist/assets/index-B_R5IU3M.css new file mode 100644 index 0000000000000000000000000000000000000000..8095cad83f04d804df0dad2dffb0e390c7db921d --- /dev/null +++ b/dist/assets/index-B_R5IU3M.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-1\.5{left:.375rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.right-8{right:2rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-6{top:1.5rem}.top-8{top:2rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-\[2\/3\]{aspect-ratio:2/3}.aspect-\[3\/4\]{aspect-ratio:3/4}.h-1{height:.25rem}.h-1\/3{height:33.333333%}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[500px\]{height:500px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-60{max-height:15rem}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[300\%\]{width:300%}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[3ch\]{min-width:3ch}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[150px\]{max-width:150px}.max-w-\[1800px\]{max-width:1800px}.max-w-\[1920px\]{max-width:1920px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-left{transform-origin:left}.origin-right{transform-origin:right}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-\[fadeIn_0\.7s_ease-out_forwards\]{animation:fadeIn .7s ease-out forwards}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#bb86fc\]{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.border-\[\#bb86fc\]\/30{border-color:#bb86fc4d}.border-\[\#bb86fc\]\/40{border-color:#bb86fc66}.border-\[\#bb86fc\]\/50{border-color:#bb86fc80}.border-blue-500\/30{border-color:#3b82f64d}.border-gray-500\/30{border-color:#6b72804d}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-600\/50{border-color:#4b556380}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-700\/30{border-color:#3741514d}.border-gray-700\/40{border-color:#37415166}.border-gray-700\/50{border-color:#37415180}.border-gray-700\/60{border-color:#37415199}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-gray-800\/50{border-color:#1f293780}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-500\/30{border-color:#22c55e4d}.border-pink-500\/30{border-color:#ec48994d}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-purple-500\/50{border-color:#a855f780}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-transparent{border-color:transparent}.border-white\/50{border-color:#ffffff80}.border-t-transparent{border-top-color:transparent}.bg-\[\#050505\]{--tw-bg-opacity: 1;background-color:rgb(5 5 5 / var(--tw-bg-opacity, 1))}.bg-\[\#0a0a0a\]{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-\[\#0f0f0f\]{--tw-bg-opacity: 1;background-color:rgb(15 15 15 / var(--tw-bg-opacity, 1))}.bg-\[\#121212\]{--tw-bg-opacity: 1;background-color:rgb(18 18 18 / var(--tw-bg-opacity, 1))}.bg-\[\#121212\]\/90{background-color:#121212e6}.bg-\[\#151515\]{--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]\/50{background-color:#1a1a1a80}.bg-\[\#1f1f1f\]{--tw-bg-opacity: 1;background-color:rgb(31 31 31 / var(--tw-bg-opacity, 1))}.bg-\[\#252525\]{--tw-bg-opacity: 1;background-color:rgb(37 37 37 / var(--tw-bg-opacity, 1))}.bg-\[\#bb86fc\]{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.bg-\[\#bb86fc\]\/10{background-color:#bb86fc1a}.bg-\[\#bb86fc\]\/20{background-color:#bb86fc33}.bg-\[\#bb86fc\]\/90{background-color:#bb86fce6}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/95{background-color:#000000f2}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-700\/40{background-color:#37415166}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600\/90{background-color:#16a34ae6}.bg-pink-500\/20{background-color:#ec489933}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.bg-purple-900\/90{background-color:#581c87e6}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-600\/80{background-color:#dc2626cc}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-\[\#1a1a1a\]{--tw-gradient-from: #1a1a1a var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 26 26 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#1f1f1f\]{--tw-gradient-from: #1f1f1f var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 31 31 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#1f1f1f\]\/80{--tw-gradient-from: rgb(31 31 31 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 31 31 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#242424\]{--tw-gradient-from: #242424 var(--tw-gradient-from-position);--tw-gradient-to: rgb(36 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#2a2a2a\]{--tw-gradient-from: #2a2a2a var(--tw-gradient-from-position);--tw-gradient-to: rgb(42 42 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#2a2a2a\]\/80{--tw-gradient-from: rgb(42 42 42 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(42 42 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#9966dd\]{--tw-gradient-from: #9966dd var(--tw-gradient-from-position);--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#bb86fc\]{--tw-gradient-from: #bb86fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(187 134 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#bb86fc\]\/20{--tw-gradient-from: rgb(187 134 252 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(187 134 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-700\/40{--tw-gradient-from: rgb(55 65 81 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(55 65 81 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800{--tw-gradient-from: #1f2937 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-\[\#9966dd\]{--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #9966dd var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/20{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-\[\#0f0f0f\]{--tw-gradient-to: #0f0f0f var(--tw-gradient-to-position)}.to-\[\#121212\]{--tw-gradient-to: #121212 var(--tw-gradient-to-position)}.to-\[\#1a1a1a\]{--tw-gradient-to: #1a1a1a var(--tw-gradient-to-position)}.to-\[\#1a1a1a\]\/80{--tw-gradient-to: rgb(26 26 26 / .8) var(--tw-gradient-to-position)}.to-\[\#1f1f1f\]{--tw-gradient-to: #1f1f1f var(--tw-gradient-to-position)}.to-\[\#1f1f1f\]\/80{--tw-gradient-to: rgb(31 31 31 / .8) var(--tw-gradient-to-position)}.to-\[\#252525\]{--tw-gradient-to: #252525 var(--tw-gradient-to-position)}.to-\[\#7744cc\]{--tw-gradient-to: #7744cc var(--tw-gradient-to-position)}.to-\[\#9966dd\]{--tw-gradient-to: #9966dd var(--tw-gradient-to-position)}.to-\[\#bb86fc\]{--tw-gradient-to: #bb86fc var(--tw-gradient-to-position)}.to-gray-400{--tw-gradient-to: #9ca3af var(--tw-gradient-to-position)}.to-gray-600\/40{--tw-gradient-to: rgb(75 85 99 / .4) var(--tw-gradient-to-position)}.to-gray-900{--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-left{-o-object-position:left;object-position:left}.object-right{-o-object-position:right;object-position:right}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\[\#bb86fc\]{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-pink-300{--tw-text-opacity: 1;color:rgb(249 168 212 / var(--tw-text-opacity, 1))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.text-purple-100{--tw-text-opacity: 1;color:rgb(243 232 255 / var(--tw-text-opacity, 1))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/40{color:#fff6}.text-white\/70{color:#ffffffb3}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.decoration-gray-600{text-decoration-color:#4b5563}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.accent-\[\#bb86fc\]{accent-color:#bb86fc}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_15px_-3px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow: 0 0 15px -3px rgba(168,85,247,.3);--tw-shadow-colored: 0 0 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[\#bb86fc\]\/10{--tw-shadow-color: rgb(187 134 252 / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/20{--tw-shadow-color: rgb(187 134 252 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/30{--tw-shadow-color: rgb(187 134 252 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/40{--tw-shadow-color: rgb(187 134 252 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-black\/50{--tw-shadow-color: rgb(0 0 0 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-blue-500\/20{--tw-shadow-color: rgb(59 130 246 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/40{--tw-shadow-color: rgb(34 197 94 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/20{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-600\/30{--tw-shadow-color: rgb(147 51 234 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-900\/20{--tw-shadow-color: rgb(88 28 135 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/20{--tw-shadow-color: rgb(239 68 68 / .2);--tw-shadow: var(--tw-shadow-colored)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-\[\#bb86fc\]{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 134 252 / var(--tw-ring-opacity, 1))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-none{transition-property:none}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes quickFadeIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}.animate-quick-fade-in{animation:quickFadeIn .15s ease-out forwards}@keyframes smoothFadeIn{0%{opacity:0;transform:scale(.98)}50%{opacity:.5}to{opacity:1;transform:scale(1)}}.animate-smooth-fade-in{animation:smoothFadeIn 1.2s ease-out forwards}.masonry-container{-moz-column-count:2;column-count:2;-moz-column-gap:4px;column-gap:4px}@media (min-width: 640px){.masonry-container{-moz-column-count:3;column-count:3}}@media (min-width: 768px){.masonry-container{-moz-column-count:4;column-count:4}}@media (min-width: 1024px){.masonry-container{-moz-column-count:5;column-count:5}}@media (min-width: 1280px){.masonry-container{-moz-column-count:6;column-count:6}}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.animate-shimmer{animation:shimmer 2.5s infinite}.masonry-item{-moz-column-break-inside:avoid;break-inside:avoid;margin-bottom:4px;display:inline-block;width:100%}@keyframes slideInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideInLeft{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes slideInRight{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes glow{0%,to{box-shadow:0 0 5px #8b5cf61a}50%{box-shadow:0 0 20px #8b5cf64d}}@keyframes pulse-color{0%,to{color:currentColor}50%{color:#8b5cf699}}.animate-slide-in-up{animation:slideInUp .5s ease-out forwards}.animate-slide-in-down{animation:slideInDown .5s ease-out forwards}.animate-slide-in-left{animation:slideInLeft .5s ease-out forwards}.animate-slide-in-right{animation:slideInRight .5s ease-out forwards}.animate-glow{animation:glow 2s ease-in-out infinite}.animate-pulse-color{animation:pulse-color 2s ease-in-out infinite}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:rotate-180:hover{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:rotate-90:hover{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[\#24A1DE\]:hover{--tw-border-opacity: 1;border-color:rgb(36 161 222 / var(--tw-border-opacity, 1))}.hover\:border-\[\#FF424D\]:hover{--tw-border-opacity: 1;border-color:rgb(255 66 77 / var(--tw-border-opacity, 1))}.hover\:border-\[\#bb86fc\]:hover{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.hover\:border-\[\#bb86fc\]\/50:hover{border-color:#bb86fc80}.hover\:border-gray-500:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:border-gray-600\/70:hover{border-color:#4b5563b3}.hover\:border-gray-700:hover{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.hover\:border-gray-700\/60:hover{border-color:#37415199}.hover\:border-purple-500:hover{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.hover\:border-purple-500\/50:hover{border-color:#a855f780}.hover\:border-red-500\/40:hover{border-color:#ef444466}.hover\:border-white:hover{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#1f1f1f\]:hover{--tw-bg-opacity: 1;background-color:rgb(31 31 31 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#242424\]:hover{--tw-bg-opacity: 1;background-color:rgb(36 36 36 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#2a2a2a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 42 42 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#333\]:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#9966dd\]:hover{--tw-bg-opacity: 1;background-color:rgb(153 102 221 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#bb86fc\]:hover{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#bb86fc\]\/10:hover{background-color:#bb86fc1a}.hover\:bg-\[\#bb86fc\]\/20:hover{background-color:#bb86fc33}.hover\:bg-\[\#bb86fc\]\/30:hover{background-color:#bb86fc4d}.hover\:bg-\[\#bb86fc\]\/5:hover{background-color:#bb86fc0d}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-500\/30:hover{background-color:#a855f74d}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-700:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/20:hover{background-color:#ef444433}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:from-\[\#9966dd\]:hover{--tw-gradient-from: #9966dd var(--tw-gradient-from-position);--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-gray-700\/60:hover{--tw-gradient-from: rgb(55 65 81 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(55 65 81 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-\[\#7744cc\]:hover{--tw-gradient-to: #7744cc var(--tw-gradient-to-position)}.hover\:to-gray-600\/60:hover{--tw-gradient-to: rgb(75 85 99 / .6) var(--tw-gradient-to-position)}.hover\:text-\[\#24A1DE\]:hover{--tw-text-opacity: 1;color:rgb(36 161 222 / var(--tw-text-opacity, 1))}.hover\:text-\[\#FF424D\]:hover{--tw-text-opacity: 1;color:rgb(255 66 77 / var(--tw-text-opacity, 1))}.hover\:text-\[\#bb86fc\]:hover{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.hover\:text-purple-400:hover{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-white:hover{text-decoration-color:#fff}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-\[\#bb86fc\]\/60:hover{--tw-shadow-color: rgb(187 134 252 / .6);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/10:hover{--tw-shadow-color: rgb(168 85 247 / .1);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/20:hover{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-600\/50:hover{--tw-shadow-color: rgb(147 51 234 / .5);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-\[\#bb86fc\]:focus{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.focus\:border-purple-500:focus{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.focus\:border-purple-500\/50:focus{border-color:#a855f780}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[\#bb86fc\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 134 252 / var(--tw-ring-opacity, 1))}.focus\:ring-\[\#bb86fc\]\/30:focus{--tw-ring-color: rgb(187 134 252 / .3)}.focus\:ring-purple-500\/50:focus{--tw-ring-color: rgb(168 85 247 / .5)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-\[\#1a1a1a\]:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.group:hover .group-hover\:-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[1\.08\]{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[1\.10\]{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:bg-\[\#bb86fc\]\/40{background-color:#bb86fc66}.group:hover .group-hover\:bg-purple-500\/40{background-color:#a855f766}.group:hover .group-hover\:text-\[\#bb86fc\]{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-white\/60{color:#fff9}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:shadow-\[\#bb86fc\]\/30{--tw-shadow-color: rgb(187 134 252 / .3);--tw-shadow: var(--tw-shadow-colored)}.group:hover .group-hover\:shadow-\[\#bb86fc\]\/60{--tw-shadow-color: rgb(187 134 252 / .6);--tw-shadow: var(--tw-shadow-colored)}.peer:checked~.peer-checked\:bg-\[\#bb86fc\]{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.peer:focus~.peer-focus\:ring-blue-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1))}.peer:focus~.peer-focus\:ring-purple-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(216 180 254 / var(--tw-ring-opacity, 1))}.peer:focus~.peer-focus\:ring-red-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(252 165 165 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:left-8{left:2rem}.sm\:right-8{right:2rem}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:mt-12{margin-top:3rem}.sm\:mt-2{margin-top:.5rem}.sm\:mt-8{margin-top:2rem}.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-14{height:3.5rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:w-10{width:2.5rem}.sm\:w-14{width:3.5rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-64{width:16rem}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:gap-0{gap:0px}.sm\:gap-1\.5{gap:.375rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:p-12{padding:3rem}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pt-12{padding-top:3rem}.sm\:pt-8{padding-top:2rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:right-8{right:2rem}.md\:flex{display:flex}.md\:hidden{display:none}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-3{gap:.75rem}.md\:p-12{padding:3rem}.md\:px-12{padding-left:3rem;padding-right:3rem}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (prefers-color-scheme: dark){.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-blue-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 33 168 / var(--tw-ring-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-red-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(153 27 27 / var(--tw-ring-opacity, 1))}} diff --git a/dist/assets/index-BmVodIQq.js b/dist/assets/index-BmVodIQq.js new file mode 100644 index 0000000000000000000000000000000000000000..6aeb0674720434a388204648171b1579bc6b262a --- /dev/null +++ b/dist/assets/index-BmVodIQq.js @@ -0,0 +1,3558 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Hu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ww={exports:{}},Uc={},_w={exports:{}},Le={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ml=Symbol.for("react.element"),CT=Symbol.for("react.portal"),NT=Symbol.for("react.fragment"),AT=Symbol.for("react.strict_mode"),PT=Symbol.for("react.profiler"),RT=Symbol.for("react.provider"),DT=Symbol.for("react.context"),jT=Symbol.for("react.forward_ref"),LT=Symbol.for("react.suspense"),OT=Symbol.for("react.memo"),MT=Symbol.for("react.lazy"),Ay=Symbol.iterator;function VT(t){return t===null||typeof t!="object"?null:(t=Ay&&t[Ay]||t["@@iterator"],typeof t=="function"?t:null)}var bw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ew=Object.assign,Sw={};function jo(t,e,n){this.props=t,this.context=e,this.refs=Sw,this.updater=n||bw}jo.prototype.isReactComponent={};jo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};jo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Tw(){}Tw.prototype=jo.prototype;function Dp(t,e,n){this.props=t,this.context=e,this.refs=Sw,this.updater=n||bw}var jp=Dp.prototype=new Tw;jp.constructor=Dp;Ew(jp,jo.prototype);jp.isPureReactComponent=!0;var Py=Array.isArray,Iw=Object.prototype.hasOwnProperty,Lp={current:null},kw={key:!0,ref:!0,__self:!0,__source:!0};function Cw(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Iw.call(e,r)&&!kw.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,_e=G[pe];if(0>>1;pei(Y,A))re<_e&&0>i(Ce,Y)?(G[pe]=Ce,G[re]=A,pe=re):(G[pe]=Y,G[$]=A,pe=$);else if(re<_e&&0>i(Ce,A))G[pe]=Ce,G[re]=A,pe=re;else break e}}return se}function i(G,se){var A=G.sortIndex-se.sortIndex;return A!==0?A:G.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var u=[],c=[],h=1,f=null,p=3,g=!1,_=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(G){for(var se=n(c);se!==null;){if(se.callback===null)r(c);else if(se.startTime<=G)r(c),se.sortIndex=se.expirationTime,e(u,se);else break;se=n(c)}}function L(G){if(T=!1,k(G),!_)if(n(u)!==null)_=!0,fe(U);else{var se=n(c);se!==null&&we(L,se.startTime-G)}}function U(G,se){_=!1,T&&(T=!1,y(x),x=-1),g=!0;var A=p;try{for(k(se),f=n(u);f!==null&&(!(f.expirationTime>se)||G&&!N());){var pe=f.callback;if(typeof pe=="function"){f.callback=null,p=f.priorityLevel;var _e=pe(f.expirationTime<=se);se=t.unstable_now(),typeof _e=="function"?f.callback=_e:f===n(u)&&r(u),k(se)}else r(u);f=n(u)}if(f!==null)var P=!0;else{var $=n(c);$!==null&&we(L,$.startTime-se),P=!1}return P}finally{f=null,p=A,g=!1}}var j=!1,b=null,x=-1,E=5,I=-1;function N(){return!(t.unstable_now()-IG||125pe?(G.sortIndex=A,e(c,G),n(u)===null&&G===n(c)&&(T?(y(x),x=-1):T=!0,we(L,A-pe))):(G.sortIndex=_e,e(u,G),_||g||(_=!0,fe(U))),G},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(G){var se=p;return function(){var A=p;p=se;try{return G.apply(this,arguments)}finally{p=A}}}})(Dw);Rw.exports=Dw;var QT=Rw.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var YT=F,Fn=QT;function X(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qh=Object.prototype.hasOwnProperty,XT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Dy={},jy={};function JT(t){return Qh.call(jy,t)?!0:Qh.call(Dy,t)?!1:XT.test(t)?jy[t]=!0:(Dy[t]=!0,!1)}function ZT(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function eI(t,e,n,r){if(e===null||typeof e>"u"||ZT(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function fn(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Qt[t]=new fn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Qt[e]=new fn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Qt[t]=new fn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Qt[t]=new fn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Qt[t]=new fn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Qt[t]=new fn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Qt[t]=new fn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Qt[t]=new fn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Qt[t]=new fn(t,5,!1,t.toLowerCase(),null,!1,!1)});var Mp=/[\-:]([a-z])/g;function Vp(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Mp,Vp);Qt[e]=new fn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Mp,Vp);Qt[e]=new fn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Mp,Vp);Qt[e]=new fn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Qt[t]=new fn(t,1,!1,t.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new fn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Qt[t]=new fn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Fp(t,e,n,r){var i=Qt.hasOwnProperty(e)?Qt[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var u=` +`+i[o].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=o&&0<=a);break}}}finally{Jd=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?fa(t):""}function tI(t){switch(t.tag){case 5:return fa(t.type);case 16:return fa("Lazy");case 13:return fa("Suspense");case 19:return fa("SuspenseList");case 0:case 2:case 15:return t=Zd(t.type,!1),t;case 11:return t=Zd(t.type.render,!1),t;case 1:return t=Zd(t.type,!0),t;default:return""}}function Zh(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case qs:return"Fragment";case Hs:return"Portal";case Yh:return"Profiler";case Up:return"StrictMode";case Xh:return"Suspense";case Jh:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Ow:return(t.displayName||"Context")+".Consumer";case Lw:return(t._context.displayName||"Context")+".Provider";case zp:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Bp:return e=t.displayName||null,e!==null?e:Zh(t.type)||"Memo";case fi:e=t._payload,t=t._init;try{return Zh(t(e))}catch{}}return null}function nI(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zh(e);case 8:return e===Up?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Oi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Vw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function rI(t){var e=Vw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Wl(t){t._valueTracker||(t._valueTracker=rI(t))}function Fw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Vw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function qu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ef(t,e){var n=e.checked;return pt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Oy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Oi(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Uw(t,e){e=e.checked,e!=null&&Fp(t,"checked",e,!1)}function tf(t,e){Uw(t,e);var n=Oi(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?nf(t,e.type,n):e.hasOwnProperty("defaultValue")&&nf(t,e.type,Oi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function My(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function nf(t,e,n){(e!=="number"||qu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var pa=Array.isArray;function io(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Gl.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ua(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var _a={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iI=["Webkit","ms","Moz","O"];Object.keys(_a).forEach(function(t){iI.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),_a[e]=_a[t]})});function Hw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||_a.hasOwnProperty(t)&&_a[t]?(""+e).trim():e+"px"}function qw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Hw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var sI=pt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function of(t,e){if(e){if(sI[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(X(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(X(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(X(61))}if(e.style!=null&&typeof e.style!="object")throw Error(X(62))}}function af(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lf=null;function $p(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var uf=null,so=null,oo=null;function Uy(t){if(t=vl(t)){if(typeof uf!="function")throw Error(X(280));var e=t.stateNode;e&&(e=qc(e),uf(t.stateNode,t.type,e))}}function Ww(t){so?oo?oo.push(t):oo=[t]:so=t}function Gw(){if(so){var t=so,e=oo;if(oo=so=null,Uy(t),e)for(t=0;t>>=0,t===0?32:31-(gI(t)/yI|0)|0}var Kl=64,Ql=4194304;function ma(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Qu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ma(a):(s&=o,s!==0&&(r=ma(s)))}else o=n&~i,o!==0?r=ma(o):s!==0&&(r=ma(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function gl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-or(e),t[e]=n}function _I(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Ea),Qy=" ",Yy=!1;function f_(t,e){switch(t){case"keyup":return QI.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ws=!1;function XI(t,e){switch(t){case"compositionend":return p_(e);case"keypress":return e.which!==32?null:(Yy=!0,Qy);case"textInput":return t=e.data,t===Qy&&Yy?null:t;default:return null}}function JI(t,e){if(Ws)return t==="compositionend"||!Xp&&f_(t,e)?(t=d_(),Eu=Kp=wi=null,Ws=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=e0(n)}}function v_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?v_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function x_(){for(var t=window,e=qu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=qu(t.document)}return e}function Jp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function ak(t){var e=x_(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&v_(n.ownerDocument.documentElement,n)){if(r!==null&&Jp(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=t0(n,s);var o=t0(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Gs=null,mf=null,Ta=null,gf=!1;function n0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gf||Gs==null||Gs!==qu(r)||(r=Gs,"selectionStart"in r&&Jp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ta&&Wa(Ta,r)||(Ta=r,r=Ju(mf,"onSelect"),0Ys||(t.current=bf[Ys],bf[Ys]=null,Ys--)}function rt(t,e){Ys++,bf[Ys]=t.current,t.current=e}var Mi={},sn=Wi(Mi),En=Wi(!1),ys=Mi;function xo(t,e){var n=t.type.contextTypes;if(!n)return Mi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Sn(t){return t=t.childContextTypes,t!=null}function ec(){lt(En),lt(sn)}function u0(t,e,n){if(sn.current!==Mi)throw Error(X(168));rt(sn,e),rt(En,n)}function C_(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(X(108,nI(t)||"Unknown",i));return pt({},n,r)}function tc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Mi,ys=sn.current,rt(sn,t),rt(En,En.current),!0}function c0(t,e,n){var r=t.stateNode;if(!r)throw Error(X(169));n?(t=C_(t,e,ys),r.__reactInternalMemoizedMergedChildContext=t,lt(En),lt(sn),rt(sn,t)):lt(En),rt(En,n)}var Or=null,Wc=!1,fh=!1;function N_(t){Or===null?Or=[t]:Or.push(t)}function xk(t){Wc=!0,N_(t)}function Gi(){if(!fh&&Or!==null){fh=!0;var t=0,e=Ke;try{var n=Or;for(Ke=1;t>=o,i-=o,Vr=1<<32-or(e)+i|n<x?(E=b,b=null):E=b.sibling;var I=p(y,b,k[x],L);if(I===null){b===null&&(b=E);break}t&&b&&I.alternate===null&&e(y,b),w=s(I,w,x),j===null?U=I:j.sibling=I,j=I,b=E}if(x===k.length)return n(y,b),ct&&rs(y,x),U;if(b===null){for(;xx?(E=b,b=null):E=b.sibling;var N=p(y,b,I.value,L);if(N===null){b===null&&(b=E);break}t&&b&&N.alternate===null&&e(y,b),w=s(N,w,x),j===null?U=N:j.sibling=N,j=N,b=E}if(I.done)return n(y,b),ct&&rs(y,x),U;if(b===null){for(;!I.done;x++,I=k.next())I=f(y,I.value,L),I!==null&&(w=s(I,w,x),j===null?U=I:j.sibling=I,j=I);return ct&&rs(y,x),U}for(b=r(y,b);!I.done;x++,I=k.next())I=g(b,y,x,I.value,L),I!==null&&(t&&I.alternate!==null&&b.delete(I.key===null?x:I.key),w=s(I,w,x),j===null?U=I:j.sibling=I,j=I);return t&&b.forEach(function(D){return e(y,D)}),ct&&rs(y,x),U}function R(y,w,k,L){if(typeof k=="object"&&k!==null&&k.type===qs&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case ql:e:{for(var U=k.key,j=w;j!==null;){if(j.key===U){if(U=k.type,U===qs){if(j.tag===7){n(y,j.sibling),w=i(j,k.props.children),w.return=y,y=w;break e}}else if(j.elementType===U||typeof U=="object"&&U!==null&&U.$$typeof===fi&&f0(U)===j.type){n(y,j.sibling),w=i(j,k.props),w.ref=oa(y,j,k),w.return=y,y=w;break e}n(y,j);break}else e(y,j);j=j.sibling}k.type===qs?(w=hs(k.props.children,y.mode,L,k.key),w.return=y,y=w):(L=Pu(k.type,k.key,k.props,null,y.mode,L),L.ref=oa(y,w,k),L.return=y,y=L)}return o(y);case Hs:e:{for(j=k.key;w!==null;){if(w.key===j)if(w.tag===4&&w.stateNode.containerInfo===k.containerInfo&&w.stateNode.implementation===k.implementation){n(y,w.sibling),w=i(w,k.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else e(y,w);w=w.sibling}w=_h(k,y.mode,L),w.return=y,y=w}return o(y);case fi:return j=k._init,R(y,w,j(k._payload),L)}if(pa(k))return _(y,w,k,L);if(ta(k))return T(y,w,k,L);nu(y,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,w!==null&&w.tag===6?(n(y,w.sibling),w=i(w,k),w.return=y,y=w):(n(y,w),w=wh(k,y.mode,L),w.return=y,y=w),o(y)):n(y,w)}return R}var _o=D_(!0),j_=D_(!1),ic=Wi(null),sc=null,Zs=null,nm=null;function rm(){nm=Zs=sc=null}function im(t){var e=ic.current;lt(ic),t._currentValue=e}function Tf(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function lo(t,e){sc=t,nm=Zs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(bn=!0),t.firstContext=null)}function Yn(t){var e=t._currentValue;if(nm!==t)if(t={context:t,memoizedValue:e,next:null},Zs===null){if(sc===null)throw Error(X(308));Zs=t,sc.dependencies={lanes:0,firstContext:t}}else Zs=Zs.next=t;return e}var ls=null;function sm(t){ls===null?ls=[t]:ls.push(t)}function L_(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,sm(e)):(n.next=i.next,i.next=n),e.interleaved=n,Gr(t,r)}function Gr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var pi=!1;function om(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O_(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Br(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ci(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ze&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Gr(t,n)}return i=r.interleaved,i===null?(e.next=e,sm(r)):(e.next=i.next,i.next=e),r.interleaved=e,Gr(t,n)}function Tu(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,qp(t,n)}}function p0(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function oc(t,e,n,r){var i=t.updateQueue;pi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var h=t.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=u))}if(s!==null){var f=i.baseState;o=0,h=c=u=null,a=s;do{var p=a.lane,g=a.eventTime;if((r&p)===p){h!==null&&(h=h.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=t,T=a;switch(p=e,g=n,T.tag){case 1:if(_=T.payload,typeof _=="function"){f=_.call(g,f,p);break e}f=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=T.payload,p=typeof _=="function"?_.call(g,f,p):_,p==null)break e;f=pt({},f,p);break e;case 2:pi=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=g,u=f):h=h.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(h===null&&(u=f),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ws|=o,t.lanes=o,t.memoizedState=f}}function m0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=mh.transition;mh.transition={};try{t(!1),e()}finally{Ke=n,mh.transition=r}}function Z_(){return Xn().memoizedState}function Ek(t,e,n){var r=Ai(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},e1(t))t1(e,n);else if(n=L_(t,e,n,r),n!==null){var i=dn();ar(n,t,r,i),n1(n,e,r)}}function Sk(t,e,n){var r=Ai(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(e1(t))t1(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,ur(a,o)){var u=e.interleaved;u===null?(i.next=i,sm(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=L_(t,e,i,r),n!==null&&(i=dn(),ar(n,t,r,i),n1(n,e,r))}}function e1(t){var e=t.alternate;return t===ft||e!==null&&e===ft}function t1(t,e){Ia=lc=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function n1(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,qp(t,n)}}var uc={readContext:Yn,useCallback:Jt,useContext:Jt,useEffect:Jt,useImperativeHandle:Jt,useInsertionEffect:Jt,useLayoutEffect:Jt,useMemo:Jt,useReducer:Jt,useRef:Jt,useState:Jt,useDebugValue:Jt,useDeferredValue:Jt,useTransition:Jt,useMutableSource:Jt,useSyncExternalStore:Jt,useId:Jt,unstable_isNewReconciler:!1},Tk={readContext:Yn,useCallback:function(t,e){return mr().memoizedState=[t,e===void 0?null:e],t},useContext:Yn,useEffect:y0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,ku(4194308,4,K_.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ku(4194308,4,t,e)},useInsertionEffect:function(t,e){return ku(4,2,t,e)},useMemo:function(t,e){var n=mr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=mr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Ek.bind(null,ft,t),[r.memoizedState,t]},useRef:function(t){var e=mr();return t={current:t},e.memoizedState=t},useState:g0,useDebugValue:pm,useDeferredValue:function(t){return mr().memoizedState=t},useTransition:function(){var t=g0(!1),e=t[0];return t=bk.bind(null,t[1]),mr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ft,i=mr();if(ct){if(n===void 0)throw Error(X(407));n=n()}else{if(n=e(),$t===null)throw Error(X(349));xs&30||U_(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,y0(B_.bind(null,r,s,t),[t]),r.flags|=2048,el(9,z_.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=mr(),e=$t.identifierPrefix;if(ct){var n=Fr,r=Vr;n=(r&~(1<<32-or(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ja++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[vr]=e,t[Qa]=r,h1(t,e,!1,!1),e.stateNode=t;e:{switch(o=af(n,r),n){case"dialog":at("cancel",t),at("close",t),i=r;break;case"iframe":case"object":case"embed":at("load",t),i=r;break;case"video":case"audio":for(i=0;iSo&&(e.flags|=128,r=!0,aa(s,!1),e.lanes=4194304)}else{if(!r)if(t=ac(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),aa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ct)return Zt(e),null}else 2*Et()-s.renderingStartTime>So&&n!==1073741824&&(e.flags|=128,r=!0,aa(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Et(),e.sibling=null,n=ht.current,rt(ht,r?n&1|2:n&1),e):(Zt(e),null);case 22:case 23:return wm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?jn&1073741824&&(Zt(e),e.subtreeFlags&6&&(e.flags|=8192)):Zt(e),null;case 24:return null;case 25:return null}throw Error(X(156,e.tag))}function Dk(t,e){switch(em(e),e.tag){case 1:return Sn(e.type)&&ec(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return bo(),lt(En),lt(sn),um(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return lm(e),null;case 13:if(lt(ht),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));wo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return lt(ht),null;case 4:return bo(),null;case 10:return im(e.type._context),null;case 22:case 23:return wm(),null;case 24:return null;default:return null}}var iu=!1,nn=!1,jk=typeof WeakSet=="function"?WeakSet:Set,ce=null;function eo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(t,e,r)}else n.current=null}function jf(t,e,n){try{n()}catch(r){yt(t,e,r)}}var C0=!1;function Lk(t,e){if(yf=Yu,t=x_(),Jp(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,h=0,f=t,p=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(u=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(g=f.firstChild)!==null;)p=f,f=g;for(;;){if(f===t)break t;if(p===n&&++c===i&&(a=o),p===s&&++h===r&&(u=o),(g=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=g}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(vf={focusedElem:t,selectionRange:n},Yu=!1,ce=e;ce!==null;)if(e=ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ce=t;else for(;ce!==null;){e=ce;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var T=_.memoizedProps,R=_.memoizedState,y=e.stateNode,w=y.getSnapshotBeforeUpdate(e.elementType===e.type?T:er(e.type,T),R);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var k=e.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(L){yt(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,ce=t;break}ce=e.return}return _=C0,C0=!1,_}function ka(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&jf(e,n,s)}i=i.next}while(i!==r)}}function Qc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Lf(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function m1(t){var e=t.alternate;e!==null&&(t.alternate=null,m1(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[vr],delete e[Qa],delete e[_f],delete e[yk],delete e[vk])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function g1(t){return t.tag===5||t.tag===3||t.tag===4}function N0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||g1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Of(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Zu));else if(r!==4&&(t=t.child,t!==null))for(Of(t,e,n),t=t.sibling;t!==null;)Of(t,e,n),t=t.sibling}function Mf(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Mf(t,e,n),t=t.sibling;t!==null;)Mf(t,e,n),t=t.sibling}var qt=null,tr=!1;function ci(t,e,n){for(n=n.child;n!==null;)y1(t,e,n),n=n.sibling}function y1(t,e,n){if(wr&&typeof wr.onCommitFiberUnmount=="function")try{wr.onCommitFiberUnmount(zc,n)}catch{}switch(n.tag){case 5:nn||eo(n,e);case 6:var r=qt,i=tr;qt=null,ci(t,e,n),qt=r,tr=i,qt!==null&&(tr?(t=qt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):qt.removeChild(n.stateNode));break;case 18:qt!==null&&(tr?(t=qt,n=n.stateNode,t.nodeType===8?hh(t.parentNode,n):t.nodeType===1&&hh(t,n),Ha(t)):hh(qt,n.stateNode));break;case 4:r=qt,i=tr,qt=n.stateNode.containerInfo,tr=!0,ci(t,e,n),qt=r,tr=i;break;case 0:case 11:case 14:case 15:if(!nn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&jf(n,e,o),i=i.next}while(i!==r)}ci(t,e,n);break;case 1:if(!nn&&(eo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){yt(n,e,a)}ci(t,e,n);break;case 21:ci(t,e,n);break;case 22:n.mode&1?(nn=(r=nn)||n.memoizedState!==null,ci(t,e,n),nn=r):ci(t,e,n);break;default:ci(t,e,n)}}function A0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new jk),e.forEach(function(r){var i=Hk.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zn(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Et()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Mk(r/1960))-r,10t?16:t,_i===null)var r=!1;else{if(t=_i,_i=null,hc=0,ze&6)throw Error(X(331));var i=ze;for(ze|=4,ce=t.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uEt()-vm?ds(t,0):ym|=n),Tn(t,e)}function T1(t,e){e===0&&(t.mode&1?(e=Ql,Ql<<=1,!(Ql&130023424)&&(Ql=4194304)):e=1);var n=dn();t=Gr(t,e),t!==null&&(gl(t,e,n),Tn(t,n))}function $k(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),T1(t,n)}function Hk(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(e),T1(t,n)}var I1;I1=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||En.current)bn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return bn=!1,Pk(t,e,n);bn=!!(t.flags&131072)}else bn=!1,ct&&e.flags&1048576&&A_(e,rc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Cu(t,e),t=e.pendingProps;var i=xo(e,sn.current);lo(e,n),i=dm(null,e,r,t,i,n);var s=hm();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Sn(r)?(s=!0,tc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,om(e),i.updater=Kc,e.stateNode=i,i._reactInternals=e,kf(e,r,t,n),e=Af(null,e,r,!0,s,n)):(e.tag=0,ct&&s&&Zp(e),cn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Cu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=Wk(r),t=er(r,t),i){case 0:e=Nf(null,e,r,t,n);break e;case 1:e=T0(null,e,r,t,n);break e;case 11:e=E0(null,e,r,t,n);break e;case 14:e=S0(null,e,r,er(r.type,t),n);break e}throw Error(X(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Nf(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),T0(t,e,r,i,n);case 3:e:{if(u1(e),t===null)throw Error(X(387));r=e.pendingProps,s=e.memoizedState,i=s.element,O_(t,e),oc(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Eo(Error(X(423)),e),e=I0(t,e,r,n,i);break e}else if(r!==i){i=Eo(Error(X(424)),e),e=I0(t,e,r,n,i);break e}else for(Ln=ki(e.stateNode.containerInfo.firstChild),Vn=e,ct=!0,nr=null,n=j_(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wo(),r===i){e=Kr(t,e,n);break e}cn(t,e,r,n)}e=e.child}return e;case 5:return M_(e),t===null&&Sf(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,xf(r,i)?o=null:s!==null&&xf(r,s)&&(e.flags|=32),l1(t,e),cn(t,e,o,n),e.child;case 6:return t===null&&Sf(e),null;case 13:return c1(t,e,n);case 4:return am(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=_o(e,null,r,n):cn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),E0(t,e,r,i,n);case 7:return cn(t,e,e.pendingProps,n),e.child;case 8:return cn(t,e,e.pendingProps.children,n),e.child;case 12:return cn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,rt(ic,r._currentValue),r._currentValue=o,s!==null)if(ur(s.value,o)){if(s.children===i.children&&!En.current){e=Kr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Br(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Tf(s.return,n,e),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(X(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Tf(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}cn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,lo(e,n),i=Yn(i),r=r(i),e.flags|=1,cn(t,e,r,n),e.child;case 14:return r=e.type,i=er(r,e.pendingProps),i=er(r.type,i),S0(t,e,r,i,n);case 15:return o1(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Cu(t,e),e.tag=1,Sn(r)?(t=!0,tc(e)):t=!1,lo(e,n),r1(e,r,i),kf(e,r,i,n),Af(null,e,r,!0,t,n);case 19:return d1(t,e,n);case 22:return a1(t,e,n)}throw Error(X(156,e.tag))};function k1(t,e){return e_(t,e)}function qk(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(t,e,n,r){return new qk(t,e,n,r)}function bm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Wk(t){if(typeof t=="function")return bm(t)?1:0;if(t!=null){if(t=t.$$typeof,t===zp)return 11;if(t===Bp)return 14}return 2}function Pi(t,e){var n=t.alternate;return n===null?(n=Wn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Pu(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")bm(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case qs:return hs(n.children,i,s,e);case Up:o=8,i|=8;break;case Yh:return t=Wn(12,n,e,i|2),t.elementType=Yh,t.lanes=s,t;case Xh:return t=Wn(13,n,e,i),t.elementType=Xh,t.lanes=s,t;case Jh:return t=Wn(19,n,e,i),t.elementType=Jh,t.lanes=s,t;case Mw:return Xc(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Lw:o=10;break e;case Ow:o=9;break e;case zp:o=11;break e;case Bp:o=14;break e;case fi:o=16,r=null;break e}throw Error(X(130,t==null?t:typeof t,""))}return e=Wn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function hs(t,e,n,r){return t=Wn(7,t,r,e),t.lanes=n,t}function Xc(t,e,n,r){return t=Wn(22,t,r,e),t.elementType=Mw,t.lanes=n,t.stateNode={isHidden:!1},t}function wh(t,e,n){return t=Wn(6,t,null,e),t.lanes=n,t}function _h(t,e,n){return e=Wn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Gk(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=th(0),this.expirationTimes=th(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=th(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Em(t,e,n,r,i,s,o,a,u){return t=new Gk(t,e,n,a,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Wn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},om(s),t}function Kk(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P1)}catch(t){console.error(t)}}P1(),Pw.exports=Un;var R1=Pw.exports;const Zk=Fc(R1);var D1,V0=R1;D1=V0.createRoot,V0.hydrateRoot;/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var e2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Re=(t,e)=>{const n=F.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,...c},h)=>F.createElement("svg",{ref:h,...e2,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${t2(t)}`,a].join(" "),...c},[...e.map(([f,p])=>F.createElement(f,p)),...Array.isArray(u)?u:[u]]));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n2=Re("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const To=Re("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r2=Re("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F0=Re("BookMarked",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["polyline",{points:"10 2 10 10 13 7 16 10 16 2",key:"13o6vz"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nl=Re("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i2=Re("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wl=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nd=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rd=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j1=Re("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L1=Re("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s2=Re("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o2=Re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O1=Re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ua=Re("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bf=Re("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ca=Re("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M1=Re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $f=Re("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hf=Re("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U0=Re("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z0=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V1=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F1=Re("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a2=Re("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U1=Re("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z1=Re("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const co=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const km=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qf=Re("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B1=Re("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mc=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l2=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B0=Re("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $1=Re("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u2=Re("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $r=Re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cm=Re("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const In=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nm=Re("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Am=Re("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),bh=new Set;function Gn({src:t,alt:e,className:n="",imgClassName:r="",objectFit:i="contain",aspectRatio:s,loading:o,draggable:a}){const u=bh.has(t),[c,h]=F.useState(u),[f,p]=F.useState(!1),[g,_]=F.useState(0);F.useEffect(()=>{bh.has(t)?(h(!0),p(!1)):(h(!1),p(!1)),_(0)},[t]);const T=()=>{p(!1),h(!1),_(w=>w+1)},R=()=>{h(!0),p(!1),bh.add(t)},y=g>0?`${t}${t.includes("?")?"&":"?"}retry=${g}`:t;return d.jsxs("div",{className:`relative w-full h-full overflow-hidden ${f?"bg-[#1a1a1a]/50 rounded-lg min-h-[300px]":""} ${n}`,style:s&&s!=="auto"?{aspectRatio:s}:void 0,children:[d.jsx("div",{className:`absolute inset-0 flex items-center justify-center transition-opacity duration-500 ${c?"opacity-0 pointer-events-none":"opacity-100"}`,children:f?d.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center max-w-sm w-full h-full",children:[d.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center mb-3",children:d.jsx(n2,{className:"w-6 h-6 text-red-500"})}),d.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"La imagen no cargó. El servidor podría tener problemas."}),d.jsxs("button",{onClick:T,className:"flex items-center justify-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 text-white rounded-lg transition-colors border border-gray-700 w-full max-w-[200px]",children:[d.jsx(km,{className:"w-4 h-4"}),d.jsxs("span",{children:["Reintentar (",g,")"]})]})]}):d.jsx("div",{className:"w-8 h-8 border-2 border-[#bb86fc] border-t-transparent rounded-full animate-spin"})}),!f&&d.jsx("img",{src:y,alt:e,loading:o,draggable:a,className:`w-full h-full object-${i} transition-all duration-1000 ease-linear ${r} ${c?"opacity-100":"opacity-0"}`,onLoad:R,onError:()=>{p(!0),h(!1)}})]})}function H1({images:t,initialIndex:e,onClose:n}){const[r,i]=F.useState(e),[s,o]=F.useState(!1),[a,u]=F.useState(0),[c,h]=F.useState(1),[f,p]=F.useState({x:0,y:0}),[g,_]=F.useState(!1),[T,R]=F.useState({x:0,y:0}),[y,w]=F.useState(null),[k,L]=F.useState(1),U=F.useRef(null);F.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}),[]);const j=$=>{const Y=t.length;return($%Y+Y)%Y},b=$=>Math.hypot($[0].clientX-$[1].clientX,$[0].clientY-$[1].clientY),x=($,Y)=>{const re=window.innerWidth,Ce=window.innerHeight,de=(re*Y-re)/2,Qe=(Ce*Y-Ce)/2;return{x:Math.min(Math.max($.x,-de),de),y:Math.min(Math.max($.y,-Qe),Qe)}},E=s?2:1,I=()=>{i($=>j($-E)),u(0),h(1),p({x:0,y:0})},N=()=>{i($=>j($+E)),u(0),h(1),p({x:0,y:0})},D=($,Y)=>{_(!0),R({x:$,y:Y})},C=($,Y)=>{if(g)if(c>1){const re=$-T.x,Ce=Y-T.y;p(de=>({x:de.x+re,y:de.y+Ce})),R({x:$,y:Y})}else{const re=$-T.x;u(re)}},ge=()=>{var re;if(_(!1),w(null),c>1)return;const Y=(((re=U.current)==null?void 0:re.clientWidth)||window.innerWidth)*.25;Math.abs(a)>Y?a>0?I():N():u(0)},ie=$=>{$.preventDefault(),D($.clientX,$.clientY)},fe=$=>{$.preventDefault(),C($.clientX,$.clientY)},we=()=>ge(),G=$=>{if($.touches.length===2){const Y=b($.touches);w(Y),L(c),_(!1)}else $.touches.length===1&&D($.touches[0].clientX,$.touches[0].clientY)},se=$=>{if($.touches.length===2&&y!==null){const re=b($.touches)/y,Ce=Math.min(Math.max(k*re,1),4);h(Ce),p(de=>x(de,Ce))}else $.touches.length===1&&C($.touches[0].clientX,$.touches[0].clientY)},A=$=>{if(y!==null&&$.touches.length<2){w(null);return}ge()};F.useEffect(()=>{function $(Y){Y.key==="Escape"?n():Y.key==="ArrowLeft"?I():Y.key==="ArrowRight"?N():Y.key==="+"||Y.key==="="?h(re=>{const Ce=Math.min(re+.5,4);return p(de=>x(de,Ce)),Ce}):Y.key==="-"&&h(re=>{const Ce=Math.max(re-.5,1);return p(de=>x(de,Ce)),Ce})}return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[c,s]);let pe=`translateX(calc(-33.333333% + ${a}px))`,_e=g?"none":"transform 0.1s ease-out";a===0&&(_e="none");const P=$=>{const Y=j($);if(s){const re=j($+1);return d.jsxs("div",{className:"flex w-full h-full items-center justify-center px-2 sm:px-10",children:[d.jsx("div",{className:"flex-1 h-full flex items-center justify-end",children:d.jsx(Gn,{src:t[Y],alt:`Página ${Y+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-lg origin-right object-right transition-none"})}),d.jsx("div",{className:"flex-1 h-full flex items-center justify-start",children:d.jsx(Gn,{src:t[re],alt:`Página ${re+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-lg origin-left object-left transition-none"})})]})}else return d.jsx(Gn,{src:t[Y],alt:`Página ${Y+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-2xl transition-none"})};return d.jsxs("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 select-none touch-none overflow-hidden",style:{touchAction:"none"},ref:U,onWheel:$=>{$.stopPropagation();const Y=$.deltaY<0?.5:-.5;h(re=>{const Ce=Math.min(Math.max(re+Y,1),4);return p(de=>x(de,Ce)),Ce})},onMouseDown:ie,onMouseMove:fe,onMouseUp:we,onMouseLeave:()=>{_(!1),c===1&&u(0)},onTouchStart:G,onTouchMove:se,onTouchEnd:A,children:[d.jsxs("div",{className:"absolute top-6 right-6 flex items-center gap-4 z-50",children:[d.jsxs("div",{className:"flex items-center gap-2 bg-black/50 rounded-lg p-1",children:[d.jsx("button",{onClick:()=>o(!s),className:`p-2 transition-colors ${s?"text-[#bb86fc]":"text-white hover:text-[#bb86fc]"}`,title:s?"Vista Individual":"Vista de Libro",children:s?d.jsx(nl,{className:"w-5 h-5"}):d.jsx(i2,{className:"w-5 h-5"})}),d.jsx("div",{className:"w-px h-4 bg-white/20 mx-1"}),d.jsx("button",{onClick:()=>h($=>{const Y=Math.max($-.5,1);return p(re=>x(re,Y)),Y}),className:"p-2 text-white hover:text-[#bb86fc] transition-colors",children:d.jsx(Am,{className:"w-5 h-5"})}),d.jsxs("span",{className:"text-white text-sm min-w-[3ch] text-center",children:[Math.round(c*100),"%"]}),d.jsx("button",{onClick:()=>h($=>{const Y=Math.min($+.5,4);return p(re=>x(re,Y)),Y}),className:"p-2 text-white hover:text-[#bb86fc] transition-colors",children:d.jsx(Nm,{className:"w-5 h-5"})})]}),d.jsx("button",{onClick:n,className:"p-2 rounded-lg bg-white/10 hover:bg-white/20 text-white transition-all duration-200",children:d.jsx(In,{className:"w-6 h-6"})})]}),d.jsxs("div",{className:"flex h-full w-[300%] absolute top-0 left-0",style:{transform:pe,transition:_e},children:[d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:P(r-E)}),d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:d.jsx("div",{className:"relative flex items-center justify-center w-full h-full",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transition:g?"none":"transform 0.1s ease-out",cursor:c>1?g?"grabbing":"grab":"default"},onDoubleClick:$=>{$.stopPropagation(),h(Y=>Y>1?1:2.5),p({x:0,y:0})},children:P(r)})}),d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:P(r+E)})]}),c===1&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:$=>{$.stopPropagation(),I()},className:"absolute left-4 sm:left-8 top-1/2 -translate-y-1/2 p-3 sm:p-4 rounded-lg text-white opacity-40 hover:opacity-100 transition-opacity duration-200 z-40",children:d.jsx(nd,{className:"w-8 h-8 sm:w-10 sm:h-10"})}),d.jsx("button",{onClick:$=>{$.stopPropagation(),N()},className:"absolute right-4 sm:right-8 top-1/2 -translate-y-1/2 p-3 sm:p-4 rounded-lg text-white opacity-40 hover:opacity-100 transition-opacity duration-200 z-40",children:d.jsx(rd,{className:"w-8 h-8 sm:w-10 sm:h-10"})})]}),d.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 text-white px-4 py-2 rounded-lg text-sm font-medium z-40 pointer-events-none",children:s?`${r+1}-${Math.min(r+2,t.length)} / ${t.length}`:`${r+1} / ${t.length}`})]})}function id(){return d.jsxs("footer",{className:"py-6 border-t border-gray-800/50 flex flex-col md:flex-row items-center justify-between gap-4 text-gray-400 text-sm mt-auto w-full px-8 relative",children:[d.jsxs("div",{className:"flex flex-wrap justify-center gap-6 mx-auto",children:[d.jsxs("a",{href:"https://t.me/twistedbrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.295-.605.295l.213-3.054 5.56-5.022c.242-.213-.054-.333-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z"})}),"Twisted Brody"]}),d.jsxs("a",{href:"https://t.me/+CmmZFHM9hpViYzMx",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.295-.605.295l.213-3.054 5.56-5.022c.242-.213-.054-.333-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z"})}),"Canal Hub"]}),d.jsxs("a",{href:"https://x.com/TwistedBrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X"]}),d.jsxs("a",{href:"https://www.patreon.com/cw/Twistedbrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M0 .48v23.04h4.22V.48zm15.385 0c-4.764 0-8.641 3.88-8.641 8.65 0 4.755 3.877 8.623 8.641 8.623 4.75 0 8.615-3.868 8.615-8.623C24 4.36 20.136.48 15.385.48z"})}),"Patreon"]}),d.jsxs("button",{onClick:()=>{window.location.hash="info"},className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx(V1,{className:"w-4 h-4"}),d.jsx("span",{children:"Info"})]})]}),d.jsxs("div",{className:"md:absolute md:right-8 text-xs opacity-50",children:["Twisted Brody MangaFlow © ",new Date().getFullYear()]})]})}function c2({manga:t,onBack:e}){const n=t.chapters&&t.chapters.length>0?t.chapters[0]:null,r=n?n.original_pages&&n.original_pages.length>0?n.original_pages:n.pages:[],[i,s]=F.useState("vertical"),[o,a]=F.useState(1),[u,c]=F.useState(!1),[h,f]=F.useState(0);if(!r||r.length===0)return d.jsxs("div",{className:"min-h-screen bg-[#121212] flex flex-col items-center justify-center",children:[d.jsx("button",{onClick:e,className:"absolute top-6 left-6 p-2 hover:bg-[#333] rounded-lg transition-colors text-white",children:d.jsx(To,{className:"w-6 h-6"})}),d.jsx("div",{className:"text-gray-400 text-lg",children:"No hay páginas disponibles"})]});const p=()=>a(T=>Math.min(T+.25,3)),g=()=>a(T=>Math.max(T-.25,.5)),_=()=>a(1);return d.jsxs("div",{className:"min-h-screen flex flex-col bg-[#121212]",children:[d.jsxs("header",{className:"sticky top-0 z-50 bg-[#121212]/90 backdrop-blur-md border-b border-gray-800 px-4 py-3 flex items-center justify-between gap-4",children:[d.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:d.jsxs("button",{onClick:e,className:"p-2 hover:bg-[#333] rounded-lg transition-colors text-white flex items-center gap-2",children:[d.jsx(To,{className:"w-5 h-5"}),d.jsx("span",{className:"font-semibold text-sm hidden sm:inline",children:"Volver"})]})}),d.jsx("div",{className:"flex-1 flex justify-center min-w-0",children:d.jsxs("h1",{className:"text-white font-bold truncate text-center max-w-full",children:[t.title," ",d.jsx("span",{className:"text-[#bb86fc] text-xs ml-2 border border-[#bb86fc] px-1 rounded",children:"HD"})]})}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1 hidden md:flex",children:[d.jsx("button",{onClick:()=>s("vertical"),className:`p-2 rounded-md transition-all duration-200 ${i==="vertical"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Vertical",children:d.jsx(qf,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>s("gallery"),className:`p-2 rounded-md transition-all duration-200 ${i==="gallery"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Galería",children:d.jsx($f,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>s("grid"),className:`p-2 rounded-md transition-all duration-200 ${i==="grid"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Cuadrícula",children:d.jsx(Hf,{className:"w-4 h-4"})})]}),i==="vertical"&&d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsx("button",{onClick:g,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",children:d.jsx(Am,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-xs text-gray-300 w-8 text-center",children:[Math.round(o*100),"%"]}),d.jsx("button",{onClick:p,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",children:d.jsx(Nm,{className:"w-4 h-4"})}),d.jsx("button",{onClick:_,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",title:"Reset",children:d.jsx(km,{className:"w-3 h-3"})})]})]})]}),d.jsx("div",{className:"md:hidden px-4 py-2 border-b border-gray-800 bg-[#121212] flex justify-center",children:d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsxs("button",{onClick:()=>s("vertical"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="vertical"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(qf,{className:"w-3 h-3"})," Vertical"]}),d.jsxs("button",{onClick:()=>s("gallery"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="gallery"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx($f,{className:"w-3 h-3"})," Galería"]}),d.jsxs("button",{onClick:()=>s("grid"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="grid"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(Hf,{className:"w-3 h-3"})," Cuadrícula"]})]})}),d.jsx("main",{className:"flex-1 w-full max-w-[1920px] mx-auto px-0 sm:px-4 py-6",children:d.jsx("div",{className:` + bg-[#050505] min-h-screen transition-all duration-150 ease-out + ${i==="vertical"?"flex flex-col items-center gap-1":""} + ${i==="gallery"?"masonry-container p-2":""} + ${i==="grid"?"grid grid-cols-3 md:grid-cols-5 gap-2 p-2":""} + `,children:r.map((T,R)=>{const y=T;return i==="vertical"?d.jsx("div",{className:"relative transition-all duration-200",style:{width:o===1?"100%":`${100*o}%`,maxWidth:o>1?"none":"80rem"},children:d.jsx("div",{className:`mx-auto ${o<=1?"max-w-5xl":""}`,children:d.jsx(Gn,{src:y,alt:`Página ${R+1}`,aspectRatio:"auto",objectFit:"contain",loading:R<3?"eager":"lazy",className:"w-full h-auto",imgClassName:"w-full h-auto block"})})},R):d.jsx("div",{className:` + group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02] + ${i==="gallery"?"masonry-item":""} + `,onClick:()=>{f(R),c(!0)},children:d.jsx(Gn,{src:y,alt:`Página ${R+1}`,aspectRatio:i==="grid"?"1/1":"auto",objectFit:i==="grid"?"cover":"contain",loading:R<5?"eager":"lazy",className:"w-full h-auto rounded-lg",imgClassName:"group-hover:scale-110"})},R)})})}),d.jsx(id,{}),u&&d.jsx(H1,{images:r,initialIndex:h,onClose:()=>c(!1)})]})}async function d2(t,e,n){const r=await h2(t),i=f2(t);try{const s=await fetch("/api/process-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:r,name:t.name,index:e,total:n})});if(!s.ok)throw new Error(`Server processing failed: ${s.statusText}`);const o=await s.json();if(!o.success||!o.data)throw new Error("Invalid response from processing server");return{thumbnail:o.data.thumbnail,original:r,webpDisplay:o.data.webp,webpCover:o.data.webp,originalFormat:i,originalBase64:r,originalUnmodified:r}}catch(s){throw console.error("Error processing image on server, falling back to local:",s),s}}async function h2(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{var s;return e((s=i.target)==null?void 0:s.result)},r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(t)})}function f2(t){var r;const e=t.type;if(e==="image/png")return"png";if(e==="image/jpeg")return"jpg";if(e==="image/gif")return"gif";if(e==="image/webp")return"webp";const n=(r=t.name.split(".").pop())==null?void 0:r.toLowerCase();return n&&["png","jpg","jpeg","gif","webp"].includes(n)?n==="jpeg"?"jpg":n:"jpg"}async function p2(t){return new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const i=r.width/r.height;i<.9?e("portrait"):i>1.1?e("landscape"):e("square")},r.onerror=()=>n(new Error("Failed to load image")),r.src=t})}const q1="imageBatchSize",$0=10;function au(t){if(t<0)throw new Error("El tamaño del lote no puede ser negativo");localStorage.setItem(q1,t.toString())}function W1(){const t=localStorage.getItem(q1);if(!t)return $0;const e=parseInt(t,10);return isNaN(e)||e<0?$0:e>=999999?0:e}const m2="https://codebydante-brodyfilestreambot.hf.space/upload";function g2(t,e){const n=t.split(","),r=n[0].match(/:(.*?);/),i=r?r[1]:"image/jpeg",s=atob(n[n.length-1]);let o=s.length;const a=new Uint8Array(o);for(;o--;)a[o]=s.charCodeAt(o);return new File([a],e,{type:i})}const Wf=t=>new Promise(e=>setTimeout(e,t));async function Gf(t,e,n=3){var a,u,c;const r=e?`${e}.jpg`:"image.jpg",i=g2(t,r),s=new FormData;s.append("file",i);let o=0;for(;oh.abort(),6e4);try{const p=await fetch(m2,{method:"POST",body:s,signal:h.signal});if(clearTimeout(f),!p.ok){const _=await p.text();if(p.status>=500&&o=n)throw p}}throw new Error("No se pudo subir la imagen tras varios intentos.")}async function lu(t,e,n){const r=W1()||5,i=[];for(let s=0;s{const f=s+h,p=e?`${e}_${f+1}`:void 0;return Gf(c,p)}),u=await Promise.all(a);i.push(...u),n&&n(Math.min(s+r,t.length),t.length),s+r{};var H0={};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const G1=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},v2=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],a=t[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},K1={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,f=(s&3)<<4|a>>4;let p=(a&15)<<2|c>>6,g=c&63;u||(g=64,o||(p=64)),r.push(n[h],n[f],n[p],n[g])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(G1(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):v2(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(p),c!==64){const g=a<<4&240|c>>2;if(r.push(g),f!==64){const _=c<<6&192|f;r.push(_)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class x2 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const w2=function(t){const e=G1(t);return K1.encodeByteArray(e,!0)},gc=function(t){return w2(t).replace(/\./g,"")},Q1=function(t){try{return K1.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */function _2(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */const b2=()=>_2().__FIREBASE_DEFAULTS__,E2=()=>{if(typeof process>"u"||typeof H0>"u")return;const t=H0.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},S2=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&Q1(t[1]);return e&&JSON.parse(e)},sd=()=>{try{return y2()||b2()||E2()||S2()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Y1=t=>{var e,n;return(n=(e=sd())==null?void 0:e.emulatorHosts)==null?void 0:n[t]},X1=t=>{const e=Y1(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},J1=()=>{var t;return(t=sd())==null?void 0:t.config},Z1=t=>{var e;return(e=sd())==null?void 0:e[`_${t}`]};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class T2{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** + * @license + * Copyright 2025 Google LLC + * + * 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. + */function Ns(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Pm(t){return(await fetch(t,{credentials:"include"})).ok}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function eb(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...t};return[gc(JSON.stringify(n)),gc(JSON.stringify(o)),""].join(".")}const Aa={};function I2(){const t={prod:[],emulator:[]};for(const e of Object.keys(Aa))Aa[e]?t.emulator.push(e):t.prod.push(e);return t}function k2(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let q0=!1;function Rm(t,e){if(typeof window>"u"||typeof document>"u"||!Ns(window.location.host)||Aa[t]===e||Aa[t]||q0)return;Aa[t]=e;function n(p){return`__firebase__banner__${p}`}const r="__firebase__banner",s=I2().prod.length>0;function o(){const p=document.getElementById(r);p&&p.remove()}function a(p){p.style.display="flex",p.style.background="#7faaf0",p.style.position="fixed",p.style.bottom="5px",p.style.left="5px",p.style.padding=".5em",p.style.borderRadius="5px",p.style.alignItems="center"}function u(p,g){p.setAttribute("width","24"),p.setAttribute("id",g),p.setAttribute("height","24"),p.setAttribute("viewBox","0 0 24 24"),p.setAttribute("fill","none"),p.style.marginLeft="-6px"}function c(){const p=document.createElement("span");return p.style.cursor="pointer",p.style.marginLeft="16px",p.style.fontSize="24px",p.innerHTML=" ×",p.onclick=()=>{q0=!0,o()},p}function h(p,g){p.setAttribute("id",g),p.innerText="Learn more",p.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",p.setAttribute("target","__blank"),p.style.paddingLeft="5px",p.style.textDecoration="underline"}function f(){const p=k2(r),g=n("text"),_=document.getElementById(g)||document.createElement("span"),T=n("learnmore"),R=document.getElementById(T)||document.createElement("a"),y=n("preprendIcon"),w=document.getElementById(y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.created){const k=p.element;a(k),h(R,T);const L=c();u(w,y),k.append(w,_,R,L),document.body.appendChild(k)}s?(_.innerText="Preview backend disconnected.",w.innerHTML=` + + + + + + +`):(w.innerHTML=` + + + + + + +`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",g)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function on(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function C2(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(on())}function N2(){var e;const t=(e=sd())==null?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function A2(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function P2(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function R2(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function D2(){const t=on();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function j2(){return!N2()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function L2(){try{return typeof indexedDB=="object"}catch{return!1}}function O2(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)==null?void 0:s.message)||"")}}catch(n){e(n)}})}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const M2="FirebaseError";class Rr extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=M2,Object.setPrototypeOf(this,Rr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,_l.prototype.create)}}class _l{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?V2(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Rr(i,a,r)}}function V2(t,e){return t.replace(F2,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const F2=/\{\$([^}]+)}/g;function U2(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function bs(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(W0(s)&&W0(o)){if(!bs(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function W0(t){return t!==null&&typeof t=="object"}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function bl(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function z2(t,e){const n=new B2(t,e);return n.subscribe.bind(n)}class B2{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");$2(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=Eh),i.error===void 0&&(i.error=Eh),i.complete===void 0&&(i.complete=Eh);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function $2(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Eh(){}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function Yt(t){return t&&t._delegate?t._delegate:t}class Vi{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const ss="[DEFAULT]";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class H2{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new T2;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(W2(e))try{this.getOrInitializeService({instanceIdentifier:ss})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=ss){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ss){return this.instances.has(e)}getOptions(e=ss){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:q2(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ss){return this.component?this.component.multipleInstances?e:ss:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function q2(t){return t===ss?void 0:t}function W2(t){return t.instantiationMode==="EAGER"}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class G2{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new H2(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */var Me;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Me||(Me={}));const K2={debug:Me.DEBUG,verbose:Me.VERBOSE,info:Me.INFO,warn:Me.WARN,error:Me.ERROR,silent:Me.SILENT},Q2=Me.INFO,Y2={[Me.DEBUG]:"log",[Me.VERBOSE]:"log",[Me.INFO]:"info",[Me.WARN]:"warn",[Me.ERROR]:"error"},X2=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let G0,K0;function Z2(){return G0||(G0=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function eC(){return K0||(K0=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const tb=new WeakMap,Kf=new WeakMap,nb=new WeakMap,Sh=new WeakMap,jm=new WeakMap;function tC(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Ri(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&tb.set(n,t)}).catch(()=>{}),jm.set(e,t),e}function nC(t){if(Kf.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});Kf.set(t,e)}let Qf={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Kf.get(t);if(e==="objectStoreNames")return t.objectStoreNames||nb.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Ri(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function rC(t){Qf=t(Qf)}function iC(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(Th(this),e,...n);return nb.set(r,e.sort?e.sort():[e]),Ri(r)}:eC().includes(t)?function(...e){return t.apply(Th(this),e),Ri(tb.get(this))}:function(...e){return Ri(t.apply(Th(this),e))}}function sC(t){return typeof t=="function"?iC(t):(t instanceof IDBTransaction&&nC(t),J2(t,Z2())?new Proxy(t,Qf):t)}function Ri(t){if(t instanceof IDBRequest)return tC(t);if(Sh.has(t))return Sh.get(t);const e=sC(t);return e!==t&&(Sh.set(t,e),jm.set(e,t)),e}const Th=t=>jm.get(t);function oC(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Ri(o);return r&&o.addEventListener("upgradeneeded",u=>{r(Ri(o.result),u.oldVersion,u.newVersion,Ri(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const aC=["get","getKey","getAll","getAllKeys","count"],lC=["put","add","delete","clear"],Ih=new Map;function Q0(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Ih.get(e))return Ih.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=lC.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||aC.includes(n)))return;const s=async function(o,...a){const u=this.transaction(o,i?"readwrite":"readonly");let c=u.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&u.done]))[0]};return Ih.set(e,s),s}rC(t=>({...t,get:(e,n,r)=>Q0(e,n)||t.get(e,n,r),has:(e,n)=>!!Q0(e,n)||t.has(e,n)}));/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class uC{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(cC(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function cC(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Yf="@firebase/app",Y0="0.14.6";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Qr=new Dm("@firebase/app"),dC="@firebase/app-compat",hC="@firebase/analytics-compat",fC="@firebase/analytics",pC="@firebase/app-check-compat",mC="@firebase/app-check",gC="@firebase/auth",yC="@firebase/auth-compat",vC="@firebase/database",xC="@firebase/data-connect",wC="@firebase/database-compat",_C="@firebase/functions",bC="@firebase/functions-compat",EC="@firebase/installations",SC="@firebase/installations-compat",TC="@firebase/messaging",IC="@firebase/messaging-compat",kC="@firebase/performance",CC="@firebase/performance-compat",NC="@firebase/remote-config",AC="@firebase/remote-config-compat",PC="@firebase/storage",RC="@firebase/storage-compat",DC="@firebase/firestore",jC="@firebase/ai",LC="@firebase/firestore-compat",OC="firebase",MC="12.6.0";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Xf="[DEFAULT]",VC={[Yf]:"fire-core",[dC]:"fire-core-compat",[fC]:"fire-analytics",[hC]:"fire-analytics-compat",[mC]:"fire-app-check",[pC]:"fire-app-check-compat",[gC]:"fire-auth",[yC]:"fire-auth-compat",[vC]:"fire-rtdb",[xC]:"fire-data-connect",[wC]:"fire-rtdb-compat",[_C]:"fire-fn",[bC]:"fire-fn-compat",[EC]:"fire-iid",[SC]:"fire-iid-compat",[TC]:"fire-fcm",[IC]:"fire-fcm-compat",[kC]:"fire-perf",[CC]:"fire-perf-compat",[NC]:"fire-rc",[AC]:"fire-rc-compat",[PC]:"fire-gcs",[RC]:"fire-gcs-compat",[DC]:"fire-fst",[LC]:"fire-fst-compat",[jC]:"fire-vertex","fire-js":"fire-js",[OC]:"fire-js-all"};/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const yc=new Map,FC=new Map,Jf=new Map;function X0(t,e){try{t.container.addComponent(e)}catch(n){Qr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Es(t){const e=t.name;if(Jf.has(e))return Qr.debug(`There were multiple attempts to register component ${e}.`),!1;Jf.set(e,t);for(const n of yc.values())X0(n,t);for(const n of FC.values())X0(n,t);return!0}function od(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function rr(t){return t==null?!1:t.settings!==void 0}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const UC={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Di=new _l("app","Firebase",UC);/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class zC{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Vi("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Di.create("app-deleted",{appName:this._name})}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const As=MC;function rb(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:Xf,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw Di.create("bad-app-name",{appName:String(i)});if(n||(n=J1()),!n)throw Di.create("no-options");const s=yc.get(i);if(s){if(bs(n,s.options)&&bs(r,s.config))return s;throw Di.create("duplicate-app",{appName:i})}const o=new G2(i);for(const u of Jf.values())o.addComponent(u);const a=new zC(n,r,o);return yc.set(i,a),a}function Lm(t=Xf){const e=yc.get(t);if(!e&&t===Xf&&J1())return rb();if(!e)throw Di.create("no-app",{appName:t});return e}function br(t,e,n){let r=VC[t]??t;n&&(r+=`-${n}`);const i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){const o=[`Unable to register library "${r}" with version "${e}":`];i&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&o.push("and"),s&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Qr.warn(o.join(" "));return}Es(new Vi(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const BC="firebase-heartbeat-database",$C=1,rl="firebase-heartbeat-store";let kh=null;function ib(){return kh||(kh=oC(BC,$C,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(rl)}catch(n){console.warn(n)}}}}).catch(t=>{throw Di.create("idb-open",{originalErrorMessage:t.message})})),kh}async function HC(t){try{const n=(await ib()).transaction(rl),r=await n.objectStore(rl).get(sb(t));return await n.done,r}catch(e){if(e instanceof Rr)Qr.warn(e.message);else{const n=Di.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Qr.warn(n.message)}}}async function J0(t,e){try{const r=(await ib()).transaction(rl,"readwrite");await r.objectStore(rl).put(e,sb(t)),await r.done}catch(n){if(n instanceof Rr)Qr.warn(n.message);else{const r=Di.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Qr.warn(r.message)}}}function sb(t){return`${t.name}!${t.options.appId}`}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const qC=1024,WC=30;class GC{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new QC(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Z0();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>WC){const o=YC(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Qr.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Z0(),{heartbeatsToSend:r,unsentEntries:i}=KC(this._heartbeatsCache.heartbeats),s=gc(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(n){return Qr.warn(n),""}}}function Z0(){return new Date().toISOString().substring(0,10)}function KC(t,e=qC){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ev(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),ev(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class QC{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return L2()?O2().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await HC(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return J0(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return J0(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function ev(t){return gc(JSON.stringify({version:2,heartbeats:t})).length}function YC(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;rnew uC(e),"PRIVATE")),Es(new Vi("heartbeat",e=>new GC(e),"PRIVATE")),br(Yf,Y0,t),br(Yf,Y0,"esm2020"),br("fire-js","")}XC("");var JC="firebase",ZC="12.6.0";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */br(JC,ZC,"app");var tv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var ji,ob;(function(){var t;/** @license + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/function e(b,x){function E(){}E.prototype=x.prototype,b.F=x.prototype,b.prototype=new E,b.prototype.constructor=b,b.D=function(I,N,D){for(var C=Array(arguments.length-2),ge=2;ge>>25),C=D+(N^x&(E^N))+I[1]+3905402710&4294967295,D=x+(C<<12&4294967295|C>>>20),C=N+(E^D&(x^E))+I[2]+606105819&4294967295,N=D+(C<<17&4294967295|C>>>15),C=E+(x^N&(D^x))+I[3]+3250441966&4294967295,E=N+(C<<22&4294967295|C>>>10),C=x+(D^E&(N^D))+I[4]+4118548399&4294967295,x=E+(C<<7&4294967295|C>>>25),C=D+(N^x&(E^N))+I[5]+1200080426&4294967295,D=x+(C<<12&4294967295|C>>>20),C=N+(E^D&(x^E))+I[6]+2821735955&4294967295,N=D+(C<<17&4294967295|C>>>15),C=E+(x^N&(D^x))+I[7]+4249261313&4294967295,E=N+(C<<22&4294967295|C>>>10),C=x+(D^E&(N^D))+I[8]+1770035416&4294967295,x=E+(C<<7&4294967295|C>>>25),C=D+(N^x&(E^N))+I[9]+2336552879&4294967295,D=x+(C<<12&4294967295|C>>>20),C=N+(E^D&(x^E))+I[10]+4294925233&4294967295,N=D+(C<<17&4294967295|C>>>15),C=E+(x^N&(D^x))+I[11]+2304563134&4294967295,E=N+(C<<22&4294967295|C>>>10),C=x+(D^E&(N^D))+I[12]+1804603682&4294967295,x=E+(C<<7&4294967295|C>>>25),C=D+(N^x&(E^N))+I[13]+4254626195&4294967295,D=x+(C<<12&4294967295|C>>>20),C=N+(E^D&(x^E))+I[14]+2792965006&4294967295,N=D+(C<<17&4294967295|C>>>15),C=E+(x^N&(D^x))+I[15]+1236535329&4294967295,E=N+(C<<22&4294967295|C>>>10),C=x+(N^D&(E^N))+I[1]+4129170786&4294967295,x=E+(C<<5&4294967295|C>>>27),C=D+(E^N&(x^E))+I[6]+3225465664&4294967295,D=x+(C<<9&4294967295|C>>>23),C=N+(x^E&(D^x))+I[11]+643717713&4294967295,N=D+(C<<14&4294967295|C>>>18),C=E+(D^x&(N^D))+I[0]+3921069994&4294967295,E=N+(C<<20&4294967295|C>>>12),C=x+(N^D&(E^N))+I[5]+3593408605&4294967295,x=E+(C<<5&4294967295|C>>>27),C=D+(E^N&(x^E))+I[10]+38016083&4294967295,D=x+(C<<9&4294967295|C>>>23),C=N+(x^E&(D^x))+I[15]+3634488961&4294967295,N=D+(C<<14&4294967295|C>>>18),C=E+(D^x&(N^D))+I[4]+3889429448&4294967295,E=N+(C<<20&4294967295|C>>>12),C=x+(N^D&(E^N))+I[9]+568446438&4294967295,x=E+(C<<5&4294967295|C>>>27),C=D+(E^N&(x^E))+I[14]+3275163606&4294967295,D=x+(C<<9&4294967295|C>>>23),C=N+(x^E&(D^x))+I[3]+4107603335&4294967295,N=D+(C<<14&4294967295|C>>>18),C=E+(D^x&(N^D))+I[8]+1163531501&4294967295,E=N+(C<<20&4294967295|C>>>12),C=x+(N^D&(E^N))+I[13]+2850285829&4294967295,x=E+(C<<5&4294967295|C>>>27),C=D+(E^N&(x^E))+I[2]+4243563512&4294967295,D=x+(C<<9&4294967295|C>>>23),C=N+(x^E&(D^x))+I[7]+1735328473&4294967295,N=D+(C<<14&4294967295|C>>>18),C=E+(D^x&(N^D))+I[12]+2368359562&4294967295,E=N+(C<<20&4294967295|C>>>12),C=x+(E^N^D)+I[5]+4294588738&4294967295,x=E+(C<<4&4294967295|C>>>28),C=D+(x^E^N)+I[8]+2272392833&4294967295,D=x+(C<<11&4294967295|C>>>21),C=N+(D^x^E)+I[11]+1839030562&4294967295,N=D+(C<<16&4294967295|C>>>16),C=E+(N^D^x)+I[14]+4259657740&4294967295,E=N+(C<<23&4294967295|C>>>9),C=x+(E^N^D)+I[1]+2763975236&4294967295,x=E+(C<<4&4294967295|C>>>28),C=D+(x^E^N)+I[4]+1272893353&4294967295,D=x+(C<<11&4294967295|C>>>21),C=N+(D^x^E)+I[7]+4139469664&4294967295,N=D+(C<<16&4294967295|C>>>16),C=E+(N^D^x)+I[10]+3200236656&4294967295,E=N+(C<<23&4294967295|C>>>9),C=x+(E^N^D)+I[13]+681279174&4294967295,x=E+(C<<4&4294967295|C>>>28),C=D+(x^E^N)+I[0]+3936430074&4294967295,D=x+(C<<11&4294967295|C>>>21),C=N+(D^x^E)+I[3]+3572445317&4294967295,N=D+(C<<16&4294967295|C>>>16),C=E+(N^D^x)+I[6]+76029189&4294967295,E=N+(C<<23&4294967295|C>>>9),C=x+(E^N^D)+I[9]+3654602809&4294967295,x=E+(C<<4&4294967295|C>>>28),C=D+(x^E^N)+I[12]+3873151461&4294967295,D=x+(C<<11&4294967295|C>>>21),C=N+(D^x^E)+I[15]+530742520&4294967295,N=D+(C<<16&4294967295|C>>>16),C=E+(N^D^x)+I[2]+3299628645&4294967295,E=N+(C<<23&4294967295|C>>>9),C=x+(N^(E|~D))+I[0]+4096336452&4294967295,x=E+(C<<6&4294967295|C>>>26),C=D+(E^(x|~N))+I[7]+1126891415&4294967295,D=x+(C<<10&4294967295|C>>>22),C=N+(x^(D|~E))+I[14]+2878612391&4294967295,N=D+(C<<15&4294967295|C>>>17),C=E+(D^(N|~x))+I[5]+4237533241&4294967295,E=N+(C<<21&4294967295|C>>>11),C=x+(N^(E|~D))+I[12]+1700485571&4294967295,x=E+(C<<6&4294967295|C>>>26),C=D+(E^(x|~N))+I[3]+2399980690&4294967295,D=x+(C<<10&4294967295|C>>>22),C=N+(x^(D|~E))+I[10]+4293915773&4294967295,N=D+(C<<15&4294967295|C>>>17),C=E+(D^(N|~x))+I[1]+2240044497&4294967295,E=N+(C<<21&4294967295|C>>>11),C=x+(N^(E|~D))+I[8]+1873313359&4294967295,x=E+(C<<6&4294967295|C>>>26),C=D+(E^(x|~N))+I[15]+4264355552&4294967295,D=x+(C<<10&4294967295|C>>>22),C=N+(x^(D|~E))+I[6]+2734768916&4294967295,N=D+(C<<15&4294967295|C>>>17),C=E+(D^(N|~x))+I[13]+1309151649&4294967295,E=N+(C<<21&4294967295|C>>>11),C=x+(N^(E|~D))+I[4]+4149444226&4294967295,x=E+(C<<6&4294967295|C>>>26),C=D+(E^(x|~N))+I[11]+3174756917&4294967295,D=x+(C<<10&4294967295|C>>>22),C=N+(x^(D|~E))+I[2]+718787259&4294967295,N=D+(C<<15&4294967295|C>>>17),C=E+(D^(N|~x))+I[9]+3951481745&4294967295,b.g[0]=b.g[0]+x&4294967295,b.g[1]=b.g[1]+(N+(C<<21&4294967295|C>>>11))&4294967295,b.g[2]=b.g[2]+N&4294967295,b.g[3]=b.g[3]+D&4294967295}r.prototype.v=function(b,x){x===void 0&&(x=b.length);const E=x-this.blockSize,I=this.C;let N=this.h,D=0;for(;D>>I&255;return b};function s(b,x){var E=a;return Object.prototype.hasOwnProperty.call(E,b)?E[b]:E[b]=x(b)}function o(b,x){this.h=x;const E=[];let I=!0;for(let N=b.length-1;N>=0;N--){const D=b[N]|0;I&&D==x||(E[N]=D,I=!1)}this.g=E}var a={};function u(b){return-128<=b&&b<128?s(b,function(x){return new o([x|0],x<0?-1:0)}):new o([b|0],b<0?-1:0)}function c(b){if(isNaN(b)||!isFinite(b))return f;if(b<0)return R(c(-b));const x=[];let E=1;for(let I=0;b>=E;I++)x[I]=b/E|0,E*=4294967296;return new o(x,0)}function h(b,x){if(b.length==0)throw Error("number format error: empty string");if(x=x||10,x<2||36=0)throw Error('number format error: interior "-" character');const E=c(Math.pow(x,8));let I=f;for(let D=0;D=0?I:4294967296+I)*x,x*=4294967296}return b},t.toString=function(b){if(b=b||10,b<2||360?E.g[0]:E.h)>>>0).toString(b);if(E=N,_(E))return D+I;for(;D.length<6;)D="0"+D;I=D+I}},t.i=function(b){return b<0?0:b>>16)+(this.i(N)>>>16)+(b.i(N)>>>16);I=C>>>16,D&=65535,C&=65535,E[N]=C<<16|D}return new o(E,E[E.length-1]&-2147483648?-1:0)};function y(b,x){return b.add(R(x))}t.j=function(b){if(_(this)||_(b))return f;if(T(this))return T(b)?R(this).j(R(b)):R(R(this).j(b));if(T(b))return R(this.j(R(b)));if(this.l(g)<0&&b.l(g)<0)return c(this.m()*b.m());const x=this.g.length+b.g.length,E=[];for(var I=0;I<2*x;I++)E[I]=0;for(I=0;I>>16,C=this.i(I)&65535,ge=b.i(N)>>>16,ie=b.i(N)&65535;E[2*I+2*N]+=C*ie,w(E,2*I+2*N),E[2*I+2*N+1]+=D*ie,w(E,2*I+2*N+1),E[2*I+2*N+1]+=C*ge,w(E,2*I+2*N+1),E[2*I+2*N+2]+=D*ge,w(E,2*I+2*N+2)}for(b=0;b>>16,b[x]&=65535,x++}function k(b,x){this.g=b,this.h=x}function L(b,x){if(_(x))throw Error("division by zero");if(_(b))return new k(f,f);if(T(b))return x=L(R(b),x),new k(R(x.g),R(x.h));if(T(x))return x=L(b,R(x)),new k(R(x.g),x.h);if(b.g.length>30){if(T(b)||T(x))throw Error("slowDivide_ only works with positive integers.");for(var E=p,I=x;I.l(b)<=0;)E=U(E),I=U(I);var N=j(E,1),D=j(I,1);for(I=j(I,2),E=j(E,2);!_(I);){var C=D.add(I);C.l(b)<=0&&(N=N.add(E),D=C),I=j(I,1),E=j(E,1)}return x=y(b,N.j(x)),new k(N,x)}for(N=f;b.l(x)>=0;){for(E=Math.max(1,Math.floor(b.m()/x.m())),I=Math.ceil(Math.log(E)/Math.LN2),I=I<=48?1:Math.pow(2,I-48),D=c(E),C=D.j(x);T(C)||C.l(b)>0;)E-=I,D=c(E),C=D.j(x);_(D)&&(D=p),N=N.add(D),b=y(b,C)}return new k(N,b)}t.B=function(b){return L(this,b).h},t.and=function(b){const x=Math.max(this.g.length,b.g.length),E=[];for(let I=0;I>>31;return new o(E,b.h)}function j(b,x){const E=x>>5;x%=32;const I=b.g.length-E,N=[];for(let D=0;D0?b.i(D+E)>>>x|b.i(D+E+1)<<32-x:b.i(D+E);return new o(N,b.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,ob=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.B,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=h,ji=o}).apply(typeof tv<"u"?tv:typeof self<"u"?self:typeof window<"u"?window:{});var uu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var ab,ya,lb,Ru,Zf,ub,cb,db;(function(){var t,e=Object.defineProperty;function n(l){l=[typeof globalThis=="object"&&globalThis,l,typeof window=="object"&&window,typeof self=="object"&&self,typeof uu=="object"&&uu];for(var m=0;ml&&AsyncContext.Snapshot.wrap(l):l=>l;function g(l){const m=l.length;if(m>0){const v=Array(m);for(let S=0;S0?(this.h--,m=this.g,this.g=m.next,m.next=null):m=this.i(),m}}function R(l){o.setTimeout(()=>{throw l},0)}function y(){var l=b;let m=null;return l.g&&(m=l.g,l.g=l.g.next,l.g||(l.h=null),m.next=null),m}class w{constructor(){this.h=this.g=null}add(m,v){const S=k.get();S.set(m,v),this.h?this.h.next=S:this.g=S,this.h=S}}var k=new T(()=>new L,l=>l.reset());class L{constructor(){this.next=this.g=this.h=null}set(m,v){this.h=m,this.g=v,this.next=null}reset(){this.next=this.g=this.h=null}}let U,j=!1,b=new w,x=()=>{const l=Promise.resolve(void 0);U=()=>{l.then(E)}};function E(){for(var l;l=y();){try{l.h.call(l.g)}catch(v){R(v)}var m=k;m.j(l),m.h<100&&(m.h++,l.next=m.g,m.g=l)}j=!1}function I(){this.u=this.u,this.C=this.C}I.prototype.u=!1,I.prototype.dispose=function(){this.u||(this.u=!0,this.N())},I.prototype[Symbol.dispose]=function(){this.dispose()},I.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function N(l,m){this.type=l,this.g=this.target=m,this.defaultPrevented=!1}N.prototype.h=function(){this.defaultPrevented=!0};var D=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var l=!1,m=Object.defineProperty({},"passive",{get:function(){l=!0}});try{const v=()=>{};o.addEventListener("test",v,m),o.removeEventListener("test",v,m)}catch{}return l}();function C(l){return/^[\s\xa0]*$/.test(l)}function ge(l,m){N.call(this,l?l.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,l&&this.init(l,m)}f(ge,N),ge.prototype.init=function(l,m){const v=this.type=l.type,S=l.changedTouches&&l.changedTouches.length?l.changedTouches[0]:null;this.target=l.target||l.srcElement,this.g=m,m=l.relatedTarget,m||(v=="mouseover"?m=l.fromElement:v=="mouseout"&&(m=l.toElement)),this.relatedTarget=m,S?(this.clientX=S.clientX!==void 0?S.clientX:S.pageX,this.clientY=S.clientY!==void 0?S.clientY:S.pageY,this.screenX=S.screenX||0,this.screenY=S.screenY||0):(this.clientX=l.clientX!==void 0?l.clientX:l.pageX,this.clientY=l.clientY!==void 0?l.clientY:l.pageY,this.screenX=l.screenX||0,this.screenY=l.screenY||0),this.button=l.button,this.key=l.key||"",this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.pointerId=l.pointerId||0,this.pointerType=l.pointerType,this.state=l.state,this.i=l,l.defaultPrevented&&ge.Z.h.call(this)},ge.prototype.h=function(){ge.Z.h.call(this);const l=this.i;l.preventDefault?l.preventDefault():l.returnValue=!1};var ie="closure_listenable_"+(Math.random()*1e6|0),fe=0;function we(l,m,v,S,M){this.listener=l,this.proxy=null,this.src=m,this.type=v,this.capture=!!S,this.ha=M,this.key=++fe,this.da=this.fa=!1}function G(l){l.da=!0,l.listener=null,l.proxy=null,l.src=null,l.ha=null}function se(l,m,v){for(const S in l)m.call(v,l[S],S,l)}function A(l,m){for(const v in l)m.call(void 0,l[v],v,l)}function pe(l){const m={};for(const v in l)m[v]=l[v];return m}const _e="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function P(l,m){let v,S;for(let M=1;M-1?(m=l[te],v||(m.fa=!1)):(m=new we(m,this.src,z,!!S,M),m.fa=v,l.push(m)),m};function Y(l,m){const v=m.type;if(v in l.g){var S=l.g[v],M=Array.prototype.indexOf.call(S,m,void 0),z;(z=M>=0)&&Array.prototype.splice.call(S,M,1),z&&(G(m),l.g[v].length==0&&(delete l.g[v],l.h--))}}function re(l,m,v,S){for(let M=0;M-1&&(G(m[v]),Array.prototype.splice.call(m,v,1),m.length==0&&(delete l.g[z],l.h--)))):l&&(l=St(l))&&(m=l.g[m.toString()],l=-1,m&&(l=re(m,v,S,M)),(v=l>-1?m[l]:null)&&xt(v))}function xt(l){if(typeof l!="number"&&l&&!l.da){var m=l.src;if(m&&m[ie])Y(m.i,l);else{var v=l.type,S=l.proxy;m.removeEventListener?m.removeEventListener(v,S,l.capture):m.detachEvent?m.detachEvent(Rt(v),S):m.addListener&&m.removeListener&&m.removeListener(S),(v=St(m))?(Y(v,l),v.h==0&&(v.src=null,m[Ce]=null)):G(l)}}}function Rt(l){return l in de?de[l]:de[l]="on"+l}function ln(l,m){if(l.da)l=!0;else{m=new ge(m,this);const v=l.listener,S=l.ha||l.src;l.fa&&xt(l),l=v.call(S,m)}return l}function St(l){return l=l[Ce],l instanceof $?l:null}var st="__closure_events_fn_"+(Math.random()*1e9>>>0);function Ht(l){return typeof l=="function"?l:(l[st]||(l[st]=function(m){return l.handleEvent(m)}),l[st])}function Oe(){I.call(this),this.i=new $(this),this.M=this,this.G=null}f(Oe,I),Oe.prototype[ie]=!0,Oe.prototype.removeEventListener=function(l,m,v,S){Vt(this,l,m,v,S)};function Ye(l,m){var v,S=l.G;if(S)for(v=[];S;S=S.G)v.push(S);if(l=l.M,S=m.type||m,typeof m=="string")m=new N(m,l);else if(m instanceof N)m.target=m.target||l;else{var M=m;m=new N(S,l),P(m,M)}M=!0;let z,te;if(v)for(te=v.length-1;te>=0;te--)z=m.g=v[te],M=ee(z,S,!0,m)&&M;if(z=m.g=l,M=ee(z,S,!0,m)&&M,M=ee(z,S,!1,m)&&M,v)for(te=0;te2147483647?-1:o.setTimeout(l,m||0)}function V(l){l.g=Q(()=>{l.g=null,l.i&&(l.i=!1,V(l))},l.l);const m=l.h;l.h=null,l.m.apply(null,m)}class K extends I{constructor(m,v){super(),this.m=m,this.l=v,this.h=null,this.i=!1,this.g=null}j(m){this.h=arguments,this.g?this.i=!0:V(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function me(l){I.call(this),this.h=l,this.g={}}f(me,I);var O=[];function B(l){se(l.g,function(m,v){this.g.hasOwnProperty(v)&&xt(m)},l),l.g={}}me.prototype.N=function(){me.Z.N.call(this),B(this)},me.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var oe=o.JSON.stringify,le=o.JSON.parse,he=class{stringify(l){return o.JSON.stringify(l,void 0)}parse(l){return o.JSON.parse(l,void 0)}};function $e(){}function je(){}var He={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function et(){N.call(this,"d")}f(et,N);function H(){N.call(this,"c")}f(H,N);var Z={},be=null;function ye(){return be=be||new Oe}Z.Ia="serverreachability";function ve(l){N.call(this,Z.Ia,l)}f(ve,N);function Xe(l){const m=ye();Ye(m,new ve(m))}Z.STAT_EVENT="statevent";function wt(l,m){N.call(this,Z.STAT_EVENT,l),this.stat=m}f(wt,N);function Ee(l){const m=ye();Ye(m,new wt(m,l))}Z.Ja="timingevent";function _t(l,m){N.call(this,Z.Ja,l),this.size=m}f(_t,N);function Se(l,m){if(typeof l!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){l()},m)}function ut(){this.g=!0}ut.prototype.ua=function(){this.g=!1};function Ft(l,m,v,S,M,z){l.info(function(){if(l.g)if(z){var te="",De=z.split("&");for(let Je=0;Je1){const Ut=jt[0];jt=jt[1];const hr=Ut.split("_");te=hr.length>=2&&hr[1]=="type"?te+(Ut+"="+jt+"&"):te+(Ut+"=redacted&")}}}else te=null;else te=z;return"XMLHTTP REQ ("+S+") [attempt "+M+"]: "+m+` +`+v+` +`+te})}function un(l,m,v,S,M,z,te){l.info(function(){return"XMLHTTP RESP ("+S+") [ attempt "+M+"]: "+m+` +`+v+` +`+z+" "+te})}function Jn(l,m,v,S){l.info(function(){return"XMLHTTP TEXT ("+m+"): "+pn(l,v)+(S?" "+S:"")})}function Dt(l,m){l.info(function(){return"TIMEOUT: "+m})}ut.prototype.info=function(){};function pn(l,m){if(!l.g)return m;if(!m)return null;try{const z=JSON.parse(m);if(z){for(l=0;l0&&l.length;)v.push(l.shift()),m--;return l.length&&v.push(l.join(":")),v}function ii(l,m,v,S){this.j=l,this.i=m,this.l=v,this.S=S||1,this.V=new me(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Gg}function Gg(){this.i=null,this.g="",this.h=!1}var Kg={},Md={};function Vd(l,m,v){l.M=1,l.A=Ol(dr(m)),l.u=v,l.R=!0,Qg(l,null)}function Qg(l,m){l.F=Date.now(),Ll(l),l.B=dr(l.A);var v=l.B,S=l.S;Array.isArray(S)||(S=[String(S)]),ly(v.i,"t",S),l.C=0,v=l.j.L,l.h=new Gg,l.g=Iy(l.j,v?m:null,!l.u),l.P>0&&(l.O=new K(c(l.Y,l,l.g),l.P)),m=l.V,v=l.g,S=l.ba;var M="readystatechange";Array.isArray(M)||(M&&(O[0]=M.toString()),M=O);for(let z=0;z0&&!this.W){this.W=!0;var te=this.j;te.g==this&&te.aa&&!te.P&&(te.j.info("Great, no buffering proxy detected. Bytes received: "+v.length),Kd(te),te.P=!0,Ee(11))}}else Jn(this.i,this.l,v,null),Ud(this,v);De==4&&Zi(this),this.o&&!this.K&&(De==4?by(this.j,this):(this.o=!1,Ll(this)))}else IT(this.g),m==400&&v.indexOf("Unknown SID")>0?(this.m=3,Ee(12)):(this.m=0,Ee(13)),Zi(this),qo(this)}}}catch{}finally{}};function dT(l){if(!Yg(l))return l.g.la();const m=my(l.g);if(m==="")return"";let v="";const S=m.length,M=ai(l.g)==4;if(!l.h.i){if(typeof TextDecoder>"u")return Zi(l),qo(l),"";l.h.i=new o.TextDecoder}for(let z=0;zm.length?Md:(m=m.slice(S,S+v),l.C=S+v,m)))}ii.prototype.cancel=function(){this.K=!0,Zi(this)};function Ll(l){l.T=Date.now()+l.H,Xg(l,l.H)}function Xg(l,m){if(l.D!=null)throw Error("WatchDog timer not null");l.D=Se(c(l.aa,l),m)}function Fd(l){l.D&&(o.clearTimeout(l.D),l.D=null)}ii.prototype.aa=function(){this.D=null;const l=Date.now();l-this.T>=0?(Dt(this.i,this.B),this.M!=2&&(Xe(),Ee(17)),Zi(this),this.m=2,qo(this)):Xg(this,this.T-l)};function qo(l){l.j.I==0||l.K||by(l.j,l)}function Zi(l){Fd(l);var m=l.O;m&&typeof m.dispose=="function"&&m.dispose(),l.O=null,B(l.V),l.g&&(m=l.g,l.g=null,m.abort(),m.dispose())}function Ud(l,m){try{var v=l.j;if(v.I!=0&&(v.g==l||zd(v.h,l))){if(!l.L&&zd(v.h,l)&&v.I==3){try{var S=v.Ba.g.parse(m)}catch{S=null}if(Array.isArray(S)&&S.length==3){var M=S;if(M[0]==0){e:if(!v.v){if(v.g)if(v.g.F+3e30&&(S=1.5*li,v.O=S,v.j.info("backChannelRequestTimeoutMs_="+S)),S=v;const ui=l.g;if(ui){const $l=ui.g?ui.g.getResponseHeader("X-Client-Wire-Protocol"):null;if($l){var z=S.h;z.g||$l.indexOf("spdy")==-1&&$l.indexOf("quic")==-1&&$l.indexOf("h2")==-1||(z.j=z.l,z.g=new Set,z.h&&(Bd(z,z.h),z.h=null))}if(S.G){const Qd=ui.g?ui.g.getResponseHeader("X-HTTP-Session-Id"):null;Qd&&(S.wa=Qd,ot(S.J,S.G,Qd))}}v.I=3,v.l&&v.l.ra(),v.aa&&(v.T=Date.now()-l.F,v.j.info("Handshake RTT: "+v.T+"ms")),S=v;var te=l;if(S.na=Ty(S,S.L?S.ba:null,S.W),te.L){ty(S.h,te);var De=te,jt=S.O;jt&&(De.H=jt),De.D&&(Fd(De),Ll(De)),S.g=te}else wy(S);v.i.length>0&&Ul(v)}else Je[0]!="stop"&&Je[0]!="close"||ts(v,7);else v.I==3&&(Je[0]=="stop"||Je[0]=="close"?Je[0]=="stop"?ts(v,7):Wd(v):Je[0]!="noop"&&v.l&&v.l.qa(Je),v.A=0)}}Xe(4)}catch{}}var fT=class{constructor(l,m){this.g=l,this.map=m}};function Jg(l){this.l=l||10,o.PerformanceNavigationTiming?(l=o.performance.getEntriesByType("navigation"),l=l.length>0&&(l[0].nextHopProtocol=="hq"||l[0].nextHopProtocol=="h2")):l=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=l?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function Zg(l){return l.h?!0:l.g?l.g.size>=l.j:!1}function ey(l){return l.h?1:l.g?l.g.size:0}function zd(l,m){return l.h?l.h==m:l.g?l.g.has(m):!1}function Bd(l,m){l.g?l.g.add(m):l.h=m}function ty(l,m){l.h&&l.h==m?l.h=null:l.g&&l.g.has(m)&&l.g.delete(m)}Jg.prototype.cancel=function(){if(this.i=ny(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const l of this.g.values())l.cancel();this.g.clear()}};function ny(l){if(l.h!=null)return l.i.concat(l.h.G);if(l.g!=null&&l.g.size!==0){let m=l.i;for(const v of l.g.values())m=m.concat(v.G);return m}return g(l.i)}var ry=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function pT(l,m){if(l){l=l.split("&");for(let v=0;v=0?(M=l[v].substring(0,S),z=l[v].substring(S+1)):M=l[v],m(M,z?decodeURIComponent(z.replace(/\+/g," ")):"")}}}function si(l){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let m;l instanceof si?(this.l=l.l,Wo(this,l.j),this.o=l.o,this.g=l.g,Go(this,l.u),this.h=l.h,$d(this,uy(l.i)),this.m=l.m):l&&(m=String(l).match(ry))?(this.l=!1,Wo(this,m[1]||"",!0),this.o=Ko(m[2]||""),this.g=Ko(m[3]||"",!0),Go(this,m[4]),this.h=Ko(m[5]||"",!0),$d(this,m[6]||"",!0),this.m=Ko(m[7]||"")):(this.l=!1,this.i=new Yo(null,this.l))}si.prototype.toString=function(){const l=[];var m=this.j;m&&l.push(Qo(m,iy,!0),":");var v=this.g;return(v||m=="file")&&(l.push("//"),(m=this.o)&&l.push(Qo(m,iy,!0),"@"),l.push(Pn(v).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),v=this.u,v!=null&&l.push(":",String(v))),(v=this.h)&&(this.g&&v.charAt(0)!="/"&&l.push("/"),l.push(Qo(v,v.charAt(0)=="/"?yT:gT,!0))),(v=this.i.toString())&&l.push("?",v),(v=this.m)&&l.push("#",Qo(v,xT)),l.join("")},si.prototype.resolve=function(l){const m=dr(this);let v=!!l.j;v?Wo(m,l.j):v=!!l.o,v?m.o=l.o:v=!!l.g,v?m.g=l.g:v=l.u!=null;var S=l.h;if(v)Go(m,l.u);else if(v=!!l.h){if(S.charAt(0)!="/")if(this.g&&!this.h)S="/"+S;else{var M=m.h.lastIndexOf("/");M!=-1&&(S=m.h.slice(0,M+1)+S)}if(M=S,M==".."||M==".")S="";else if(M.indexOf("./")!=-1||M.indexOf("/.")!=-1){S=M.lastIndexOf("/",0)==0,M=M.split("/");const z=[];for(let te=0;te1||z.length==1&&z[0]!="")&&z.pop(),S&&te==M.length&&z.push("")):(z.push(De),S=!0)}S=z.join("/")}else S=M}return v?m.h=S:v=l.i.toString()!=="",v?$d(m,uy(l.i)):v=!!l.m,v&&(m.m=l.m),m};function dr(l){return new si(l)}function Wo(l,m,v){l.j=v?Ko(m,!0):m,l.j&&(l.j=l.j.replace(/:$/,""))}function Go(l,m){if(m){if(m=Number(m),isNaN(m)||m<0)throw Error("Bad port number "+m);l.u=m}else l.u=null}function $d(l,m,v){m instanceof Yo?(l.i=m,wT(l.i,l.l)):(v||(m=Qo(m,vT)),l.i=new Yo(m,l.l))}function ot(l,m,v){l.i.set(m,v)}function Ol(l){return ot(l,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),l}function Ko(l,m){return l?m?decodeURI(l.replace(/%25/g,"%2525")):decodeURIComponent(l):""}function Qo(l,m,v){return typeof l=="string"?(l=encodeURI(l).replace(m,mT),v&&(l=l.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),l):null}function mT(l){return l=l.charCodeAt(0),"%"+(l>>4&15).toString(16)+(l&15).toString(16)}var iy=/[#\/\?@]/g,gT=/[#\?:]/g,yT=/[#\?]/g,vT=/[#\?@]/g,xT=/#/g;function Yo(l,m){this.h=this.g=null,this.i=l||null,this.j=!!m}function es(l){l.g||(l.g=new Map,l.h=0,l.i&&pT(l.i,function(m,v){l.add(decodeURIComponent(m.replace(/\+/g," ")),v)}))}t=Yo.prototype,t.add=function(l,m){es(this),this.i=null,l=Os(this,l);let v=this.g.get(l);return v||this.g.set(l,v=[]),v.push(m),this.h+=1,this};function sy(l,m){es(l),m=Os(l,m),l.g.has(m)&&(l.i=null,l.h-=l.g.get(m).length,l.g.delete(m))}function oy(l,m){return es(l),m=Os(l,m),l.g.has(m)}t.forEach=function(l,m){es(this),this.g.forEach(function(v,S){v.forEach(function(M){l.call(m,M,S,this)},this)},this)};function ay(l,m){es(l);let v=[];if(typeof m=="string")oy(l,m)&&(v=v.concat(l.g.get(Os(l,m))));else for(l=Array.from(l.g.values()),m=0;m0?String(l[0]):m):m};function ly(l,m,v){sy(l,m),v.length>0&&(l.i=null,l.g.set(Os(l,m),g(v)),l.h+=v.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const l=[],m=Array.from(this.g.keys());for(let S=0;S{S.abort(),oi(v,"TestPingServer: timeout",!1,m)},1e4);fetch(l,{signal:S.signal}).then(z=>{clearTimeout(M),z.ok?oi(v,"TestPingServer: ok",!0,m):oi(v,"TestPingServer: server error",!1,m)}).catch(()=>{clearTimeout(M),oi(v,"TestPingServer: error",!1,m)})}function oi(l,m,v,S,M){try{M&&(M.onload=null,M.onerror=null,M.onabort=null,M.ontimeout=null),S(v)}catch{}}function ET(){this.g=new he}function Hd(l){this.i=l.Sb||null,this.h=l.ab||!1}f(Hd,$e),Hd.prototype.g=function(){return new Ml(this.i,this.h)};function Ml(l,m){Oe.call(this),this.H=l,this.o=m,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}f(Ml,Oe),t=Ml.prototype,t.open=function(l,m){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=l,this.D=m,this.readyState=1,Jo(this)},t.send=function(l){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const m={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};l&&(m.body=l),(this.H||o).fetch(new Request(this.D,m)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Xo(this)),this.readyState=0},t.Pa=function(l){if(this.g&&(this.l=l,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=l.headers,this.readyState=2,Jo(this)),this.g&&(this.readyState=3,Jo(this),this.g)))if(this.responseType==="arraybuffer")l.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in l){if(this.j=l.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;cy(this)}else l.text().then(this.Oa.bind(this),this.ga.bind(this))};function cy(l){l.j.read().then(l.Ma.bind(l)).catch(l.ga.bind(l))}t.Ma=function(l){if(this.g){if(this.o&&l.value)this.response.push(l.value);else if(!this.o){var m=l.value?l.value:new Uint8Array(0);(m=this.B.decode(m,{stream:!l.done}))&&(this.response=this.responseText+=m)}l.done?Xo(this):Jo(this),this.readyState==3&&cy(this)}},t.Oa=function(l){this.g&&(this.response=this.responseText=l,Xo(this))},t.Na=function(l){this.g&&(this.response=l,Xo(this))},t.ga=function(){this.g&&Xo(this)};function Xo(l){l.readyState=4,l.l=null,l.j=null,l.B=null,Jo(l)}t.setRequestHeader=function(l,m){this.A.append(l,m)},t.getResponseHeader=function(l){return this.h&&this.h.get(l.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const l=[],m=this.h.entries();for(var v=m.next();!v.done;)v=v.value,l.push(v[0]+": "+v[1]),v=m.next();return l.join(`\r +`)};function Jo(l){l.onreadystatechange&&l.onreadystatechange.call(l)}Object.defineProperty(Ml.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(l){this.m=l?"include":"same-origin"}});function dy(l){let m="";return se(l,function(v,S){m+=S,m+=":",m+=v,m+=`\r +`}),m}function qd(l,m,v){e:{for(S in v){var S=!1;break e}S=!0}S||(v=dy(v),typeof l=="string"?v!=null&&Pn(v):ot(l,m,v))}function gt(l){Oe.call(this),this.headers=new Map,this.L=l||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}f(gt,Oe);var ST=/^https?$/i,TT=["POST","PUT"];t=gt.prototype,t.Fa=function(l){this.H=l},t.ea=function(l,m,v,S){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+l);m=m?m.toUpperCase():"GET",this.D=l,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():gn.g(),this.g.onreadystatechange=p(c(this.Ca,this));try{this.B=!0,this.g.open(m,String(l),!0),this.B=!1}catch(z){hy(this,z);return}if(l=v||"",v=new Map(this.headers),S)if(Object.getPrototypeOf(S)===Object.prototype)for(var M in S)v.set(M,S[M]);else if(typeof S.keys=="function"&&typeof S.get=="function")for(const z of S.keys())v.set(z,S.get(z));else throw Error("Unknown input type for opt_headers: "+String(S));S=Array.from(v.keys()).find(z=>z.toLowerCase()=="content-type"),M=o.FormData&&l instanceof o.FormData,!(Array.prototype.indexOf.call(TT,m,void 0)>=0)||S||M||v.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[z,te]of v)this.g.setRequestHeader(z,te);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(l),this.v=!1}catch(z){hy(this,z)}};function hy(l,m){l.h=!1,l.g&&(l.j=!0,l.g.abort(),l.j=!1),l.l=m,l.o=5,fy(l),Vl(l)}function fy(l){l.A||(l.A=!0,Ye(l,"complete"),Ye(l,"error"))}t.abort=function(l){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=l||7,Ye(this,"complete"),Ye(this,"abort"),Vl(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Vl(this,!0)),gt.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?py(this):this.Xa())},t.Xa=function(){py(this)};function py(l){if(l.h&&typeof s<"u"){if(l.v&&ai(l)==4)setTimeout(l.Ca.bind(l),0);else if(Ye(l,"readystatechange"),ai(l)==4){l.h=!1;try{const z=l.ca();e:switch(z){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var m=!0;break e;default:m=!1}var v;if(!(v=m)){var S;if(S=z===0){let te=String(l.D).match(ry)[1]||null;!te&&o.self&&o.self.location&&(te=o.self.location.protocol.slice(0,-1)),S=!ST.test(te?te.toLowerCase():"")}v=S}if(v)Ye(l,"complete"),Ye(l,"success");else{l.o=6;try{var M=ai(l)>2?l.g.statusText:""}catch{M=""}l.l=M+" ["+l.ca()+"]",fy(l)}}finally{Vl(l)}}}}function Vl(l,m){if(l.g){l.m&&(clearTimeout(l.m),l.m=null);const v=l.g;l.g=null,m||Ye(l,"ready");try{v.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function ai(l){return l.g?l.g.readyState:0}t.ca=function(){try{return ai(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(l){if(this.g){var m=this.g.responseText;return l&&m.indexOf(l)==0&&(m=m.substring(l.length)),le(m)}};function my(l){try{if(!l.g)return null;if("response"in l.g)return l.g.response;switch(l.F){case"":case"text":return l.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in l.g)return l.g.mozResponseArrayBuffer}return null}catch{return null}}function IT(l){const m={};l=(l.g&&ai(l)>=2&&l.g.getAllResponseHeaders()||"").split(`\r +`);for(let S=0;S0&&(this.ia=l.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=gy.prototype,t.ka=8,t.I=1,t.connect=function(l,m,v,S){Ee(0),this.W=l,this.H=m||{},v&&S!==void 0&&(this.H.OSID=v,this.H.OAID=S),this.F=this.X,this.J=Ty(this,null,this.W),Ul(this)};function Wd(l){if(yy(l),l.I==3){var m=l.V++,v=dr(l.J);if(ot(v,"SID",l.M),ot(v,"RID",m),ot(v,"TYPE","terminate"),ea(l,v),m=new ii(l,l.j,m),m.M=2,m.A=Ol(dr(v)),v=!1,o.navigator&&o.navigator.sendBeacon)try{v=o.navigator.sendBeacon(m.A.toString(),"")}catch{}!v&&o.Image&&(new Image().src=m.A,v=!0),v||(m.g=Iy(m.j,null),m.g.ea(m.A)),m.F=Date.now(),Ll(m)}Sy(l)}function Fl(l){l.g&&(Kd(l),l.g.cancel(),l.g=null)}function yy(l){Fl(l),l.v&&(o.clearTimeout(l.v),l.v=null),zl(l),l.h.cancel(),l.m&&(typeof l.m=="number"&&o.clearTimeout(l.m),l.m=null)}function Ul(l){if(!Zg(l.h)&&!l.m){l.m=!0;var m=l.Ea;U||x(),j||(U(),j=!0),b.add(m,l),l.D=0}}function kT(l,m){return ey(l.h)>=l.h.j-(l.m?1:0)?!1:l.m?(l.i=m.G.concat(l.i),!0):l.I==1||l.I==2||l.D>=(l.Sa?0:l.Ta)?!1:(l.m=Se(c(l.Ea,l,m),Ey(l,l.D)),l.D++,!0)}t.Ea=function(l){if(this.m)if(this.m=null,this.I==1){if(!l){this.V=Math.floor(Math.random()*1e5),l=this.V++;const M=new ii(this,this.j,l);let z=this.o;if(this.U&&(z?(z=pe(z),P(z,this.U)):z=this.U),this.u!==null||this.R||(M.J=z,z=null),this.S)e:{for(var m=0,v=0;v4096){m=v;break e}if(m===4096||v===this.i.length-1){m=v+1;break e}}m=1e3}else m=1e3;m=xy(this,M,m),v=dr(this.J),ot(v,"RID",l),ot(v,"CVER",22),this.G&&ot(v,"X-HTTP-Session-Id",this.G),ea(this,v),z&&(this.R?m="headers="+Pn(dy(z))+"&"+m:this.u&&qd(v,this.u,z)),Bd(this.h,M),this.Ra&&ot(v,"TYPE","init"),this.S?(ot(v,"$req",m),ot(v,"SID","null"),M.U=!0,Vd(M,v,null)):Vd(M,v,m),this.I=2}}else this.I==3&&(l?vy(this,l):this.i.length==0||Zg(this.h)||vy(this))};function vy(l,m){var v;m?v=m.l:v=l.V++;const S=dr(l.J);ot(S,"SID",l.M),ot(S,"RID",v),ot(S,"AID",l.K),ea(l,S),l.u&&l.o&&qd(S,l.u,l.o),v=new ii(l,l.j,v,l.D+1),l.u===null&&(v.J=l.o),m&&(l.i=m.G.concat(l.i)),m=xy(l,v,1e3),v.H=Math.round(l.va*.5)+Math.round(l.va*.5*Math.random()),Bd(l.h,v),Vd(v,S,m)}function ea(l,m){l.H&&se(l.H,function(v,S){ot(m,S,v)}),l.l&&se({},function(v,S){ot(m,S,v)})}function xy(l,m,v){v=Math.min(l.i.length,v);const S=l.l?c(l.l.Ka,l.l,l):null;e:{var M=l.i;let De=-1;for(;;){const jt=["count="+v];De==-1?v>0?(De=M[0].g,jt.push("ofs="+De)):De=0:jt.push("ofs="+De);let Je=!0;for(let Ut=0;Ut=3?!1:(l.Y++,l.v=Se(c(l.Da,l),Ey(l,l.A)),l.A++,!0)}t.Da=function(){if(this.v=null,_y(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var l=4*this.T;this.j.info("BP detection timer enabled: "+l),this.B=Se(c(this.Wa,this),l)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,Ee(10),Fl(this),_y(this))};function Kd(l){l.B!=null&&(o.clearTimeout(l.B),l.B=null)}function _y(l){l.g=new ii(l,l.j,"rpc",l.Y),l.u===null&&(l.g.J=l.o),l.g.P=0;var m=dr(l.na);ot(m,"RID","rpc"),ot(m,"SID",l.M),ot(m,"AID",l.K),ot(m,"CI",l.F?"0":"1"),!l.F&&l.ia&&ot(m,"TO",l.ia),ot(m,"TYPE","xmlhttp"),ea(l,m),l.u&&l.o&&qd(m,l.u,l.o),l.O&&(l.g.H=l.O);var v=l.g;l=l.ba,v.M=1,v.A=Ol(dr(m)),v.u=null,v.R=!0,Qg(v,l)}t.Va=function(){this.C!=null&&(this.C=null,Fl(this),Gd(this),Ee(19))};function zl(l){l.C!=null&&(o.clearTimeout(l.C),l.C=null)}function by(l,m){var v=null;if(l.g==m){zl(l),Kd(l),l.g=null;var S=2}else if(zd(l.h,m))v=m.G,ty(l.h,m),S=1;else return;if(l.I!=0){if(m.o)if(S==1){v=m.u?m.u.length:0,m=Date.now()-m.F;var M=l.D;S=ye(),Ye(S,new _t(S,v)),Ul(l)}else wy(l);else if(M=m.m,M==3||M==0&&m.X>0||!(S==1&&kT(l,m)||S==2&&Gd(l)))switch(v&&v.length>0&&(m=l.h,m.i=m.i.concat(v)),M){case 1:ts(l,5);break;case 4:ts(l,10);break;case 3:ts(l,6);break;default:ts(l,2)}}}function Ey(l,m){let v=l.Qa+Math.floor(Math.random()*l.Za);return l.isActive()||(v*=2),v*m}function ts(l,m){if(l.j.info("Error code "+m),m==2){var v=c(l.bb,l),S=l.Ua;const M=!S;S=new si(S||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Wo(S,"https"),Ol(S),M?_T(S.toString(),v):bT(S.toString(),v)}else Ee(2);l.I=0,l.l&&l.l.pa(m),Sy(l),yy(l)}t.bb=function(l){l?(this.j.info("Successfully pinged google.com"),Ee(2)):(this.j.info("Failed to ping google.com"),Ee(1))};function Sy(l){if(l.I=0,l.ja=[],l.l){const m=ny(l.h);(m.length!=0||l.i.length!=0)&&(_(l.ja,m),_(l.ja,l.i),l.h.i.length=0,g(l.i),l.i.length=0),l.l.oa()}}function Ty(l,m,v){var S=v instanceof si?dr(v):new si(v);if(S.g!="")m&&(S.g=m+"."+S.g),Go(S,S.u);else{var M=o.location;S=M.protocol,m=m?m+"."+M.hostname:M.hostname,M=+M.port;const z=new si(null);S&&Wo(z,S),m&&(z.g=m),M&&Go(z,M),v&&(z.h=v),S=z}return v=l.G,m=l.wa,v&&m&&ot(S,v,m),ot(S,"VER",l.ka),ea(l,S),S}function Iy(l,m,v){if(m&&!l.L)throw Error("Can't create secondary domain capable XhrIo object.");return m=l.Aa&&!l.ma?new gt(new Hd({ab:v})):new gt(l.ma),m.Fa(l.L),m}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function ky(){}t=ky.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function Bl(){}Bl.prototype.g=function(l,m){return new Rn(l,m)};function Rn(l,m){Oe.call(this),this.g=new gy(m),this.l=l,this.h=m&&m.messageUrlParams||null,l=m&&m.messageHeaders||null,m&&m.clientProtocolHeaderRequired&&(l?l["X-Client-Protocol"]="webchannel":l={"X-Client-Protocol":"webchannel"}),this.g.o=l,l=m&&m.initMessageHeaders||null,m&&m.messageContentType&&(l?l["X-WebChannel-Content-Type"]=m.messageContentType:l={"X-WebChannel-Content-Type":m.messageContentType}),m&&m.sa&&(l?l["X-WebChannel-Client-Profile"]=m.sa:l={"X-WebChannel-Client-Profile":m.sa}),this.g.U=l,(l=m&&m.Qb)&&!C(l)&&(this.g.u=l),this.A=m&&m.supportsCrossDomainXhr||!1,this.v=m&&m.sendRawJson||!1,(m=m&&m.httpSessionIdParam)&&!C(m)&&(this.g.G=m,l=this.h,l!==null&&m in l&&(l=this.h,m in l&&delete l[m])),this.j=new Ms(this)}f(Rn,Oe),Rn.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Rn.prototype.close=function(){Wd(this.g)},Rn.prototype.o=function(l){var m=this.g;if(typeof l=="string"){var v={};v.__data__=l,l=v}else this.v&&(v={},v.__data__=oe(l),l=v);m.i.push(new fT(m.Ya++,l)),m.I==3&&Ul(m)},Rn.prototype.N=function(){this.g.l=null,delete this.j,Wd(this.g),delete this.g,Rn.Z.N.call(this)};function Cy(l){et.call(this),l.__headers__&&(this.headers=l.__headers__,this.statusCode=l.__status__,delete l.__headers__,delete l.__status__);var m=l.__sm__;if(m){e:{for(const v in m){l=v;break e}l=void 0}(this.i=l)&&(l=this.i,m=m!==null&&l in m?m[l]:void 0),this.data=m}else this.data=l}f(Cy,et);function Ny(){H.call(this),this.status=1}f(Ny,H);function Ms(l){this.g=l}f(Ms,ky),Ms.prototype.ra=function(){Ye(this.g,"a")},Ms.prototype.qa=function(l){Ye(this.g,new Cy(l))},Ms.prototype.pa=function(l){Ye(this.g,new Ny)},Ms.prototype.oa=function(){Ye(this.g,"b")},Bl.prototype.createWebChannel=Bl.prototype.g,Rn.prototype.send=Rn.prototype.o,Rn.prototype.open=Rn.prototype.m,Rn.prototype.close=Rn.prototype.close,db=function(){return new Bl},cb=function(){return ye()},ub=Z,Zf={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},jr.NO_ERROR=0,jr.TIMEOUT=8,jr.HTTP_ERROR=6,Ru=jr,mn.COMPLETE="complete",lb=mn,je.EventType=He,He.OPEN="a",He.CLOSE="b",He.ERROR="c",He.MESSAGE="d",Oe.prototype.listen=Oe.prototype.J,ya=je,gt.prototype.listenOnce=gt.prototype.K,gt.prototype.getLastError=gt.prototype.Ha,gt.prototype.getLastErrorCode=gt.prototype.ya,gt.prototype.getStatus=gt.prototype.ca,gt.prototype.getResponseJson=gt.prototype.La,gt.prototype.getResponseText=gt.prototype.la,gt.prototype.send=gt.prototype.ea,gt.prototype.setWithCredentials=gt.prototype.Fa,ab=gt}).apply(typeof uu<"u"?uu:typeof self<"u"?self:typeof window<"u"?window:{});const nv="@firebase/firestore",rv="4.9.2";/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class tn{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}tn.UNAUTHENTICATED=new tn(null),tn.GOOGLE_CREDENTIALS=new tn("google-credentials-uid"),tn.FIRST_PARTY=new tn("first-party-uid"),tn.MOCK_USER=new tn("mock-user");/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */let Mo="12.3.0";/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Ss=new Dm("@firebase/firestore");function Us(){return Ss.logLevel}function ue(t,...e){if(Ss.logLevel<=Me.DEBUG){const n=e.map(Om);Ss.debug(`Firestore (${Mo}): ${t}`,...n)}}function Yr(t,...e){if(Ss.logLevel<=Me.ERROR){const n=e.map(Om);Ss.error(`Firestore (${Mo}): ${t}`,...n)}}function Io(t,...e){if(Ss.logLevel<=Me.WARN){const n=e.map(Om);Ss.warn(`Firestore (${Mo}): ${t}`,...n)}}function Om(t){if(typeof t=="string")return t;try{/** +* @license +* Copyright 2020 Google LLC +* +* 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. +*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function Te(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,hb(t,r,n)}function hb(t,e,n){let r=`FIRESTORE (${Mo}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw Yr(r),new Error(r)}function Ge(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||hb(e,i,r)}function Ae(t,e){return t}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const q={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class ae extends Rr{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Hr{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class fb{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class eN{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(tn.UNAUTHENTICATED))}shutdown(){}}class tN{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class nN{constructor(e){this.t=e,this.currentUser=tn.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){Ge(this.o===void 0,42304);let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let s=new Hr;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Hr,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const u=s;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},a=u=>{ue("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(u=>a(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?a(u):(ue("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Hr)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(ue("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Ge(typeof r.accessToken=="string",31837,{l:r}),new fb(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Ge(e===null||typeof e=="string",2055,{h:e}),new tn(e)}}class rN{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=tn.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class iN{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new rN(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(tn.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class iv{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class sN{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,rr(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){Ge(this.o===void 0,3512);const r=s=>{s.error!=null&&ue("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.m;return this.m=s.token,ue("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{ue("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.V.getImmediate({optional:!0});s?i(s):ue("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new iv(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Ge(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new iv(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function oN(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function ep(t,e){const n=Math.min(t.length,e.length);for(let r=0;r=aN&&e<=lN}function ko(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const sv="__name__";class yr{constructor(e,n,r){n===void 0?n=0:n>e.length&&Te(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&Te(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return yr.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof yr?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length=0)throw new ae(q.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new nt(n)}static emptyPath(){return new nt([])}}const uN=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Gt extends yr{construct(e,n,r){return new Gt(e,n,r)}static isValidIdentifier(e){return uN.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Gt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===sv}static keyField(){return new Gt([sv])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new ae(q.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&nt.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return nt.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new xe(new nt(e.slice()))}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function pb(t,e,n){if(!n)throw new ae(q.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function cN(t,e,n,r){if(e===!0&&r===!0)throw new ae(q.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function ov(t){if(!xe.isDocumentKey(t))throw new ae(q.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function av(t){if(xe.isDocumentKey(t))throw new ae(q.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function mb(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function ad(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Te(12329,{type:typeof t})}function kn(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ae(q.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=ad(t);throw new ae(q.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** + * @license + * Copyright 2025 Google LLC + * + * 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. + */function At(t,e){const n={typeString:t};return e&&(n.value=e),n}function El(t,e){if(!mb(t))throw new ae(q.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const i=e[r].typeString,s="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const o=t[r];if(i&&typeof o!==i){n=`JSON field '${r}' must be a ${i}.`;break}if(s!==void 0&&o!==s.value){n=`Expected '${r}' field to equal '${s.value}'`;break}}if(n)throw new ae(q.INVALID_ARGUMENT,n);return!0}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const lv=-62135596800,uv=1e6;class We{static now(){return We.fromMillis(Date.now())}static fromDate(e){return We.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*uv);return new We(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new ae(q.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new ae(q.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e=253402300800)throw new ae(q.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/uv}_compareTo(e){return this.seconds===e.seconds?Ve(this.nanoseconds,e.nanoseconds):Ve(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:We._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(El(e,We._jsonSchema))return new We(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-lv;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}We._jsonSchemaVersion="firestore/timestamp/1.0",We._jsonSchema={type:At("string",We._jsonSchemaVersion),seconds:At("number"),nanoseconds:At("number")};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ne{static fromTimestamp(e){return new Ne(e)}static min(){return new Ne(new We(0,0))}static max(){return new Ne(new We(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const il=-1;function dN(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=Ne.fromTimestamp(r===1e9?new We(n+1,0):new We(n,r));return new Fi(i,xe.empty(),e)}function hN(t){return new Fi(t.readTime,t.key,il)}class Fi{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new Fi(Ne.min(),xe.empty(),il)}static max(){return new Fi(Ne.max(),xe.empty(),il)}}function fN(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=xe.comparator(t.documentKey,e.documentKey),n!==0?n:Ve(t.largestBatchId,e.largestBatchId))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const pN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class mN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */async function Vo(t){if(t.code!==q.FAILED_PRECONDITION||t.message!==pN)throw t;ue("LocalStore","Unexpectedly lost primary lease")}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class W{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&Te(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new W((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof W?n:W.resolve(n)}catch(n){return W.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):W.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):W.reject(n)}static resolve(e){return new W((n,r)=>{n(e)})}static reject(e){return new W((n,r)=>{r(e)})}static waitFor(e){return new W((n,r)=>{let i=0,s=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++s,o&&s===i&&n()},u=>r(u))}),o=!0,s===i&&n()})}static or(e){let n=W.resolve(!1);for(const r of e)n=n.next(i=>i?W.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new W((r,i)=>{const s=e.length,o=new Array(s);let a=0;for(let u=0;u{o[c]=h,++a,a===s&&r(o)},h=>i(h))}})}static doWhile(e,n){return new W((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function gN(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function Fo(t){return t.name==="IndexedDbTransactionError"}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */class ld{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>n.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}ld.ce=-1;/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Vm=-1;function ud(t){return t==null}function vc(t){return t===0&&1/t==-1/0}function yN(t){return typeof t=="number"&&Number.isInteger(t)&&!vc(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const gb="";function vN(t){let e="";for(let n=0;n0&&(e=cv(e)),e=xN(t.get(n),e);return cv(e)}function xN(t,e){let n=e;const r=t.length;for(let i=0;i0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new cu(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new cu(this.root,e,this.comparator,!1)}getReverseIterator(){return new cu(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new cu(this.root,e,this.comparator,!0)}}class cu{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Wt{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??Wt.RED,this.left=i??Wt.EMPTY,this.right=s??Wt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new Wt(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Wt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Wt.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Wt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Wt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Te(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Te(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Te(27949);return e+(this.isRed()?0:1)}}Wt.EMPTY=null,Wt.RED=!0,Wt.BLACK=!1;Wt.EMPTY=new class{constructor(){this.size=0}get key(){throw Te(57766)}get value(){throw Te(16141)}get color(){throw Te(16727)}get left(){throw Te(29726)}get right(){throw Te(36894)}copy(e,n,r,i,s){return this}insert(e,n,r){return new Wt(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Mt{constructor(e){this.comparator=e,this.data=new mt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new hv(this.data.getIterator())}getIteratorFrom(e){return new hv(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof Mt)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new Mt(this.comparator);return n.data=e,n}}class hv{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class On{constructor(e){this.fields=e,e.sort(Gt.comparator)}static empty(){return new On([])}unionWith(e){let n=new Mt(Gt.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new On(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return ko(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */class vb extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Xt{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new vb("Invalid base64 string: "+s):s}}(e);return new Xt(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;oeNr(n,e))!==void 0}function Co(t,e){if(t===e)return 0;const n=Bi(t),r=Bi(e);if(n!==r)return Ve(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Ve(t.booleanValue,e.booleanValue);case 2:return function(s,o){const a=bt(s.integerValue||s.doubleValue),u=bt(o.integerValue||o.doubleValue);return au?1:a===u?0:isNaN(a)?isNaN(u)?0:-1:1}(t,e);case 3:return fv(t.timestampValue,e.timestampValue);case 4:return fv(sl(t),sl(e));case 5:return ep(t.stringValue,e.stringValue);case 6:return function(s,o){const a=zi(s),u=zi(o);return a.compareTo(u)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const a=s.split("/"),u=o.split("/");for(let c=0;ci+Du(s),0)}(t.arrayValue);case 10:case 11:return function(r){let i=0;return Ki(r.fields,(s,o)=>{i+=s.length+Du(o)}),i}(t.mapValue);default:throw Te(13486,{value:t})}}function mv(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function np(t){return!!t&&"integerValue"in t}function Um(t){return!!t&&"arrayValue"in t}function gv(t){return!!t&&"nullValue"in t}function yv(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function ju(t){return!!t&&"mapValue"in t}function EN(t){var n,r;return((r=(((n=t==null?void 0:t.mapValue)==null?void 0:n.fields)||{})[Eb])==null?void 0:r.stringValue)===Sb}function Pa(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return Ki(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=Pa(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Pa(t.arrayValue.values[n]);return e}return{...t}}function SN(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===bN}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class _n{constructor(e){this.value=e}static empty(){return new _n({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(a)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=Pa(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());ju(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Nr(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[i]=s);for(const i of r)delete e[i]}clone(){return new _n(Pa(this.value))}}function Tb(t){const e=[];return Ki(t.fields,(n,r)=>{const i=new Gt([n]);if(ju(r)){const s=Tb(r.mapValue).fields;if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new On(e)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class rn{constructor(e,n,r,i,s,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=a}static newInvalidDocument(e){return new rn(e,0,Ne.min(),Ne.min(),Ne.min(),_n.empty(),0)}static newFoundDocument(e,n,r,i){return new rn(e,1,n,Ne.min(),r,i,0)}static newNoDocument(e,n){return new rn(e,2,n,Ne.min(),Ne.min(),_n.empty(),0)}static newUnknownDocument(e,n){return new rn(e,3,n,Ne.min(),Ne.min(),_n.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(Ne.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=_n.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=_n.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Ne.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof rn&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new rn(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class _c{constructor(e,n){this.position=e,this.inclusive=n}}function vv(t,e,n){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return Te(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class cr extends Ib{constructor(e,n){super(),this.filters=e,this.op=n,this.Pe=null}static create(e,n){return new cr(e,n)}matches(e){return kb(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function kb(t){return t.op==="and"}function Cb(t){return IN(t)&&kb(t)}function IN(t){for(const e of t.filters)if(e instanceof cr)return!1;return!0}function rp(t){if(t instanceof Nt)return t.field.canonicalString()+t.op.toString()+No(t.value);if(Cb(t))return t.filters.map(e=>rp(e)).join(",");{const e=t.filters.map(n=>rp(n)).join(",");return`${t.op}(${e})`}}function Nb(t,e){return t instanceof Nt?function(r,i){return i instanceof Nt&&r.op===i.op&&r.field.isEqual(i.field)&&Nr(r.value,i.value)}(t,e):t instanceof cr?function(r,i){return i instanceof cr&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&Nb(o,i.filters[a]),!0):!1}(t,e):void Te(19439)}function Ab(t){return t instanceof Nt?function(n){return`${n.field.canonicalString()} ${n.op} ${No(n.value)}`}(t):t instanceof cr?function(n){return n.op.toString()+" {"+n.getFilters().map(Ab).join(" ,")+"}"}(t):"Filter"}class kN extends Nt{constructor(e,n,r){super(e,n,r),this.key=xe.fromName(r.referenceValue)}matches(e){const n=xe.comparator(e.key,this.key);return this.matchesComparison(n)}}class CN extends Nt{constructor(e,n){super(e,"in",n),this.keys=Pb("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class NN extends Nt{constructor(e,n){super(e,"not-in",n),this.keys=Pb("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function Pb(t,e){var n;return(((n=e.arrayValue)==null?void 0:n.values)||[]).map(r=>xe.fromName(r.referenceValue))}class AN extends Nt{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return Um(n)&&al(n.arrayValue,this.value)}}class PN extends Nt{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&al(this.value.arrayValue,n)}}class RN extends Nt{constructor(e,n){super(e,"not-in",n)}matches(e){if(al(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!al(this.value.arrayValue,n)}}class DN extends Nt{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!Um(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>al(this.value.arrayValue,r))}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class jN{constructor(e,n=null,r=[],i=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.Te=null}}function wv(t,e=null,n=[],r=[],i=null,s=null,o=null){return new jN(t,e,n,r,i,s,o)}function zm(t){const e=Ae(t);if(e.Te===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>rp(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),ud(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>No(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>No(r)).join(",")),e.Te=n}return e.Te}function Bm(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Mt(Gt.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.Ie.push(new ll(s,r))}),n.has(Gt.keyField().canonicalString())||e.Ie.push(new ll(Gt.keyField(),r))}return e.Ie}function Er(t){const e=Ae(t);return e.Ee||(e.Ee=ON(e,Ra(t))),e.Ee}function ON(t,e){if(t.limitType==="F")return wv(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new ll(i.field,s)});const n=t.endAt?new _c(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new _c(t.startAt.position,t.startAt.inclusive):null;return wv(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function sp(t,e){const n=t.filters.concat([e]);return new Uo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function op(t,e,n){return new Uo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function hd(t,e){return Bm(Er(t),Er(e))&&t.limitType===e.limitType}function Db(t){return`${zm(Er(t))}|lt:${t.limitType}`}function zs(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>Ab(i)).join(", ")}]`),ud(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>No(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>No(i)).join(",")),`Target(${r})`}(Er(t))}; limitType=${t.limitType})`}function fd(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):xe.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of Ra(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,a,u){const c=vv(o,a,u);return o.inclusive?c<=0:c<0}(r.startAt,Ra(r),i)||r.endAt&&!function(o,a,u){const c=vv(o,a,u);return o.inclusive?c>=0:c>0}(r.endAt,Ra(r),i))}(t,e)}function MN(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function jb(t){return(e,n)=>{let r=!1;for(const i of Ra(t)){const s=VN(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function VN(t,e,n){const r=t.field.isKeyField()?xe.comparator(e.key,n.key):function(s,o,a){const u=o.data.field(s),c=a.data.field(s);return u!==null&&c!==null?Co(u,c):Te(42886)}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return Te(19790,{direction:t.dir})}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ps{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s{for(const[i,s]of r)e(i,s)})}isEmpty(){return yb(this.inner)}size(){return this.innerSize}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const FN=new mt(xe.comparator);function Xr(){return FN}const Lb=new mt(xe.comparator);function va(...t){let e=Lb;for(const n of t)e=e.insert(n.key,n);return e}function Ob(t){let e=Lb;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function cs(){return Da()}function Mb(){return Da()}function Da(){return new Ps(t=>t.toString(),(t,e)=>t.isEqual(e))}const UN=new mt(xe.comparator),zN=new Mt(xe.comparator);function Fe(...t){let e=zN;for(const n of t)e=e.add(n);return e}const BN=new Mt(Ve);function $N(){return BN}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function $m(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:vc(e)?"-0":e}}function Vb(t){return{integerValue:""+t}}function Fb(t,e){return yN(e)?Vb(e):$m(t,e)}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */class pd{constructor(){this._=void 0}}function HN(t,e,n){return t instanceof bc?function(i,s){const o={fields:{[wb]:{stringValue:xb},[bb]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&Fm(s)&&(s=cd(s)),s&&(o.fields[_b]=s),{mapValue:o}}(n,e):t instanceof ul?zb(t,e):t instanceof cl?Bb(t,e):function(i,s){const o=Ub(i,s),a=bv(o)+bv(i.Ae);return np(o)&&np(i.Ae)?Vb(a):$m(i.serializer,a)}(t,e)}function qN(t,e,n){return t instanceof ul?zb(t,e):t instanceof cl?Bb(t,e):n}function Ub(t,e){return t instanceof dl?function(r){return np(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class bc extends pd{}class ul extends pd{constructor(e){super(),this.elements=e}}function zb(t,e){const n=$b(e);for(const r of t.elements)n.some(i=>Nr(i,r))||n.push(r);return{arrayValue:{values:n}}}class cl extends pd{constructor(e){super(),this.elements=e}}function Bb(t,e){let n=$b(e);for(const r of t.elements)n=n.filter(i=>!Nr(i,r));return{arrayValue:{values:n}}}class dl extends pd{constructor(e,n){super(),this.serializer=e,this.Ae=n}}function bv(t){return bt(t.integerValue||t.doubleValue)}function $b(t){return Um(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class WN{constructor(e,n){this.field=e,this.transform=n}}function GN(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof ul&&i instanceof ul||r instanceof cl&&i instanceof cl?ko(r.elements,i.elements,Nr):r instanceof dl&&i instanceof dl?Nr(r.Ae,i.Ae):r instanceof bc&&i instanceof bc}(t.transform,e.transform)}class KN{constructor(e,n){this.version=e,this.transformResults=n}}class Qn{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new Qn}static exists(e){return new Qn(void 0,e)}static updateTime(e){return new Qn(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Lu(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class md{}function Hb(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Hm(t.key,Qn.none()):new Sl(t.key,t.data,Qn.none());{const n=t.data,r=_n.empty();let i=new Mt(Gt.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new Qi(t.key,r,new On(i.toArray()),Qn.none())}}function QN(t,e,n){t instanceof Sl?function(i,s,o){const a=i.value.clone(),u=Sv(i.fieldTransforms,s,o.transformResults);a.setAll(u),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof Qi?function(i,s,o){if(!Lu(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=Sv(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(qb(i)),u.setAll(a),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function ja(t,e,n,r){return t instanceof Sl?function(s,o,a,u){if(!Lu(s.precondition,o))return a;const c=s.value.clone(),h=Tv(s.fieldTransforms,u,o);return c.setAll(h),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof Qi?function(s,o,a,u){if(!Lu(s.precondition,o))return a;const c=Tv(s.fieldTransforms,u,o),h=o.data;return h.setAll(qb(s)),h.setAll(c),o.convertToFoundDocument(o.version,h).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(t,e,n,r):function(s,o,a){return Lu(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function YN(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=Ub(r.transform,i||null);s!=null&&(n===null&&(n=_n.empty()),n.set(r.field,s))}return n||null}function Ev(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&ko(r,i,(s,o)=>GN(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Sl extends md{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Qi extends md{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function qb(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function Sv(t,e,n){const r=new Map;Ge(t.length===n.length,32656,{Re:n.length,Ve:t.length});for(let i=0;i{const s=e.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const u=Hb(o,a);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(Ne.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Fe())}isEqual(e){return this.batchId===e.batchId&&ko(this.mutations,e.mutations,(n,r)=>Ev(n,r))&&ko(this.baseMutations,e.baseMutations,(n,r)=>Ev(n,r))}}class qm{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){Ge(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let i=function(){return UN}();const s=e.mutations;for(let o=0;o=8)throw new xa(`Invalid padding: ${n}`);if(r<0)throw new xa(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new xa(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new xa(`Invalid padding when bitmap length is 0: ${n}`);this.ge=8*e.length-n,this.pe=ji.fromNumber(this.ge)}ye(e,n,r){let i=e.add(n.multiply(ji.fromNumber(r)));return i.compare(rA)===1&&(i=new ji([i.getBits(0),i.getBits(1)],0)),i.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<o.insert(a)),o}insert(e){if(this.ge===0)return;const n=Iv(e),[r,i]=kv(n);for(let s=0;s0&&(this.Oe=!0,this.Me=e)}ke(){let e=Fe(),n=Fe(),r=Fe();return this.Fe.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:Te(38017,{changeType:s})}}),new Tl(this.Me,this.xe,e,n,r)}qe(){this.Oe=!1,this.Fe=Nv()}Qe(e,n){this.Oe=!0,this.Fe=this.Fe.insert(e,n)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,Ge(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class iA{constructor(e){this.Ge=e,this.ze=new Map,this.je=Xr(),this.Je=hu(),this.He=hu(),this.Ye=new mt(Ve)}Ze(e){for(const n of e.be)e.De&&e.De.isFoundDocument()?this.Xe(n,e.De):this.et(n,e.key,e.De);for(const n of e.removedTargetIds)this.et(n,e.key,e.De)}tt(e){this.forEachTarget(e,n=>{const r=this.nt(n);switch(e.state){case 0:this.rt(n)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(n);break;case 3:this.rt(n)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(n)&&(this.it(n),r.Le(e.resumeToken));break;default:Te(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.ze.forEach((r,i)=>{this.rt(i)&&n(i)})}st(e){const n=e.targetId,r=e.Ce.count,i=this.ot(n);if(i){const s=i.target;if(ip(s))if(r===0){const o=new xe(s.path);this.et(n,o,rn.newNoDocument(o,Ne.min()))}else Ge(r===1,20013,{expectedCount:r});else{const o=this._t(n);if(o!==r){const a=this.ut(e),u=a?this.ct(a,e,o):1;if(u!==0){this.it(n);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(n,c)}}}}}ut(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=zi(r).toUint8Array()}catch(u){if(u instanceof vb)return Io("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new Wm(o,i,s)}catch(u){return Io(u instanceof xa?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.ge===0?null:a}ct(e,n,r){return n.Ce.count===r-this.Pt(e,n.targetId)?0:2}Pt(e,n){const r=this.Ge.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.et(n,s,null),i++)}),i}Tt(e){const n=new Map;this.ze.forEach((s,o)=>{const a=this.ot(o);if(a){if(s.current&&ip(a.target)){const u=new xe(a.target.path);this.It(u).has(o)||this.Et(o,u)||this.et(o,u,rn.newNoDocument(u,e))}s.Be&&(n.set(o,s.ke()),s.qe())}});let r=Fe();this.He.forEach((s,o)=>{let a=!0;o.forEachWhile(u=>{const c=this.ot(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(s))}),this.je.forEach((s,o)=>o.setReadTime(e));const i=new gd(e,n,this.Ye,this.je,r);return this.je=Xr(),this.Je=hu(),this.He=hu(),this.Ye=new mt(Ve),i}Xe(e,n){if(!this.rt(e))return;const r=this.Et(e,n.key)?2:0;this.nt(e).Qe(n.key,r),this.je=this.je.insert(n.key,n),this.Je=this.Je.insert(n.key,this.It(n.key).add(e)),this.He=this.He.insert(n.key,this.dt(n.key).add(e))}et(e,n,r){if(!this.rt(e))return;const i=this.nt(e);this.Et(e,n)?i.Qe(n,1):i.$e(n),this.He=this.He.insert(n,this.dt(n).delete(e)),this.He=this.He.insert(n,this.dt(n).add(e)),r&&(this.je=this.je.insert(n,r))}removeTarget(e){this.ze.delete(e)}_t(e){const n=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let n=this.ze.get(e);return n||(n=new Cv,this.ze.set(e,n)),n}dt(e){let n=this.He.get(e);return n||(n=new Mt(Ve),this.He=this.He.insert(e,n)),n}It(e){let n=this.Je.get(e);return n||(n=new Mt(Ve),this.Je=this.Je.insert(e,n)),n}rt(e){const n=this.ot(e)!==null;return n||ue("WatchChangeAggregator","Detected inactive target",e),n}ot(e){const n=this.ze.get(e);return n&&n.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new Cv),this.Ge.getRemoteKeysForTarget(e).forEach(n=>{this.et(e,n,null)})}Et(e,n){return this.Ge.getRemoteKeysForTarget(e).has(n)}}function hu(){return new mt(xe.comparator)}function Nv(){return new mt(xe.comparator)}const sA={asc:"ASCENDING",desc:"DESCENDING"},oA={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},aA={and:"AND",or:"OR"};class lA{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function ap(t,e){return t.useProto3Json||ud(e)?e:{value:e}}function Ec(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Qb(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function uA(t,e){return Ec(t,e.toTimestamp())}function Sr(t){return Ge(!!t,49232),Ne.fromTimestamp(function(n){const r=Ui(n);return new We(r.seconds,r.nanos)}(t))}function Gm(t,e){return lp(t,e).canonicalString()}function lp(t,e){const n=function(i){return new nt(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function Yb(t){const e=nt.fromString(t);return Ge(tE(e),10190,{key:e.toString()}),e}function up(t,e){return Gm(t.databaseId,e.path)}function Nh(t,e){const n=Yb(e);if(n.get(1)!==t.databaseId.projectId)throw new ae(q.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ae(q.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new xe(Jb(n))}function Xb(t,e){return Gm(t.databaseId,e)}function cA(t){const e=Yb(t);return e.length===4?nt.emptyPath():Jb(e)}function cp(t){return new nt(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Jb(t){return Ge(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function Av(t,e,n){return{name:up(t,e),fields:n.value.mapValue.fields}}function dA(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:Te(39313,{state:c})}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(c,h){return c.useProto3Json?(Ge(h===void 0||typeof h=="string",58123),Xt.fromBase64String(h||"")):(Ge(h===void 0||h instanceof Buffer||h instanceof Uint8Array,16193),Xt.fromUint8Array(h||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const h=c.code===void 0?q.UNKNOWN:Wb(c.code);return new ae(h,c.message||"")}(o);n=new Kb(r,i,s,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=Nh(t,r.document.name),s=Sr(r.document.updateTime),o=r.document.createTime?Sr(r.document.createTime):Ne.min(),a=new _n({mapValue:{fields:r.document.fields}}),u=rn.newFoundDocument(i,s,o,a),c=r.targetIds||[],h=r.removedTargetIds||[];n=new Ou(c,h,u.key,u)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=Nh(t,r.document),s=r.readTime?Sr(r.readTime):Ne.min(),o=rn.newNoDocument(i,s),a=r.removedTargetIds||[];n=new Ou([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=Nh(t,r.document),s=r.removedTargetIds||[];n=new Ou([],s,i,null)}else{if(!("filter"in e))return Te(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new eA(i,s),a=r.targetId;n=new Gb(a,o)}}return n}function hA(t,e){let n;if(e instanceof Sl)n={update:Av(t,e.key,e.value)};else if(e instanceof Hm)n={delete:up(t,e.key)};else if(e instanceof Qi)n={update:Av(t,e.key,e.data),updateMask:_A(e.fieldMask)};else{if(!(e instanceof XN))return Te(16599,{Vt:e.type});n={verify:up(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof bc)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof ul)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof cl)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof dl)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw Te(20930,{transform:o.transform})}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:uA(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:Te(27497)}(t,e.precondition)),n}function fA(t,e){return t&&t.length>0?(Ge(e!==void 0,14353),t.map(n=>function(i,s){let o=i.updateTime?Sr(i.updateTime):Sr(s);return o.isEqual(Ne.min())&&(o=Sr(s)),new KN(o,i.transformResults||[])}(n,e))):[]}function pA(t,e){return{documents:[Xb(t,e.path)]}}function mA(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=Xb(t,i);const s=function(c){if(c.length!==0)return eE(cr.create(c,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(h=>function(p){return{field:Bs(p.field),direction:vA(p.dir)}}(h))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=ap(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{ft:n,parent:i}}function gA(t){let e=cA(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Ge(r===1,65062);const h=n.from[0];h.allDescendants?i=h.collectionId:e=e.child(h.collectionId)}let s=[];n.where&&(s=function(f){const p=Zb(f);return p instanceof cr&&Cb(p)?p.getFilters():[p]}(n.where));let o=[];n.orderBy&&(o=function(f){return f.map(p=>function(_){return new ll($s(_.field),function(R){switch(R){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(_.direction))}(p))}(n.orderBy));let a=null;n.limit&&(a=function(f){let p;return p=typeof f=="object"?f.value:f,ud(p)?null:p}(n.limit));let u=null;n.startAt&&(u=function(f){const p=!!f.before,g=f.values||[];return new _c(g,p)}(n.startAt));let c=null;return n.endAt&&(c=function(f){const p=!f.before,g=f.values||[];return new _c(g,p)}(n.endAt)),LN(e,i,o,s,a,"F",u,c)}function yA(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Te(28987,{purpose:i})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function Zb(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=$s(n.unaryFilter.field);return Nt.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=$s(n.unaryFilter.field);return Nt.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=$s(n.unaryFilter.field);return Nt.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=$s(n.unaryFilter.field);return Nt.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Te(61313);default:return Te(60726)}}(t):t.fieldFilter!==void 0?function(n){return Nt.create($s(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return Te(58110);default:return Te(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return cr.create(n.compositeFilter.filters.map(r=>Zb(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return Te(1026)}}(n.compositeFilter.op))}(t):Te(30097,{filter:t})}function vA(t){return sA[t]}function xA(t){return oA[t]}function wA(t){return aA[t]}function Bs(t){return{fieldPath:t.canonicalString()}}function $s(t){return Gt.fromServerFormat(t.fieldPath)}function eE(t){return t instanceof Nt?function(n){if(n.op==="=="){if(yv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NAN"}};if(gv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(yv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NOT_NAN"}};if(gv(n.value))return{unaryFilter:{field:Bs(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Bs(n.field),op:xA(n.op),value:n.value}}}(t):t instanceof cr?function(n){const r=n.getFilters().map(i=>eE(i));return r.length===1?r[0]:{compositeFilter:{op:wA(n.op),filters:r}}}(t):Te(54877,{filter:t})}function _A(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function tE(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class bi{constructor(e,n,r,i,s=Ne.min(),o=Ne.min(),a=Xt.EMPTY_BYTE_STRING,u=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=u}withSequenceNumber(e){return new bi(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new bi(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new bi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new bi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class bA{constructor(e){this.yt=e}}function EA(t){const e=gA({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?op(e,e.limit,"L"):e}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class SA{constructor(){this.Cn=new TA}addToCollectionParentIndex(e,n){return this.Cn.add(n),W.resolve()}getCollectionParents(e,n){return W.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return W.resolve()}deleteFieldIndex(e,n){return W.resolve()}deleteAllFieldIndexes(e){return W.resolve()}createTargetIndexes(e,n){return W.resolve()}getDocumentsMatchingTarget(e,n){return W.resolve(null)}getIndexType(e,n){return W.resolve(0)}getFieldIndexes(e,n){return W.resolve([])}getNextCollectionGroupToUpdate(e){return W.resolve(null)}getMinOffset(e,n){return W.resolve(Fi.min())}getMinOffsetFromCollectionGroup(e,n){return W.resolve(Fi.min())}updateCollectionGroup(e,n,r){return W.resolve()}updateIndexEntries(e,n){return W.resolve()}}class TA{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new Mt(nt.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new Mt(nt.comparator)).toArray()}}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */const Pv={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},nE=41943040;class xn{static withCacheSize(e){return new xn(e,xn.DEFAULT_COLLECTION_PERCENTILE,xn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */xn.DEFAULT_COLLECTION_PERCENTILE=10,xn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,xn.DEFAULT=new xn(nE,xn.DEFAULT_COLLECTION_PERCENTILE,xn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),xn.DISABLED=new xn(-1,0,0);/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ao{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new Ao(0)}static cr(){return new Ao(-1)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Rv="LruGarbageCollector",IA=1048576;function Dv([t,e],[n,r]){const i=Ve(t,n);return i===0?Ve(e,r):i}class kA{constructor(e){this.Ir=e,this.buffer=new Mt(Dv),this.Er=0}dr(){return++this.Er}Ar(e){const n=[e,this.dr()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){Fo(n)?ue(Rv,"Ignoring IndexedDB error during garbage collection: ",n):await Vo(n)}await this.Vr(3e5)})}}class NA{constructor(e,n){this.mr=e,this.params=n}calculateTargetCount(e,n){return this.mr.gr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return W.resolve(ld.ce);const r=new kA(n);return this.mr.forEachTarget(e,i=>r.Ar(i.sequenceNumber)).next(()=>this.mr.pr(e,i=>r.Ar(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.mr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.mr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(ue("LruGarbageCollector","Garbage collection skipped; disabled"),W.resolve(Pv)):this.getCacheSize(e).next(r=>r(f>this.params.maximumSequenceNumbersToCollect?(ue("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${f}`),i=this.params.maximumSequenceNumbersToCollect):i=f,o=Date.now(),this.nthSequenceNumber(e,i))).next(f=>(r=f,a=Date.now(),this.removeTargets(e,r,n))).next(f=>(s=f,u=Date.now(),this.removeOrphanedDocuments(e,r))).next(f=>(c=Date.now(),Us()<=Me.DEBUG&&ue("LruGarbageCollector",`LRU Garbage Collection + Counted targets in ${o-h}ms + Determined least recently used ${i} in `+(a-o)+`ms + Removed ${s} targets in `+(u-a)+`ms + Removed ${f} documents in `+(c-u)+`ms +Total Duration: ${c-h}ms`),W.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:s,documentsRemoved:f})))}}function AA(t,e){return new NA(t,e)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class PA{constructor(){this.changes=new Ps(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,rn.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?W.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + *//** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class RA{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class DA{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&ja(r.mutation,i,On.empty(),We.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Fe()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Fe()){const i=cs();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=va();return s.forEach((a,u)=>{o=o.insert(a,u.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=cs();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Fe()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,r,i){let s=Xr();const o=Da(),a=function(){return Da()}();return n.forEach((u,c)=>{const h=r.get(c.key);i.has(c.key)&&(h===void 0||h.mutation instanceof Qi)?s=s.insert(c.key,c):h!==void 0?(o.set(c.key,h.mutation.getFieldMask()),ja(h.mutation,c,h.mutation.getFieldMask(),We.now())):o.set(c.key,On.empty())}),this.recalculateAndSaveOverlays(e,s).next(u=>(u.forEach((c,h)=>o.set(c,h)),n.forEach((c,h)=>a.set(c,new RA(h,o.get(c)??null))),a))}recalculateAndSaveOverlays(e,n){const r=Da();let i=new mt((o,a)=>o-a),s=Fe();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(u=>{const c=n.get(u);if(c===null)return;let h=r.get(u)||On.empty();h=a.applyToLocalView(c,h),r.set(u,h);const f=(i.get(a.batchId)||Fe()).add(u);i=i.insert(a.batchId,f)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),c=u.key,h=u.value,f=Mb();h.forEach(p=>{if(!s.has(p)){const g=Hb(n.get(p),r.get(p));g!==null&&f.set(p,g),s=s.add(p)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,f))}return W.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return xe.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):Rb(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):W.resolve(cs());let a=il,u=s;return o.next(c=>W.forEach(c,(h,f)=>(a{u=u.insert(h,p)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,u,c,Fe())).next(h=>({batchId:a,changes:Ob(h)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new xe(n)).next(r=>{let i=va();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=va();return this.indexManager.getCollectionParents(e,s).next(a=>W.forEach(a,u=>{const c=function(f,p){return new Uo(p,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(h=>{h.forEach((f,p)=>{o=o.insert(f,p)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((u,c)=>{const h=c.getKey();o.get(h)===null&&(o=o.insert(h,rn.newInvalidDocument(h)))});let a=va();return o.forEach((u,c)=>{const h=s.get(u);h!==void 0&&ja(h.mutation,c,On.empty(),We.now()),fd(n,c)&&(a=a.insert(u,c))}),a})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class jA{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,n){return W.resolve(this.Lr.get(n))}saveBundleMetadata(e,n){return this.Lr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Sr(i.createTime)}}(n)),W.resolve()}getNamedQuery(e,n){return W.resolve(this.kr.get(n))}saveNamedQuery(e,n){return this.kr.set(n.name,function(i){return{name:i.name,query:EA(i.bundledQuery),readTime:Sr(i.readTime)}}(n)),W.resolve()}}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class LA{constructor(){this.overlays=new mt(xe.comparator),this.qr=new Map}getOverlay(e,n){return W.resolve(this.overlays.get(n))}getOverlays(e,n){const r=cs();return W.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.St(e,n,s)}),W.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.qr.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.qr.delete(r)),W.resolve()}getOverlaysForCollection(e,n,r){const i=cs(),s=n.length+1,o=new xe(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const u=a.getNext().value,c=u.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===s&&u.largestBatchId>r&&i.set(u.getKey(),u)}return W.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new mt((c,h)=>c-h);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let h=s.get(c.largestBatchId);h===null&&(h=cs(),s=s.insert(c.largestBatchId,h)),h.set(c.getKey(),c)}}const a=cs(),u=s.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((c,h)=>a.set(c,h)),!(a.size()>=i)););return W.resolve(a)}St(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.qr.get(i.largestBatchId).delete(r.key);this.qr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new ZN(n,r));let s=this.qr.get(n);s===void 0&&(s=Fe(),this.qr.set(n,s)),this.qr.set(n,s.add(r.key))}}/** + * @license + * Copyright 2024 Google LLC + * + * 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. + */class OA{constructor(){this.sessionToken=Xt.EMPTY_BYTE_STRING}getSessionToken(e){return W.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,W.resolve()}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Km{constructor(){this.Qr=new Mt(zt.$r),this.Ur=new Mt(zt.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,n){const r=new zt(e,n);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Gr(new zt(e,n))}zr(e,n){e.forEach(r=>this.removeReference(r,n))}jr(e){const n=new xe(new nt([])),r=new zt(n,e),i=new zt(n,e+1),s=[];return this.Ur.forEachInRange([r,i],o=>{this.Gr(o),s.push(o.key)}),s}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const n=new xe(new nt([])),r=new zt(n,e),i=new zt(n,e+1);let s=Fe();return this.Ur.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new zt(e,0),r=this.Qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class zt{constructor(e,n){this.key=e,this.Yr=n}static $r(e,n){return xe.comparator(e.key,n.key)||Ve(e.Yr,n.Yr)}static Kr(e,n){return Ve(e.Yr,n.Yr)||xe.comparator(e.key,n.key)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class MA{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.tr=1,this.Zr=new Mt(zt.$r)}checkEmpty(e){return W.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new JN(s,n,r,i);this.mutationQueue.push(o);for(const a of i)this.Zr=this.Zr.add(new zt(a.key,s)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return W.resolve(o)}lookupMutationBatch(e,n){return W.resolve(this.Xr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.ei(r),s=i<0?0:i;return W.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return W.resolve(this.mutationQueue.length===0?Vm:this.tr-1)}getAllMutationBatches(e){return W.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new zt(n,0),i=new zt(n,Number.POSITIVE_INFINITY),s=[];return this.Zr.forEachInRange([r,i],o=>{const a=this.Xr(o.Yr);s.push(a)}),W.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Mt(Ve);return n.forEach(i=>{const s=new zt(i,0),o=new zt(i,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([s,o],a=>{r=r.add(a.Yr)})}),W.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;xe.isDocumentKey(s)||(s=s.child(""));const o=new zt(new xe(s),0);let a=new Mt(Ve);return this.Zr.forEachWhile(u=>{const c=u.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(u.Yr)),!0)},o),W.resolve(this.ti(a))}ti(e){const n=[];return e.forEach(r=>{const i=this.Xr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Ge(this.ni(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return W.forEach(n.mutations,i=>{const s=new zt(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,n){const r=new zt(n,0),i=this.Zr.firstAfterOrEqual(r);return W.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,W.resolve()}ni(e,n){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const n=this.ei(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class VA{constructor(e){this.ri=e,this.docs=function(){return new mt(xe.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.ri(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return W.resolve(r?r.document.mutableCopy():rn.newInvalidDocument(n))}getEntries(e,n){let r=Xr();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():rn.newInvalidDocument(i))}),W.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=Xr();const o=n.path,a=new xe(o.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(a);for(;u.hasNext();){const{key:c,value:{document:h}}=u.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||fN(hN(h),r)<=0||(i.has(h.key)||fd(n,h))&&(s=s.insert(h.key,h.mutableCopy()))}return W.resolve(s)}getAllFromCollectionGroup(e,n,r,i){Te(9500)}ii(e,n){return W.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new FA(this)}getSize(e){return W.resolve(this.size)}}class FA extends PA{constructor(e){super(),this.Nr=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Nr.addEntry(e,i)):this.Nr.removeEntry(r)}),W.waitFor(n)}getFromCache(e,n){return this.Nr.getEntry(e,n)}getAllFromCache(e,n){return this.Nr.getEntries(e,n)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class UA{constructor(e){this.persistence=e,this.si=new Ps(n=>zm(n),Bm),this.lastRemoteSnapshotVersion=Ne.min(),this.highestTargetId=0,this.oi=0,this._i=new Km,this.targetCount=0,this.ai=Ao.ur()}forEachTarget(e,n){return this.si.forEach((r,i)=>n(i)),W.resolve()}getLastRemoteSnapshotVersion(e){return W.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return W.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),W.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.oi&&(this.oi=n),W.resolve()}Pr(e){this.si.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ai=new Ao(n),this.highestTargetId=n),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,n){return this.Pr(n),this.targetCount+=1,W.resolve()}updateTargetData(e,n){return this.Pr(n),W.resolve()}removeTargetData(e,n){return this.si.delete(n.target),this._i.jr(n.targetId),this.targetCount-=1,W.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.si.forEach((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.si.delete(o),s.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),W.waitFor(s).next(()=>i)}getTargetCount(e){return W.resolve(this.targetCount)}getTargetData(e,n){const r=this.si.get(n)||null;return W.resolve(r)}addMatchingKeys(e,n,r){return this._i.Wr(n,r),W.resolve()}removeMatchingKeys(e,n,r){this._i.zr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),W.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this._i.jr(n),W.resolve()}getMatchingKeysForTargetId(e,n){const r=this._i.Hr(n);return W.resolve(r)}containsKey(e,n){return W.resolve(this._i.containsKey(n))}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class rE{constructor(e,n){this.ui={},this.overlays={},this.ci=new ld(0),this.li=!1,this.li=!0,this.hi=new OA,this.referenceDelegate=e(this),this.Pi=new UA(this),this.indexManager=new SA,this.remoteDocumentCache=function(i){return new VA(i)}(r=>this.referenceDelegate.Ti(r)),this.serializer=new bA(n),this.Ii=new jA(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new LA,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ui[e.toKey()];return r||(r=new MA(n,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,n,r){ue("MemoryPersistence","Starting transaction:",e);const i=new zA(this.ci.next());return this.referenceDelegate.Ei(),r(i).next(s=>this.referenceDelegate.di(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Ai(e,n){return W.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,n)))}}class zA extends mN{constructor(e){super(),this.currentSequenceNumber=e}}class Qm{constructor(e){this.persistence=e,this.Ri=new Km,this.Vi=null}static mi(e){return new Qm(e)}get fi(){if(this.Vi)return this.Vi;throw Te(60996)}addReference(e,n,r){return this.Ri.addReference(r,n),this.fi.delete(r.toString()),W.resolve()}removeReference(e,n,r){return this.Ri.removeReference(r,n),this.fi.add(r.toString()),W.resolve()}markPotentiallyOrphaned(e,n){return this.fi.add(n.toString()),W.resolve()}removeTarget(e,n){this.Ri.jr(n.targetId).forEach(i=>this.fi.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.fi.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}Ei(){this.Vi=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return W.forEach(this.fi,r=>{const i=xe.fromPath(r);return this.gi(e,i).next(s=>{s||n.removeEntry(i,Ne.min())})}).next(()=>(this.Vi=null,n.apply(e)))}updateLimboDocument(e,n){return this.gi(e,n).next(r=>{r?this.fi.delete(n.toString()):this.fi.add(n.toString())})}Ti(e){return 0}gi(e,n){return W.or([()=>W.resolve(this.Ri.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ai(e,n)])}}class Sc{constructor(e,n){this.persistence=e,this.pi=new Ps(r=>vN(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=AA(this,n)}static mi(e,n){return new Sc(e,n)}Ei(){}di(e){return W.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}gr(e){const n=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}wr(e){let n=0;return this.pr(e,r=>{n++}).next(()=>n)}pr(e,n){return W.forEach(this.pi,(r,i)=>this.br(e,r,i).next(s=>s?W.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const i=this.persistence.getRemoteDocumentCache(),s=i.newChangeBuffer();return i.ii(e,o=>this.br(e,o,n).next(a=>{a||(r++,s.removeEntry(o,Ne.min()))})).next(()=>s.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.pi.set(n,e.currentSequenceNumber),W.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),W.resolve()}removeReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),W.resolve()}updateLimboDocument(e,n){return this.pi.set(n,e.currentSequenceNumber),W.resolve()}Ti(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=Du(e.data.value)),n}br(e,n,r){return W.or([()=>this.persistence.Ai(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const i=this.pi.get(n);return W.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ym{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.Es=r,this.ds=i}static As(e,n){let r=Fe(),i=Fe();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new Ym(e,n.fromCache,r,i)}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */class BA{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class $A{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){return j2()?8:gN(on())>0?6:4}()}initialize(e,n){this.ps=e,this.indexManager=n,this.Rs=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.ys(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.ws(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new BA;return this.Ss(e,n,o).next(a=>{if(s.result=a,this.Vs)return this.bs(e,n,o,a.size)})}).next(()=>s.result)}bs(e,n,r,i){return r.documentReadCountthis.gs*i?(Us()<=Me.DEBUG&&ue("QueryEngine","The SDK decides to create cache indexes for query:",zs(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Er(n))):W.resolve())}ys(e,n){if(_v(n))return W.resolve(null);let r=Er(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=op(n,null,"F"),r=Er(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=Fe(...s);return this.ps.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,r).next(u=>{const c=this.Ds(n,a);return this.Cs(n,c,o,u.readTime)?this.ys(e,op(n,null,"F")):this.vs(e,c,n,u)}))})))}ws(e,n,r,i){return _v(n)||i.isEqual(Ne.min())?W.resolve(null):this.ps.getDocuments(e,r).next(s=>{const o=this.Ds(n,s);return this.Cs(n,o,r,i)?W.resolve(null):(Us()<=Me.DEBUG&&ue("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),zs(n)),this.vs(e,o,n,dN(i,il)).next(a=>a))})}Ds(e,n){let r=new Mt(jb(e));return n.forEach((i,s)=>{fd(e,s)&&(r=r.add(s))}),r}Cs(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Ss(e,n,r){return Us()<=Me.DEBUG&&ue("QueryEngine","Using full collection scan to execute query:",zs(n)),this.ps.getDocumentsMatchingQuery(e,n,Fi.min(),r)}vs(e,n,r,i){return this.ps.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Xm="LocalStore",HA=3e8;class qA{constructor(e,n,r,i){this.persistence=e,this.Fs=n,this.serializer=i,this.Ms=new mt(Ve),this.xs=new Ps(s=>zm(s),Bm),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new DA(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.Ms))}}function WA(t,e,n,r){return new qA(t,e,n,r)}async function iE(t,e){const n=Ae(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.Bs(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let u=Fe();for(const c of i){o.push(c.batchId);for(const h of c.mutations)u=u.add(h.key)}for(const c of s){a.push(c.batchId);for(const h of c.mutations)u=u.add(h.key)}return n.localDocuments.getDocuments(r,u).next(c=>({Ls:c,removedBatchIds:o,addedBatchIds:a}))})})}function GA(t,e){const n=Ae(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.Ns.newChangeBuffer({trackRemovals:!0});return function(a,u,c,h){const f=c.batch,p=f.keys();let g=W.resolve();return p.forEach(_=>{g=g.next(()=>h.getEntry(u,_)).next(T=>{const R=c.docVersions.get(_);Ge(R!==null,48541),T.version.compareTo(R)<0&&(f.applyToRemoteDocument(T,c),T.isValidDocument()&&(T.setReadTime(c.commitVersion),h.addEntry(T)))})}),g.next(()=>a.mutationQueue.removeMutationBatch(u,f))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let u=Fe();for(let c=0;c0&&(u=u.add(a.batch.mutations[c].key));return u}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function sE(t){const e=Ae(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Pi.getLastRemoteSnapshotVersion(n))}function KA(t,e){const n=Ae(t),r=e.snapshotVersion;let i=n.Ms;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.Ns.newChangeBuffer({trackRemovals:!0});i=n.Ms;const a=[];e.targetChanges.forEach((h,f)=>{const p=i.get(f);if(!p)return;a.push(n.Pi.removeMatchingKeys(s,h.removedDocuments,f).next(()=>n.Pi.addMatchingKeys(s,h.addedDocuments,f)));let g=p.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(f)!==null?g=g.withResumeToken(Xt.EMPTY_BYTE_STRING,Ne.min()).withLastLimboFreeSnapshotVersion(Ne.min()):h.resumeToken.approximateByteSize()>0&&(g=g.withResumeToken(h.resumeToken,r)),i=i.insert(f,g),function(T,R,y){return T.resumeToken.approximateByteSize()===0||R.snapshotVersion.toMicroseconds()-T.snapshotVersion.toMicroseconds()>=HA?!0:y.addedDocuments.size+y.modifiedDocuments.size+y.removedDocuments.size>0}(p,g,h)&&a.push(n.Pi.updateTargetData(s,g))});let u=Xr(),c=Fe();if(e.documentUpdates.forEach(h=>{e.resolvedLimboDocuments.has(h)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,h))}),a.push(QA(s,o,e.documentUpdates).next(h=>{u=h.ks,c=h.qs})),!r.isEqual(Ne.min())){const h=n.Pi.getLastRemoteSnapshotVersion(s).next(f=>n.Pi.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(h)}return W.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,c)).next(()=>u)}).then(s=>(n.Ms=i,s))}function QA(t,e,n){let r=Fe(),i=Fe();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=Xr();return n.forEach((a,u)=>{const c=s.get(a);u.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),u.isNoDocument()&&u.version.isEqual(Ne.min())?(e.removeEntry(a,u.readTime),o=o.insert(a,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(a,u)):ue(Xm,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",u.version)}),{ks:o,qs:i}})}function YA(t,e){const n=Ae(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=Vm),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function XA(t,e){const n=Ae(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Pi.getTargetData(r,e).next(s=>s?(i=s,W.resolve(i)):n.Pi.allocateTargetId(r).next(o=>(i=new bi(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Pi.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.Ms.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(r.targetId,r),n.xs.set(e,r.targetId)),r})}async function dp(t,e,n){const r=Ae(t),i=r.Ms.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!Fo(o))throw o;ue(Xm,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Ms=r.Ms.remove(e),r.xs.delete(i.target)}function jv(t,e,n){const r=Ae(t);let i=Ne.min(),s=Fe();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,c,h){const f=Ae(u),p=f.xs.get(h);return p!==void 0?W.resolve(f.Ms.get(p)):f.Pi.getTargetData(c,h)}(r,o,Er(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(o,a.targetId).next(u=>{s=u})}).next(()=>r.Fs.getDocumentsMatchingQuery(o,e,n?i:Ne.min(),n?s:Fe())).next(a=>(JA(r,MN(e),a),{documents:a,Qs:s})))}function JA(t,e,n){let r=t.Os.get(e)||Ne.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.Os.set(e,r)}class Lv{constructor(){this.activeTargetIds=$N()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class ZA{constructor(){this.Mo=new Lv,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,n,r){this.xo[e]=n}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new Lv,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class eP{Oo(e){}shutdown(){}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Ov="ConnectivityMonitor";class Mv{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){ue(Ov,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){ue(Ov,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */let fu=null;function hp(){return fu===null?fu=function(){return 268435456+Math.round(2147483648*Math.random())}():fu++,"0x"+fu.toString(16)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Ah="RestConnection",tP={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class nP{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Uo=n+"://"+e.host,this.Ko=`projects/${r}/databases/${i}`,this.Wo=this.databaseId.database===xc?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Go(e,n,r,i,s){const o=hp(),a=this.zo(e,n.toUriEncodedString());ue(Ah,`Sending RPC '${e}' ${o}:`,a,r);const u={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(u,i,s);const{host:c}=new URL(a),h=Ns(c);return this.Jo(e,a,u,r,h).then(f=>(ue(Ah,`Received RPC '${e}' ${o}: `,f),f),f=>{throw Io(Ah,`RPC '${e}' ${o} failed with error: `,f,"url: ",a,"request:",r),f})}Ho(e,n,r,i,s,o){return this.Go(e,n,r,i,s)}jo(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Mo}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,s)=>e[s]=i),r&&r.headers.forEach((i,s)=>e[s]=i)}zo(e,n){const r=tP[e];return`${this.Uo}/v1/${n}:${r}`}terminate(){}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class rP{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const en="WebChannelConnection";class iP extends nP{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,i,s){const o=hp();return new Promise((a,u)=>{const c=new ab;c.setWithCredentials(!0),c.listenOnce(lb.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Ru.NO_ERROR:const f=c.getResponseJson();ue(en,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(f)),a(f);break;case Ru.TIMEOUT:ue(en,`RPC '${e}' ${o} timed out`),u(new ae(q.DEADLINE_EXCEEDED,"Request time out"));break;case Ru.HTTP_ERROR:const p=c.getStatus();if(ue(en,`RPC '${e}' ${o} failed with status:`,p,"response text:",c.getResponseText()),p>0){let g=c.getResponseJson();Array.isArray(g)&&(g=g[0]);const _=g==null?void 0:g.error;if(_&&_.status&&_.message){const T=function(y){const w=y.toLowerCase().replace(/_/g,"-");return Object.values(q).indexOf(w)>=0?w:q.UNKNOWN}(_.status);u(new ae(T,_.message))}else u(new ae(q.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new ae(q.UNAVAILABLE,"Connection failed."));break;default:Te(9055,{l_:e,streamId:o,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{ue(en,`RPC '${e}' ${o} completed.`)}});const h=JSON.stringify(i);ue(en,`RPC '${e}' ${o} sending request:`,i),c.send(n,"POST",h,r,15)})}T_(e,n,r){const i=hp(),s=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=db(),a=cb(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(u.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(u.useFetchStreams=!0),this.jo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const h=s.join("");ue(en,`Creating RPC '${e}' stream ${i}: ${h}`,u);const f=o.createWebChannel(h,u);this.I_(f);let p=!1,g=!1;const _=new rP({Yo:R=>{g?ue(en,`Not sending because RPC '${e}' stream ${i} is closed:`,R):(p||(ue(en,`Opening RPC '${e}' stream ${i} transport.`),f.open(),p=!0),ue(en,`RPC '${e}' stream ${i} sending:`,R),f.send(R))},Zo:()=>f.close()}),T=(R,y,w)=>{R.listen(y,k=>{try{w(k)}catch(L){setTimeout(()=>{throw L},0)}})};return T(f,ya.EventType.OPEN,()=>{g||(ue(en,`RPC '${e}' stream ${i} transport opened.`),_.o_())}),T(f,ya.EventType.CLOSE,()=>{g||(g=!0,ue(en,`RPC '${e}' stream ${i} transport closed`),_.a_(),this.E_(f))}),T(f,ya.EventType.ERROR,R=>{g||(g=!0,Io(en,`RPC '${e}' stream ${i} transport errored. Name:`,R.name,"Message:",R.message),_.a_(new ae(q.UNAVAILABLE,"The operation could not be completed")))}),T(f,ya.EventType.MESSAGE,R=>{var y;if(!g){const w=R.data[0];Ge(!!w,16349);const k=w,L=(k==null?void 0:k.error)||((y=k[0])==null?void 0:y.error);if(L){ue(en,`RPC '${e}' stream ${i} received error:`,L);const U=L.status;let j=function(E){const I=Tt[E];if(I!==void 0)return Wb(I)}(U),b=L.message;j===void 0&&(j=q.INTERNAL,b="Unknown error status: "+U+" with message "+L.message),g=!0,_.a_(new ae(j,b)),f.close()}else ue(en,`RPC '${e}' stream ${i} received:`,w),_.u_(w)}}),T(a,ub.STAT_EVENT,R=>{R.stat===Zf.PROXY?ue(en,`RPC '${e}' stream ${i} detected buffering proxy`):R.stat===Zf.NOPROXY&&ue(en,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{_.__()},0),_}terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(n=>n===e)}}function Ph(){return typeof document<"u"?document:null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function yd(t){return new lA(t,!0)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class oE{constructor(e,n,r=1e3,i=1.5,s=6e4){this.Mi=e,this.timerId=n,this.d_=r,this.A_=i,this.R_=s,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const n=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),i=Math.max(0,n-r);i>0&&ue("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.V_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Vv="PersistentStream";class aE{constructor(e,n,r,i,s,o,a,u){this.Mi=e,this.S_=r,this.b_=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new oE(e,n)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():n&&n.code===q.RESOURCE_EXHAUSTED?(Yr(n.toString()),Yr("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):n&&n.code===q.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(n)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),n=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.D_===n&&this.G_(r,i)},r=>{e(()=>{const i=new ae(q.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(i)})})}G_(e,n){const r=this.W_(this.D_);this.stream=this.j_(e,n),this.stream.Xo(()=>{r(()=>this.listener.Xo())}),this.stream.t_(()=>{r(()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.t_()))}),this.stream.r_(i=>{r(()=>this.z_(i))}),this.stream.onMessage(i=>{r(()=>++this.F_==1?this.J_(i):this.onNext(i))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return ue(Vv,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return n=>{this.Mi.enqueueAndForget(()=>this.D_===e?n():(ue(Vv,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class sP extends aE{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}j_(e,n){return this.connection.T_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const n=dA(this.serializer,e),r=function(s){if(!("targetChange"in s))return Ne.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?Ne.min():o.readTime?Sr(o.readTime):Ne.min()}(e);return this.listener.H_(n,r)}Y_(e){const n={};n.database=cp(this.serializer),n.addTarget=function(s,o){let a;const u=o.target;if(a=ip(u)?{documents:pA(s,u)}:{query:mA(s,u).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=Qb(s,o.resumeToken);const c=ap(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(Ne.min())>0){a.readTime=Ec(s,o.snapshotVersion.toTimestamp());const c=ap(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const r=yA(this.serializer,e);r&&(n.labels=r),this.q_(n)}Z_(e){const n={};n.database=cp(this.serializer),n.removeTarget=e,this.q_(n)}}class oP extends aE{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}get X_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}K_(){this.X_&&this.ea([])}j_(e,n){return this.connection.T_("Write",e,n)}J_(e){return Ge(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Ge(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){Ge(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const n=fA(e.writeResults,e.commitTime),r=Sr(e.commitTime);return this.listener.na(r,n)}ra(){const e={};e.database=cp(this.serializer),this.q_(e)}ea(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>hA(this.serializer,r))};this.q_(n)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class aP{}class lP extends aP{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new ae(q.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,n,r,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Go(e,lp(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===q.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new ae(q.UNKNOWN,s.toString())})}Ho(e,n,r,i,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Ho(e,lp(n,r),i,o,a,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===q.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new ae(q.UNKNOWN,o.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class uP{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const n=`Could not reach Cloud Firestore backend. ${e} +This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(Yr(n),this.aa=!1):ue("OnlineStateTracker",n)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Ts="RemoteStore";class cP{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=s,this.Aa.Oo(o=>{r.enqueueAndForget(async()=>{Rs(this)&&(ue(Ts,"Restarting streams for network reachability change."),await async function(u){const c=Ae(u);c.Ea.add(4),await Il(c),c.Ra.set("Unknown"),c.Ea.delete(4),await vd(c)}(this))})}),this.Ra=new uP(r,i)}}async function vd(t){if(Rs(t))for(const e of t.da)await e(!0)}async function Il(t){for(const e of t.da)await e(!1)}function lE(t,e){const n=Ae(t);n.Ia.has(e.targetId)||(n.Ia.set(e.targetId,e),tg(n)?eg(n):zo(n).O_()&&Zm(n,e))}function Jm(t,e){const n=Ae(t),r=zo(n);n.Ia.delete(e),r.O_()&&uE(n,e),n.Ia.size===0&&(r.O_()?r.L_():Rs(n)&&n.Ra.set("Unknown"))}function Zm(t,e){if(t.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Ne.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}zo(t).Y_(e)}function uE(t,e){t.Va.Ue(e),zo(t).Z_(e)}function eg(t){t.Va=new iA({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),At:e=>t.Ia.get(e)||null,ht:()=>t.datastore.serializer.databaseId}),zo(t).start(),t.Ra.ua()}function tg(t){return Rs(t)&&!zo(t).x_()&&t.Ia.size>0}function Rs(t){return Ae(t).Ea.size===0}function cE(t){t.Va=void 0}async function dP(t){t.Ra.set("Online")}async function hP(t){t.Ia.forEach((e,n)=>{Zm(t,e)})}async function fP(t,e){cE(t),tg(t)?(t.Ra.ha(e),eg(t)):t.Ra.set("Unknown")}async function pP(t,e,n){if(t.Ra.set("Online"),e instanceof Kb&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.Ia.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.Ia.delete(a),i.Va.removeTarget(a))}(t,e)}catch(r){ue(Ts,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await Tc(t,r)}else if(e instanceof Ou?t.Va.Ze(e):e instanceof Gb?t.Va.st(e):t.Va.tt(e),!n.isEqual(Ne.min()))try{const r=await sE(t.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.Va.Tt(o);return a.targetChanges.forEach((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const h=s.Ia.get(c);h&&s.Ia.set(c,h.withResumeToken(u.resumeToken,o))}}),a.targetMismatches.forEach((u,c)=>{const h=s.Ia.get(u);if(!h)return;s.Ia.set(u,h.withResumeToken(Xt.EMPTY_BYTE_STRING,h.snapshotVersion)),uE(s,u);const f=new bi(h.target,u,c,h.sequenceNumber);Zm(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(r){ue(Ts,"Failed to raise snapshot:",r),await Tc(t,r)}}async function Tc(t,e,n){if(!Fo(e))throw e;t.Ea.add(1),await Il(t),t.Ra.set("Offline"),n||(n=()=>sE(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{ue(Ts,"Retrying IndexedDB access"),await n(),t.Ea.delete(1),await vd(t)})}function dE(t,e){return e().catch(n=>Tc(t,n,e))}async function xd(t){const e=Ae(t),n=$i(e);let r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Vm;for(;mP(e);)try{const i=await YA(e.localStore,r);if(i===null){e.Ta.length===0&&n.L_();break}r=i.batchId,gP(e,i)}catch(i){await Tc(e,i)}hE(e)&&fE(e)}function mP(t){return Rs(t)&&t.Ta.length<10}function gP(t,e){t.Ta.push(e);const n=$i(t);n.O_()&&n.X_&&n.ea(e.mutations)}function hE(t){return Rs(t)&&!$i(t).x_()&&t.Ta.length>0}function fE(t){$i(t).start()}async function yP(t){$i(t).ra()}async function vP(t){const e=$i(t);for(const n of t.Ta)e.ea(n.mutations)}async function xP(t,e,n){const r=t.Ta.shift(),i=qm.from(r,e,n);await dE(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await xd(t)}async function wP(t,e){e&&$i(t).X_&&await async function(r,i){if(function(o){return tA(o)&&o!==q.ABORTED}(i.code)){const s=r.Ta.shift();$i(r).B_(),await dE(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await xd(r)}}(t,e),hE(t)&&fE(t)}async function Fv(t,e){const n=Ae(t);n.asyncQueue.verifyOperationInProgress(),ue(Ts,"RemoteStore received new credentials");const r=Rs(n);n.Ea.add(3),await Il(n),r&&n.Ra.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ea.delete(3),await vd(n)}async function _P(t,e){const n=Ae(t);e?(n.Ea.delete(2),await vd(n)):e||(n.Ea.add(2),await Il(n),n.Ra.set("Unknown"))}function zo(t){return t.ma||(t.ma=function(n,r,i){const s=Ae(n);return s.sa(),new sP(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Xo:dP.bind(null,t),t_:hP.bind(null,t),r_:fP.bind(null,t),H_:pP.bind(null,t)}),t.da.push(async e=>{e?(t.ma.B_(),tg(t)?eg(t):t.Ra.set("Unknown")):(await t.ma.stop(),cE(t))})),t.ma}function $i(t){return t.fa||(t.fa=function(n,r,i){const s=Ae(n);return s.sa(),new oP(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Xo:()=>Promise.resolve(),t_:yP.bind(null,t),r_:wP.bind(null,t),ta:vP.bind(null,t),na:xP.bind(null,t)}),t.da.push(async e=>{e?(t.fa.B_(),await xd(t)):(await t.fa.stop(),t.Ta.length>0&&(ue(Ts,`Stopping write stream with ${t.Ta.length} pending writes`),t.Ta=[]))})),t.fa}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ng{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new Hr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,a=new ng(e,n,o,i,s);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ae(q.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function rg(t,e){if(Yr("AsyncQueue",`${e}: ${t}`),Fo(t))return new ae(q.UNAVAILABLE,`${e}: ${t}`);throw t}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ho{static emptySet(e){return new ho(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||xe.comparator(n.key,r.key):(n,r)=>xe.comparator(n.key,r.key),this.keyedMap=va(),this.sortedSet=new mt(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof ho)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( + `+e.join(` +`)+` +)`}copy(e,n){const r=new ho;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Uv{constructor(){this.ga=new mt(xe.comparator)}track(e){const n=e.doc.key,r=this.ga.get(n);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(n,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(n):e.type===1&&r.type===2?this.ga=this.ga.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):Te(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(n,e)}ya(){const e=[];return this.ga.inorderTraversal((n,r)=>{e.push(r)}),e}}class Po{constructor(e,n,r,i,s,o,a,u,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new Po(e,n,ho.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&hd(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;ie.Da())}}class EP{constructor(){this.queries=zv(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const i=Ae(n),s=i.queries;i.queries=zv(),s.forEach((o,a)=>{for(const u of a.Sa)u.onError(r)})})(this,new ae(q.ABORTED,"Firestore shutting down"))}}function zv(){return new Ps(t=>Db(t),hd)}async function ig(t,e){const n=Ae(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.ba()&&e.Da()&&(r=2):(s=new bP,r=e.Da()?0:1);try{switch(r){case 0:s.wa=await n.onListen(i,!0);break;case 1:s.wa=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const a=rg(o,`Initialization of query '${zs(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,s),s.Sa.push(e),e.va(n.onlineState),s.wa&&e.Fa(s.wa)&&og(n)}async function sg(t,e){const n=Ae(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.Sa.indexOf(e);o>=0&&(s.Sa.splice(o,1),s.Sa.length===0?i=e.Da()?0:1:!s.ba()&&e.Da()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function SP(t,e){const n=Ae(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.Sa)a.Fa(i)&&(r=!0);o.wa=i}}r&&og(n)}function TP(t,e,n){const r=Ae(t),i=r.queries.get(e);if(i)for(const s of i.Sa)s.onError(n);r.queries.delete(e)}function og(t){t.Ca.forEach(e=>{e.next()})}var fp,Bv;(Bv=fp||(fp={})).Ma="default",Bv.Cache="cache";class ag{constructor(e,n,r){this.query=e,this.xa=n,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new Po(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),n=!0):this.La(e,this.onlineState)&&(this.ka(e),n=!0),this.Na=e,n}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let n=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),n=!0),n}La(e,n){if(!e.fromCache||!this.Da())return!0;const r=n!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const n=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}ka(e){e=Po.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==fp.Cache}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class pE{constructor(e){this.key=e}}class mE{constructor(e){this.key=e}}class IP{constructor(e,n){this.query=e,this.Ya=n,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=Fe(),this.mutatedKeys=Fe(),this.eu=jb(e),this.tu=new ho(this.eu)}get nu(){return this.Ya}ru(e,n){const r=n?n.iu:new Uv,i=n?n.tu:this.tu;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((h,f)=>{const p=i.get(h),g=fd(this.query,f)?f:null,_=!!p&&this.mutatedKeys.has(p.key),T=!!g&&(g.hasLocalMutations||this.mutatedKeys.has(g.key)&&g.hasCommittedMutations);let R=!1;p&&g?p.data.isEqual(g.data)?_!==T&&(r.track({type:3,doc:g}),R=!0):this.su(p,g)||(r.track({type:2,doc:g}),R=!0,(u&&this.eu(g,u)>0||c&&this.eu(g,c)<0)&&(a=!0)):!p&&g?(r.track({type:0,doc:g}),R=!0):p&&!g&&(r.track({type:1,doc:p}),R=!0,(u||c)&&(a=!0)),R&&(g?(o=o.add(g),s=T?s.add(h):s.delete(h)):(o=o.delete(h),s=s.delete(h)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const h=this.query.limitType==="F"?o.last():o.first();o=o.delete(h.key),s=s.delete(h.key),r.track({type:1,doc:h})}return{tu:o,iu:r,Cs:a,mutatedKeys:s}}su(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort((h,f)=>function(g,_){const T=R=>{switch(R){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Te(20277,{Rt:R})}};return T(g)-T(_)}(h.type,f.type)||this.eu(h.doc,f.doc)),this.ou(r),i=i??!1;const a=n&&!i?this._u():[],u=this.Xa.size===0&&this.current&&!i?1:0,c=u!==this.Za;return this.Za=u,o.length!==0||c?{snapshot:new Po(this.query,e.tu,s,o,e.mutatedKeys,u===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new Uv,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach(n=>this.Ya=this.Ya.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ya=this.Ya.delete(n)),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=Fe(),this.tu.forEach(r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))});const n=[];return e.forEach(r=>{this.Xa.has(r)||n.push(new mE(r))}),this.Xa.forEach(r=>{e.has(r)||n.push(new pE(r))}),n}cu(e){this.Ya=e.Qs,this.Xa=Fe();const n=this.ru(e.documents);return this.applyChanges(n,!0)}lu(){return Po.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const lg="SyncEngine";class kP{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class CP{constructor(e){this.key=e,this.hu=!1}}class NP{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new Ps(a=>Db(a),hd),this.Iu=new Map,this.Eu=new Set,this.du=new mt(xe.comparator),this.Au=new Map,this.Ru=new Km,this.Vu={},this.mu=new Map,this.fu=Ao.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function AP(t,e,n=!0){const r=_E(t);let i;const s=r.Tu.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.lu()):i=await gE(r,e,n,!0),i}async function PP(t,e){const n=_E(t);await gE(n,e,!0,!1)}async function gE(t,e,n,r){const i=await XA(t.localStore,Er(e)),s=i.targetId,o=t.sharedClientState.addLocalQueryTarget(s,n);let a;return r&&(a=await RP(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&lE(t.remoteStore,i),a}async function RP(t,e,n,r,i){t.pu=(f,p,g)=>async function(T,R,y,w){let k=R.view.ru(y);k.Cs&&(k=await jv(T.localStore,R.query,!1).then(({documents:b})=>R.view.ru(b,k)));const L=w&&w.targetChanges.get(R.targetId),U=w&&w.targetMismatches.get(R.targetId)!=null,j=R.view.applyChanges(k,T.isPrimaryClient,L,U);return Hv(T,R.targetId,j.au),j.snapshot}(t,f,p,g);const s=await jv(t.localStore,e,!0),o=new IP(e,s.Qs),a=o.ru(s.documents),u=Tl.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=o.applyChanges(a,t.isPrimaryClient,u);Hv(t,n,c.au);const h=new kP(e,n,o);return t.Tu.set(e,h),t.Iu.has(n)?t.Iu.get(n).push(e):t.Iu.set(n,[e]),c.snapshot}async function DP(t,e,n){const r=Ae(t),i=r.Tu.get(e),s=r.Iu.get(i.targetId);if(s.length>1)return r.Iu.set(i.targetId,s.filter(o=>!hd(o,e))),void r.Tu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await dp(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&Jm(r.remoteStore,i.targetId),pp(r,i.targetId)}).catch(Vo)):(pp(r,i.targetId),await dp(r.localStore,i.targetId,!0))}async function jP(t,e){const n=Ae(t),r=n.Tu.get(e),i=n.Iu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),Jm(n.remoteStore,r.targetId))}async function LP(t,e,n){const r=BP(t);try{const i=await function(o,a){const u=Ae(o),c=We.now(),h=a.reduce((g,_)=>g.add(_.key),Fe());let f,p;return u.persistence.runTransaction("Locally write mutations","readwrite",g=>{let _=Xr(),T=Fe();return u.Ns.getEntries(g,h).next(R=>{_=R,_.forEach((y,w)=>{w.isValidDocument()||(T=T.add(y))})}).next(()=>u.localDocuments.getOverlayedDocuments(g,_)).next(R=>{f=R;const y=[];for(const w of a){const k=YN(w,f.get(w.key).overlayedDocument);k!=null&&y.push(new Qi(w.key,k,Tb(k.value.mapValue),Qn.exists(!0)))}return u.mutationQueue.addMutationBatch(g,c,y,a)}).next(R=>{p=R;const y=R.applyToLocalDocumentSet(f,T);return u.documentOverlayCache.saveOverlays(g,R.batchId,y)})}).then(()=>({batchId:p.batchId,changes:Ob(f)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,u){let c=o.Vu[o.currentUser.toKey()];c||(c=new mt(Ve)),c=c.insert(a,u),o.Vu[o.currentUser.toKey()]=c}(r,i.batchId,n),await kl(r,i.changes),await xd(r.remoteStore)}catch(i){const s=rg(i,"Failed to persist write");n.reject(s)}}async function yE(t,e){const n=Ae(t);try{const r=await KA(n.localStore,e);e.targetChanges.forEach((i,s)=>{const o=n.Au.get(s);o&&(Ge(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?o.hu=!0:i.modifiedDocuments.size>0?Ge(o.hu,14607):i.removedDocuments.size>0&&(Ge(o.hu,42227),o.hu=!1))}),await kl(n,r,e)}catch(r){await Vo(r)}}function $v(t,e,n){const r=Ae(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.Tu.forEach((s,o)=>{const a=o.view.va(e);a.snapshot&&i.push(a.snapshot)}),function(o,a){const u=Ae(o);u.onlineState=a;let c=!1;u.queries.forEach((h,f)=>{for(const p of f.Sa)p.va(a)&&(c=!0)}),c&&og(u)}(r.eventManager,e),i.length&&r.Pu.H_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function OP(t,e,n){const r=Ae(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Au.get(e),s=i&&i.key;if(s){let o=new mt(xe.comparator);o=o.insert(s,rn.newNoDocument(s,Ne.min()));const a=Fe().add(s),u=new gd(Ne.min(),new Map,new mt(Ve),o,a);await yE(r,u),r.du=r.du.remove(s),r.Au.delete(e),ug(r)}else await dp(r.localStore,e,!1).then(()=>pp(r,e,n)).catch(Vo)}async function MP(t,e){const n=Ae(t),r=e.batch.batchId;try{const i=await GA(n.localStore,e);xE(n,r,null),vE(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await kl(n,i)}catch(i){await Vo(i)}}async function VP(t,e,n){const r=Ae(t);try{const i=await function(o,a){const u=Ae(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let h;return u.mutationQueue.lookupMutationBatch(c,a).next(f=>(Ge(f!==null,37113),h=f.keys(),u.mutationQueue.removeMutationBatch(c,f))).next(()=>u.mutationQueue.performConsistencyCheck(c)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(c,h,a)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,h)).next(()=>u.localDocuments.getDocuments(c,h))})}(r.localStore,e);xE(r,e,n),vE(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await kl(r,i)}catch(i){await Vo(i)}}function vE(t,e){(t.mu.get(e)||[]).forEach(n=>{n.resolve()}),t.mu.delete(e)}function xE(t,e,n){const r=Ae(t);let i=r.Vu[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.Vu[r.currentUser.toKey()]=i}}function pp(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Iu.get(e))t.Tu.delete(r),n&&t.Pu.yu(r,n);t.Iu.delete(e),t.isPrimaryClient&&t.Ru.jr(e).forEach(r=>{t.Ru.containsKey(r)||wE(t,r)})}function wE(t,e){t.Eu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(Jm(t.remoteStore,n),t.du=t.du.remove(e),t.Au.delete(n),ug(t))}function Hv(t,e,n){for(const r of n)r instanceof pE?(t.Ru.addReference(r.key,e),FP(t,r)):r instanceof mE?(ue(lg,"Document no longer in limbo: "+r.key),t.Ru.removeReference(r.key,e),t.Ru.containsKey(r.key)||wE(t,r.key)):Te(19791,{wu:r})}function FP(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Eu.has(r)||(ue(lg,"New document in limbo: "+n),t.Eu.add(r),ug(t))}function ug(t){for(;t.Eu.size>0&&t.du.size{o.push(r.pu(u,e,n).then(c=>{var h;if((c||n)&&r.isPrimaryClient){const f=c?!c.fromCache:(h=n==null?void 0:n.targetChanges.get(u.targetId))==null?void 0:h.current;r.sharedClientState.updateQueryState(u.targetId,f?"current":"not-current")}if(c){i.push(c);const f=Ym.As(u.targetId,c);s.push(f)}}))}),await Promise.all(o),r.Pu.H_(i),await async function(u,c){const h=Ae(u);try{await h.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>W.forEach(c,p=>W.forEach(p.Es,g=>h.persistence.referenceDelegate.addReference(f,p.targetId,g)).next(()=>W.forEach(p.ds,g=>h.persistence.referenceDelegate.removeReference(f,p.targetId,g)))))}catch(f){if(!Fo(f))throw f;ue(Xm,"Failed to update sequence numbers: "+f)}for(const f of c){const p=f.targetId;if(!f.fromCache){const g=h.Ms.get(p),_=g.snapshotVersion,T=g.withLastLimboFreeSnapshotVersion(_);h.Ms=h.Ms.insert(p,T)}}}(r.localStore,s))}async function UP(t,e){const n=Ae(t);if(!n.currentUser.isEqual(e)){ue(lg,"User change. New user:",e.toKey());const r=await iE(n.localStore,e);n.currentUser=e,function(s,o){s.mu.forEach(a=>{a.forEach(u=>{u.reject(new ae(q.CANCELLED,o))})}),s.mu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await kl(n,r.Ls)}}function zP(t,e){const n=Ae(t),r=n.Au.get(e);if(r&&r.hu)return Fe().add(r.key);{let i=Fe();const s=n.Iu.get(e);if(!s)return i;for(const o of s){const a=n.Tu.get(o);i=i.unionWith(a.view.nu)}return i}}function _E(t){const e=Ae(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=yE.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=zP.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=OP.bind(null,e),e.Pu.H_=SP.bind(null,e.eventManager),e.Pu.yu=TP.bind(null,e.eventManager),e}function BP(t){const e=Ae(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=MP.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=VP.bind(null,e),e}class Ic{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=yd(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,n){return null}Mu(e,n){return null}vu(e){return WA(this.persistence,new $A,e.initialUser,this.serializer)}Cu(e){return new rE(Qm.mi,this.serializer)}Du(e){return new ZA}async terminate(){var e,n;(e=this.gcScheduler)==null||e.stop(),(n=this.indexBackfillerScheduler)==null||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Ic.provider={build:()=>new Ic};class $P extends Ic{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,n){Ge(this.persistence.referenceDelegate instanceof Sc,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new CA(r,e.asyncQueue,n)}Cu(e){const n=this.cacheSizeBytes!==void 0?xn.withCacheSize(this.cacheSizeBytes):xn.DEFAULT;return new rE(r=>Sc.mi(r,n),this.serializer)}}class mp{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>$v(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=UP.bind(null,this.syncEngine),await _P(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new EP}()}createDatastore(e){const n=yd(e.databaseInfo.databaseId),r=function(s){return new iP(s)}(e.databaseInfo);return function(s,o,a,u){return new lP(s,o,a,u)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,a){return new cP(r,i,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>$v(this.syncEngine,n,0),function(){return Mv.v()?new Mv:new eP}())}createSyncEngine(e,n){return function(i,s,o,a,u,c,h){const f=new NP(i,s,o,a,u,c);return h&&(f.gu=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const s=Ae(i);ue(Ts,"RemoteStore shutting down."),s.Ea.add(5),await Il(s),s.Aa.shutdown(),s.Ra.set("Unknown")}(this.remoteStore),(e=this.datastore)==null||e.terminate(),(n=this.eventManager)==null||n.terminate()}}mp.provider={build:()=>new mp};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + *//** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class cg{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):Yr("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Hi="FirestoreClient";class HP{constructor(e,n,r,i,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=tn.UNAUTHENTICATED,this.clientId=Mm.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async o=>{ue(Hi,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(ue(Hi,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Hr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=rg(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function Rh(t,e){t.asyncQueue.verifyOperationInProgress(),ue(Hi,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await iE(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function qv(t,e){t.asyncQueue.verifyOperationInProgress();const n=await qP(t);ue(Hi,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>Fv(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>Fv(e.remoteStore,i)),t._onlineComponents=e}async function qP(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){ue(Hi,"Using user provided OfflineComponentProvider");try{await Rh(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===q.FAILED_PRECONDITION||i.code===q.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;Io("Error using user provided cache. Falling back to memory cache: "+n),await Rh(t,new Ic)}}else ue(Hi,"Using default OfflineComponentProvider"),await Rh(t,new $P(void 0));return t._offlineComponents}async function bE(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(ue(Hi,"Using user provided OnlineComponentProvider"),await qv(t,t._uninitializedComponentsProvider._online)):(ue(Hi,"Using default OnlineComponentProvider"),await qv(t,new mp))),t._onlineComponents}function WP(t){return bE(t).then(e=>e.syncEngine)}async function kc(t){const e=await bE(t),n=e.eventManager;return n.onListen=AP.bind(null,e.syncEngine),n.onUnlisten=DP.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=PP.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=jP.bind(null,e.syncEngine),n}function GP(t,e,n={}){const r=new Hr;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,c){const h=new cg({next:p=>{h.Nu(),o.enqueueAndForget(()=>sg(s,f));const g=p.docs.has(a);!g&&p.fromCache?c.reject(new ae(q.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&p.fromCache&&u&&u.source==="server"?c.reject(new ae(q.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(p)},error:p=>c.reject(p)}),f=new ag(dd(a.path),h,{includeMetadataChanges:!0,qa:!0});return ig(s,f)}(await kc(t),t.asyncQueue,e,n,r)),r.promise}function KP(t,e,n={}){const r=new Hr;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,c){const h=new cg({next:p=>{h.Nu(),o.enqueueAndForget(()=>sg(s,f)),p.fromCache&&u.source==="server"?c.reject(new ae(q.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(p)},error:p=>c.reject(p)}),f=new ag(a,h,{includeMetadataChanges:!0,qa:!0});return ig(s,f)}(await kc(t),t.asyncQueue,e,n,r)),r.promise}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */function EE(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Wv=new Map;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const SE="firestore.googleapis.com",Gv=!0;class Kv{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new ae(q.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=SE,this.ssl=Gv}else this.host=e.host,this.ssl=e.ssl??Gv;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=nE;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new ae(q.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class wd{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Kv({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new ae(q.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new ae(q.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Kv(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new eN;switch(r.type){case"firstParty":return new iN(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new ae(q.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=Wv.get(n);r&&(ue("ComponentProvider","Removing Datastore"),Wv.delete(n),r.terminate())}(this),Promise.resolve()}}function QP(t,e,n,r={}){var c;t=kn(t,wd);const i=Ns(e),s=t._getSettings(),o={...s,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;i&&(Pm(`https://${a}`),Rm("Firestore",!0)),s.host!==SE&&s.host!==a&&Io("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u={...s,host:a,ssl:i,emulatorOptions:r};if(!bs(u,o)&&(t._setSettings(u),r.mockUserToken)){let h,f;if(typeof r.mockUserToken=="string")h=r.mockUserToken,f=tn.MOCK_USER;else{h=eb(r.mockUserToken,(c=t._app)==null?void 0:c.options.projectId);const p=r.mockUserToken.sub||r.mockUserToken.user_id;if(!p)throw new ae(q.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");f=new tn(p)}t._authCredentials=new tN(new fb(h,f))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Yi{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Yi(this.firestore,e,this._query)}}class vt{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Li(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new vt(this.firestore,e,this._key)}toJSON(){return{type:vt._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(El(n,vt._jsonSchema))return new vt(e,r||null,new xe(nt.fromString(n.referencePath)))}}vt._jsonSchemaVersion="firestore/documentReference/1.0",vt._jsonSchema={type:At("string",vt._jsonSchemaVersion),referencePath:At("string")};class Li extends Yi{constructor(e,n,r){super(e,n,dd(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new vt(this.firestore,null,new xe(e))}withConverter(e){return new Li(this.firestore,e,this._path)}}function Cn(t,e,...n){if(t=Yt(t),pb("collection","path",e),t instanceof wd){const r=nt.fromString(e,...n);return av(r),new Li(t,null,r)}{if(!(t instanceof vt||t instanceof Li))throw new ae(q.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(nt.fromString(e,...n));return av(r),new Li(t.firestore,null,r)}}function Pt(t,e,...n){if(t=Yt(t),arguments.length===1&&(e=Mm.newId()),pb("doc","path",e),t instanceof wd){const r=nt.fromString(e,...n);return ov(r),new vt(t,null,new xe(r))}{if(!(t instanceof vt||t instanceof Li))throw new ae(q.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(nt.fromString(e,...n));return ov(r),new vt(t.firestore,t instanceof Li?t.converter:null,new xe(r))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Qv="AsyncQueue";class Yv{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new oE(this,"async_queue_retry"),this._c=()=>{const r=Ph();r&&ue(Qv,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const n=Ph();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const n=Ph();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const n=new Hr;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!Fo(e))throw e;ue(Qv,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){const n=this.ac.then(()=>(this.rc=!0,e().catch(r=>{throw this.nc=r,this.rc=!1,Yr("INTERNAL UNHANDLED ERROR: ",Xv(r)),r}).then(r=>(this.rc=!1,r))));return this.ac=n,n}enqueueAfterDelay(e,n,r){this.uc(),this.oc.indexOf(e)>-1&&(n=0);const i=ng.createAndSchedule(this,e,n,r,s=>this.hc(s));return this.tc.push(i),i}uc(){this.nc&&Te(47125,{Pc:Xv(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const n of this.tc)if(n.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.tc)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){const n=this.tc.indexOf(e);this.tc.splice(n,1)}}function Xv(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+` +`+t.stack),e}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function Jv(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class Jr extends wd{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new Yv,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Yv(e),this._firestoreClient=void 0,await e}}}function YP(t,e){const n=typeof t=="object"?t:Lm(),r=typeof t=="string"?t:xc,i=od(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=X1("firestore");s&&QP(i,...s)}return i}function _d(t){if(t._terminated)throw new ae(q.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||XP(t),t._firestoreClient}function XP(t){var r,i,s;const e=t._freezeSettings(),n=function(a,u,c,h){return new _N(a,u,c,h.host,h.ssl,h.experimentalForceLongPolling,h.experimentalAutoDetectLongPolling,EE(h.experimentalLongPollingOptions),h.useFetchStreams,h.isUsingEmulator)}(t._databaseId,((r=t._app)==null?void 0:r.options.appId)||"",t._persistenceKey,e);t._componentsProvider||(i=e.localCache)!=null&&i._offlineComponentProvider&&((s=e.localCache)!=null&&s._onlineComponentProvider)&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new HP(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&function(a){const u=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(u),_online:u}}(t._componentsProvider))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class qn{constructor(e){this._byteString=e}static fromBase64String(e){try{return new qn(Xt.fromBase64String(e))}catch(n){throw new ae(q.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new qn(Xt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:qn._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(El(e,qn._jsonSchema))return qn.fromBase64String(e.bytes)}}qn._jsonSchemaVersion="firestore/bytes/1.0",qn._jsonSchema={type:At("string",qn._jsonSchemaVersion),bytes:At("string")};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class bd{constructor(...e){for(let n=0;n90)throw new ae(q.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new ae(q.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Ve(this._lat,e._lat)||Ve(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Tr._jsonSchemaVersion}}static fromJSON(e){if(El(e,Tr._jsonSchema))return new Tr(e.latitude,e.longitude)}}Tr._jsonSchemaVersion="firestore/geoPoint/1.0",Tr._jsonSchema={type:At("string",Tr._jsonSchemaVersion),latitude:At("number"),longitude:At("number")};/** + * @license + * Copyright 2024 Google LLC + * + * 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. + */class Ir{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let s=0;stypeof n=="number"))return new Ir(e.vectorValues);throw new ae(q.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Ir._jsonSchemaVersion="firestore/vectorValue/1.0",Ir._jsonSchema={type:At("string",Ir._jsonSchemaVersion),vectorValues:At("object")};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const JP=/^__.*__$/;class ZP{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Qi(e,this.data,this.fieldMask,n,this.fieldTransforms):new Sl(e,this.data,n,this.fieldTransforms)}}class TE{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new Qi(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function IE(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Te(40011,{Ac:t})}}class dg{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Rc(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new dg({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){var i;const n=(i=this.path)==null?void 0:i.child(e),r=this.Vc({path:n,fc:!1});return r.gc(e),r}yc(e){var i;const n=(i=this.path)==null?void 0:i.child(e),r=this.Vc({path:n,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return Cc(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Rc(){if(this.path)for(let e=0;eu.covers(f.field))}else u=null,c=o.fieldTransforms;return new ZP(new _n(a),u,c)}class Td extends Ed{_toFieldTransform(e){if(e.Ac!==2)throw e.Ac===1?e.Sc(`${this._methodName}() can only appear at the top level of your update data`):e.Sc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Td}}class hg extends Ed{constructor(e,n){super(e),this.Fc=n}_toFieldTransform(e){const n=new dl(e.serializer,Fb(e.serializer,this.Fc));return new WN(e.path,n)}isEqual(e){return e instanceof hg&&this.Fc===e.Fc}}function tR(t,e,n,r){const i=t.Cc(1,e,n);fg("Data must be an object, but it was:",i,r);const s=[],o=_n.empty();Ki(r,(u,c)=>{const h=pg(e,u,n);c=Yt(c);const f=i.yc(h);if(c instanceof Td)s.push(h);else{const p=Cl(c,f);p!=null&&(s.push(h),o.set(h,p))}});const a=new On(s);return new TE(o,a,i.fieldTransforms)}function nR(t,e,n,r,i,s){const o=t.Cc(1,e,n),a=[gp(e,r,n)],u=[i];if(s.length%2!=0)throw new ae(q.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let p=0;p=0;--p)if(!AE(c,a[p])){const g=a[p];let _=u[p];_=Yt(_);const T=o.yc(g);if(_ instanceof Td)c.push(g);else{const R=Cl(_,T);R!=null&&(c.push(g),h.set(g,R))}}const f=new On(c);return new TE(h,f,o.fieldTransforms)}function rR(t,e,n,r=!1){return Cl(n,t.Cc(r?4:3,e))}function Cl(t,e){if(NE(t=Yt(t)))return fg("Unsupported field value:",e,t),CE(t,e);if(t instanceof Ed)return function(r,i){if(!IE(i.Ac))throw i.Sc(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Sc(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.fc&&e.Ac!==4)throw e.Sc("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let u=Cl(a,i.wc(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=Yt(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return Fb(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=We.fromDate(r);return{timestampValue:Ec(i.serializer,s)}}if(r instanceof We){const s=new We(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:Ec(i.serializer,s)}}if(r instanceof Tr)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof qn)return{bytesValue:Qb(i.serializer,r._byteString)};if(r instanceof vt){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.Sc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:Gm(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof Ir)return function(o,a){return{mapValue:{fields:{[Eb]:{stringValue:Sb},[wc]:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw a.Sc("VectorValues must only contain numeric values.");return $m(a.serializer,c)})}}}}}}(r,i);throw i.Sc(`Unsupported field value: ${ad(r)}`)}(t,e)}function CE(t,e){const n={};return yb(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ki(t,(r,i)=>{const s=Cl(i,e.mc(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function NE(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof We||t instanceof Tr||t instanceof qn||t instanceof vt||t instanceof Ed||t instanceof Ir)}function fg(t,e,n){if(!NE(n)||!mb(n)){const r=ad(n);throw r==="an object"?e.Sc(t+" a custom object"):e.Sc(t+" "+r)}}function gp(t,e,n){if((e=Yt(e))instanceof bd)return e._internalPath;if(typeof e=="string")return pg(t,e);throw Cc("Field path arguments must be of type string or ",t,!1,void 0,n)}const iR=new RegExp("[~\\*/\\[\\]]");function pg(t,e,n){if(e.search(iR)>=0)throw Cc(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new bd(...e.split("."))._internalPath}catch{throw Cc(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function Cc(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new ae(q.INVALID_ARGUMENT,a+t+u)}function AE(t,e){return t.some(n=>n.isEqual(e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class PE{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new vt(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new sR(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(Id("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class sR extends PE{data(){return super.data()}}function Id(t,e){return typeof e=="string"?pg(t,e):e instanceof bd?e._internalPath:e._delegate._internalPath}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function RE(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new ae(q.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class mg{}class DE extends mg{}function Zr(t,e,...n){let r=[];e instanceof mg&&r.push(e),r=r.concat(n),function(s){const o=s.filter(u=>u instanceof gg).length,a=s.filter(u=>u instanceof kd).length;if(o>1||o>0&&a>0)throw new ae(q.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)t=i._apply(t);return t}class kd extends DE{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new kd(e,n,r)}_apply(e){const n=this._parse(e);return jE(e._query,n),new Yi(e.firestore,e.converter,sp(e._query,n))}_parse(e){const n=Sd(e.firestore);return function(s,o,a,u,c,h,f){let p;if(c.isKeyField()){if(h==="array-contains"||h==="array-contains-any")throw new ae(q.INVALID_ARGUMENT,`Invalid Query. You can't perform '${h}' queries on documentId().`);if(h==="in"||h==="not-in"){ex(f,h);const _=[];for(const T of f)_.push(Zv(u,s,T));p={arrayValue:{values:_}}}else p=Zv(u,s,f)}else h!=="in"&&h!=="not-in"&&h!=="array-contains-any"||ex(f,h),p=rR(a,o,f,h==="in"||h==="not-in");return Nt.create(c,h,p)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function Ds(t,e,n){const r=e,i=Id("where",t);return kd._create(i,r,n)}class gg extends mg{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new gg(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:cr.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,s){let o=i;const a=s.getFlattenedFilters();for(const u of a)jE(o,u),o=sp(o,u)}(e._query,n),new Yi(e.firestore,e.converter,sp(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class yg extends DE{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new yg(e,n)}_apply(e){const n=function(i,s,o){if(i.startAt!==null)throw new ae(q.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new ae(q.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new ll(s,o)}(e._query,this._field,this._direction);return new Yi(e.firestore,e.converter,function(i,s){const o=i.explicitOrderBy.concat([s]);return new Uo(i.path,i.collectionGroup,o,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function oR(t,e="asc"){const n=e,r=Id("orderBy",t);return yg._create(r,n)}function Zv(t,e,n){if(typeof(n=Yt(n))=="string"){if(n==="")throw new ae(q.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Rb(e)&&n.indexOf("/")!==-1)throw new ae(q.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(nt.fromString(n));if(!xe.isDocumentKey(r))throw new ae(q.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return mv(t,new xe(r))}if(n instanceof vt)return mv(t,n._key);throw new ae(q.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ad(n)}.`)}function ex(t,e){if(!Array.isArray(t)||t.length===0)throw new ae(q.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function jE(t,e){const n=function(i,s){for(const o of i)for(const a of o.getFlattenedFilters())if(s.indexOf(a.op)>=0)return a.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new ae(q.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new ae(q.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class aR{convertValue(e,n="none"){switch(Bi(e)){case 0:return null;case 1:return e.booleanValue;case 2:return bt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(zi(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw Te(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Ki(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertVectorValue(e){var r,i,s;const n=(s=(i=(r=e.fields)==null?void 0:r[wc].arrayValue)==null?void 0:i.values)==null?void 0:s.map(o=>bt(o.doubleValue));return new Ir(n)}convertGeoPoint(e){return new Tr(bt(e.latitude),bt(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=cd(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(sl(e));default:return null}}convertTimestamp(e){const n=Ui(e);return new We(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=nt.fromString(e);Ge(tE(r),9688,{name:e});const i=new ol(r.get(1),r.get(3)),s=new xe(r.popFirst(5));return i.isEqual(n)||Yr(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function LE(t,e,n){let r;return r=t?t.toFirestore(e):e,r}class wa{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class fs extends PE{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Mu(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(Id("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new ae(q.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=fs._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}fs._jsonSchemaVersion="firestore/documentSnapshot/1.0",fs._jsonSchema={type:At("string",fs._jsonSchemaVersion),bundleSource:At("string","DocumentSnapshot"),bundleName:At("string"),bundle:At("string")};class Mu extends fs{data(e={}){return super.data(e)}}class ps{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new wa(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Mu(this._firestore,this._userDataWriter,r.key,r,new wa(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new ae(q.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const u=new Mu(i._firestore,i._userDataWriter,a.doc.key,a.doc,new wa(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const u=new Mu(i._firestore,i._userDataWriter,a.doc.key,a.doc,new wa(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,h=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),h=o.indexOf(a.doc.key)),{type:lR(a.type),doc:u,oldIndex:c,newIndex:h}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new ae(q.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=ps._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Mm.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],i=[];return this.docs.forEach(s=>{s._document!==null&&(n.push(s._document),r.push(this._userDataWriter.convertObjectMap(s._document.data.value.mapValue.fields,"previous")),i.push(s.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function lR(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Te(61501,{type:t})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function ei(t){t=kn(t,vt);const e=kn(t.firestore,Jr);return GP(_d(e),t._key).then(n=>ME(e,t,n))}ps._jsonSchemaVersion="firestore/querySnapshot/1.0",ps._jsonSchema={type:At("string",ps._jsonSchemaVersion),bundleSource:At("string","QuerySnapshot"),bundleName:At("string"),bundle:At("string")};class vg extends aR{constructor(e){super(),this.firestore=e}convertBytes(e){return new qn(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new vt(this.firestore,null,n)}}function lr(t){t=kn(t,Yi);const e=kn(t.firestore,Jr),n=_d(e),r=new vg(e);return RE(t._query),KP(n,t._query).then(i=>new ps(e,r,t,i))}function OE(t,e,n){t=kn(t,vt);const r=kn(t.firestore,Jr),i=LE(t.converter,e);return Cd(r,[kE(Sd(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,Qn.none())])}function Xi(t,e,n,...r){t=kn(t,vt);const i=kn(t.firestore,Jr),s=Sd(i);let o;return o=typeof(e=Yt(e))=="string"||e instanceof bd?nR(s,"updateDoc",t._key,e,n,r):tR(s,"updateDoc",t._key,e),Cd(i,[o.toMutation(t._key,Qn.exists(!0))])}function yp(t){return Cd(kn(t.firestore,Jr),[new Hm(t._key,Qn.none())])}function xg(t,e){const n=kn(t.firestore,Jr),r=Pt(t),i=LE(t.converter,e);return Cd(n,[kE(Sd(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,Qn.exists(!1))]).then(()=>r)}function wg(t,...e){var u,c,h;t=Yt(t);let n={includeMetadataChanges:!1,source:"default"},r=0;typeof e[r]!="object"||Jv(e[r])||(n=e[r++]);const i={includeMetadataChanges:n.includeMetadataChanges,source:n.source};if(Jv(e[r])){const f=e[r];e[r]=(u=f.next)==null?void 0:u.bind(f),e[r+1]=(c=f.error)==null?void 0:c.bind(f),e[r+2]=(h=f.complete)==null?void 0:h.bind(f)}let s,o,a;if(t instanceof vt)o=kn(t.firestore,Jr),a=dd(t._key.path),s={next:f=>{e[r]&&e[r](ME(o,t,f))},error:e[r+1],complete:e[r+2]};else{const f=kn(t,Yi);o=kn(f.firestore,Jr),a=f._query;const p=new vg(o);s={next:g=>{e[r]&&e[r](new ps(o,p,f,g))},error:e[r+1],complete:e[r+2]},RE(t._query)}return function(p,g,_,T){const R=new cg(T),y=new ag(g,R,_);return p.asyncQueue.enqueueAndForget(async()=>ig(await kc(p),y)),()=>{R.Nu(),p.asyncQueue.enqueueAndForget(async()=>sg(await kc(p),y))}}(_d(o),a,i,s)}function Cd(t,e){return function(r,i){const s=new Hr;return r.asyncQueue.enqueueAndForget(async()=>LP(await WP(r),i,s)),s.promise}(_d(t),e)}function ME(t,e,n){const r=n.docs.get(e._key),i=new vg(t);return new fs(t,i,e._key,r,new wa(n.hasPendingWrites,n.fromCache),e.converter)}function uR(t){return new hg("increment",t)}(function(e,n=!0){(function(i){Mo=i})(As),Es(new Vi("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new Jr(new nN(r.getProvider("auth-internal")),new sN(o,r.getProvider("app-check-internal")),function(c,h){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new ae(q.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ol(c.options.projectId,h)}(o,i),o);return s={useFetchStreams:n,...s},a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),br(nv,rv,e),br(nv,rv,"esm2020")})();/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const VE="firebasestorage.googleapis.com",cR="storageBucket",dR=2*60*1e3,hR=10*60*1e3;/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Dr extends Rr{constructor(e,n,r=0){super(Dh(e),`Firebase Storage: ${n} (${Dh(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Dr.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Dh(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} +${this.customData.serverResponse}`:this.message=this._baseMessage}}var Ar;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Ar||(Ar={}));function Dh(t){return"storage/"+t}function fR(){const t="An unknown error occurred, please check the error payload for server response.";return new Dr(Ar.UNKNOWN,t)}function pR(){return new Dr(Ar.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function mR(){return new Dr(Ar.CANCELED,"User canceled the upload/download.")}function gR(t){return new Dr(Ar.INVALID_URL,"Invalid URL '"+t+"'.")}function yR(t){return new Dr(Ar.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function tx(t){return new Dr(Ar.INVALID_ARGUMENT,t)}function FE(){return new Dr(Ar.APP_DELETED,"The Firebase app was deleted.")}function vR(t){return new Dr(Ar.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ir{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=ir.makeFromUrl(e,n)}catch{return new ir(e,"")}if(r.path==="")return r;throw yR(e)}static makeFromUrl(e,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(L){L.path.charAt(L.path.length-1)==="/"&&(L.path_=L.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),u={bucket:1,path:3};function c(L){L.path_=decodeURIComponent(L.path)}const h="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",g=new RegExp(`^https?://${f}/${h}/b/${i}/o${p}`,"i"),_={bucket:1,path:3},T=n===VE?"(?:storage.googleapis.com|storage.cloud.google.com)":n,R="([^?#]*)",y=new RegExp(`^https?://${T}/${i}/${R}`,"i"),k=[{regex:a,indices:u,postModify:s},{regex:g,indices:_,postModify:c},{regex:y,indices:{bucket:1,path:2},postModify:c}];for(let L=0;L{i=null,t(g,u())},R)}function p(){s&&clearTimeout(s)}function g(R,...y){if(c){p();return}if(R){p(),h.call(null,R,...y);return}if(u()||o){p(),h.call(null,R,...y);return}r<64&&(r*=2);let k;a===1?(a=2,k=0):k=(r+Math.random())*1e3,f(k)}let _=!1;function T(R){_||(_=!0,p(),!c&&(i!==null?(R||(a=2),clearTimeout(i),f(0)):R||(a=1)))}return f(0),s=setTimeout(()=>{o=!0,T(!0)},n),T}function _R(t){t(!1)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function bR(t){return t!==void 0}function nx(t,e,n,r){if(rn)throw tx(`Invalid value for '${t}'. Expected ${n} or less.`)}function ER(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n}var Nc;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Nc||(Nc={}));/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */function SR(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return n||i||s}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class TR{constructor(e,n,r,i,s,o,a,u,c,h,f,p=!0,g=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=u,this.timeout_=c,this.progressCallback_=h,this.connectionFactory_=f,this.retry=p,this.isUsingEmulator=g,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((_,T)=>{this.resolve_=_,this.reject_=T,this.start_()})}start_(){const e=(r,i)=>{if(i){r(!1,new pu(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const u=a.loaded,c=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(u,c)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===Nc.NO_ERROR,u=s.getStatus();if(!a||SR(u,this.additionalRetryCodes_)&&this.retry){const h=s.getErrorCode()===Nc.ABORT;r(!1,new pu(!1,null,h));return}const c=this.successCodes_.indexOf(u)!==-1;r(!0,new pu(c,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const u=this.callback_(a,a.getResponse());bR(u)?s(u):s()}catch(u){o(u)}else if(a!==null){const u=fR();u.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,u)):o(u)}else if(i.canceled){const u=this.appDelete_?FE():mR();o(u)}else{const u=pR();o(u)}};this.canceled_?n(!1,new pu(!1,null,!0)):this.backoffId_=wR(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&_R(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class pu{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function IR(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function kR(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function CR(t,e){e&&(t["X-Firebase-GMPID"]=e)}function NR(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function AR(t,e,n,r,i,s,o=!0,a=!1){const u=ER(t.urlParams),c=t.url+u,h=Object.assign({},t.headers);return CR(h,e),IR(h,n),kR(h,s),NR(h,r),new TR(c,t.method,h,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o,a)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function PR(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function RR(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Ac{constructor(e,n){this._service=e,n instanceof ir?this._location=n:this._location=ir.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Ac(e,n)}get root(){const e=new ir(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return RR(this._location.path)}get storage(){return this._service}get parent(){const e=PR(this._location.path);if(e===null)return null;const n=new ir(this._location.bucket,e);return new Ac(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw vR(e)}}function rx(t,e){const n=e==null?void 0:e[cR];return n==null?null:ir.makeFromBucketSpec(n,t)}function DR(t,e,n,r={}){t.host=`${e}:${n}`;const i=Ns(e);i&&(Pm(`https://${t.host}/b`),Rm("Storage",!0)),t._isUsingEmulator=!0,t._protocol=i?"https":"http";const{mockUserToken:s}=r;s&&(t._overrideAuthToken=typeof s=="string"?s:eb(s,t.app.options.projectId))}class jR{constructor(e,n,r,i,s,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._isUsingEmulator=o,this._bucket=null,this._host=VE,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=dR,this._maxUploadRetryTime=hR,this._requests=new Set,i!=null?this._bucket=ir.makeFromBucketSpec(i,this._host):this._bucket=rx(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=ir.makeFromBucketSpec(this._url,e):this._bucket=rx(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){nx("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){nx("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(rr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Ac(this,e)}_makeRequest(e,n,r,i,s=!0){if(this._deleted)return new xR(FE());{const o=AR(e,this._appId,r,i,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,i).getPromise()}}const ix="@firebase/storage",sx="0.14.0";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const UE="storage";function LR(t=Lm(),e){t=Yt(t);const r=od(t,UE).getImmediate({identifier:e}),i=X1("storage");return i&&OR(r,...i),r}function OR(t,e,n,r={}){DR(t,e,n,r)}function MR(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new jR(n,r,i,e,As)}function VR(){Es(new Vi(UE,MR,"PUBLIC").setMultipleInstances(!0)),br(ix,sx,""),br(ix,sx,"esm2020")}VR();function zE(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const FR=zE,BE=new _l("auth","Firebase",zE());/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Pc=new Dm("@firebase/auth");function UR(t,...e){Pc.logLevel<=Me.WARN&&Pc.warn(`Auth (${As}): ${t}`,...e)}function Vu(t,...e){Pc.logLevel<=Me.ERROR&&Pc.error(`Auth (${As}): ${t}`,...e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function ti(t,...e){throw _g(t,...e)}function kr(t,...e){return _g(t,...e)}function $E(t,e,n){const r={...FR(),[e]:n};return new _l("auth","Firebase",r).create(e,{appName:t.name})}function ms(t){return $E(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function _g(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return BE.create(t,...e)}function ke(t,e,...n){if(!t)throw _g(e,...n)}function Ur(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Vu(e),new Error(e)}function ni(t,e){t||Ur(e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function vp(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.href)||""}function zR(){return ox()==="http:"||ox()==="https:"}function ox(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.protocol)||null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function BR(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(zR()||P2()||"connection"in navigator)?navigator.onLine:!0}function $R(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Nl{constructor(e,n){this.shortDelay=e,this.longDelay=n,ni(n>e,"Short delay should be less than long delay!"),this.isMobile=C2()||R2()}get(){return BR()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function bg(t,e){ni(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class HE{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Ur("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Ur("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Ur("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const HR={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const qR=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],WR=new Nl(3e4,6e4);function Eg(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function Bo(t,e,n,r,i={}){return qE(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=bl({key:t.config.apiKey,...o}).slice(1),u=await t._getAdditionalHeaders();u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode);const c={method:e,headers:u,...s};return A2()||(c.referrerPolicy="no-referrer"),t.emulatorConfig&&Ns(t.emulatorConfig.host)&&(c.credentials="include"),HE.fetch()(await WE(t,t.config.apiHost,n,a),c)})}async function qE(t,e,n){t._canInitEmulator=!1;const r={...HR,...e};try{const i=new KR(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw mu(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[u,c]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw mu(t,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw mu(t,"email-already-in-use",o);if(u==="USER_DISABLED")throw mu(t,"user-disabled",o);const h=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw $E(t,h,c);ti(t,h)}}catch(i){if(i instanceof Rr)throw i;ti(t,"network-request-failed",{message:String(i)})}}async function GR(t,e,n,r,i={}){const s=await Bo(t,e,n,r,i);return"mfaPendingCredential"in s&&ti(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function WE(t,e,n,r){const i=`${e}${n}?${r}`,s=t,o=s.config.emulator?bg(t.config,i):`${t.config.apiScheme}://${i}`;return qR.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}class KR{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(kr(this.auth,"network-request-failed")),WR.get())})}}function mu(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=kr(t,e,r);return i.customData._tokenResponse=n,i}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function QR(t,e){return Bo(t,"POST","/v1/accounts:delete",e)}async function Rc(t,e){return Bo(t,"POST","/v1/accounts:lookup",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function La(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function YR(t,e=!1){const n=Yt(t),r=await n.getIdToken(e),i=Sg(r);ke(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:La(jh(i.auth_time)),issuedAtTime:La(jh(i.iat)),expirationTime:La(jh(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function jh(t){return Number(t)*1e3}function Sg(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Vu("JWT malformed, contained fewer than 3 sections"),null;try{const i=Q1(n);return i?JSON.parse(i):(Vu("Failed to decode base64 JWT payload"),null)}catch(i){return Vu("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function ax(t){const e=Sg(t);return ke(e,"internal-error"),ke(typeof e.exp<"u","internal-error"),ke(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function hl(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Rr&&XR(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function XR({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class JR{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class xp{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=La(this.lastLoginAt),this.creationTime=La(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */async function Dc(t){var f;const e=t.auth,n=await t.getIdToken(),r=await hl(t,Rc(e,{idToken:n}));ke(r==null?void 0:r.users.length,e,"internal-error");const i=r.users[0];t._notifyReloadListener(i);const s=(f=i.providerUserInfo)!=null&&f.length?GE(i.providerUserInfo):[],o=e4(t.providerData,s),a=t.isAnonymous,u=!(t.email&&i.passwordHash)&&!(o!=null&&o.length),c=a?u:!1,h={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new xp(i.createdAt,i.lastLoginAt),isAnonymous:c};Object.assign(t,h)}async function ZR(t){const e=Yt(t);await Dc(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function e4(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function GE(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function t4(t,e){const n=await qE(t,{},async()=>{const r=bl({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=await WE(t,i,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const u={method:"POST",headers:a,body:r};return t.emulatorConfig&&Ns(t.emulatorConfig.host)&&(u.credentials="include"),HE.fetch()(o,u)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function n4(t,e){return Bo(t,"POST","/v2/accounts:revokeToken",Eg(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class fo{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){ke(e.idToken,"internal-error"),ke(typeof e.idToken<"u","internal-error"),ke(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):ax(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){ke(e.length!==0,"internal-error");const n=ax(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(ke(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await t4(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new fo;return r&&(ke(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(ke(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(ke(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new fo,this.toJSON())}_performRefresh(){return Ur("not implemented")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function di(t,e){ke(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class sr{constructor({uid:e,auth:n,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new JR(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new xp(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const n=await hl(this,this.stsTokenManager.getToken(this.auth,e));return ke(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return YR(this,e)}reload(){return ZR(this)}_assign(e){this!==e&&(ke(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new sr({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){ke(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Dc(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(rr(this.auth.app))return Promise.reject(ms(this.auth));const e=await this.getIdToken();return await hl(this,QR(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){const r=n.displayName??void 0,i=n.email??void 0,s=n.phoneNumber??void 0,o=n.photoURL??void 0,a=n.tenantId??void 0,u=n._redirectEventId??void 0,c=n.createdAt??void 0,h=n.lastLoginAt??void 0,{uid:f,emailVerified:p,isAnonymous:g,providerData:_,stsTokenManager:T}=n;ke(f&&T,e,"internal-error");const R=fo.fromJSON(this.name,T);ke(typeof f=="string",e,"internal-error"),di(r,e.name),di(i,e.name),ke(typeof p=="boolean",e,"internal-error"),ke(typeof g=="boolean",e,"internal-error"),di(s,e.name),di(o,e.name),di(a,e.name),di(u,e.name),di(c,e.name),di(h,e.name);const y=new sr({uid:f,auth:e,email:i,emailVerified:p,displayName:r,isAnonymous:g,photoURL:o,phoneNumber:s,tenantId:a,stsTokenManager:R,createdAt:c,lastLoginAt:h});return _&&Array.isArray(_)&&(y.providerData=_.map(w=>({...w}))),u&&(y._redirectEventId=u),y}static async _fromIdTokenResponse(e,n,r=!1){const i=new fo;i.updateFromServerResponse(n);const s=new sr({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Dc(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];ke(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?GE(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new fo;a.updateFromIdToken(r);const u=new sr({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new xp(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(u,c),u}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const lx=new Map;function zr(t){ni(t instanceof Function,"Expected a class definition");let e=lx.get(t);return e?(ni(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,lx.set(t,e),e)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class KE{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}KE.type="NONE";const ux=KE;/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */function Fu(t,e,n){return`firebase:${t}:${e}:${n}`}class po{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=Fu(this.userKey,i.apiKey,s),this.fullPersistenceKey=Fu("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await Rc(this.auth,{idToken:e}).catch(()=>{});return n?sr._fromGetAccountInfoResponse(this.auth,n,e):null}return sr._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new po(zr(ux),e,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||zr(ux);const o=Fu(r,e.config.apiKey,e.name);let a=null;for(const c of n)try{const h=await c._get(o);if(h){let f;if(typeof h=="string"){const p=await Rc(e,{idToken:h}).catch(()=>{});if(!p)break;f=await sr._fromGetAccountInfoResponse(e,p,h)}else f=sr._fromJSON(e,h);c!==s&&(a=f),s=c;break}}catch{}const u=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new po(s,e,r):(s=u[0],a&&await s._set(o,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new po(s,e,r))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function cx(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(JE(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(QE(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(eS(e))return"Blackberry";if(tS(e))return"Webos";if(YE(e))return"Safari";if((e.includes("chrome/")||XE(e))&&!e.includes("edge/"))return"Chrome";if(ZE(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function QE(t=on()){return/firefox\//i.test(t)}function YE(t=on()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function XE(t=on()){return/crios\//i.test(t)}function JE(t=on()){return/iemobile/i.test(t)}function ZE(t=on()){return/android/i.test(t)}function eS(t=on()){return/blackberry/i.test(t)}function tS(t=on()){return/webos/i.test(t)}function Tg(t=on()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function r4(t=on()){var e;return Tg(t)&&!!((e=window.navigator)!=null&&e.standalone)}function i4(){return D2()&&document.documentMode===10}function nS(t=on()){return Tg(t)||ZE(t)||tS(t)||eS(t)||/windows phone/i.test(t)||JE(t)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function rS(t,e=[]){let n;switch(t){case"Browser":n=cx(on());break;case"Worker":n=`${cx(on())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${As}/${r}`}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class s4{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,a)=>{try{const u=e(s);o(u)}catch(u){a(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */async function o4(t,e={}){return Bo(t,"GET","/v2/passwordPolicy",Eg(t,e))}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */const a4=6;class l4{constructor(e){var r;const n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??a4,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=e.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class u4{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new dx(this),this.idTokenSubscription=new dx(this),this.beforeStateQueue=new s4(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=BE,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=zr(n)),this._initializationPromise=this.queue(async()=>{var r,i,s;if(!this._deleted&&(this.persistenceManager=await po.create(this,e),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((i=this._popupRedirectResolver)!=null&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((s=this.currentUser)==null?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await Rc(this,{idToken:e}),r=await sr._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var s;if(rr(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(s=this.redirectUser)==null?void 0:s._redirectEventId,a=r==null?void 0:r._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===a)&&(u!=null&&u.user)&&(r=u.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return ke(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Dc(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=$R()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(rr(this.app))return Promise.reject(ms(this));const n=e?Yt(e):null;return n&&ke(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&ke(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return rr(this.app)?Promise.reject(ms(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return rr(this.app)?Promise.reject(ms(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(zr(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await o4(this),n=new l4(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new _l("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await n4(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&zr(e)||this._popupRedirectResolver;ke(n,this,"argument-error"),this.redirectPersistenceManager=await po.create(this,[zr(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(ke(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=e.addObserver(n);return()=>{o=!0,u()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return ke(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=rS(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var i;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await((i=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getHeartbeatsHeader());n&&(e["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){var n;if(rr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return e!=null&&e.error&&UR(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function Ig(t){return Yt(t)}class dx{constructor(e){this.auth=e,this.observer=null,this.addObserver=z2(n=>this.observer=n)}get next(){return ke(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */let kg={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function c4(t){kg=t}function d4(t){return kg.loadJS(t)}function h4(){return kg.gapiScript}function f4(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function p4(t,e){const n=od(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(bs(s,e??{}))return i;ti(i,"already-initialized")}return n.initialize({options:e})}function m4(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(zr);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function g4(t,e,n){const r=Ig(t);ke(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=iS(e),{host:o,port:a}=y4(e),u=a===null?"":`:${a}`,c={url:`${s}//${o}${u}/`},h=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){ke(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),ke(bs(c,r.config.emulator)&&bs(h,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=c,r.emulatorConfig=h,r.settings.appVerificationDisabledForTesting=!0,Ns(o)?(Pm(`${s}//${o}${u}`),Rm("Auth",!0)):v4()}function iS(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function y4(t){const e=iS(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:hx(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:hx(o)}}}function hx(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function v4(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class sS{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Ur("not implemented")}_getIdTokenResponse(e){return Ur("not implemented")}_linkToIdToken(e,n){return Ur("not implemented")}_getReauthenticationResolver(e){return Ur("not implemented")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function mo(t,e){return GR(t,"POST","/v1/accounts:signInWithIdp",Eg(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const x4="http://localhost";class Is extends sS{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new Is(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):ti("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=n;if(!r||!i)return null;const o=new Is(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return mo(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,mo(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,mo(e,n)}buildRequest(){const e={requestUri:x4,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=bl(n)}return e}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class oS{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Al extends oS{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class yi extends Al{constructor(){super("facebook.com")}static credential(e){return Is._fromParams({providerId:yi.PROVIDER_ID,signInMethod:yi.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return yi.credentialFromTaggedObject(e)}static credentialFromError(e){return yi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return yi.credential(e.oauthAccessToken)}catch{return null}}}yi.FACEBOOK_SIGN_IN_METHOD="facebook.com";yi.PROVIDER_ID="facebook.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Mr extends Al{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return Is._fromParams({providerId:Mr.PROVIDER_ID,signInMethod:Mr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Mr.credentialFromTaggedObject(e)}static credentialFromError(e){return Mr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Mr.credential(n,r)}catch{return null}}}Mr.GOOGLE_SIGN_IN_METHOD="google.com";Mr.PROVIDER_ID="google.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class vi extends Al{constructor(){super("github.com")}static credential(e){return Is._fromParams({providerId:vi.PROVIDER_ID,signInMethod:vi.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return vi.credentialFromTaggedObject(e)}static credentialFromError(e){return vi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return vi.credential(e.oauthAccessToken)}catch{return null}}}vi.GITHUB_SIGN_IN_METHOD="github.com";vi.PROVIDER_ID="github.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class xi extends Al{constructor(){super("twitter.com")}static credential(e,n){return Is._fromParams({providerId:xi.PROVIDER_ID,signInMethod:xi.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return xi.credentialFromTaggedObject(e)}static credentialFromError(e){return xi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return xi.credential(n,r)}catch{return null}}}xi.TWITTER_SIGN_IN_METHOD="twitter.com";xi.PROVIDER_ID="twitter.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Ro{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await sr._fromIdTokenResponse(e,r,i),o=fx(r);return new Ro({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=fx(r);return new Ro({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function fx(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class jc extends Rr{constructor(e,n,r,i){super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,jc.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new jc(e,n,r,i)}}function aS(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?jc._fromErrorAndOperation(t,s,e,r):s})}async function w4(t,e,n=!1){const r=await hl(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ro._forOperation(t,"link",r)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */async function _4(t,e,n=!1){const{auth:r}=t;if(rr(r.app))return Promise.reject(ms(r));const i="reauthenticate";try{const s=await hl(t,aS(r,i,e,t),n);ke(s.idToken,r,"internal-error");const o=Sg(s.idToken);ke(o,r,"internal-error");const{sub:a}=o;return ke(t.uid===a,r,"user-mismatch"),Ro._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&ti(r,"user-mismatch"),s}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function b4(t,e,n=!1){if(rr(t.app))return Promise.reject(ms(t));const r="signIn",i=await aS(t,r,e),s=await Ro._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}function E4(t,e,n,r){return Yt(t).onIdTokenChanged(e,n,r)}function S4(t,e,n){return Yt(t).beforeAuthStateChanged(e,n)}const Lc="__sak";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class lS{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Lc,"1"),this.storage.removeItem(Lc),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const T4=1e3,I4=10;class uS extends lS{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=nS(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,u)=>{this.notifyListeners(o,u)});return}const r=e.key;n?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);i4()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,I4):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},T4)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}uS.type="LOCAL";const k4=uS;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class cS extends lS{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}cS.type="SESSION";const dS=cS;/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */function C4(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Nd{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new Nd(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async c=>c(n.origin,s)),u=await C4(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Nd.receivers=[];/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Cg(t="",e=10){let n="";for(let r=0;r{const c=Cg("",20);i.port1.start();const h=setTimeout(()=>{u(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const p=f;if(p.data.eventId===c)switch(p.data.status){case"ack":clearTimeout(h),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(p.data.response);break;default:clearTimeout(h),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Cr(){return window}function A4(t){Cr().location.href=t}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */function hS(){return typeof Cr().WorkerGlobalScope<"u"&&typeof Cr().importScripts=="function"}async function P4(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function R4(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)==null?void 0:t.controller)||null}function D4(){return hS()?self:null}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const fS="firebaseLocalStorageDb",j4=1,Oc="firebaseLocalStorage",pS="fbase_key";class Pl{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Ad(t,e){return t.transaction([Oc],e?"readwrite":"readonly").objectStore(Oc)}function L4(){const t=indexedDB.deleteDatabase(fS);return new Pl(t).toPromise()}function wp(){const t=indexedDB.open(fS,j4);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Oc,{keyPath:pS})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Oc)?e(r):(r.close(),await L4(),e(await wp()))})})}async function px(t,e,n){const r=Ad(t,!0).put({[pS]:e,value:n});return new Pl(r).toPromise()}async function O4(t,e){const n=Ad(t,!1).get(e),r=await new Pl(n).toPromise();return r===void 0?null:r.value}function mx(t,e){const n=Ad(t,!0).delete(e);return new Pl(n).toPromise()}const M4=800,V4=3;class mS{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await wp(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>V4)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return hS()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Nd._getInstance(D4()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await P4(),!this.activeServiceWorker)return;this.sender=new N4(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(n=e[0])!=null&&n.fulfilled&&(r=e[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||R4()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await wp();return await px(e,Lc,"1"),await mx(e,Lc),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>px(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>O4(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>mx(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Ad(i,!1).getAll();return new Pl(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),M4)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}mS.type="LOCAL";const F4=mS;new Nl(3e4,6e4);/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function U4(t,e){return e?zr(e):(ke(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Ng extends sS{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return mo(e,this._buildIdpRequest())}_linkToIdToken(e,n){return mo(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return mo(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function z4(t){return b4(t.auth,new Ng(t),t.bypassAuthState)}function B4(t){const{auth:e,user:n}=t;return ke(n,e,"internal-error"),_4(n,new Ng(t),t.bypassAuthState)}async function $4(t){const{auth:e,user:n}=t;return ke(n,e,"internal-error"),w4(n,new Ng(t),t.bypassAuthState)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class gS{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(u))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return z4;case"linkViaPopup":case"linkViaRedirect":return $4;case"reauthViaPopup":case"reauthViaRedirect":return B4;default:ti(this.auth,"internal-error")}}resolve(e){ni(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ni(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const H4=new Nl(2e3,1e4);class no extends gS{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,no.currentPopupAction&&no.currentPopupAction.cancel(),no.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return ke(e,this.auth,"internal-error"),e}async onExecution(){ni(this.filter.length===1,"Popup operations only handle one event");const e=Cg();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(kr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(kr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,no.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(kr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,H4.get())};e()}}no.currentPopupAction=null;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const q4="pendingRedirect",Uu=new Map;class W4 extends gS{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Uu.get(this.auth._key());if(!e){try{const r=await G4(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Uu.set(this.auth._key(),e)}return this.bypassAuthState||Uu.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function G4(t,e){const n=Y4(e),r=Q4(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function K4(t,e){Uu.set(t._key(),e)}function Q4(t){return zr(t._redirectPersistence)}function Y4(t){return Fu(q4,t.config.apiKey,t.name)}async function X4(t,e,n=!1){if(rr(t.app))return Promise.reject(ms(t));const r=Ig(t),i=U4(r,e),o=await new W4(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const J4=10*60*1e3;class Z4{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!eD(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!yS(e)){const i=((r=e.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(kr(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=J4&&this.cachedEventUids.clear(),this.cachedEventUids.has(gx(e))}saveEventToCache(e){this.cachedEventUids.add(gx(e)),this.lastProcessedEventTime=Date.now()}}function gx(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function yS({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function eD(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return yS(t);default:return!1}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function tD(t,e={}){return Bo(t,"GET","/v1/projects",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const nD=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,rD=/^https?/;async function iD(t){if(t.config.emulator)return;const{authorizedDomains:e}=await tD(t);for(const n of e)try{if(sD(n))return}catch{}ti(t,"unauthorized-domain")}function sD(t){const e=vp(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!rD.test(n))return!1;if(nD.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const oD=new Nl(3e4,6e4);function yx(){const t=Cr().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var i,s,o;function r(){yx(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{yx(),n(kr(t,"network-request-failed"))},timeout:oD.get()})}if((s=(i=Cr().gapi)==null?void 0:i.iframes)!=null&&s.Iframe)e(gapi.iframes.getContext());else if((o=Cr().gapi)!=null&&o.load)r();else{const a=f4("iframefcb");return Cr()[a]=()=>{gapi.load?r():n(kr(t,"network-request-failed"))},d4(`${h4()}?onload=${a}`).catch(u=>n(u))}}).catch(e=>{throw zu=null,e})}let zu=null;function lD(t){return zu=zu||aD(t),zu}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const uD=new Nl(5e3,15e3),cD="__/auth/iframe",dD="emulator/auth/iframe",hD={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},fD=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function pD(t){const e=t.config;ke(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?bg(e,dD):`https://${t.config.authDomain}/${cD}`,r={apiKey:e.apiKey,appName:t.name,v:As},i=fD.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${bl(r).slice(1)}`}async function mD(t){const e=await lD(t),n=Cr().gapi;return ke(n,t,"internal-error"),e.open({where:document.body,url:pD(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:hD,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=kr(t,"network-request-failed"),a=Cr().setTimeout(()=>{s(o)},uD.get());function u(){Cr().clearTimeout(a),i(r)}r.ping(u).then(u,()=>{s(o)})}))}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const gD={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},yD=500,vD=600,xD="_blank",wD="http://localhost";class vx{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function _D(t,e,n,r=yD,i=vD){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u={...gD,width:r.toString(),height:i.toString(),top:s,left:o},c=on().toLowerCase();n&&(a=XE(c)?xD:n),QE(c)&&(e=e||wD,u.scrollbars="yes");const h=Object.entries(u).reduce((p,[g,_])=>`${p}${g}=${_},`,"");if(r4(c)&&a!=="_self")return bD(e||"",a),new vx(null);const f=window.open(e||"",a,h);ke(f,t,"popup-blocked");try{f.focus()}catch{}return new vx(f)}function bD(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const ED="__/auth/handler",SD="emulator/auth/handler",TD=encodeURIComponent("fac");async function xx(t,e,n,r,i,s){ke(t.config.authDomain,t,"auth-domain-config-required"),ke(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:As,eventId:i};if(e instanceof oS){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",U2(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,f]of Object.entries({}))o[h]=f}if(e instanceof Al){const h=e.getScopes().filter(f=>f!=="");h.length>0&&(o.scopes=h.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const h of Object.keys(a))a[h]===void 0&&delete a[h];const u=await t._getAppCheckToken(),c=u?`#${TD}=${encodeURIComponent(u)}`:"";return`${ID(t)}?${bl(a).slice(1)}${c}`}function ID({config:t}){return t.emulator?bg(t,SD):`https://${t.authDomain}/${ED}`}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Lh="webStorageSupport";class kD{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=dS,this._completeRedirectFn=X4,this._overrideRedirectResult=K4}async _openPopup(e,n,r,i){var o;ni((o=this.eventManagers[e._key()])==null?void 0:o.manager,"_initialize() not called before _openPopup()");const s=await xx(e,n,r,vp(),i);return _D(e,s,Cg())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await xx(e,n,r,vp(),i);return A4(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(ni(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await mD(e),r=new Z4(e);return n.register("authEvent",i=>(ke(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Lh,{type:Lh},i=>{var o;const s=(o=i==null?void 0:i[0])==null?void 0:o[Lh];s!==void 0&&n(!!s),ti(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=iD(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return nS()||YE()||Tg()}}const CD=kD;var wx="@firebase/auth",_x="1.11.1";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class ND{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){ke(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function AD(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function PD(t){Es(new Vi("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;ke(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:rS(t)},c=new u4(r,i,s,u);return m4(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Es(new Vi("auth-internal",e=>{const n=Ig(e.getProvider("auth").getImmediate());return(r=>new ND(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),br(wx,_x,AD(t)),br(wx,_x,"esm2020")}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const RD=5*60,DD=Z1("authIdTokenMaxAge")||RD;let bx=null;const jD=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>DD)return;const i=n==null?void 0:n.token;bx!==i&&(bx=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function LD(t=Lm()){const e=od(t,"auth");if(e.isInitialized())return e.getImmediate();const n=p4(t,{popupRedirectResolver:CD,persistence:[F4,k4,dS]}),r=Z1("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=jD(s.toString());S4(n,o,()=>o(n.currentUser)),E4(n,a=>o(a))}}const i=Y1("auth");return i&&g4(n,`http://${i}`),n}function OD(){var t;return((t=document.getElementsByTagName("head"))==null?void 0:t[0])??document}c4({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=kr("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",OD().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});PD("Browser");const MD={apiKey:"AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE",authDomain:"twistedbrody-9d163.firebaseapp.com",projectId:"twistedbrody-9d163",storageBucket:"twistedbrody-9d163.firebasestorage.app",messagingSenderId:"733213514129",appId:"1:733213514129:web:e9694684f5c3994ed06230",measurementId:"G-N8TQ7MY42W"},Ag=rb(MD),Be=YP(Ag);LR(Ag);LD(Ag);new Mr;function fl(t){if(t!=null){if(Array.isArray(t)){const e=t.map(n=>fl(n)).filter(n=>n!=null&&n!=="");return e.length>0?e:void 0}if(typeof t=="object"&&!(t instanceof We)){const e={};for(const n in t)if(t.hasOwnProperty(n)){const r=fl(t[n]);r!=null&&(e[n]=r)}return Object.keys(e).length>0?e:void 0}return t}}const Rl={MANGA_PREFIX:"mangalib_detail_v2_"};function Pd(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(n){console.warn(`Error saving ${t} to localStorage`,n)}}function VD(t){try{localStorage.removeItem(t)}catch(e){console.warn(`Error removing ${t} from localStorage`,e)}}async function Rd(){const t=Zr(Cn(Be,"mangas"),oR("created_at","desc")),e=await lr(t),r=(await lr(Cn(Be,"categories"))).docs.reduce((o,a)=>(o[a.id]={id:a.id,...a.data()},o),{}),i=await Promise.all(e.docs.map(async o=>{var a,u;try{const c=o.data();let h=new Date().toISOString();(a=c.created_at)!=null&&a.toDate?h=c.created_at.toDate().toISOString():c.created_at&&(h=new Date(c.created_at).toISOString());let f=h;(u=c.updated_at)!=null&&u.toDate&&(f=c.updated_at.toDate().toISOString());const p=Zr(Cn(Be,"chapters"),Ds("manga_id","==",o.id)),_=(await lr(p)).docs.map(y=>{var U,j;const w=y.data(),k=(U=w.created_at)!=null&&U.toDate?w.created_at.toDate().toISOString():new Date().toISOString(),L=(j=w.updated_at)!=null&&j.toDate?w.updated_at.toDate().toISOString():new Date().toISOString();return{id:y.id,manga_id:w.manga_id,number:w.number,title:w.title,pages:w.pages||[],page_formats:w.page_formats||[],original_pages:w.original_pages||[],created_at:k,updated_at:L}}).sort((y,w)=>y.number-w.number),R=(c.categories||[]).map(y=>r[y]).filter(y=>y!==void 0);return{id:o.id,...c,created_at:h,updated_at:f,categories:R,chapters:_}}catch(c){return console.error(`[DATA ERROR] Skipping corrupt manga ${o.id}:`,c),null}})),s=i.filter(o=>o!==null);return console.log(`[DATA] Loaded ${s.length} mangas (Skipped ${i.length-s.length} corrupt)`),s}const Do=new Map;async function vS(t){var h,f;const e=Pt(Be,"mangas",t),n=await ei(e);if(!n.exists())return null;const r=n.data(),i=Zr(Cn(Be,"chapters"),Ds("manga_id","==",t)),o=(await lr(i)).docs.map(p=>{const g=p.data();return{id:p.id,manga_id:g.manga_id,number:g.number,title:g.title,pages:g.pages||[],page_formats:g.page_formats||[],original_pages:g.original_pages||[],created_at:g.created_at.toDate().toISOString(),updated_at:g.updated_at.toDate().toISOString()}}).sort((p,g)=>p.number-g.number),a=r.categories||[],u=[];for(const p of a){const g=Pt(Be,"categories",p),_=await ei(g);_.exists()&&u.push({id:_.id,..._.data(),created_at:((f=(h=_.data().created_at)==null?void 0:h.toDate)==null?void 0:f.call(h).toISOString())||new Date().toISOString()})}const c={id:n.id,...r,created_at:r.created_at.toDate().toISOString(),categories:u,chapters:o,updated_at:r.updated_at?r.updated_at.toDate().toISOString():r.created_at.toDate().toISOString()};return Do.set(t,c),Pd(`${Rl.MANGA_PREFIX}${t}`,c),c}function FD(t,e){const n=Pt(Be,"mangas",t);return wg(n,async r=>{if(!r.exists()){e(null);return}const i=r.data();let s=Do.get(t),o=(s==null?void 0:s.chapters)||[],a=(s==null?void 0:s.categories)||[];if(!s){const c=Zr(Cn(Be,"chapters"),Ds("manga_id","==",t));o=(await lr(c)).docs.map(p=>({id:p.id,...p.data(),created_at:p.data().created_at.toDate().toISOString(),updated_at:p.data().updated_at.toDate().toISOString()})).sort((p,g)=>p.number-g.number);const f=i.categories||[];a=[];for(const p of f){const g=await ei(Pt(Be,"categories",p));g.exists()&&a.push({id:g.id,...g.data()})}}const u={id:r.id,...i,chapters:o,categories:a,created_at:i.created_at.toDate().toISOString(),updated_at:i.updated_at?i.updated_at.toDate().toISOString():i.created_at.toDate().toISOString()};Do.set(t,u),Pd(`${Rl.MANGA_PREFIX}${t}`,u),e(u)})}async function UD(t){const e=We.now(),n={title:t.title,author:t.author,description:t.description||"",status:t.status||"En curso",categories:t.categoryIds||[],views:0,rating:0,created_at:e,updated_at:e};t.thumbnail_url&&(n.thumbnail_url=t.thumbnail_url),t.cover_url&&(n.cover_url=t.cover_url);const r=await xg(Cn(Be,"mangas"),n),i=new Date().toISOString(),s={id:r.id,title:t.title,author:t.author,description:t.description||"",status:t.status||"En curso",categories:t.categoryIds||[],chapters:[],views:0,rating:0,created_at:i,updated_at:i};return t.thumbnail_url&&(s.thumbnail_url=t.thumbnail_url),t.cover_url&&(s.cover_url=t.cover_url),Do.set(s.id,s),Pd(`${Rl.MANGA_PREFIX}${s.id}`,s),s}async function xS(){return(await lr(Cn(Be,"categories"))).docs.map(e=>({id:e.id,...e.data()}))}async function wS(t,e="genre"){const n=await xg(Cn(Be,"categories"),{name:t,type:e}),r=await ei(n);return{id:r.id,...r.data()}}async function _S(t){const e=Pt(Be,"categories",t);await yp(e);const n=Zr(Cn(Be,"mangas"),Ds("categories","array-contains",t)),i=(await lr(n)).docs.map(s=>{const u=(s.data().categories||[]).filter(c=>c!==t);return Xi(Pt(Be,"mangas",s.id),{categories:u})});await Promise.all(i)}async function Ex(t){const e=We.now(),n=await xg(Cn(Be,"chapters"),{manga_id:t.manga_id,number:t.number,title:t.title,pages:t.pages,page_formats:t.page_formats||[],original_pages:t.original_pages||[],created_at:e,updated_at:e}),r=await ei(n),i=r.data();return{id:r.id,manga_id:i.manga_id,number:i.number,title:i.title,pages:i.pages||[],page_formats:i.page_formats||[],original_pages:i.original_pages||[],created_at:i.created_at.toDate().toISOString(),updated_at:i.updated_at.toDate().toISOString()}}async function zD(){const e=(await Rd()).map(n=>{const r=Pt(Be,"mangas",n.id);return Xi(r,{views:0})});await Promise.all(e)}async function BD(t){const e=Pt(Be,"mangas",t);await Xi(e,{views:uR(1)})}async function bS(t,e){var _,T;const n=Pt(Be,"mangas",t),r=We.now(),i={title:e.title,author:e.author,categories:e.categoryIds||[],updated_at:r};e.status&&(i.status=e.status),e.description!==void 0&&e.description!==null&&(i.description=e.description),e.thumbnail_url&&(i.thumbnail_url=e.thumbnail_url),e.cover_url&&(i.cover_url=e.cover_url);const s=fl(i);await Xi(n,s);const o=await ei(n);if(!o.exists())throw new Error("Manga no encontrado");const a=o.data(),u=Zr(Cn(Be,"chapters"),Ds("manga_id","==",t)),h=(await lr(u)).docs.map(R=>{const y=R.data();return{id:R.id,manga_id:y.manga_id,number:y.number,title:y.title,pages:y.pages||[],page_formats:y.page_formats||[],original_pages:y.original_pages||[],created_at:y.created_at.toDate().toISOString(),updated_at:y.updated_at.toDate().toISOString()}}).sort((R,y)=>R.number-y.number),f=a.categories||[],p=[];for(const R of f){const y=Pt(Be,"categories",R),w=await ei(y);w.exists()&&p.push({id:w.id,...w.data(),created_at:((T=(_=w.data().created_at)==null?void 0:_.toDate)==null?void 0:T.call(_).toISOString())||new Date().toISOString()})}const g={id:o.id,...a,created_at:a.created_at.toDate().toISOString(),categories:p,chapters:h,updated_at:a.updated_at.toDate().toISOString()};return Do.set(g.id,g),Pd(`${Rl.MANGA_PREFIX}${g.id}`,g),g}async function Sx(t){const e=Pt(Be,"mangas",t),n=Zr(Cn(Be,"chapters"),Ds("manga_id","==",t)),r=await lr(n);for(const i of r.docs)await yp(i.ref);await yp(e),Do.delete(t),VD(`${Rl.MANGA_PREFIX}${t}`)}async function $D(t,e){const n=Pt(Be,"mangas",t),r=await ei(n);if(!r.exists())throw new Error("Manga no encontrado");const s={external_links:[...r.data().external_links||[],e]},o=fl(s);await Xi(n,o)}async function HD(t,e){const n=Pt(Be,"mangas",t),r=await ei(n);if(!r.exists())throw new Error("Manga no encontrado");const s={external_links:(r.data().external_links||[]).filter((a,u)=>u!==e)},o=fl(s);await Xi(n,o)}async function qD(t,e,n,r){const s=(await Rd()).filter(o=>o.id!==t).map(o=>{var T,R;let a=0;const u=((T=o.categories)==null?void 0:T.map(y=>y.id))||[],c=e.filter(y=>u.includes(y));a+=c.length*10;const h=n.toLowerCase().split(/\s+/).filter(y=>y.length>2),f=o.title.toLowerCase().split(/\s+/).filter(y=>y.length>2),p=h.filter(y=>f.includes(y));a+=p.length*5;const g=((R=o.author)==null?void 0:R.toLowerCase().split(/\s+/).filter(y=>y.length>2))||[],_=h.filter(y=>g.includes(y));return a+=_.length*3,{manga:o,score:a}}).filter(o=>o.score>0).sort((o,a)=>{const u=o.manga.title.toLowerCase(),c=a.manga.title.toLowerCase();return u.localeCompare(c)}).map(o=>o.manga);return r?s.slice(0,r):s}async function WD(t){const e=Zr(Cn(Be,"mangas"),Ds("author","==",t)),r=(await lr(e)).docs.map(i=>Xi(Pt(Be,"mangas",i.id),{author:""}));await Promise.all(r)}async function GD(){const t=Zr(Cn(Be,"mangas")),e=await lr(t),n=new Set;return e.forEach(r=>{const i=r.data();i&&i.author&&typeof i.author=="string"&&i.author.trim()!==""&&n.add(i.author.trim())}),Array.from(n).sort()}function KD(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const QD=t=>{switch(t){case"success":return JD;case"info":return ej;case"warning":return ZD;case"error":return tj;default:return null}},YD=Array(12).fill(0),XD=({visible:t,className:e})=>ne.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ne.createElement("div",{className:"sonner-spinner"},YD.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),JD=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ZD=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ej=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tj=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nj=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rj=()=>{const[t,e]=ne.useState(document.hidden);return ne.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let _p=1;class ij{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:_p++,o=this.toasts.find(u=>u.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...e,id:s,title:r}),{...u,...e,id:s,dismissible:a,title:r}):u):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],ne.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(oj(c)&&!c.ok){s=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,_=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,..._})}else if(c instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,_=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,..._})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,_=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,..._})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const h=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,g=typeof h=="object"&&!ne.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:f,...g})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((c,h)=>a.then(()=>o[0]==="reject"?h(o[1]):c(o[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||_p++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const vn=new ij,sj=(t,e)=>{const n=(e==null?void 0:e.id)||_p++;return vn.addToast({title:t,...e,id:n}),n},oj=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",aj=sj,lj=()=>vn.toasts,uj=()=>vn.getActiveToasts(),kt=Object.assign(aj,{success:vn.success,info:vn.info,warning:vn.warning,error:vn.error,custom:vn.custom,message:vn.message,promise:vn.promise,dismiss:vn.dismiss,loading:vn.loading},{getHistory:lj,getToasts:uj});KD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function gu(t){return t.label!==void 0}const cj=3,dj="24px",hj="16px",Tx=4e3,fj=356,pj=14,mj=45,gj=200;function pr(...t){return t.filter(Boolean).join(" ")}function yj(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const vj=t=>{var e,n,r,i,s,o,a,u,c;const{invert:h,toast:f,unstyled:p,interacting:g,setHeights:_,visibleToasts:T,heights:R,index:y,toasts:w,expanded:k,removeToast:L,defaultRichColors:U,closeButton:j,style:b,cancelButtonStyle:x,actionButtonStyle:E,className:I="",descriptionClassName:N="",duration:D,position:C,gap:ge,expandByDefault:ie,classNames:fe,icons:we,closeButtonAriaLabel:G="Close toast"}=t,[se,A]=ne.useState(null),[pe,_e]=ne.useState(null),[P,$]=ne.useState(!1),[Y,re]=ne.useState(!1),[Ce,de]=ne.useState(!1),[Qe,Ze]=ne.useState(!1),[dt,Vt]=ne.useState(!1),[xt,Rt]=ne.useState(0),[ln,St]=ne.useState(0),st=ne.useRef(f.duration||D||Tx),Ht=ne.useRef(null),Oe=ne.useRef(null),Ye=y===0,ee=y+1<=T,Q=f.type,V=f.dismissible!==!1,K=f.className||"",me=f.descriptionClassName||"",O=ne.useMemo(()=>R.findIndex(Se=>Se.toastId===f.id)||0,[R,f.id]),B=ne.useMemo(()=>{var Se;return(Se=f.closeButton)!=null?Se:j},[f.closeButton,j]),oe=ne.useMemo(()=>f.duration||D||Tx,[f.duration,D]),le=ne.useRef(0),he=ne.useRef(0),$e=ne.useRef(0),je=ne.useRef(null),[He,et]=C.split("-"),H=ne.useMemo(()=>R.reduce((Se,ut,Ft)=>Ft>=O?Se:Se+ut.height,0),[R,O]),Z=rj(),be=f.invert||h,ye=Q==="loading";he.current=ne.useMemo(()=>O*ge+H,[O,H]),ne.useEffect(()=>{st.current=oe},[oe]),ne.useEffect(()=>{$(!0)},[]),ne.useEffect(()=>{const Se=Oe.current;if(Se){const ut=Se.getBoundingClientRect().height;return St(ut),_(Ft=>[{toastId:f.id,height:ut,position:f.position},...Ft]),()=>_(Ft=>Ft.filter(un=>un.toastId!==f.id))}},[_,f.id]),ne.useLayoutEffect(()=>{if(!P)return;const Se=Oe.current,ut=Se.style.height;Se.style.height="auto";const Ft=Se.getBoundingClientRect().height;Se.style.height=ut,St(Ft),_(un=>un.find(Dt=>Dt.toastId===f.id)?un.map(Dt=>Dt.toastId===f.id?{...Dt,height:Ft}:Dt):[{toastId:f.id,height:Ft,position:f.position},...un])},[P,f.title,f.description,_,f.id,f.jsx,f.action,f.cancel]);const ve=ne.useCallback(()=>{re(!0),Rt(he.current),_(Se=>Se.filter(ut=>ut.toastId!==f.id)),setTimeout(()=>{L(f)},gj)},[f,L,_,he]);ne.useEffect(()=>{if(f.promise&&Q==="loading"||f.duration===1/0||f.type==="loading")return;let Se;return k||g||Z?(()=>{if($e.current{st.current!==1/0&&(le.current=new Date().getTime(),Se=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),ve()},st.current))})(),()=>clearTimeout(Se)},[k,g,f,Q,Z,ve]),ne.useEffect(()=>{f.delete&&(ve(),f.onDismiss==null||f.onDismiss.call(f,f))},[ve,f.delete]);function Xe(){var Se;if(we!=null&&we.loading){var ut;return ne.createElement("div",{className:pr(fe==null?void 0:fe.loader,f==null||(ut=f.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Q==="loading"},we.loading)}return ne.createElement(XD,{className:pr(fe==null?void 0:fe.loader,f==null||(Se=f.classNames)==null?void 0:Se.loader),visible:Q==="loading"})}const wt=f.icon||(we==null?void 0:we[Q])||QD(Q);var Ee,_t;return ne.createElement("li",{tabIndex:0,ref:Oe,className:pr(I,K,fe==null?void 0:fe.toast,f==null||(e=f.classNames)==null?void 0:e.toast,fe==null?void 0:fe.default,fe==null?void 0:fe[Q],f==null||(n=f.classNames)==null?void 0:n[Q]),"data-sonner-toast":"","data-rich-colors":(Ee=f.richColors)!=null?Ee:U,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":P,"data-promise":!!f.promise,"data-swiped":dt,"data-removed":Y,"data-visible":ee,"data-y-position":He,"data-x-position":et,"data-index":y,"data-front":Ye,"data-swiping":Ce,"data-dismissible":V,"data-type":Q,"data-invert":be,"data-swipe-out":Qe,"data-swipe-direction":pe,"data-expanded":!!(k||ie&&P),"data-testid":f.testId,style:{"--index":y,"--toasts-before":y,"--z-index":w.length-y,"--offset":`${Y?xt:he.current}px`,"--initial-height":ie?"auto":`${ln}px`,...b,...f.style},onDragEnd:()=>{de(!1),A(null),je.current=null},onPointerDown:Se=>{Se.button!==2&&(ye||!V||(Ht.current=new Date,Rt(he.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(de(!0),je.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,ut,Ft;if(Qe||!V)return;je.current=null;const un=Number(((Se=Oe.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jn=Number(((ut=Oe.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((Ft=Ht.current)==null?void 0:Ft.getTime()),pn=se==="x"?un:Jn,jr=Math.abs(pn)/Dt;if(Math.abs(pn)>=mj||jr>.11){Rt(he.current),f.onDismiss==null||f.onDismiss.call(f,f),_e(se==="x"?un>0?"right":"left":Jn>0?"down":"up"),ve(),Ze(!0);return}else{var mn,gn;(mn=Oe.current)==null||mn.style.setProperty("--swipe-amount-x","0px"),(gn=Oe.current)==null||gn.style.setProperty("--swipe-amount-y","0px")}Vt(!1),de(!1),A(null)},onPointerMove:Se=>{var ut,Ft,un;if(!je.current||!V||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const Dt=Se.clientY-je.current.y,pn=Se.clientX-je.current.x;var jr;const mn=(jr=t.swipeDirections)!=null?jr:yj(C);!se&&(Math.abs(pn)>1||Math.abs(Dt)>1)&&A(Math.abs(pn)>Math.abs(Dt)?"x":"y");let gn={x:0,y:0};const Ls=Pn=>1/(1.5+Math.abs(Pn)/20);if(se==="y"){if(mn.includes("top")||mn.includes("bottom"))if(mn.includes("top")&&Dt<0||mn.includes("bottom")&&Dt>0)gn.y=Dt;else{const Pn=Dt*Ls(Dt);gn.y=Math.abs(Pn)0)gn.x=pn;else{const Pn=pn*Ls(pn);gn.x=Math.abs(Pn)0||Math.abs(gn.y)>0)&&Vt(!0),(Ft=Oe.current)==null||Ft.style.setProperty("--swipe-amount-x",`${gn.x}px`),(un=Oe.current)==null||un.style.setProperty("--swipe-amount-y",`${gn.y}px`)}},B&&!f.jsx&&Q!=="loading"?ne.createElement("button",{"aria-label":G,"data-disabled":ye,"data-close-button":!0,onClick:ye||!V?()=>{}:()=>{ve(),f.onDismiss==null||f.onDismiss.call(f,f)},className:pr(fe==null?void 0:fe.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(_t=we==null?void 0:we.close)!=null?_t:nj):null,(Q||f.icon||f.promise)&&f.icon!==null&&((we==null?void 0:we[Q])!==null||f.icon)?ne.createElement("div",{"data-icon":"",className:pr(fe==null?void 0:fe.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Xe():null,f.type!=="loading"?wt:null):null,ne.createElement("div",{"data-content":"",className:pr(fe==null?void 0:fe.content,f==null||(s=f.classNames)==null?void 0:s.content)},ne.createElement("div",{"data-title":"",className:pr(fe==null?void 0:fe.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ne.createElement("div",{"data-description":"",className:pr(N,me,fe==null?void 0:fe.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),ne.isValidElement(f.cancel)?f.cancel:f.cancel&&gu(f.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||x,onClick:Se=>{gu(f.cancel)&&V&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Se),ve())},className:pr(fe==null?void 0:fe.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,ne.isValidElement(f.action)?f.action:f.action&&gu(f.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||E,onClick:Se=>{gu(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Se),!Se.defaultPrevented&&ve())},className:pr(fe==null?void 0:fe.actionButton,f==null||(c=f.classNames)==null?void 0:c.actionButton)},f.action.label):null)};function Ix(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function xj(t,e){const n={};return[t,e].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?hj:dj;function u(c){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(a)}),n}const wj=ne.forwardRef(function(e,n){const{id:r,invert:i,position:s="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:u,className:c,offset:h,mobileOffset:f,theme:p="light",richColors:g,duration:_,style:T,visibleToasts:R=cj,toastOptions:y,dir:w=Ix(),gap:k=pj,icons:L,containerAriaLabel:U="Notifications"}=e,[j,b]=ne.useState([]),x=ne.useMemo(()=>r?j.filter(P=>P.toasterId===r):j.filter(P=>!P.toasterId),[j,r]),E=ne.useMemo(()=>Array.from(new Set([s].concat(x.filter(P=>P.position).map(P=>P.position)))),[x,s]),[I,N]=ne.useState([]),[D,C]=ne.useState(!1),[ge,ie]=ne.useState(!1),[fe,we]=ne.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ne.useRef(null),se=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=ne.useRef(null),pe=ne.useRef(!1),_e=ne.useCallback(P=>{b($=>{var Y;return(Y=$.find(re=>re.id===P.id))!=null&&Y.delete||vn.dismiss(P.id),$.filter(({id:re})=>re!==P.id)})},[]);return ne.useEffect(()=>vn.subscribe(P=>{if(P.dismiss){requestAnimationFrame(()=>{b($=>$.map(Y=>Y.id===P.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{Zk.flushSync(()=>{b($=>{const Y=$.findIndex(re=>re.id===P.id);return Y!==-1?[...$.slice(0,Y),{...$[Y],...P},...$.slice(Y+1)]:[P,...$]})})})}),[j]),ne.useEffect(()=>{if(p!=="system"){we(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?we("dark"):we("light")),typeof window>"u")return;const P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:$})=>{we($?"dark":"light")})}catch{P.addListener(({matches:Y})=>{try{we(Y?"dark":"light")}catch(re){console.error(re)}})}},[p]),ne.useEffect(()=>{j.length<=1&&C(!1)},[j]),ne.useEffect(()=>{const P=$=>{var Y;if(o.every(de=>$[de]||$.code===de)){var Ce;C(!0),(Ce=G.current)==null||Ce.focus()}$.code==="Escape"&&(document.activeElement===G.current||(Y=G.current)!=null&&Y.contains(document.activeElement))&&C(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[o]),ne.useEffect(()=>{if(G.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,pe.current=!1)}},[G.current]),ne.createElement("section",{ref:n,"aria-label":`${U} ${se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((P,$)=>{var Y;const[re,Ce]=P.split("-");return x.length?ne.createElement("ol",{key:P,dir:w==="auto"?Ix():w,tabIndex:-1,ref:G,className:c,"data-sonner-toaster":!0,"data-sonner-theme":fe,"data-y-position":re,"data-x-position":Ce,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${fj}px`,"--gap":`${k}px`,...T,...xj(h,f)},onBlur:de=>{pe.current&&!de.currentTarget.contains(de.relatedTarget)&&(pe.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||pe.current||(pe.current=!0,A.current=de.relatedTarget)},onMouseEnter:()=>C(!0),onMouseMove:()=>C(!0),onMouseLeave:()=>{ge||C(!1)},onDragEnd:()=>C(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},x.filter(de=>!de.position&&$===0||de.position===P).map((de,Qe)=>{var Ze,dt;return ne.createElement(vj,{key:de.id,icons:L,index:Qe,toast:de,defaultRichColors:g,duration:(Ze=y==null?void 0:y.duration)!=null?Ze:_,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:i,visibleToasts:R,closeButton:(dt=y==null?void 0:y.closeButton)!=null?dt:u,interacting:ge,position:P,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:_e,toasts:x.filter(Vt=>Vt.position==de.position),heights:I.filter(Vt=>Vt.position==de.position),setHeights:N,expandByDefault:a,gap:k,expanded:D,swipeDirections:e.swipeDirections})})):null}))});function Ei({label:t,type:e,categories:n,selectedIds:r,onSelect:i,onRemove:s,onCreate:o,onDeleteCategory:a,colorClass:u,placeholder:c="Añadir..."}){const[h,f]=F.useState(""),[p,g]=F.useState(!1),_=F.useRef(null),T=F.useMemo(()=>n.filter(j=>j.type===e||!j.type&&e==="genre"),[n,e]),R=F.useMemo(()=>h.trim()?T.filter(j=>j.name.toLowerCase().includes(h.toLowerCase())):T,[T,h]);F.useEffect(()=>{const j=b=>{_.current&&!_.current.contains(b.target)&&g(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]);const y=j=>{j.key==="Enter"&&(j.preventDefault(),w())},w=()=>{if(!h.trim())return;const j=T.find(b=>b.name.toLowerCase()===h.trim().toLowerCase());j?r.includes(j.id)||i(j.id):o(h.trim()),f(""),g(!1)},k=(j,b)=>{j.stopPropagation(),kt("¿Eliminar esta categoría permanentemente?",{description:"Esta acción no se puede deshacer.",action:{label:"Eliminar",onClick:()=>a(b)},cancel:{label:"Cancelar",onClick:()=>{}},duration:5e3})},U=u.includes("blue")?{bg:"bg-blue-500/20",text:"text-blue-300",border:"border-blue-500/30"}:u.includes("green")?{bg:"bg-green-500/20",text:"text-green-300",border:"border-green-500/30"}:u.includes("purple")?{bg:"bg-purple-500/20",text:"text-purple-300",border:"border-purple-500/30"}:u.includes("pink")?{bg:"bg-pink-500/20",text:"text-pink-300",border:"border-pink-500/30"}:{bg:"bg-gray-500/20",text:"text-gray-300",border:"border-gray-500/30"};return d.jsxs("div",{className:"space-y-3 mb-6",ref:_,children:[d.jsx("label",{className:`text-xs uppercase font-bold tracking-wider ${u}`,children:t}),d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:"text",value:h,onChange:j=>{f(j.target.value),g(!0)},onFocus:()=>g(!0),onKeyDown:y,placeholder:c,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all"}),h&&d.jsx("button",{onClick:()=>f(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white",children:d.jsx(In,{className:"w-3 h-3"})})]}),d.jsx("button",{onClick:w,disabled:!h.trim(),className:"bg-[#bb86fc]/20 hover:bg-[#bb86fc]/30 text-[#bb86fc] px-3 rounded-lg transition-all",children:d.jsx(co,{className:"w-5 h-5"})})]}),p&&(R.length>0||h)&&d.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#1a1a1a] border border-gray-700/50 rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto w-full custom-scrollbar",children:R.length>0?R.map(j=>{const b=r.includes(j.id);return d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 hover:bg-white/5 cursor-pointer group",onClick:()=>{b||(i(j.id),f(""),g(!1))},children:[d.jsx("span",{className:`text-sm ${b?"text-[#bb86fc]":"text-gray-300"}`,children:j.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[b&&d.jsx(wl,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsx("button",{onClick:x=>k(x,j.id),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-500/20 text-gray-500 hover:text-red-400 rounded transition-all",title:"Eliminar permanentemente",children:d.jsx($r,{className:"w-3.5 h-3.5"})})]})]},j.id)}):d.jsxs("div",{className:"px-4 py-3 text-center",children:[d.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"No encontrado."}),d.jsxs("button",{onClick:w,className:"text-xs text-[#bb86fc] hover:underline font-semibold",children:['Crear "',h,'"']})]})})]}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:r.map(j=>{const b=n.find(x=>x.id===j);return!b||b.type!==e&&!(e==="genre"&&!b.type)?null:d.jsxs("span",{className:`px-3 py-1 ${U.bg} ${U.text} text-xs rounded-full border ${U.border} flex items-center gap-2`,children:[b.name,d.jsx("button",{onClick:()=>s(j),className:"hover:text-white",children:d.jsx(In,{className:"w-3 h-3"})})]},j)})})]})}function gs({size:t=40,borderWidth:e=2,className:n=""}){return d.jsx("div",{className:`flex items-center justify-center ${n}`,children:d.jsx("div",{className:"relative",style:{width:`${t}px`,height:`${t}px`},children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:`${t}px`,height:`${t}px`,borderWidth:`${e}px`,borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.3)",borderTopColor:"#bb86fc",animation:"spin 1.2s linear infinite",boxShadow:"0 0 20px rgba(139, 92, 246, 0.2)"}})})})}function _j(t){const e=new Map,n=t.split(` +`);let r="",i="";for(const a of n){const u=a.trim();if(u.includes("---- WEB P LINKS ----")){r="WEB P LINKS";continue}if(u.includes("---- ORIGINAL LINKS ----")){r="ORIGINAL LINKS";continue}if(u.includes("Para Hugging Face (Público):")){i="Hugging Face";continue}if(u.includes("Para tu PC Local (Pruebas):")){i="Local";continue}if(i==="Hugging Face"&&u.match(/^\(\d+\)\s+.*?\s+=\s+http/)){const c=u.match(/^\((\d+)\)\s+.*?\s+=\s+(http.*)$/);if(c){const h=parseInt(c[1],10),f=c[2].trim();e.has(h)||e.set(h,{originalFormat:"webp",originalBase64:""});const p=e.get(h);f.includes("/stream/")||f.includes("hash="),r==="WEB P LINKS"?(p.thumbnail=f,p.webpDisplay=f,p.webpCover=f):r==="ORIGINAL LINKS"&&(p.original=f,p.originalUnmodified=f)}}}const s=[],o=Array.from(e.keys()).sort((a,u)=>a-u);for(const a of o){const u=e.get(a);u&&u.thumbnail&&u.original?s.push(u):u&&u.thumbnail&&(u.original=u.thumbnail,u.originalUnmodified=u.thumbnail,s.push(u))}return s}function bj({isOpen:t,onClose:e,onMangaCreated:n,editingManga:r,onDelete:i}){const[s,o]=F.useState({title:"",name:"",description:"",selectedCategories:[]}),[a,u]=F.useState(null),[c,h]=F.useState(!1),[f,p]=F.useState(null),[g,_]=F.useState([]),[T,R]=F.useState(!1),[y,w]=F.useState([]),[k,L]=F.useState(!1),[U,j]=F.useState(null),[b,x]=F.useState(0),[E,I]=F.useState(!1),[N,D]=F.useState(0),[C,ge]=F.useState(0),[ie,fe]=F.useState(!1),[we,G]=F.useState(null),[se,A]=F.useState(null),[pe,_e]=F.useState(!1),[P,$]=F.useState(W1()),Y=!!r;F.useEffect(()=>{var ee,Q;if(t&&(re(),r)){o({title:r.title,name:r.author,description:r.description||"",selectedCategories:((ee=r.categories)==null?void 0:ee.map(K=>typeof K=="string"?K:K.id))||[]}),r.thumbnail_url&&p(r.thumbnail_url);const V=(Q=r.chapters)==null?void 0:Q[0];if(V!=null&&V.pages&&V.pages.length>0){const K=V.pages,me=V.original_pages||[],O=K.map((B,oe)=>{var le;return{thumbnail:B,original:me[oe]||B,webpDisplay:B,webpCover:B,originalFormat:((le=V.page_formats)==null?void 0:le[oe])||"jpg",originalBase64:"",originalUnmodified:""}});w(O)}}},[t,r]),F.useEffect(()=>{y.length>0&&we===null&&!a&&!se&&!f&&Oe(0)},[y]);async function re(){try{const ee=await xS();_(ee)}catch(ee){console.error("Error loading categories:",ee)}}const Ce=async ee=>{const{name:Q,value:V}=ee.target;o(K=>({...K,[Q]:V}))},de=ee=>{o(Q=>({...Q,selectedCategories:Q.selectedCategories.filter(V=>V!==ee)}))},Qe=async(ee,Q)=>{if(ee.trim()){if(Q==="tag"){const V=ee.split(" ").map(K=>K.trim()).filter(K=>K.length>0);for(const K of V)await Ze(K,Q);return}await Ze(ee,Q)}},Ze=async(ee,Q)=>{try{const V=g.find(K=>K.name.toLowerCase()===ee.trim().toLowerCase()&&K.type===Q);if(V)o(K=>K.selectedCategories.includes(V.id)?K:{...K,selectedCategories:[...K.selectedCategories,V.id]});else{const K=await wS(ee.trim(),Q);_(me=>me.find(O=>O.id===K.id)?me:[...me,K]),o(me=>me.selectedCategories.includes(K.id)?me:{...me,selectedCategories:[...me.selectedCategories,K.id]})}}catch(V){console.error("Error creating category:",V)}},dt=async ee=>{try{await _S(ee),_(Q=>Q.filter(V=>V.id!==ee)),o(Q=>({...Q,selectedCategories:Q.selectedCategories.filter(V=>V!==ee)}))}catch(Q){console.error("Error deleting category:",Q),alert("Error al eliminar la categoría")}},Vt=async ee=>{var V;const Q=(V=ee.target.files)==null?void 0:V[0];if(Q){h(!0);try{const K=await d2(Q);u(K),p(K.originalUnmodified)}catch(K){console.error("Error processing image:",K),alert("Error al procesar la imagen. Intenta con otro archivo.")}finally{h(!1)}}},xt=async ee=>{let Q="";if(ee.target instanceof HTMLInputElement&&ee.target.files&&ee.target.files.length>0){const V=ee.target.files[0];try{Q=await V.text()}catch(K){console.error("Error reading text file:",K),alert("Error al leer el archivo de texto.");return}}else ee.target instanceof HTMLTextAreaElement&&(Q=ee.target.value);if(Q.trim()){L(!0);try{const V=_j(Q);if(V.length===0){alert("No se encontraron enlaces válidos en el texto provisto. Asegúrate de copiar el formato correcto.");return}w(K=>[...K,...V])}catch(V){console.error("Error parsing pages from text:",V),alert("Error al procesar los enlaces.")}finally{L(!1),ee.target instanceof HTMLInputElement&&(ee.target.value="")}}},Rt=ee=>{w(Q=>Q.filter((V,K)=>K!==ee))},ln=ee=>{j(ee)},St=(ee,Q)=>{if(ee.preventDefault(),U===null||U===Q)return;const V=[...y],K=V[U];V.splice(U,1),V.splice(Q,0,K),w(V),j(Q)},st=()=>{j(null)},Ht=async()=>{var ee,Q,V,K,me;if(!s.title||!s.title.trim()){alert("El título es requerido");return}R(!0);try{let O=[...s.selectedCategories],B=(r==null?void 0:r.thumbnail_url)||void 0,oe=(r==null?void 0:r.cover_url)||void 0;if(se)B=se.thumbnail,oe=se.original;else if(a)if(a.originalBase64==="")B=a.thumbnail,oe=a.originalUnmodified;else try{I(!0),ge(2),D(1),x(0);const le=await Gf(a.thumbnail,`${s.title}_thumb`);x(50),D(2);const he=await Gf(a.originalUnmodified,`${s.title}_cover`);x(100),B=le.data.url,oe=he.data.url}catch(le){console.error("Error uploading cover images:",le),alert("Error al subir la portada. Continuar sin portada.")}finally{I(!1),x(0)}else y.length>0&&(B=y[0].webpDisplay,oe=y[0].originalUnmodified);if(Y&&r){const le={title:s.title.trim(),author:((ee=s.name)==null?void 0:ee.trim())||"",description:((Q=s.description)==null?void 0:Q.trim())||"",categoryIds:O};if(B&&(le.thumbnail_url=B),oe&&(le.cover_url=oe),await bS(r.id,le),y.length>0&&y.length>0)try{I(!0);const he=y.filter(ye=>ye.originalBase64!==""&&!ye.original.includes("/stream/")&&!ye.original.includes("hash="));let $e=[],je=[];if(he.length>0){ge(he.length*2),D(0),x(0);const ye=he.map(Ee=>Ee.webpDisplay),ve=he.map(Ee=>Ee.originalUnmodified),Xe=await lu(ye,`${s.title}_updated_webp`,(Ee,_t)=>{D(Ee),x(Math.round(Ee/(he.length*2)*100))}),wt=await lu(ve,`${s.title}_updated_original`,(Ee,_t)=>{D(he.length+Ee),x(Math.round((he.length+Ee)/(he.length*2)*100))});$e=Xe.map(Ee=>Ee.data.url),je=wt.map(Ee=>Ee.data.url)}let He=0;const et=y.map(ye=>ye.originalBase64!==""&&!ye.original.includes("/stream/")&&!ye.original.includes("hash=")?$e[He++]:ye.webpDisplay);He=0;const H=y.map(ye=>ye.originalBase64!==""&&!ye.original.includes("/stream/")&&!ye.original.includes("hash=")?je[He++]:ye.original),Z=y.map(ye=>ye.originalFormat);I(!1),x(0);const be=(V=r.chapters)==null?void 0:V[0];be?await Xi(Pt(Be,"chapters",be.id),{pages:et,page_formats:Z,original_pages:H,updated_at:We.now()}):await Ex({manga_id:r.id,number:1,title:"Páginas",pages:et,page_formats:Z,original_pages:H})}catch(he){console.error("Error updating chapter:",he),alert("Error al actualizar las páginas.")}n(r.id)}else{const le={title:s.title.trim(),author:((K=s.name)==null?void 0:K.trim())||"",categoryIds:O};(me=s.description)!=null&&me.trim()&&(le.description=s.description.trim()),B&&(le.thumbnail_url=B),oe&&(le.cover_url=oe);const he=await UD(le);if(!he.id)throw new Error("No se pudo obtener el ID del manga creado");const $e=he.id;if(y.length>0)try{I(!0);const je=y.filter(ve=>ve.originalBase64!==""&&!ve.original.includes("/stream/")&&!ve.original.includes("hash="));let He=[],et=[];if(je.length>0){ge(je.length*2),D(0),x(0);const ve=je.map(_t=>_t.webpDisplay),Xe=je.map(_t=>_t.originalUnmodified),wt=await lu(ve,`${s.title}_ch1_webp`,(_t,Se)=>{D(_t),x(Math.round(_t/(je.length*2)*100))}),Ee=await lu(Xe,`${s.title}_ch1_original`,(_t,Se)=>{D(je.length+_t),x(Math.round((je.length+_t)/(je.length*2)*100))});He=wt.map(_t=>_t.data.url),et=Ee.map(_t=>_t.data.url)}let H=0;const Z=y.map(ve=>ve.originalBase64!==""&&!ve.original.includes("/stream/")&&!ve.original.includes("hash=")?He[H++]:ve.webpDisplay);H=0;const be=y.map(ve=>ve.originalBase64!==""&&!ve.original.includes("/stream/")&&!ve.original.includes("hash=")?et[H++]:ve.original),ye=y.map(ve=>ve.originalFormat);I(!1),x(0),await Ex({manga_id:$e,number:1,title:"Páginas",pages:Z,page_formats:ye,original_pages:be})}catch(je){console.error("Error creating chapter:",je),alert("Error al crear el capítulo. Por favor intenta de nuevo.")}n($e)}Ye()}catch(O){console.error("Error creating/updating manga:",O);let B="Error al guardar el manga. ";if(O.message)B+=O.message;else if(O.code)switch(O.code){case"permission-denied":B+="No tienes permisos para realizar esta operación.";break;case"unavailable":B+="El servicio no está disponible. Verifica tu conexión.";break;case"invalid-argument":B+="Algunos datos no son válidos. Revisa el formulario.";break;default:B+=`Código de error: ${O.code}`}else B+="Por favor intenta de nuevo.";alert(B)}finally{R(!1),I(!1),x(0)}},Oe=ee=>{const Q=y[ee];if(!Q.originalBase64)A({thumbnail:Q.thumbnail,original:Q.original}),u(null);else{const K={thumbnail:Q.thumbnail,original:Q.originalUnmodified,webpDisplay:Q.originalUnmodified,webpCover:Q.originalUnmodified,originalFormat:Q.originalFormat,originalBase64:Q.originalBase64,originalUnmodified:Q.originalUnmodified};u(K),A(null)}p(Q.thumbnail),G(ee),fe(!1)},Ye=()=>{o({title:"",name:"",description:"",selectedCategories:[]}),u(null),A(null),p(null),w([]),x(0),I(!1),D(0),ge(0),fe(!1),G(null),e()};return t?d.jsxs("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-2xl max-h-[90vh] overflow-y-auto shadow-2xl",children:[d.jsxs("div",{className:"sticky top-0 bg-gradient-to-b from-[#2a2a2a] to-[#1f1f1f] border-b border-gray-700/30 px-8 py-6 flex items-center justify-between z-10",children:[d.jsxs("div",{children:[d.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-lg shadow-lg shadow-[#bb86fc]/30",children:d.jsx(nl,{className:"w-5 h-5 text-white"})}),Y?"Editar Manga":"Crear Manga"]}),d.jsx("p",{className:"text-sm text-gray-400 mt-1.5",children:Y?"Actualiza los detalles de tu obra":"Comparte tu historia con el mundo"})]}),d.jsx("button",{onClick:Ye,className:"text-gray-500 hover:text-white hover:bg-white/10 transition-all p-2 rounded-lg",children:d.jsx(In,{className:"w-6 h-6"})})]}),d.jsxs("div",{className:"p-8 space-y-5",children:[d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Información Principal"})]}),d.jsxs("div",{className:"space-y-3.5",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Título del Manga ",d.jsx("span",{className:"text-red-400 font-bold",children:"*"})]}),d.jsx("input",{type:"text",name:"title",placeholder:"El nombre de tu obra maestra",value:s.title,onChange:Ce,onKeyPress:ee=>ee.key==="Enter"&&Y&&!T&&Ht(),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Autor ",d.jsx("span",{className:"text-gray-500 font-normal",children:"(opcional)"})]}),d.jsx("input",{type:"text",name:"name",placeholder:"Tu nombre o seudónimo",value:s.name,onChange:Ce,onKeyPress:ee=>ee.key==="Enter"&&Y&&!T&&Ht(),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Sinopsis ",d.jsx("span",{className:"text-gray-500 font-normal",children:"(opcional)"})]}),d.jsx("textarea",{name:"description",placeholder:"Cuéntanos de qué trata tu manga, qué lo hace especial...",value:s.description,onChange:Ce,onKeyDown:ee=>ee.key==="Enter"&&ee.ctrlKey&&Y&&!T&&Ht(),rows:3,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70 resize-none"})]})]})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Clasificación"})]}),d.jsx(Ei,{label:"Personajes",type:"character",categories:g,selectedIds:s.selectedCategories,onSelect:ee=>{s.selectedCategories.includes(ee)||o(Q=>({...Q,selectedCategories:[...Q.selectedCategories,ee]}))},onRemove:de,onCreate:ee=>Qe(ee,"character"),onDeleteCategory:dt,colorClass:"text-blue-400",placeholder:"Añadir personaje..."}),d.jsx(Ei,{label:"Series",type:"series",categories:g,selectedIds:s.selectedCategories,onSelect:ee=>{s.selectedCategories.includes(ee)||o(Q=>({...Q,selectedCategories:[...Q.selectedCategories,ee]}))},onRemove:de,onCreate:ee=>Qe(ee,"series"),onDeleteCategory:dt,colorClass:"text-green-400",placeholder:"Añadir serie..."}),d.jsx(Ei,{label:"Géneros",type:"genre",categories:g,selectedIds:s.selectedCategories,onSelect:ee=>{s.selectedCategories.includes(ee)||o(Q=>({...Q,selectedCategories:[...Q.selectedCategories,ee]}))},onRemove:de,onCreate:ee=>Qe(ee,"genre"),onDeleteCategory:dt,colorClass:"text-purple-400",placeholder:"Añadir género..."}),d.jsx(Ei,{label:"Etiquetas",type:"tag",categories:g,selectedIds:s.selectedCategories,onSelect:ee=>{s.selectedCategories.includes(ee)||o(Q=>({...Q,selectedCategories:[...Q.selectedCategories,ee]}))},onRemove:de,onCreate:ee=>Qe(ee,"tag"),onDeleteCategory:dt,colorClass:"text-pink-400",placeholder:"Añadir etiqueta..."})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Portada"}),d.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:"Opcional"})]}),c&&d.jsxs("div",{className:"mb-4",children:[d.jsx("div",{className:"flex items-center justify-between mb-2",children:d.jsx("span",{className:"text-xs font-semibold text-[#bb86fc]",children:"Procesando portada..."})}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out animate-pulse",style:{width:"100%"}})})]}),f&&!c&&d.jsxs("div",{className:"mb-4 relative group max-w-xs mx-auto",children:[d.jsx(Gn,{src:f,alt:"Preview",aspectRatio:"3/4",objectFit:"cover",loading:"eager",className:"rounded-xl border border-gray-600 shadow-2xl shadow-[#bb86fc]/20"}),d.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:d.jsx("button",{onClick:()=>{u(null),p(null),G(null)},className:"bg-red-600/80 hover:bg-red-600 text-white p-2 rounded-lg transition-all shadow-lg",children:d.jsx($r,{className:"w-4 h-4"})})}),we!==null&&d.jsxs("div",{className:"absolute bottom-2 left-2 bg-green-600/90 text-white text-xs px-2.5 py-1 rounded-lg font-semibold",children:["Página ",we+1]})]}),d.jsxs("div",{className:"flex gap-3 mb-4",children:[d.jsxs("label",{className:"flex-1 border-2 border-dashed border-gray-600/50 rounded-xl p-6 cursor-pointer hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all block group",children:[d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl flex items-center justify-center shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:c?d.jsx(gs,{size:24,borderWidth:2}):d.jsx(co,{className:"w-6 h-6 text-white"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-xs font-semibold text-white mb-0.5",children:c?"Procesando...":"Subir portada"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Archivo"})]})]}),d.jsx("input",{type:"file",accept:"image/*",onChange:Vt,disabled:c,className:"hidden"})]}),y.length>0&&d.jsxs("button",{onClick:()=>fe(!ie),className:"flex-1 border-2 border-dashed border-gray-600/50 rounded-xl p-6 hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all group flex flex-col items-center justify-center gap-2 bg-gradient-to-br from-[#1a1a1a] to-[#0f0f0f]",children:[d.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-[#9966dd] to-[#bb86fc] rounded-xl flex items-center justify-center shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:d.jsx(z0,{className:"w-6 h-6 text-white"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-xs font-semibold text-white mb-0.5",children:"Elegir página"}),d.jsxs("p",{className:"text-xs text-gray-400",children:[y.length," disponibles"]})]})]})]})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Páginas del Capítulo"}),d.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:"Opcional"}),d.jsxs("button",{onClick:()=>_e(!0),className:"bg-[#1a1a1a] hover:bg-[#242424] border border-gray-600/50 hover:border-[#bb86fc]/50 text-gray-300 hover:text-[#bb86fc] p-2 rounded-lg transition-all flex items-center gap-1.5 text-xs font-medium",title:"Configurar tamaño de lote de subida",children:[d.jsx(B0,{className:"w-3.5 h-3.5"}),d.jsxs("span",{className:"hidden sm:inline",children:["Subida: ",P===0?"Sin límite":`${P} por lote`]})]})]}),k&&d.jsxs("div",{className:"mb-5",children:[d.jsx("div",{className:"flex items-center justify-between mb-2",children:d.jsx("span",{className:"text-xs font-semibold text-[#bb86fc]",children:"Procesando enlaces..."})}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out animate-pulse",style:{width:"100%"}})})]}),y.length>0&&!k&&d.jsxs("div",{className:"mb-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(U0,{className:"w-3.5 h-3.5 text-gray-500"}),d.jsxs("p",{className:"text-xs text-gray-400",children:[y.length," página",y.length!==1?"s":""," • Arrastra para reordenar"]})]}),d.jsx("div",{className:"grid grid-cols-4 gap-2",children:y.map((ee,Q)=>d.jsxs("div",{draggable:!0,onDragStart:()=>ln(Q),onDragOver:V=>St(V,Q),onDragEnd:st,style:{animationDelay:`${Q*40}ms`},className:`relative group cursor-move opacity-0 animate-[fadeIn_0.7s_ease-out_forwards] ${U===Q?"opacity-50 scale-95":"hover:scale-105"} transition-all duration-200`,children:[d.jsxs("div",{className:"relative overflow-hidden w-full aspect-[3/4] rounded-lg border border-gray-600/50 shadow-md bg-black",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"24px",height:"24px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})}),d.jsx("img",{src:ee.thumbnail,alt:`Página ${Q+1}`,className:"w-full h-full object-cover transition-all duration-700 ease-out transform-gpu group-hover:scale-[1.08] group-hover:shadow-[#bb86fc]/30 opacity-0 scale-95",onLoad:V=>{var me;V.currentTarget.classList.remove("opacity-0","scale-95"),V.currentTarget.classList.add("opacity-100","scale-100");const K=(me=V.currentTarget.parentElement)==null?void 0:me.querySelector("div:nth-child(1)");K&&K.classList.add("opacity-0","pointer-events-none")}})]}),d.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity rounded-lg flex items-center justify-center gap-2",children:[d.jsx(U0,{className:"w-4 h-4 text-white/70"}),d.jsx("button",{onClick:()=>Rt(Q),className:"bg-red-600/80 hover:bg-red-600 text-white p-1.5 rounded-lg transition-all shadow-lg",children:d.jsx($r,{className:"w-3.5 h-3.5"})})]}),d.jsx("div",{className:"absolute top-1.5 left-1.5 bg-black/80 text-white text-xs px-2 py-0.5 rounded-md font-semibold",children:Q+1})]},Q))})]}),y.length===0&&d.jsxs("label",{className:"border-2 border-dashed border-gray-600/50 rounded-xl p-8 text-center hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all block group",children:[d.jsx("div",{className:"w-14 h-14 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl flex items-center justify-center mx-auto mb-4 shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:k?d.jsx(gs,{size:24,borderWidth:2}):d.jsx(z0,{className:"w-7 h-7 text-white"})}),d.jsx("p",{className:"text-sm font-semibold text-white mb-2",children:k?"Procesando...":"Sube tu archivo TXT"}),d.jsx("div",{className:"flex flex-col gap-4 max-w-lg mx-auto mt-4",children:d.jsxs("div",{className:"relative",children:[d.jsx("span",{className:"bg-[#1a1a1a] hover:bg-[#242424] border border-gray-600/50 text-white px-4 py-2 rounded-lg text-sm font-medium transition-all block w-max mx-auto cursor-pointer relative z-10",children:"Seleccionar Archivo .txt"}),d.jsx("input",{type:"file",accept:".txt",onChange:xt,disabled:k,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer z-20"})]})})]})]}),E&&d.jsxs("div",{className:"mb-6 bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-5 border border-[#bb86fc]/30 shadow-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(gs,{size:16,borderWidth:2}),d.jsxs("span",{className:"text-sm font-semibold text-white",children:["Subiendo imagen ",N," de ",C]})]}),d.jsxs("span",{className:"text-sm font-bold text-[#bb86fc]",children:[b,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-3 overflow-hidden border border-[#bb86fc]/40 shadow-inner",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] via-[#9966dd] to-[#bb86fc] h-full transition-all duration-500 ease-out relative overflow-hidden",style:{width:`${b}%`},children:d.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-pulse"})})}),d.jsx("p",{className:"text-xs text-gray-400 mt-2 text-center",children:"Por favor no cierres esta ventana..."})]}),d.jsxs("div",{className:"flex gap-3 pt-6 border-t border-gray-700/50",children:[Y&&i&&d.jsxs("button",{onClick:()=>{window.confirm("¿Estás seguro de que deseas eliminar este manga? Esta acción no se puede deshacer.")&&r&&(i(r.id),e())},className:"bg-red-500/10 border border-red-500/30 hover:bg-red-500/20 text-red-500 px-4 py-3 rounded-lg font-semibold text-sm transition-all flex items-center gap-2 mr-auto",children:[d.jsx($r,{className:"w-4 h-4"}),"Eliminar"]}),d.jsx("button",{onClick:Ye,disabled:T||E,className:"flex-1 bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-5 py-3 rounded-lg font-semibold text-sm transition-all shadow-md disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancelar"}),d.jsx("button",{onClick:Ht,disabled:T||E||!s.title.trim(),children:E?"Subiendo imágenes...":T?Y?"Actualizando...":"Creando...":Y?"Guardar Cambios":"Crear Manga"})]})]})]}),ie&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-2xl max-h-[80vh] shadow-2xl overflow-hidden flex flex-col",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between flex-shrink-0",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Selecciona portada"}),d.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Elige una página para usar como portada del manga"})]}),d.jsx("button",{onClick:()=>fe(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10 flex-shrink-0",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"overflow-y-auto flex-1 p-6",children:d.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-3",children:y.map((ee,Q)=>d.jsxs("button",{onClick:()=>Oe(Q),className:`group relative aspect-[3/4] rounded-lg overflow-hidden transition-all duration-300 hover:scale-105 border-2 ${we===Q?"border-green-500 shadow-lg shadow-green-500/40":"border-gray-600/50 hover:border-[#bb86fc]/50"}`,children:[d.jsxs("div",{className:"absolute inset-0 overflow-hidden bg-black flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"20px",height:"20px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})}),d.jsx("img",{src:ee.thumbnail,alt:`Página ${Q+1}`,className:"w-full h-full object-cover transition-all duration-700 ease-out transform-gpu group-hover:scale-[1.10] opacity-0 scale-95",onLoad:V=>{var me;V.currentTarget.classList.remove("opacity-0","scale-95"),V.currentTarget.classList.add("opacity-100","scale-100");const K=(me=V.currentTarget.parentElement)==null?void 0:me.querySelector("div:nth-child(1)");K&&K.classList.add("opacity-0","pointer-events-none")}})]}),d.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:d.jsx("div",{className:"bg-[#bb86fc]/90 text-white px-3 py-1.5 rounded-lg font-semibold text-sm",children:"Seleccionar"})}),d.jsx("div",{className:"absolute bottom-2 left-2 bg-black/80 text-white text-xs px-2 py-1 rounded-md font-semibold",children:Q+1}),we===Q&&d.jsxs("div",{className:"absolute top-2 right-2 bg-green-600/90 text-white px-2.5 py-1.5 rounded-lg flex items-center gap-1.5 font-semibold text-xs",children:[d.jsx("div",{className:"w-2 h-2 bg-white rounded-full"}),"Seleccionado"]})]},Q))})}),d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f]/80 to-[#1a1a1a]/80 border-t border-gray-700/30 px-6 py-4 flex items-center justify-end gap-3 flex-shrink-0",children:[d.jsx("button",{onClick:()=>fe(!1),className:"bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-4 py-2 rounded-lg font-semibold text-sm transition-all",children:"Cancelar"}),d.jsx("button",{onClick:()=>fe(!1),className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-4 py-2 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Confirmar"})]})]})}),pe&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-md shadow-2xl",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-lg shadow-lg shadow-[#bb86fc]/30",children:d.jsx(B0,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Configurar Subida"}),d.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Tamaño de lote de imágenes"})]})]}),d.jsx("button",{onClick:()=>_e(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border border-gray-700/40 rounded-lg p-4 mb-4",children:[d.jsx("h3",{className:"text-xs font-semibold text-gray-300 mb-2",children:"Opciones disponibles:"}),d.jsxs("ul",{className:"text-xs text-gray-400 space-y-1.5",children:[d.jsx("li",{children:"• 1 por lote: Más lento pero más estable"}),d.jsx("li",{children:"• 10 por lote: Balance entre velocidad y estabilidad (predeterminado)"}),d.jsx("li",{children:"• 50 por lote: Más rápido para muchas imágenes"}),d.jsx("li",{children:"• Sin límite: Sube todas las imágenes simultáneamente"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx("button",{onClick:()=>{$(1),au(1)},className:`p-4 rounded-lg border-2 transition-all ${P===1?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"1"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{$(10),au(10)},className:`p-4 rounded-lg border-2 transition-all ${P===10?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"10"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{$(50),au(50)},className:`p-4 rounded-lg border-2 transition-all ${P===50?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"50"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{$(0),au(999999)},className:`p-4 rounded-lg border-2 transition-all ${P===0||P>=999999?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"∞"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin límite"})]})})]}),d.jsx("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-3",children:d.jsxs("p",{className:"text-green-400 text-xs font-semibold",children:["Configuración guardada: ",P===0||P>=999999?"Sin límite":`${P} imagen${P!==1?"es":""} por lote`]})}),d.jsx("button",{onClick:()=>_e(!1),className:"w-full bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Cerrar"})]})]})})]}):null}const ES="settings",SS="announcement";async function kx(t,e){const n=Pt(Be,ES,SS),r=new Date;let i=null;e&&(i=new Date(r.getTime()+e).toISOString());const s={text:t,updatedAt:r.toISOString(),expiresAt:i};await OE(n,s)}function Ej(t){const e=Pt(Be,ES,SS);return wg(e,n=>{n.exists()?t(n.data()):t(null)})}function Sj({isOpen:t,onClose:e,isCategoryPlusEnabled:n,onCategoryPlusChange:r,isCopyIdsEnabled:i,onCopyIdsChange:s,isDeletePlusEnabled:o,onDeletePlusChange:a}){const[u,c]=F.useState(""),[h,f]=F.useState(24),[p,g]=F.useState("hours"),[_,T]=F.useState(!1);F.useEffect(()=>{},[t]);const R=async()=>{if(!u.trim()){kt.error("El texto del anuncio no puede estar vacío");return}let w=0;p==="seconds"&&(w=h*1e3),p==="minutes"&&(w=h*60*1e3),p==="hours"&&(w=h*60*60*1e3),p==="days"&&(w=h*24*60*60*1e3);try{await kx(u,w),kt.success("Anuncio publicado exitosamente"),c(""),e()}catch(k){console.error(k),kt.error("Error al publicar el anuncio")}},y=async()=>{try{await kx("",null),c(""),T(!1),kt.success("Anuncio eliminado.")}catch(w){console.error(w),kt.error("Error al eliminar")}};return t?d.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-lg shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-[#bb86fc]/10 rounded-lg text-[#bb86fc]",children:d.jsx($1,{className:"w-5 h-5"})}),d.jsx("h2",{className:"text-xl font-bold text-white",children:"Ajustes de Administrador"})]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-8 overflow-y-auto custom-scrollbar",children:[d.jsx("section",{className:"space-y-4",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`p-2 rounded-lg ${n?"bg-purple-500/10 text-purple-400":"bg-gray-800 text-gray-400"}`,children:d.jsx(F1,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-white",children:"Categorías Plus"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Habilitar selección múltiple y edición masiva"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",className:"sr-only peer",checked:n,onChange:w=>r(w.target.checked)}),d.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-purple-300 dark:peer-focus:ring-purple-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[#bb86fc]"})]})]})}),d.jsx("section",{className:"space-y-4 pt-4 border-t border-gray-800",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`p-2 rounded-lg ${i?"bg-blue-500/10 text-blue-400":"bg-gray-800 text-gray-400"}`,children:d.jsx(O1,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-white",children:"Copiar IDs Plus"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Habilitar selección masiva para copiar IDs"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",className:"sr-only peer",checked:i,onChange:w=>s(w.target.checked)}),d.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-500"})]})]})}),d.jsx("section",{className:"space-y-4 pt-4 border-t border-gray-800",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`p-2 rounded-lg ${o?"bg-red-500/10 text-red-500":"bg-gray-800 text-gray-400"}`,children:d.jsx($r,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-white",children:"Eliminar Plus"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Habilitar selección masiva para eliminar mangas"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",className:"sr-only peer",checked:o,onChange:w=>a(w.target.checked)}),d.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-red-300 dark:peer-focus:ring-red-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-red-500"})]})]})}),d.jsxs("section",{className:"space-y-4 pt-4 border-t border-gray-800",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-red-500/10 rounded-lg text-red-500",children:d.jsx(Bf,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Gestión de Vistas"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Restablecer contadores de visualización"})]})]}),d.jsx("button",{onClick:async()=>{if(window.confirm("¿Seguro que quieres reiniciar las vistas de TODOS los mangas a 0? Esta acción no se puede deshacer."))try{await zD(),kt.success("Vistas reiniciadas correctamente.")}catch(w){console.error(w),kt.error("Error al reiniciar vistas.")}},className:"w-full bg-red-500/10 hover:bg-red-500/20 text-red-500 py-2.5 rounded-lg font-semibold text-sm transition-all border border-red-500/20 hover:border-red-500/40",children:"Reiniciar Vistas a 0"})]}),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-px bg-gray-800"}),d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-purple-500/10 rounded-lg text-purple-400",children:d.jsx(U1,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Publicar Anuncio"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Visible para todos los usuarios"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("textarea",{value:u,onChange:w=>c(w.target.value),placeholder:"Escribe el mensaje del anuncio...",className:"w-full bg-[#1a1a1a] border border-gray-700 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-[#bb86fc] min-h-[100px] resize-none"}),d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("div",{className:"flex-1 bg-[#1a1a1a] border border-gray-700 rounded-lg px-3 py-2 flex items-center gap-2",children:[d.jsx(o2,{className:"w-4 h-4 text-gray-400"}),d.jsx("input",{type:"number",min:"1",value:h,onChange:w=>f(Number(w.target.value)),className:"bg-transparent text-white text-sm w-full focus:outline-none"})]}),d.jsxs("select",{value:p,onChange:w=>g(w.target.value),className:"bg-[#1a1a1a] border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-[#bb86fc]",children:[d.jsx("option",{value:"seconds",children:"Segundos"}),d.jsx("option",{value:"minutes",children:"Minutos"}),d.jsx("option",{value:"hours",children:"Horas"}),d.jsx("option",{value:"days",children:"Días"})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>T(!0),className:"px-4 py-2.5 rounded-lg font-semibold text-sm bg-red-500/10 text-red-500 border border-red-500/20 hover:bg-red-500/20 transition-colors",title:"Eliminar anuncio",children:d.jsx($r,{className:"w-5 h-5"})}),d.jsx("button",{onClick:R,className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white py-2.5 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/20",children:"Publicar Anuncio"})]})]})]})]})]}),_&&d.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-6 animate-in fade-in duration-200",children:d.jsx("div",{className:"bg-[#1a1a1a] border border-gray-700 w-full max-w-sm rounded-xl shadow-2xl p-6 transform scale-100 animate-in zoom-in-95 duration-200",children:d.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[d.jsx("div",{className:"p-3 bg-red-500/10 rounded-full text-red-500",children:d.jsx($r,{className:"w-8 h-8"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"¿Eliminar anuncio?"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Esta acción eliminará el anuncio actual inmediatamente. No se puede deshacer."})]}),d.jsxs("div",{className:"flex gap-3 w-full mt-2",children:[d.jsx("button",{onClick:()=>T(!1),className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:bg-gray-800 transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:y,className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold bg-red-500 hover:bg-red-600 text-white transition-colors shadow-lg shadow-red-500/20",children:"Eliminar"})]})]})})})]})}):null}function Tj({isAdmin:t}){const[e,n]=F.useState(""),[r,i]=F.useState(null),[s,o]=F.useState(""),[a,u]=F.useState(!0);return F.useEffect(()=>{const c=Ej(h=>{h?(n(h.text),i(h.expiresAt)):(n(""),i(null)),u(!1)});return()=>c()},[]),F.useEffect(()=>{if(!r){o("");return}const c=setInterval(()=>{const h=new Date().getTime(),p=new Date(r).getTime()-h;if(p<=0)n(""),i(null),clearInterval(c);else{const g=Math.floor(p/864e5),_=Math.floor(p%(1e3*60*60*24)/(1e3*60*60)),T=Math.floor(p%(1e3*60*60)/(1e3*60)),R=Math.floor(p%(1e3*60)/1e3);let y="";g>0&&(y+=`${g}d `),y+=`${_.toString().padStart(2,"0")}h ${T.toString().padStart(2,"0")}m ${R.toString().padStart(2,"0")}s`,o(y)}},1e3);return()=>clearInterval(c)},[r]),!e&&!a||!e?null:d.jsx("div",{className:"w-full max-w-[1800px] mx-auto px-4 sm:px-6 md:px-12 mt-6 mb-8 animate-in fade-in slide-in-from-top-4 duration-500 flex justify-center",children:d.jsxs("div",{className:"bg-gradient-to-r from-[#bb86fc]/20 to-[#121212] border border-[#bb86fc]/30 rounded-xl p-6 flex flex-col items-center gap-4 shadow-lg shadow-[#bb86fc]/10 relative group backdrop-blur-sm max-w-2xl w-full text-center",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2.5 bg-[#bb86fc]/20 rounded-lg animate-pulse",children:d.jsx(U1,{className:"w-6 h-6 text-[#bb86fc]"})}),d.jsxs("h3",{className:"text-sm font-bold text-[#bb86fc] uppercase tracking-wider flex items-center gap-2",children:["Información Importante",d.jsx("span",{className:"w-2 h-2 rounded-full bg-[#bb86fc] animate-ping"})]})]}),d.jsx("div",{className:"text-base text-gray-200 leading-relaxed whitespace-pre-wrap font-medium max-w-lg",children:e}),s&&d.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-gray-400 bg-black/30 px-3 py-1.5 rounded-full border border-gray-800",children:[d.jsx(u2,{className:"w-3.5 h-3.5"}),d.jsxs("span",{children:["Expira en: ",s]})]})]})})}const TS=()=>"",Ij=t=>{if(!t)return;if(t.startsWith("blob:")||t.startsWith("data:"))return t;const e=TS(),n=new URLSearchParams({url:t,width:"600",quality:"85",format:"webp"});return`${e}/api/image-proxy?${n.toString()}`},kj=(t,e)=>{if(!t)return"";if(t.startsWith("blob:")||t.startsWith("data:"))return t;const n=TS(),r=new URLSearchParams({url:t});return`${n}/api/image-proxy?${r.toString()}`};function IS({id:t,title:e,author:n,pageCount:r,thumbnail:i,manga:s,onSelect:o,onEdit:a,onDelete:u,isCategoryPlusEnabled:c,isSelected:h,onToggleSelect:f}){const[p,g]=F.useState(!1),_=i?Ij(i):void 0,T=w=>{w.stopPropagation(),g(!0)},R=w=>{w.stopPropagation(),u==null||u(t),g(!1)},y=w=>{w.stopPropagation(),s&&(a==null||a(s))};return d.jsxs("div",{className:"group cursor-pointer flex flex-col w-full max-w-xs",children:[d.jsxs("div",{onClick:()=>{c&&f?f():(BD(t),o==null||o(t))},className:`relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02] aspect-[2/3] ${h?"ring-4 ring-[#bb86fc]":""}`,children:[_?d.jsxs(d.Fragment,{children:[d.jsx(Gn,{src:_,alt:e,aspectRatio:"2/3",objectFit:"cover",loading:"lazy",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-gradient-to-br from-gray-800 to-gray-900 rounded-lg group-hover:text-white/60",children:d.jsx(nl,{className:"w-12 h-12"})}),d.jsxs("div",{className:"absolute bottom-2 left-2 bg-black/70 text-white text-xs px-2 py-1 rounded-md font-semibold opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[r," paginas"]}),c&&d.jsx("div",{className:`absolute top-2 left-2 w-6 h-6 rounded-md border-2 flex items-center justify-center transition-all ${h?"bg-[#bb86fc] border-[#bb86fc]":"bg-black/50 border-white/50 hover:border-white"}`,children:h&&d.jsx(wl,{className:"w-4 h-4 text-white"})}),!c&&d.jsxs("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex gap-1",children:[s&&a&&d.jsx("button",{onClick:y,className:"bg-black/60 hover:bg-purple-600 text-white p-1.5 rounded-full transition-colors backdrop-blur-sm",title:"Editar manga",children:d.jsx(z1,{className:"w-3 h-3"})}),u&&d.jsx("button",{onClick:T,className:"bg-black/60 hover:bg-red-600 text-white p-1.5 rounded-full transition-colors backdrop-blur-sm",title:"Eliminar manga",children:d.jsx($r,{className:"w-3 h-3"})})]}),p&&d.jsxs("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex flex-col items-center justify-center gap-3 rounded-lg z-20 animate-in fade-in duration-200",children:[d.jsx("p",{className:"text-white text-sm font-semibold text-center px-3",children:"Eliminar manga?"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:w=>{w.stopPropagation(),g(!1)},className:"bg-gray-600 hover:bg-gray-700 text-white px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200 transform hover:scale-105 active:scale-95",children:"Cancelar"}),d.jsx("button",{onClick:R,className:"bg-red-600 hover:bg-red-700 text-white px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200 transform hover:scale-105 active:scale-95",children:"Eliminar"})]})]})]}),d.jsxs("div",{className:"mt-1 sm:mt-2 flex flex-col gap-0.5 text-center mb-2",children:[d.jsx("h3",{onClick:()=>o==null?void 0:o(t),className:"font-semibold text-xs sm:text-sm text-white line-clamp-2 cursor-pointer text-center group-hover:text-purple-400 transition-colors duration-300 ease-out",children:e}),n&&n.trim()!==""&&n.toLowerCase()!=="anónimo"&&n.toLowerCase()!=="anonimo"&&d.jsx("p",{className:"text-xs text-gray-400 text-center group-hover:text-gray-300 transition-colors duration-300 ease-out",children:n})]})]})}function Cj({id:t,onBack:e,onNavigateToManga:n,onMangaLoaded:r,onSelectCategory:i,onSelectAuthor:s,isAdmin:o=!1}){var he,$e,je,He,et;const[a,u]=F.useState(null),[c,h]=F.useState(!0),[f,p]=F.useState(!1),[g,_]=F.useState(0),[T,R]=F.useState(!1),[y,w]=F.useState(!1),[k,L]=F.useState(!1),[U,j]=F.useState(0),[b,x]=F.useState(!1),[E,I]=F.useState({name:"",url:""}),[N,D]=F.useState([]),[C,ge]=F.useState("portrait"),[ie,fe]=F.useState("vertical"),[we,G]=F.useState(!1),[se,A]=F.useState(0),[pe,_e]=F.useState([]),[P,$]=F.useState(!1),[Y,re]=F.useState(""),[Ce,de]=F.useState([]),[Qe,Ze]=F.useState(!1),[dt,Vt]=F.useState(!1),[xt,Rt]=F.useState(1),[ln,St]=F.useState(1),st=6,Ht=()=>St(H=>Math.min(H+.25,3)),Oe=()=>St(H=>Math.max(H-.25,.5)),Ye=()=>St(1);F.useEffect(()=>{me();const H=FD(t,be=>{be&&(u(()=>be),h(!1))});ee(),re("");const Z=localStorage.getItem("manga-view-mode");return(Z==="vertical"||Z==="gallery"||Z==="grid")&&fe(Z),()=>H()},[t]);async function ee(){try{Ze(!0);const H=await Rd();de(H)}catch(H){console.error("Error loading all mangas:",H)}finally{Ze(!1)}}F.useEffect(()=>{function H(Z){const be=Z.target;T&&!be.closest(".download-menu-container")&&R(!1),y&&!be.closest(".pdf-menu-container")&&w(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[T,y]);const Q=async()=>{if(E.name.trim()&&E.url.trim()&&a)try{await $D(a.id,E),D([...N,E]),I({name:"",url:""}),x(!1)}catch(H){console.error("Error al guardar el enlace:",H),alert("Error al guardar el enlace")}},V=async H=>{if(a)try{await HD(a.id,H),D(N.filter((Z,be)=>be!==H))}catch(Z){console.error("Error al eliminar el enlace:",Z),alert("Error al eliminar el enlace")}},K=H=>{fe(H),localStorage.setItem("manga-view-mode",H)};async function me(){try{h(!0);const H=await vS(t);if(H){if(u(H),D(H.external_links||[]),H.cover_url)try{const Z=await p2(H.cover_url);ge(Z)}catch(Z){console.warn("Failed to detect image orientation:",Z),ge("portrait")}O(H)}}catch(H){console.error("Error loading manga:",H)}finally{}}async function O(H){var Z;try{$(!0);const be=((Z=H.categories)==null?void 0:Z.map(ve=>ve.id))||[],ye=await qD(H.id,be,H.title);_e(ye),Rt(1)}catch(be){console.error("Error loading recommendations:",be)}finally{$(!1)}}async function B(H){const Z=(a==null?void 0:a.id)||t;if(!Z){alert("Error: ID no encontrado.");return}const be=Z;console.log(`🚀 [CLIENTE] Suscribiendo a progreso: ${be}`);const ye=new EventSource(`/api/download/progress/${be}`);ye.onmessage=ve=>{const Xe=JSON.parse(ve.data);_(Xe.progress),Xe.progress>=100&&ye.close()};try{console.log("🚀 [CLIENTE] Iniciando descarga para ID:",Z),p(!0),R(!1),_(0);const ve=await fetch("/api/download/zip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mangaId:Z,mangaTitle:(a==null?void 0:a.title)||"Descarga",format:H,jobId:be})});if(!ve.ok)throw new Error("Error en el servidor");const Xe=await ve.blob(),wt=window.URL.createObjectURL(Xe),Ee=document.createElement("a");Ee.href=wt,Ee.download=`${(a==null?void 0:a.title)||"manga"}.zip`,document.body.appendChild(Ee),Ee.click(),Ee.remove(),window.URL.revokeObjectURL(wt),console.log("✅ [CLIENTE] Descarga disparada con éxito")}catch(ve){console.error("❌ Error en la descarga:",ve),alert("Hubo un fallo en la matriz de descarga.")}finally{p(!1),ye.close()}}async function oe(H){const Z=(a==null?void 0:a.id)||t;if(!Z){alert("Error: ID no encontrado.");return}const be=Z;console.log(`🚀 [CLIENTE] Suscribiendo a progreso PDF: ${be}`);const ye=new EventSource(`/api/download/progress/${be}`);ye.onmessage=ve=>{const Xe=JSON.parse(ve.data);Xe.progress&&j(Xe.progress),Xe.progress>=100&&ye.close()};try{console.log("🚀 [CLIENTE] Iniciando PDF para ID:",Z),L(!0),j(0),w(!1);const ve=await fetch("/api/download/pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mangaId:Z,mangaTitle:(a==null?void 0:a.title)||"Descarga",format:H,jobId:be})});if(!ve.ok)throw new Error("Error en el servidor al generar PDF");const Xe=await ve.blob(),wt=window.URL.createObjectURL(Xe),Ee=document.createElement("a");Ee.href=wt,Ee.download=`${(a==null?void 0:a.title)||"manga"}.pdf`,document.body.appendChild(Ee),Ee.click(),Ee.remove(),window.URL.revokeObjectURL(wt),console.log("✅ [CLIENTE] PDF descargado con éxito")}catch(ve){console.error("Error initiating PDF generation:",ve),alert("Error al generar PDF (puede que el archivo sea muy grande o Python falló).")}finally{L(!1),ye.close()}}if(c)return d.jsxs("div",{className:"h-screen bg-[#121212] flex flex-col items-center justify-center gap-4",children:[d.jsx(gs,{size:40,borderWidth:2}),d.jsx("div",{className:"text-gray-400 text-sm",children:"Cargando..."})]});if(!a)return d.jsx("div",{className:"h-screen bg-[#121212] flex items-center justify-center",children:d.jsx("div",{className:"text-gray-400 text-lg",children:"Manga no encontrado"})});const le=Y.trim()?Ce.filter(H=>{var Xe;if(!H.id||!H.title||H.id===a.id)return!1;const Z=Y.toLowerCase(),be=H.title.toLowerCase().includes(Z),ye=H.author?H.author.toLowerCase().includes(Z):!1,ve=((Xe=H.categories)==null?void 0:Xe.some(wt=>{var Ee;return(Ee=wt==null?void 0:wt.name)==null?void 0:Ee.toLowerCase().includes(Z)}))||!1;return be||ye||ve}):[];return d.jsxs("div",{className:"h-screen flex flex-col bg-[#121212] overflow-hidden",children:[d.jsx("header",{className:"border-b border-gray-800 z-40 bg-[#121212] flex-shrink-0",children:d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-3 sm:py-4 flex items-center gap-3 sm:gap-4",children:[d.jsx("button",{onClick:e,className:"p-2 hover:bg-[#333] rounded-lg transition-colors text-gray-300 hover:text-white flex-shrink-0",children:d.jsx(To,{className:"w-5 h-5"})}),d.jsx("h1",{className:"text-base sm:text-lg font-bold text-white truncate flex-shrink-0",children:a.title}),d.jsx("div",{className:"flex-1 max-w-md ml-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx(mc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),d.jsx("input",{type:"text",placeholder:"Buscar comics…",value:Y,onChange:H=>re(H.target.value),className:"w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-3 py-2 text-sm placeholder-gray-400 focus:ring-2 focus:ring-[#bb86fc] focus:outline-none transition-all border border-gray-700/50 focus:border-[#bb86fc]"})]})})]})}),d.jsxs("main",{className:"flex-1 overflow-y-auto bg-[#121212]",children:[d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-4 sm:py-8",children:[!Y.trim()&&d.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-6",children:[d.jsx("div",{className:"flex-shrink-0 mx-auto sm:mx-0",children:d.jsx("div",{className:"group w-56 sm:w-64",children:d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",children:a.cover_url?d.jsxs(d.Fragment,{children:[d.jsx(Gn,{src:a.cover_url,alt:a.title,aspectRatio:"2/3",objectFit:"cover",loading:"eager",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-black",children:d.jsx(F0,{className:"w-16 h-16"})})})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h2",{className:"text-2xl sm:text-4xl font-bold text-white mb-3 sm:mb-4",children:a.title}),d.jsx("div",{className:"mb-4",children:d.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.author&&a.author.toLowerCase()!=="anónimo"&&a.author.toLowerCase()!=="anonimo"&&d.jsxs(d.Fragment,{children:[d.jsx(Cm,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsx("button",{onClick:()=>s==null?void 0:s(a.author),className:"text-sm hover:text-[#bb86fc] hover:underline transition-colors",children:a.author}),d.jsx("div",{className:"w-1 h-1 bg-gray-600 rounded-full mx-2"})]}),d.jsx(Bf,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsxs("span",{className:"text-sm",children:[((he=a.views)==null?void 0:he.toLocaleString())||0," vistas"]})]})}),d.jsxs("div",{className:"mb-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Categorías"}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:($e=a.categories)==null?void 0:$e.sort((H,Z)=>{const be={series:1,character:2,genre:3,tag:4,other:5},ye=H.type||"genre",ve=Z.type||"genre";return(be[ye]||5)-(be[ve]||5)}).map(H=>{let Z="bg-[#bb86fc]/20 text-[#bb86fc] border-[#bb86fc]/40";return H.type==="character"?Z="bg-blue-500/20 text-blue-300 border-blue-500/30":H.type==="series"?Z="bg-green-500/20 text-green-300 border-green-500/30":H.type==="tag"&&(Z="bg-pink-500/20 text-pink-300 border-pink-500/30"),d.jsx("button",{onClick:()=>i==null?void 0:i(H.name),className:`px-3 py-1.5 text-xs rounded-full border ${Z} hover:opacity-80 transition-opacity cursor-pointer`,children:H.name},H.id)})})]}),a.description&&a.description.trim()!==""&&d.jsxs("div",{className:"mb-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Sinopsis"}),d.jsx("p",{className:"text-sm text-gray-400 leading-relaxed whitespace-pre-wrap",children:a.description})]}),d.jsx("div",{className:"flex flex-col gap-3 sm:gap-4",children:a.chapters&&a.chapters.length>0&&a.chapters[0].pages&&a.chapters[0].pages.length>0&&d.jsxs(d.Fragment,{children:[f&&d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs sm:text-sm font-semibold text-[#bb86fc]",children:"Descargando ZIP"}),d.jsxs("span",{className:"text-xs sm:text-sm font-bold text-[#bb86fc]",children:[g,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${g}%`}})})]}),k&&d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs sm:text-sm font-semibold text-[#bb86fc]",children:"Generando PDF"}),d.jsxs("span",{className:"text-xs sm:text-sm font-bold text-[#bb86fc]",children:[U,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${U}%`}})})]}),d.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[d.jsxs("div",{className:"relative download-menu-container",children:[d.jsxs("button",{onClick:()=>R(!T),disabled:f,className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx(ua,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:f?`Descargando (${g}%)`:"ZIP"}),d.jsx("span",{className:"sm:hidden",children:"ZIP"})]}),T&&!f&&d.jsxs("div",{className:"absolute top-full mt-2 left-0 bg-[#1f1f1f] border border-gray-700/60 rounded-lg shadow-2xl shadow-black/50 overflow-hidden z-50 min-w-[200px]",children:[d.jsxs("button",{onClick:()=>B("original"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"Original"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin cambios"})]})]}),d.jsxs("button",{onClick:()=>B("webp"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"WebP"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Optimizado"})]})]}),d.jsxs("button",{onClick:()=>B("png"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"PNG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin pérdida"})]})]}),d.jsxs("button",{onClick:()=>B("jpg"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2",children:[d.jsx(ua,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"JPG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Comprimido"})]})]})]})]}),d.jsxs("div",{className:"relative pdf-menu-container",children:[d.jsxs("button",{onClick:()=>w(!y),disabled:k,className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx(ca,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:k?`Generando (${U}%)`:"PDF"}),d.jsx("span",{className:"sm:hidden",children:"PDF"})]}),y&&!k&&d.jsxs("div",{className:"absolute top-full mt-2 left-0 bg-[#1f1f1f] border border-gray-700/60 rounded-lg shadow-2xl shadow-black/50 overflow-hidden z-50 min-w-[200px]",children:[d.jsxs("button",{onClick:()=>oe("original"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"Original"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin cambios"})]})]}),d.jsxs("button",{onClick:()=>oe("webp"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"WebP"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Optimizado"})]})]}),d.jsxs("button",{onClick:()=>oe("png"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"PNG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin pérdida"})]})]}),d.jsxs("button",{onClick:()=>oe("jpg"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2",children:[d.jsx(ca,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"JPG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Comprimido"})]})]})]})]}),d.jsxs("button",{onClick:()=>{a!=null&&a.id&&(window.location.hash=`manga/${a.id}/hd`)},className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200",children:[d.jsx(Bf,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:"Ver HD"}),d.jsx("span",{className:"sm:hidden",children:"HD"})]}),d.jsxs("button",{onClick:async()=>{try{await navigator.clipboard.writeText(a.id),Vt(!0),setTimeout(()=>Vt(!1),2e3),window.open("https://t.me/twistedbrodymangaflowbot","_blank")}catch(H){console.error("Failed to copy:",H)}},className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200",children:[dt?d.jsx(wl,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}):d.jsx(l2,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:dt?"ID Copiado":"Bot Telegram"}),d.jsx("span",{className:"sm:hidden",children:dt?"Copiado":"Bot"})]}),N.map((H,Z)=>d.jsxs("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1.5 font-semibold text-xs sm:text-sm transition-all duration-200 group",children:[d.jsx(a2,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"truncate max-w-[150px]",children:H.name}),o&&d.jsx("button",{onClick:be=>{be.preventDefault(),be.stopPropagation(),V(Z)},className:"opacity-0 group-hover:opacity-100 hover:text-red-400 transition-all flex-shrink-0",children:d.jsx(In,{className:"w-3 h-3 sm:w-4 sm:h-4"})})]},Z)),o&&d.jsx("button",{onClick:()=>x(!0),className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] p-1.5 sm:p-2 rounded-lg transition-all duration-200 flex items-center justify-center",title:"Añadir enlace externo",children:d.jsx(co,{className:"w-4 h-4 sm:w-5 sm:h-5"})})]})]})})]})]}),Y.trim()?d.jsxs("div",{className:"mt-2",children:[d.jsxs("h3",{className:"text-lg font-semibold text-white mb-4",children:["Resultados de búsqueda",le.length>0&&d.jsxs("span",{className:"text-sm text-gray-400 ml-2",children:["(",le.length," ",le.length===1?"resultado":"resultados",")"]})]}),Qe?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(gs,{size:40,borderWidth:2})}):le.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[d.jsx(mc,{className:"w-12 h-12 text-gray-600 mb-3"}),d.jsxs("p",{className:"text-gray-400 text-sm",children:['No se encontraron comics que coincidan con "',Y,'"']})]}):d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3",children:le.map(H=>{var be,ye;if(!H.id||!H.title)return null;(be=H.chapters)!=null&&be.length;const Z=((ye=H.chapters)==null?void 0:ye.reduce((ve,Xe)=>{var wt;return ve+(((wt=Xe.pages)==null?void 0:wt.length)||0)},0))||0;return d.jsx(IS,{id:H.id,title:H.title,author:H.author||"Desconocido",pageCount:Z,thumbnail:H.cover_url||H.thumbnail_url||void 0,manga:H,onSelect:ve=>{n&&(window.scrollTo({top:0,behavior:"smooth"}),n(ve))}},H.id)})})]}):a.chapters&&a.chapters.length>0&&a.chapters[0].pages&&a.chapters[0].pages.length>0&&d.jsxs("div",{className:"mt-6 sm:mt-8 border-t border-gray-800 pt-6 sm:pt-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4 sm:mb-6",children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:"Páginas"}),d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsxs("button",{onClick:()=>K("vertical"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${ie==="vertical"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista vertical",children:[d.jsx(qf,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Vertical"})]}),d.jsxs("button",{onClick:()=>K("gallery"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${ie==="gallery"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista galería",children:[d.jsx($f,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Galería"})]}),d.jsxs("button",{onClick:()=>K("grid"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${ie==="grid"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista cuadrícula",children:[d.jsx(Hf,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Cuadrícula"})]}),ie==="vertical"&&d.jsxs("div",{className:"flex items-center gap-1 ml-2 border-l border-gray-700 pl-2",children:[d.jsx("button",{onClick:Oe,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Reducir",children:d.jsx(Am,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-xs text-gray-300 w-8 text-center hidden sm:inline-block",children:[Math.round(ln*100),"%"]}),d.jsx("button",{onClick:Ht,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Aumentar",children:d.jsx(Nm,{className:"w-4 h-4"})}),d.jsx("button",{onClick:Ye,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Restablecer",children:d.jsx(km,{className:"w-3 h-3"})})]})]})]}),d.jsx("div",{className:`bg-[#121212] rounded-lg p-2 sm:p-4 transition-all duration-150 ease-out ${ie==="vertical"?"flex flex-col items-center gap-4":ie==="gallery"?"masonry-container":"grid grid-cols-3 md:grid-cols-5 gap-2"}`,children:ie==="gallery"?a.chapters[0].pages.map((H,Z)=>({pageUrl:H,index:Z})).map(({pageUrl:H,index:Z})=>d.jsx("div",{className:"masonry-item group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",onClick:()=>{A(Z),G(!0)},children:d.jsx(Gn,{src:H,alt:`Página ${Z+1}`,aspectRatio:"auto",objectFit:"contain",loading:Z>2?"lazy":"eager",className:"rounded-lg",imgClassName:"group-hover:scale-110"})},Z)):a.chapters[0].pages.map((H,Z)=>({pageUrl:H,index:Z})).map(({pageUrl:H,index:Z})=>d.jsx("div",{className:ie==="vertical"?"relative transition-all duration-200 mx-auto":"group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",style:ie==="vertical"?{width:`${Math.min(100*ln,100)}%`,maxWidth:ln>1?"none":void 0}:void 0,onClick:()=>{ie==="grid"&&(A(Z),G(!0))},children:d.jsx(Gn,{src:H,alt:`Página ${Z+1}`,aspectRatio:ie==="vertical"?"auto":"1/1",objectFit:ie==="vertical"?"contain":"cover",loading:Z>2?"lazy":"eager",className:ie==="vertical"?"rounded-lg shadow-2xl w-full":"rounded-lg",imgClassName:ie==="vertical"?"w-full":"group-hover:scale-110"})},Z))})]}),!Y.trim()&&pe.length>0&&d.jsxs("div",{className:"mt-8 sm:mt-12 border-t border-gray-800 pt-8 sm:pt-12",children:[d.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-white mb-6",children:"Recomendaciones"}),P?d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3",children:Array.from({length:6}).map((H,Z)=>d.jsxs("div",{className:"animate-pulse",children:[d.jsx("div",{className:"bg-gray-800 rounded-lg aspect-[2/3] w-full mb-2"}),d.jsx("div",{className:"h-3 bg-gray-800 rounded w-3/4 mx-auto mb-1"}),d.jsx("div",{className:"h-2 bg-gray-800 rounded w-1/2 mx-auto"})]},Z))}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 mb-6 animate-slide-in-right",children:pe.slice((xt-1)*st,xt*st).map((H,Z)=>d.jsx("div",{children:d.jsxs("div",{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"}),n&&n(H.id)},className:"group cursor-pointer flex flex-col",children:[d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",children:H.cover_url||H.thumbnail_url?d.jsxs(d.Fragment,{children:[d.jsx(Gn,{src:H.cover_url||H.thumbnail_url||"",alt:H.title,aspectRatio:"2/3",objectFit:"cover",loading:"lazy",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-black",children:d.jsx(F0,{className:"w-8 h-8"})})}),d.jsxs("div",{className:"mt-2 flex flex-col gap-0.5",children:[d.jsx("h4",{className:"font-semibold text-xs text-white line-clamp-2 text-center group-hover:text-[#bb86fc] transition-colors duration-300",children:H.title}),H.categories&&H.categories.length>0&&d.jsx("p",{className:"text-xs text-gray-500 text-center truncate",children:(H.categories.find(be=>be.type==="series")||H.categories[0]).name})]})]})},H.id))},xt),pe.length>st&&d.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4 flex-wrap",children:[d.jsx("button",{onClick:()=>Rt(1),disabled:xt===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(j1,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>Rt(H=>Math.max(1,H-1)),disabled:xt===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(nd,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-sm text-gray-400 px-2",children:["Página ",xt," de ",Math.ceil(pe.length/st)]}),d.jsx("button",{onClick:()=>Rt(H=>Math.min(Math.ceil(pe.length/st),H+1)),disabled:xt===Math.ceil(pe.length/st),className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(rd,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>Rt(Math.ceil(pe.length/st)),disabled:xt===Math.ceil(pe.length/st),className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(L1,{className:"w-4 h-4"})})]})]})]})]}),d.jsx(id,{})]}),we&&((He=(je=a.chapters)==null?void 0:je[0])==null?void 0:He.pages)&&d.jsx(H1,{images:((et=a.chapters)==null?void 0:et[0].pages)||[],initialIndex:se,onClose:()=>G(!1)}),b&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-md shadow-2xl",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between",children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Añadir Enlace Externo"}),d.jsx("button",{onClick:()=>x(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-200 mb-2",children:"Nombre del Enlace"}),d.jsx("input",{type:"text",placeholder:"Ej: Servidor Alternativo",value:E.name,onChange:H=>I({...E,name:H.target.value}),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-200 mb-2",children:"URL del Enlace"}),d.jsx("input",{type:"url",placeholder:"https://ejemplo.com/descarga",value:E.url,onChange:H=>I({...E,url:H.target.value}),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all"})]}),d.jsxs("div",{className:"flex gap-3 pt-2",children:[d.jsx("button",{onClick:()=>x(!1),className:"flex-1 bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all",children:"Cancelar"}),d.jsx("button",{onClick:Q,disabled:!E.name.trim()||!E.url.trim(),className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] disabled:opacity-50 disabled:cursor-not-allowed text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Añadir Enlace"})]})]})]})})]})}function Nj({manga:t,chapter:e,onBack:n}){const[r,i]=F.useState(0);if(!e.pages||e.pages.length===0)return d.jsxs("div",{className:"h-screen bg-[#121212] flex flex-col items-center justify-center",children:[d.jsx("button",{onClick:n,className:"absolute top-6 left-6 p-2 hover:bg-[#333] rounded-lg transition-colors text-gray-300 hover:text-white",children:d.jsx(To,{className:"w-5 h-5"})}),d.jsx("div",{className:"text-gray-400 text-lg",children:"No hay páginas disponibles"})]});const s=()=>{r>0&&i(r-1)},o=()=>{r{const c=u<2,h=kj(a);return d.jsx("div",{className:"w-full flex justify-center",children:d.jsx(Gn,{src:h,alt:`Página ${u+1}`,aspectRatio:"auto",objectFit:"contain",loading:c?"eager":"lazy",className:"max-w-full shadow-2xl",showPlaceholder:u>0})},u)}),d.jsx("div",{className:"w-full mt-8",children:d.jsx(id,{})})]})}),d.jsx("div",{className:"border-t border-gray-700/60 bg-gradient-to-r from-[#2a2a2a] to-[#252525] px-6 py-6 flex-shrink-0",children:d.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[d.jsxs("button",{onClick:s,disabled:r===0,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-all",children:[d.jsx(nd,{className:"w-5 h-5"}),"Anterior"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"range",min:"0",max:e.pages.length-1,value:r,onChange:a=>i(parseInt(a.target.value)),className:"w-64 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-[#bb86fc]"}),d.jsxs("span",{className:"text-sm text-gray-400 w-12 text-right",children:[r+1,"/",e.pages.length]})]}),d.jsxs("button",{onClick:o,disabled:r===e.pages.length-1,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-all",children:["Siguiente",d.jsx(rd,{className:"w-5 h-5"})]})]})})]})}const kS="settings",CS="info",Aj=`# Bienvenid@ a Twisted Brody MangaFlow +¡Tu plataforma definitiva para la gestión y lectura de mangas! + +Este proyecto nació con la misión de ofrecer una experiencia de lectura fluida, moderna y sin interrupciones, diseñada por fans para fans. + +## 🌟 Características Principales + +* **⚡ Lectura sin límites:** Disfruta de una interfaz optimizada, rápida y responsiva. +* **📥 Descargas Flexibles:** Baja tus capítulos favoritos en formato **ZIP** o **PDF** para leer offline. +* **🔄 Conversión Inteligente:** Nuestro servidor procesa las imágenes para darte la mejor calidad y compatibilidad. + +## 🤝 Comunidad y Apoyo + +Este es un proyecto **sin fines de lucro**, desarrollado por pura pasión. + +Sin embargo, si valoras mi trabajo y quieres apoyarme para mantener el proyecto vivo, puedes suscribirte a mi **Patreon**. ¡Tu apoyo significa mucho! + +* [**💜 Apóyame en Patreon**](https://www.patreon.com/cw/Twistedbrody) + +### 💡 ¿Tienes nuevas ideas? +¡Quiero escucharlas! Si tienes sugerencias, feedback o ideas locas, háblame directamente: + +* **Telegram:** [@twistedbrodyoficial](https://t.me/twistedbrodyoficial) + +También puedes unirte a nuestros canales: +* [Canal Principal](https://t.me/twistedbrody) +* [Canal Hub](https://t.me/+CmmZFHM9hpViYzMx) +* [X (Twitter)](https://x.com/TwistedBrody) + +--- +> **Disclaimer:** Todo el contenido es propiedad de sus respectivos autores. Apoya el material original siempre que sea posible. + + +`;async function Pj(t){const e=Pt(Be,kS,CS),n={content:t,updatedAt:new Date().toISOString()};await OE(e,n)}function Rj(t){const e=Pt(Be,kS,CS);return wg(e,n=>{n.exists()?t(n.data()):t({content:Aj,updatedAt:new Date().toISOString()})})}function Dj(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oj={};function Cx(t,e){return(Oj.jsx?Lj:jj).test(t)}const Mj=/[ \t\n\f\r]/g;function Vj(t){return typeof t=="object"?t.type==="text"?Nx(t.value):!1:Nx(t)}function Nx(t){return t.replace(Mj,"")===""}class Dl{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Dl.prototype.normal={};Dl.prototype.property={};Dl.prototype.space=void 0;function NS(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Dl(n,r,e)}function bp(t){return t.toLowerCase()}class An{constructor(e,n){this.attribute=n,this.property=e}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let Fj=0;const Pe=js(),It=js(),Ep=js(),J=js(),tt=js(),go=js(),Dn=js();function js(){return 2**++Fj}const Sp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:It,commaOrSpaceSeparated:Dn,commaSeparated:go,number:J,overloadedBoolean:Ep,spaceSeparated:tt},Symbol.toStringTag,{value:"Module"})),Oh=Object.keys(Sp);class Pg extends An{constructor(e,n,r,i){let s=-1;if(super(e,n),Ax(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&Hj.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Px,Gj);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Px.test(s)){let o=s.replace($j,Wj);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=Pg}return new i(r,e)}function Wj(t){return"-"+t.toLowerCase()}function Gj(t){return t.charAt(1).toUpperCase()}const Kj=NS([AS,Uj,DS,jS,LS],"html"),Rg=NS([AS,zj,DS,jS,LS],"svg");function Qj(t){return t.join(" ").trim()}var Dg={},Rx=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Yj=/\n/g,Xj=/^\s*/,Jj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Zj=/^:\s*/,e3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,t3=/^[;\s]*/,n3=/^\s+|\s+$/g,r3=` +`,Dx="/",jx="*",os="",i3="comment",s3="declaration";function o3(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(_){var T=_.match(Yj);T&&(n+=T.length);var R=_.lastIndexOf(r3);r=~R?_.length-R:r+_.length}function s(){var _={line:n,column:r};return function(T){return T.position=new o(_),c(),T}}function o(_){this.start=_,this.end={line:n,column:r},this.source=e.source}o.prototype.content=t;function a(_){var T=new Error(e.source+":"+n+":"+r+": "+_);if(T.reason=_,T.filename=e.source,T.line=n,T.column=r,T.source=t,!e.silent)throw T}function u(_){var T=_.exec(t);if(T){var R=T[0];return i(R),t=t.slice(R.length),T}}function c(){u(Xj)}function h(_){var T;for(_=_||[];T=f();)T!==!1&&_.push(T);return _}function f(){var _=s();if(!(Dx!=t.charAt(0)||jx!=t.charAt(1))){for(var T=2;os!=t.charAt(T)&&(jx!=t.charAt(T)||Dx!=t.charAt(T+1));)++T;if(T+=2,os===t.charAt(T-1))return a("End of comment missing");var R=t.slice(2,T-2);return r+=2,i(R),t=t.slice(T),r+=2,_({type:i3,comment:R})}}function p(){var _=s(),T=u(Jj);if(T){if(f(),!u(Zj))return a("property missing ':'");var R=u(e3),y=_({type:s3,property:Lx(T[0].replace(Rx,os)),value:R?Lx(R[0].replace(Rx,os)):os});return u(t3),y}}function g(){var _=[];h(_);for(var T;T=p();)T!==!1&&(_.push(T),h(_));return _}return c(),g()}function Lx(t){return t?t.replace(n3,os):os}var a3=o3,l3=Hu&&Hu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dg,"__esModule",{value:!0});Dg.default=c3;const u3=l3(a3);function c3(t,e){let n=null;if(!t||typeof t!="string")return n;const r=(0,u3.default)(t),i=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?e(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Dd={};Object.defineProperty(Dd,"__esModule",{value:!0});Dd.camelCase=void 0;var d3=/^--[a-zA-Z0-9_-]+$/,h3=/-([a-z])/g,f3=/^[^-]+$/,p3=/^-(webkit|moz|ms|o|khtml)-/,m3=/^-(ms)-/,g3=function(t){return!t||f3.test(t)||d3.test(t)},y3=function(t,e){return e.toUpperCase()},Ox=function(t,e){return"".concat(e,"-")},v3=function(t,e){return e===void 0&&(e={}),g3(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(m3,Ox):t=t.replace(p3,Ox),t.replace(h3,y3))};Dd.camelCase=v3;var x3=Hu&&Hu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},w3=x3(Dg),_3=Dd;function Tp(t,e){var n={};return!t||typeof t!="string"||(0,w3.default)(t,function(r,i){r&&i&&(n[(0,_3.camelCase)(r,e)]=i)}),n}Tp.default=Tp;var b3=Tp;const E3=Fc(b3),OS=MS("end"),jg=MS("start");function MS(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function S3(t){const e=jg(t),n=OS(t);if(e&&n)return{start:e,end:n}}function Oa(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Mx(t.position):"start"in t||"end"in t?Mx(t):"line"in t||"column"in t?Ip(t):""}function Ip(t){return Vx(t&&t.line)+":"+Vx(t&&t.column)}function Mx(t){return Ip(t&&t.start)+"-"+Ip(t&&t.end)}function Vx(t){return t&&typeof t=="number"?t:1}class an extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Oa(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Lg={}.hasOwnProperty,T3=new Map,I3=/[A-Z]/g,k3=new Set(["table","tbody","thead","tfoot","tr"]),C3=new Set(["td","th"]),VS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function N3(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=M3(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=O3(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Rg:Kj,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=FS(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function FS(t,e,n){if(e.type==="element")return A3(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return P3(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return D3(t,e,n);if(e.type==="mdxjsEsm")return R3(t,e);if(e.type==="root")return j3(t,e,n);if(e.type==="text")return L3(t,e)}function A3(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Rg,t.schema=i),t.ancestors.push(e);const s=zS(t,e.tagName,!1),o=V3(t,e);let a=Mg(t,e);return k3.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Vj(u):!0})),US(t,o,s,e),Og(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function P3(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}pl(t,e.position)}function R3(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);pl(t,e.position)}function D3(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Rg,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:zS(t,e.name,!0),o=F3(t,e),a=Mg(t,e);return US(t,o,s,e),Og(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function j3(t,e,n){const r={};return Og(r,Mg(t,e)),t.create(e,t.Fragment,r,n)}function L3(t,e){return e.value}function US(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Og(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function O3(t,e,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:e;return a?c(s,o,a):c(s,o)}}function M3(t,e){return n;function n(r,i,s,o){const a=Array.isArray(s.children),u=jg(r);return e(i,s,o,a,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function V3(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Lg.call(e.properties,i)){const s=U3(t,i,e.properties[i]);if(s){const[o,a]=s;t.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&C3.has(e.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function F3(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else pl(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,s=t.evaluater.evaluateExpression(a.expression)}else pl(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Mg(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:T3;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s0?(Pr(t,t.length,0,e),t):e}const zx={}.hasOwnProperty;function K3(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yo(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xr=Ji(/[A-Za-z]/),Mn=Ji(/[\dA-Za-z]/),X3=Ji(/[#-'*+\--9=?A-Z^-~]/);function kp(t){return t!==null&&(t<32||t===127)}const Cp=Ji(/\d/),J3=Ji(/[\dA-Fa-f]/),Z3=Ji(/[!-/:-@[-`{-~]/);function Ie(t){return t!==null&&t<-2}function Nn(t){return t!==null&&(t<0||t===32)}function qe(t){return t===-2||t===-1||t===32}const e6=Ji(new RegExp("\\p{P}|\\p{S}","u")),t6=Ji(/\s/);function Ji(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Ho(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function it(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return qe(u)?(t.enter(n),a(u)):e(u)}function a(u){return qe(u)&&s++o))return;const b=e.events.length;let x=b,E,I;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){if(E){I=e.events[x][1].end;break}E=!0}for(y(r),j=b;jk;){const U=n[L];e.containerState=U[1],U[0].exit.call(e,t)}n.length=k}function w(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function o6(t,e,n){return it(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $x(t){if(t===null||Nn(t)||t6(t))return 1;if(e6(t))return 2}function Fg(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Hx(f,-u),Hx(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[r][1].end={...o.start},t[n][1].start={...a.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Hn(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Hn(c,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=Hn(c,Fg(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Hn(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,c=Hn(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,Pr(t,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n0&&qe(j)?it(t,w,"linePrefix",s+1)(j):w(j)}function w(j){return j===null||Ie(j)?t.check(qx,T,L)(j):(t.enter("codeFlowValue"),k(j))}function k(j){return j===null||Ie(j)?(t.exit("codeFlowValue"),w(j)):(t.consume(j),k)}function L(j){return t.exit("codeFenced"),e(j)}function U(j,b,x){let E=0;return I;function I(ie){return j.enter("lineEnding"),j.consume(ie),j.exit("lineEnding"),N}function N(ie){return j.enter("codeFencedFence"),qe(ie)?it(j,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):D(ie)}function D(ie){return ie===a?(j.enter("codeFencedFenceSequence"),C(ie)):x(ie)}function C(ie){return ie===a?(E++,j.consume(ie),C):E>=o?(j.exit("codeFencedFenceSequence"),qe(ie)?it(j,ge,"whitespace")(ie):ge(ie)):x(ie)}function ge(ie){return ie===null||Ie(ie)?(j.exit("codeFencedFence"),b(ie)):x(ie)}}}function v6(t,e,n){const r=this;return i;function i(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const Vh={name:"codeIndented",tokenize:w6},x6={partial:!0,tokenize:_6};function w6(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),it(t,s,"linePrefix",5)(c)}function s(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):Ie(c)?t.attempt(x6,o,u)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Ie(c)?(t.exit("codeFlowValue"),o(c)):(t.consume(c),a)}function u(c){return t.exit("codeIndented"),e(c)}}function _6(t,e,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ie(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):it(t,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):Ie(o)?i(o):n(o)}}const b6={name:"codeText",previous:S6,resolve:E6,tokenize:T6};function E6(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&da(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),da(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),da(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(o):t.interrupt(r.parser.constructs.flow,n,e)(o)}}function KS(t,e,n,r,i,s,o,a,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return f;function f(y){return y===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(y),t.exit(s),p):y===null||y===32||y===41||kp(y)?n(y):(t.enter(r),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),T(y))}function p(y){return y===62?(t.enter(s),t.consume(y),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===62?(t.exit("chunkString"),t.exit(a),p(y)):y===null||y===60||Ie(y)?n(y):(t.consume(y),y===92?_:g)}function _(y){return y===60||y===62||y===92?(t.consume(y),g):g(y)}function T(y){return!h&&(y===null||y===41||Nn(y))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(r),e(y)):h999||g===null||g===91||g===93&&!u||g===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(t.exit(s),t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):Ie(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||Ie(g)||a++>999?(t.exit("chunkString"),h(g)):(t.consume(g),u||(u=!qe(g)),g===92?p:f)}function p(g){return g===91||g===92||g===93?(t.consume(g),a++,f):f(g)}}function YS(t,e,n,r,i,s){let o;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),o=p===40?41:p,u):n(p)}function u(p){return p===o?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(s),c(p))}function c(p){return p===o?(t.exit(s),u(o)):p===null?n(p):Ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),it(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===o||p===null||Ie(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?f:h)}function f(p){return p===o||p===92?(t.consume(p),h):h(p)}}function Ma(t,e){let n;return r;function r(i){return Ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):qe(i)?it(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const D6={name:"definition",tokenize:L6},j6={partial:!0,tokenize:O6};function L6(t,e,n){const r=this;let i;return s;function s(g){return t.enter("definition"),o(g)}function o(g){return QS.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return i=yo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),u):n(g)}function u(g){return Nn(g)?Ma(t,c)(g):c(g)}function c(g){return KS(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return t.attempt(j6,f,f)(g)}function f(g){return qe(g)?it(t,p,"whitespace")(g):p(g)}function p(g){return g===null||Ie(g)?(t.exit("definition"),r.parser.defined.push(i),e(g)):n(g)}}function O6(t,e,n){return r;function r(a){return Nn(a)?Ma(t,i)(a):n(a)}function i(a){return YS(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return qe(a)?it(t,o,"whitespace")(a):o(a)}function o(a){return a===null||Ie(a)?e(a):n(a)}}const M6={name:"hardBreakEscape",tokenize:V6};function V6(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return Ie(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const F6={name:"headingAtx",resolve:U6,tokenize:z6};function U6(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Pr(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function z6(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),s(h)}function s(h){return t.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&r++<6?(t.consume(h),o):h===null||Nn(h)?(t.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(t.enter("atxHeadingSequence"),u(h)):h===null||Ie(h)?(t.exit("atxHeading"),e(h)):qe(h)?it(t,a,"whitespace")(h):(t.enter("atxHeadingText"),c(h))}function u(h){return h===35?(t.consume(h),u):(t.exit("atxHeadingSequence"),a(h))}function c(h){return h===null||h===35||Nn(h)?(t.exit("atxHeadingText"),a(h)):(t.consume(h),c)}}const B6=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gx=["pre","script","style","textarea"],$6={concrete:!0,name:"htmlFlow",resolveTo:W6,tokenize:G6},H6={partial:!0,tokenize:Q6},q6={partial:!0,tokenize:K6};function W6(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function G6(t,e,n){const r=this;let i,s,o,a,u;return c;function c(P){return h(P)}function h(P){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(P),f}function f(P){return P===33?(t.consume(P),p):P===47?(t.consume(P),s=!0,T):P===63?(t.consume(P),i=3,r.interrupt?e:A):xr(P)?(t.consume(P),o=String.fromCharCode(P),R):n(P)}function p(P){return P===45?(t.consume(P),i=2,g):P===91?(t.consume(P),i=5,a=0,_):xr(P)?(t.consume(P),i=4,r.interrupt?e:A):n(P)}function g(P){return P===45?(t.consume(P),r.interrupt?e:A):n(P)}function _(P){const $="CDATA[";return P===$.charCodeAt(a++)?(t.consume(P),a===$.length?r.interrupt?e:D:_):n(P)}function T(P){return xr(P)?(t.consume(P),o=String.fromCharCode(P),R):n(P)}function R(P){if(P===null||P===47||P===62||Nn(P)){const $=P===47,Y=o.toLowerCase();return!$&&!s&&Gx.includes(Y)?(i=1,r.interrupt?e(P):D(P)):B6.includes(o.toLowerCase())?(i=6,$?(t.consume(P),y):r.interrupt?e(P):D(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?w(P):k(P))}return P===45||Mn(P)?(t.consume(P),o+=String.fromCharCode(P),R):n(P)}function y(P){return P===62?(t.consume(P),r.interrupt?e:D):n(P)}function w(P){return qe(P)?(t.consume(P),w):I(P)}function k(P){return P===47?(t.consume(P),I):P===58||P===95||xr(P)?(t.consume(P),L):qe(P)?(t.consume(P),k):I(P)}function L(P){return P===45||P===46||P===58||P===95||Mn(P)?(t.consume(P),L):U(P)}function U(P){return P===61?(t.consume(P),j):qe(P)?(t.consume(P),U):k(P)}function j(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),u=P,b):qe(P)?(t.consume(P),j):x(P)}function b(P){return P===u?(t.consume(P),u=null,E):P===null||Ie(P)?n(P):(t.consume(P),b)}function x(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Nn(P)?U(P):(t.consume(P),x)}function E(P){return P===47||P===62||qe(P)?k(P):n(P)}function I(P){return P===62?(t.consume(P),N):n(P)}function N(P){return P===null||Ie(P)?D(P):qe(P)?(t.consume(P),N):n(P)}function D(P){return P===45&&i===2?(t.consume(P),fe):P===60&&i===1?(t.consume(P),we):P===62&&i===4?(t.consume(P),pe):P===63&&i===3?(t.consume(P),A):P===93&&i===5?(t.consume(P),se):Ie(P)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(H6,_e,C)(P)):P===null||Ie(P)?(t.exit("htmlFlowData"),C(P)):(t.consume(P),D)}function C(P){return t.check(q6,ge,_e)(P)}function ge(P){return t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),ie}function ie(P){return P===null||Ie(P)?C(P):(t.enter("htmlFlowData"),D(P))}function fe(P){return P===45?(t.consume(P),A):D(P)}function we(P){return P===47?(t.consume(P),o="",G):D(P)}function G(P){if(P===62){const $=o.toLowerCase();return Gx.includes($)?(t.consume(P),pe):D(P)}return xr(P)&&o.length<8?(t.consume(P),o+=String.fromCharCode(P),G):D(P)}function se(P){return P===93?(t.consume(P),A):D(P)}function A(P){return P===62?(t.consume(P),pe):P===45&&i===2?(t.consume(P),A):D(P)}function pe(P){return P===null||Ie(P)?(t.exit("htmlFlowData"),_e(P)):(t.consume(P),pe)}function _e(P){return t.exit("htmlFlow"),e(P)}}function K6(t,e,n){const r=this;return i;function i(o){return Ie(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}function Q6(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(jd,e,n)}}const Y6={name:"htmlText",tokenize:X6};function X6(t,e,n){const r=this;let i,s,o;return a;function a(A){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(A),u}function u(A){return A===33?(t.consume(A),c):A===47?(t.consume(A),U):A===63?(t.consume(A),k):xr(A)?(t.consume(A),x):n(A)}function c(A){return A===45?(t.consume(A),h):A===91?(t.consume(A),s=0,_):xr(A)?(t.consume(A),w):n(A)}function h(A){return A===45?(t.consume(A),g):n(A)}function f(A){return A===null?n(A):A===45?(t.consume(A),p):Ie(A)?(o=f,we(A)):(t.consume(A),f)}function p(A){return A===45?(t.consume(A),g):f(A)}function g(A){return A===62?fe(A):A===45?p(A):f(A)}function _(A){const pe="CDATA[";return A===pe.charCodeAt(s++)?(t.consume(A),s===pe.length?T:_):n(A)}function T(A){return A===null?n(A):A===93?(t.consume(A),R):Ie(A)?(o=T,we(A)):(t.consume(A),T)}function R(A){return A===93?(t.consume(A),y):T(A)}function y(A){return A===62?fe(A):A===93?(t.consume(A),y):T(A)}function w(A){return A===null||A===62?fe(A):Ie(A)?(o=w,we(A)):(t.consume(A),w)}function k(A){return A===null?n(A):A===63?(t.consume(A),L):Ie(A)?(o=k,we(A)):(t.consume(A),k)}function L(A){return A===62?fe(A):k(A)}function U(A){return xr(A)?(t.consume(A),j):n(A)}function j(A){return A===45||Mn(A)?(t.consume(A),j):b(A)}function b(A){return Ie(A)?(o=b,we(A)):qe(A)?(t.consume(A),b):fe(A)}function x(A){return A===45||Mn(A)?(t.consume(A),x):A===47||A===62||Nn(A)?E(A):n(A)}function E(A){return A===47?(t.consume(A),fe):A===58||A===95||xr(A)?(t.consume(A),I):Ie(A)?(o=E,we(A)):qe(A)?(t.consume(A),E):fe(A)}function I(A){return A===45||A===46||A===58||A===95||Mn(A)?(t.consume(A),I):N(A)}function N(A){return A===61?(t.consume(A),D):Ie(A)?(o=N,we(A)):qe(A)?(t.consume(A),N):E(A)}function D(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),i=A,C):Ie(A)?(o=D,we(A)):qe(A)?(t.consume(A),D):(t.consume(A),ge)}function C(A){return A===i?(t.consume(A),i=void 0,ie):A===null?n(A):Ie(A)?(o=C,we(A)):(t.consume(A),C)}function ge(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Nn(A)?E(A):(t.consume(A),ge)}function ie(A){return A===47||A===62||Nn(A)?E(A):n(A)}function fe(A){return A===62?(t.consume(A),t.exit("htmlTextData"),t.exit("htmlText"),e):n(A)}function we(A){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),G}function G(A){return qe(A)?it(t,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):se(A)}function se(A){return t.enter("htmlTextData"),o(A)}}const Ug={name:"labelEnd",resolveAll:t5,resolveTo:n5,tokenize:r5},J6={tokenize:i5},Z6={tokenize:s5},e5={tokenize:o5};function t5(t){let e=-1;const n=[];for(;++e=3&&(c===null||Ie(c))?(t.exit("thematicBreak"),e(c)):n(c)}function u(c){return c===i?(t.consume(c),r++,u):(t.exit("thematicBreakSequence"),qe(c)?it(t,a,"whitespace")(c):a(c))}}const yn={continuation:{tokenize:g5},exit:v5,name:"list",tokenize:m5},f5={partial:!0,tokenize:x5},p5={partial:!0,tokenize:y5};function m5(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(g){const _=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Cp(g)){if(r.containerState.type||(r.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),g===42||g===45?t.check(Bu,n,c)(g):c(g);if(!r.interrupt||g===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(g)}return n(g)}function u(g){return Cp(g)&&++o<10?(t.consume(g),u):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(t.exit("listItemValue"),c(g)):n(g)}function c(g){return t.enter("listItemMarker"),t.consume(g),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,t.check(jd,r.interrupt?n:h,t.attempt(f5,p,f))}function h(g){return r.containerState.initialBlankLine=!0,s++,p(g)}function f(g){return qe(g)?(t.enter("listItemPrefixWhitespace"),t.consume(g),t.exit("listItemPrefixWhitespace"),p):n(g)}function p(g){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(g)}}function g5(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(jd,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,it(t,e,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!qe(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(p5,e,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,it(t,t.attempt(yn,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function y5(t,e,n){const r=this;return it(t,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?e(s):n(s)}}function v5(t){t.exit(this.containerState.type)}function x5(t,e,n){const r=this;return it(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!qe(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const Kx={name:"setextUnderline",resolveTo:w5,tokenize:_5};function w5(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",o,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=o,t.push(["exit",o,e]),t}function _5(t,e,n){const r=this;let i;return s;function s(c){let h=r.events.length,f;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){f=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),qe(c)?it(t,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Ie(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const b5={tokenize:E5};function E5(t){const e=this,n=t.attempt(jd,r,t.attempt(this.parser.constructs.flowInitial,i,it(t,t.attempt(this.parser.constructs.flow,i,t.attempt(C6,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const S5={resolveAll:JS()},T5=XS("string"),I5=XS("text");function XS(t){return{resolveAll:JS(t==="text"?k5:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,o,a);return o;function o(h){return c(h)?s(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),s(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const f=i[h];let p=-1;if(f)for(;++p-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(t[i].slice(0,s))}return o}function U5(t,e){let n=-1;const r=[];let i;for(;++n0){const $e=oe.tokenStack[oe.tokenStack.length-1];($e[1]||Yx).call(oe,void 0,$e[0])}for(B.position={start:hi(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:hi(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function eL(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function tL(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function nL(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Ho(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let o,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),o=t.footnoteOrder.length):o=s+1,a+=1,t.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,c),t.applyData(e,c)}function rL(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function iL(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function tT(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function sL(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return tT(t,e);const i={src:Ho(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function oL(t,e){const n={src:Ho(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function aL(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function lL(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return tT(t,e);const i={href:Ho(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function uL(t,e){const n={href:Ho(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function cL(t,e,n){const r=t.all(e),i=n?dL(n):nT(e),s={},o=[];if(typeof e.checked=="boolean"){const h=r[0];let f;h&&h.type==="element"&&h.tagName==="p"?f=h:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a1}function hL(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=jg(e.children[1]),u=OS(e.children[e.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function yL(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:e.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(Zx(e.slice(i),i>0,!1)),s.join("")}function Zx(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===Xx||s===Jx;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===Xx||s===Jx;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function wL(t,e){const n={type:"text",value:xL(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function _L(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const bL={blockquote:X5,break:J5,code:Z5,delete:eL,emphasis:tL,footnoteReference:nL,heading:rL,html:iL,imageReference:sL,image:oL,inlineCode:aL,linkReference:lL,link:uL,listItem:cL,list:hL,paragraph:fL,root:pL,strong:mL,table:gL,tableCell:vL,tableRow:yL,text:wL,thematicBreak:_L,toml:yu,yaml:yu,definition:yu,footnoteDefinition:yu};function yu(){}const rT=-1,Ld=0,Va=1,Mc=2,zg=3,Bg=4,$g=5,Hg=6,iT=7,sT=8,ew=typeof self=="object"?self:globalThis,EL=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,o]=e[i];switch(s){case Ld:case rT:return n(o,i);case Va:{const a=n([],i);for(const u of o)a.push(r(u));return a}case Mc:{const a=n({},i);for(const[u,c]of o)a[r(u)]=r(c);return a}case zg:return n(new Date(o),i);case Bg:{const{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case $g:{const a=n(new Map,i);for(const[u,c]of o)a.set(r(u),r(c));return a}case Hg:{const a=n(new Set,i);for(const u of o)a.add(r(u));return a}case iT:{const{name:a,message:u}=o;return n(new ew[a](u),i)}case sT:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new ew[s](o),i)};return r},tw=t=>EL(new Map,t)(0),Fs="",{toString:SL}={},{keys:TL}=Object,ha=t=>{const e=typeof t;if(e!=="object"||!t)return[Ld,e];const n=SL.call(t).slice(8,-1);switch(n){case"Array":return[Va,Fs];case"Object":return[Mc,Fs];case"Date":return[zg,Fs];case"RegExp":return[Bg,Fs];case"Map":return[$g,Fs];case"Set":return[Hg,Fs];case"DataView":return[Va,n]}return n.includes("Array")?[Va,n]:n.includes("Error")?[iT,n]:[Mc,n]},vu=([t,e])=>t===Ld&&(e==="function"||e==="symbol"),IL=(t,e,n,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return n.set(a,u),u},s=o=>{if(n.has(o))return n.get(o);let[a,u]=ha(o);switch(a){case Ld:{let h=o;switch(u){case"bigint":a=sT,h=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([rT],o)}return i([a,h],o)}case Va:{if(u){let p=o;return u==="DataView"?p=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(o)),i([u,[...p]],o)}const h=[],f=i([a,h],o);for(const p of o)h.push(s(p));return f}case Mc:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const h=[],f=i([a,h],o);for(const p of TL(o))(t||!vu(ha(o[p])))&&h.push([s(p),s(o[p])]);return f}case zg:return i([a,o.toISOString()],o);case Bg:{const{source:h,flags:f}=o;return i([a,{source:h,flags:f}],o)}case $g:{const h=[],f=i([a,h],o);for(const[p,g]of o)(t||!(vu(ha(p))||vu(ha(g))))&&h.push([s(p),s(g)]);return f}case Hg:{const h=[],f=i([a,h],o);for(const p of o)(t||!vu(ha(p)))&&h.push(s(p));return f}}const{message:c}=o;return i([a,{name:u,message:c}],o)};return s},nw=(t,{json:e,lossy:n}={})=>{const r=[];return IL(!(e||n),!!e,new Map,r)(t),r},Vc=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?tw(nw(t,e)):structuredClone(t):(t,e)=>tw(nw(t,e));function kL(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function CL(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function NL(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||kL,r=t.options.footnoteBackLabel||CL,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&_.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,g);typeof w=="string"&&(w={type:"text",value:w}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,g),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const R=h[h.length-1];if(R&&R.type==="element"&&R.tagName==="p"){const w=R.children[R.children.length-1];w&&w.type==="text"?w.value+=" ":R.children.push({type:"text",value:" "}),R.children.push(..._)}else h.push(..._);const y={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(h,!0)};t.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Vc(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` +`}]}}const oT=function(t){if(t==null)return DL;if(typeof t=="function")return Od(t);if(typeof t=="object")return Array.isArray(t)?AL(t):PL(t);if(typeof t=="string")return RL(t);throw new Error("Expected function, string, or object as test")};function AL(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let g=aT,_,T,R;if((!e||s(u,c,h[h.length-1]||void 0))&&(g=VL(n(u,h)),g[0]===rw))return g;if("children"in u&&u.children){const y=u;if(y.children&&g[0]!==OL)for(T=(r?y.children.length:-1)+o,R=h.concat(y);T>-1&&T0&&n.push({type:"text",value:` +`}),n}function iw(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function sw(t,e){const n=UL(t,e),r=n.one(t,void 0),i=NL(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` +`},i),s}function qL(t,e){return t&&"run"in t?async function(n,r){const i=sw(n,{file:r,...e});await t.run(i,r)}:function(n,r){return sw(n,{file:r,...t||e})}}function ow(t){if(t)throw t}var $u=Object.prototype.hasOwnProperty,uT=Object.prototype.toString,aw=Object.defineProperty,lw=Object.getOwnPropertyDescriptor,uw=function(e){return typeof Array.isArray=="function"?Array.isArray(e):uT.call(e)==="[object Array]"},cw=function(e){if(!e||uT.call(e)!=="[object Object]")return!1;var n=$u.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&$u.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||$u.call(e,i)},dw=function(e,n){aw&&n.name==="__proto__"?aw(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},hw=function(e,n){if(n==="__proto__")if($u.call(e,n)){if(lw)return lw(e,n).value}else return;return e[n]},WL=function t(){var e,n,r,i,s,o,a=arguments[0],u=1,c=arguments.length,h=!1;for(typeof a=="boolean"&&(h=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=t.apply(this,o)}catch(c){const h=c;if(a&&n)throw h;return i(h)}a||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){n||(n=!0,e(o,...a))}function s(o){i(null,o)}}const gr={basename:QL,dirname:YL,extname:XL,join:JL,sep:"/"};function QL(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');jl(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=t.length),t.slice(n,r)}function YL(t){if(jl(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function XL(t){jl(t);let e=t.length,n=-1,r=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){r=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function JL(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function eO(t,e){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=t.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,o):n=t.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function jl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const tO={cwd:nO};function nO(){return"/"}function Rp(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function rO(t){if(typeof t=="string")t=new URL(t);else if(!Rp(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return iO(t)}function iO(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[g,..._]=h;const T=r[p][1];Pp(T)&&Pp(g)&&(g=Uh(!0,T,g)),r[p]=[c,g,..._]}}}}const lO=new qg().freeze();function Hh(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function qh(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Wh(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pw(t){if(!Pp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function mw(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function xu(t){return uO(t)?t:new cT(t)}function uO(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function cO(t){return typeof t=="string"||dO(t)}function dO(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const hO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gw=[],yw={allowDangerousHtml:!0},fO=/^(https?|ircs?|mailto|xmpp)$/i,pO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function mO(t){const e=gO(t),n=yO(t);return vO(e.runSync(e.parse(n),n),t)}function gO(t){const e=t.rehypePlugins||gw,n=t.remarkPlugins||gw,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...yw}:yw;return lO().use(Y5).use(n).use(qL,r).use(e)}function yO(t){const e=t.children||"",n=new cT;return typeof e=="string"&&(n.value=e),n}function vO(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,o=e.skipHtml,a=e.unwrapDisallowed,u=e.urlTransform||xO;for(const h of pO)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+hO+h.id,void 0);return lT(t,c),N3(t,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(h,f,p){if(h.type==="raw"&&p&&typeof f=="number")return o?p.children.splice(f,1):p.children[f]={type:"text",value:h.value},f;if(h.type==="element"){let g;for(g in Mh)if(Object.hasOwn(Mh,g)&&Object.hasOwn(h.properties,g)){const _=h.properties[g],T=Mh[g];(T===null||T.includes(h.tagName))&&(h.properties[g]=u(String(_||""),g,h))}}if(h.type==="element"){let g=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!g&&r&&typeof f=="number"&&(g=!r(h,f,p)),g&&p&&typeof f=="number")return a&&h.children?p.children.splice(f,1,...h.children):p.children.splice(f,1),f}}}function xO(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||fO.test(t.slice(0,e))?t:""}function wO({onBack:t,isAdmin:e}){const[n,r]=F.useState(""),[i,s]=F.useState(!1),[o,a]=F.useState(""),[u,c]=F.useState(!0);F.useEffect(()=>{const p=Rj(g=>{g&&r(g.content),c(!1)});return()=>p()},[]);const h=async()=>{try{await Pj(o),s(!1)}catch(p){console.error("Error saving info:",p),alert("Error al guardar la información.")}},f=()=>{a(n),s(!0)};return d.jsx("div",{className:"min-h-screen bg-[#0a0a0a] text-white p-4 sm:p-6 md:p-12 animate-in fade-in slide-in-from-bottom-4 duration-300",children:d.jsxs("div",{className:"max-w-4xl mx-auto",children:[d.jsxs("button",{onClick:t,className:"flex items-center gap-2 text-gray-400 hover:text-white transition-colors mb-8 group",children:[d.jsx(To,{className:"w-5 h-5 group-hover:-translate-x-1 transition-transform"}),d.jsx("span",{className:"font-medium",children:"Volver al inicio"})]}),d.jsxs("div",{className:"bg-[#1a1a1a] rounded-2xl border border-gray-800 p-8 sm:p-12 shadow-2xl relative",children:[e&&!i&&d.jsx("button",{onClick:f,className:"absolute top-8 right-8 p-2 rounded-lg bg-gray-800 text-gray-400 hover:text-[#bb86fc] hover:bg-[#bb86fc]/10 transition-colors",title:"Editar información",children:d.jsx(z1,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex items-center gap-4 mb-8 border-b border-gray-800 pb-8",children:[d.jsx("div",{className:"p-3 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl shadow-lg shadow-[#bb86fc]/20",children:d.jsx(V1,{className:"w-8 h-8 text-white"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-white to-gray-400 bg-clip-text text-transparent",children:"Información"}),d.jsx("p",{className:"text-gray-400 mt-1",children:"Sobre Twisted Brody MangaFlow"})]})]}),i?d.jsxs("div",{className:"space-y-4",children:[d.jsx("textarea",{value:o,onChange:p=>a(p.target.value),className:"w-full h-[500px] bg-black/50 border border-[#bb86fc]/50 rounded-lg p-4 text-sm text-white focus:outline-none focus:border-[#bb86fc] font-mono",placeholder:"Escribe el contenido en Markdown..."}),d.jsxs("div",{className:"flex gap-3 justify-end",children:[d.jsxs("button",{onClick:()=>s(!1),className:"px-4 py-2 rounded-lg font-semibold text-gray-400 hover:text-white hover:bg-white/10 transition-colors flex items-center gap-2",children:[d.jsx(In,{className:"w-4 h-4"}),"Cancelar"]}),d.jsxs("button",{onClick:h,className:"px-4 py-2 rounded-lg font-semibold bg-[#bb86fc] hover:bg-[#9966dd] text-white transition-colors shadow-lg shadow-[#bb86fc]/20 flex items-center gap-2",children:[d.jsx(B1,{className:"w-4 h-4"}),"Guardar Cambios"]})]})]}):d.jsx("div",{className:"prose prose-invert prose-p:text-gray-300 prose-headings:text-white prose-a:no-underline max-w-none",children:d.jsx(mO,{components:{h1:({node:p,...g})=>d.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-[#bb86fc] to-[#7744cc] bg-clip-text text-transparent mb-6 pb-2 border-b border-gray-800",...g}),h2:({node:p,...g})=>d.jsx("h2",{className:"text-xl font-semibold text-white mt-8 mb-4 flex items-center gap-2",...g}),p:({node:p,...g})=>d.jsx("p",{className:"text-gray-300 leading-relaxed mb-4",...g}),ul:({node:p,...g})=>d.jsx("ul",{className:"space-y-2 mb-6",...g}),li:({node:p,...g})=>d.jsx("li",{className:"flex items-start gap-2 text-gray-300",...g}),a:({node:p,href:g,children:_,...T})=>{const R=g==null?void 0:g.startsWith("http");if((g==null?void 0:g.includes("t.me"))||(g==null?void 0:g.includes("patreon.com"))||(g==null?void 0:g.includes("x.com"))){let w="bg-[#1a1a1a] border border-gray-700 hover:border-gray-500",k="text-gray-300 hover:text-white";return g!=null&&g.includes("patreon")&&(w="bg-[#1a1a1a] border border-gray-700 hover:border-[#FF424D] hover:text-[#FF424D]"),g!=null&&g.includes("t.me")&&(w="bg-[#1a1a1a] border border-gray-700 hover:border-[#24A1DE] hover:text-[#24A1DE]"),g!=null&&g.includes("x.com")&&(w="bg-[#1a1a1a] border border-gray-700 hover:border-white hover:text-white"),d.jsx("a",{href:g,target:R?"_blank":void 0,rel:R?"noopener noreferrer":void 0,className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all transform hover:scale-105 shadow-sm my-1 mr-2 no-underline text-xs sm:text-sm font-medium ${w} ${k}`,...T,children:_})}return d.jsx("a",{href:g,className:"text-[#bb86fc] hover:underline",target:R?"_blank":void 0,rel:R?"noopener noreferrer":void 0,...T,children:_})},blockquote:({node:p,...g})=>d.jsx("blockquote",{className:"border-l-4 border-[#bb86fc] pl-4 py-2 bg-[#bb86fc]/10 rounded-r-lg italic text-gray-400 my-6",...g}),hr:({node:p,...g})=>d.jsx("hr",{className:"border-gray-800 my-8",...g}),img:()=>null},children:n})}),!i&&d.jsxs("div",{className:"pt-8 border-t border-gray-800 text-center text-sm text-gray-500 mt-8",children:["© ",new Date().getFullYear()," Twisted Brody. Todos los derechos reservados."]})]})]})})}function _O({label:t,authors:e,value:n,onChange:r,onDelete:i,placeholder:s="Añadir autor...",colorClass:o="text-gray-400"}){const[a,u]=F.useState(""),[c,h]=F.useState(!1),f=F.useRef(null);F.useEffect(()=>{n&&n!==a&&!c?u(n):!n&&!c&&u("")},[n]);const p=F.useMemo(()=>a.trim()?e.filter(y=>y.toLowerCase().includes(a.toLowerCase())):e,[e,a]);F.useEffect(()=>{const y=w=>{f.current&&!f.current.contains(w.target)&&h(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[]);const g=y=>{y.key==="Enter"&&(y.preventDefault(),_(a))},_=y=>{const w=y.trim();w&&(r(w),u(w),h(!1))},T=()=>{r(""),u(""),h(!1)},R=(y,w)=>{y.stopPropagation(),y.preventDefault(),i&&i(w)};return d.jsxs("div",{className:"space-y-3 mb-6",ref:f,children:[d.jsx("label",{className:`text-xs uppercase font-bold tracking-wider ${o}`,children:t}),d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:d.jsx(Cm,{className:"h-4 w-4 text-gray-500"})}),d.jsx("input",{type:"text",value:a,onChange:y=>{u(y.target.value),h(!0)},onFocus:()=>h(!0),onKeyDown:g,placeholder:s,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg pl-10 pr-10 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all"}),a&&d.jsx("button",{onClick:T,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white",children:d.jsx(In,{className:"w-3.5 h-3.5"})})]}),c&&p.length>0&&d.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#1a1a1a] border border-gray-700/50 rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto w-full custom-scrollbar",children:p.map((y,w)=>{const k=n===y;return d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 hover:bg-white/5 cursor-pointer group",onMouseDown:L=>{L.preventDefault(),_(y)},children:[d.jsx("span",{className:`text-sm ${k?"text-[#bb86fc]":"text-gray-300"}`,children:y}),d.jsxs("div",{className:"flex items-center gap-2",children:[k&&d.jsx(wl,{className:"w-4 h-4 text-[#bb86fc]"}),i&&d.jsx("button",{onMouseDown:L=>R(L,y),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-500/20 text-gray-500 hover:text-red-400 rounded transition-all",title:"Eliminar autor de todos los mangas",children:d.jsx($r,{className:"w-3.5 h-3.5"})})]})]},w)})})]}),d.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:n?`Se actualizará el autor a: "${n}"`:"Deja en blanco para no modificar el autor."})]})}function bO({isOpen:t,onClose:e,selectedMangaIds:n,onSaveComplete:r}){const[i,s]=F.useState([]),[o,a]=F.useState([]),[u,c]=F.useState([]),[h,f]=F.useState(""),[p,g]=F.useState(!1),[_,T]=F.useState(!1);F.useEffect(()=>{t&&(R(),a([]),f(""))},[t]);const R=async()=>{try{T(!0);const b=await xS();s(b);const x=await GD();c(x)}catch(b){console.error("Error loading categories:",b)}finally{T(!1)}},y=async(b,x)=>{if(b.trim()){if(x==="tag"){const E=b.split(" ").map(I=>I.trim()).filter(I=>I.length>0);for(const I of E)await w(I,x);return}await w(b,x)}},w=async(b,x)=>{try{const E=i.find(I=>I.name.toLowerCase()===b.trim().toLowerCase()&&I.type===x);if(E)a(I=>I.includes(E.id)?I:[...I,E.id]);else{const I=await wS(b.trim(),x);s(N=>N.find(D=>D.id===I.id)?N:[...N,I]),a(N=>N.includes(I.id)?N:[...N,I.id])}}catch(E){console.error("Error creating category:",E)}},k=b=>{a(x=>x.filter(E=>E!==b))},L=async b=>{try{await _S(b),s(x=>x.filter(E=>E.id!==b)),a(x=>x.filter(E=>E!==b))}catch(x){console.error("Error deleting category:",x),kt.error("Error al eliminar la categoría")}},U=b=>{kt(`¿Eliminar al autor "${b}" permanentemente?`,{description:"Se eliminará este autor de TODOS los mangas. Esta acción no se puede deshacer.",action:{label:"Eliminar",onClick:async()=>{try{T(!0),await WD(b),kt.success(`Autor "${b}" eliminado correctamente.`),c(x=>x.filter(E=>E!==b)),h===b&&f("")}catch(x){console.error("Error deleting author:",x),kt.error("Error al eliminar el autor.")}finally{T(!1)}}},cancel:{label:"Cancelar",onClick:()=>{}},duration:5e3})},j=async()=>{if(o.length===0&&!h.trim()){kt.error("Selecciona al menos una categoría o un autor para aplicar.");return}g(!0);try{const b=n.map(async x=>{var E;try{const I=await vS(x);if(!I)return;const N=((E=I.categories)==null?void 0:E.map(ge=>ge.id))||[],D=Array.from(new Set([...N,...o])),C={title:I.title,author:I.author,categoryIds:D};h.trim()&&(C.author=h.trim()),await bS(x,C)}catch(I){console.error(`Error updating manga ${x}`,I)}});await Promise.all(b),kt.success("Categorías aplicadas correctamente."),r(),e()}catch(b){console.error("Error bulk updating mangas:",b),kt.error("Error al aplicar cambios.")}finally{g(!1)}};return t?d.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-2xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10",children:[d.jsxs("h2",{className:"text-xl font-bold text-white",children:["Aplicar Categorías a ",n.length," Mangas"]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar flex-1",children:_?d.jsx("div",{className:"flex justify-center p-8",children:d.jsx(gs,{size:32})}):d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"bg-[#1f1f1f] p-4 rounded-xl border border-gray-800",children:d.jsx(_O,{label:"Autor",authors:u,value:h,onChange:f,onDelete:U,placeholder:"Seleccionar o escribir autor..."})}),d.jsx(Ei,{label:"Personajes",type:"character",categories:i,selectedIds:o,onSelect:b=>{o.includes(b)||a(x=>[...x,b])},onRemove:k,onCreate:b=>y(b,"character"),onDeleteCategory:L,colorClass:"text-blue-400",placeholder:"Añadir personaje..."}),d.jsx(Ei,{label:"Series",type:"series",categories:i,selectedIds:o,onSelect:b=>{o.includes(b)||a(x=>[...x,b])},onRemove:k,onCreate:b=>y(b,"series"),onDeleteCategory:L,colorClass:"text-green-400",placeholder:"Añadir serie..."}),d.jsx(Ei,{label:"Géneros",type:"genre",categories:i,selectedIds:o,onSelect:b=>{o.includes(b)||a(x=>[...x,b])},onRemove:k,onCreate:b=>y(b,"genre"),onDeleteCategory:L,colorClass:"text-purple-400",placeholder:"Añadir género..."}),d.jsx(Ei,{label:"Etiquetas",type:"tag",categories:i,selectedIds:o,onSelect:b=>{o.includes(b)||a(x=>[...x,b])},onRemove:k,onCreate:b=>y(b,"tag"),onDeleteCategory:L,colorClass:"text-pink-400",placeholder:"Añadir etiqueta..."})]})}),d.jsxs("div",{className:"p-6 border-t border-gray-800 flex justify-end gap-3 bg-[#1a1a1a]",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:text-white transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:j,disabled:p||o.length===0&&!h.trim(),className:"bg-[#bb86fc] hover:bg-[#9966dd] text-white px-6 py-2 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/20 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:p?d.jsxs(d.Fragment,{children:[d.jsx(gs,{size:16}),"Guardando..."]}):d.jsxs(d.Fragment,{children:[d.jsx(B1,{className:"w-4 h-4"}),"Aplicar Cambios"]})})]})]})}):null}const vw=["series","character","genre","tag","other"],EO={series:"Series",character:"Personajes",genre:"Géneros",tag:"Etiquetas",other:"Otros"};function SO({isOpen:t,onClose:e,categories:n,selectedCategories:r,onToggleCategory:i,onClearFilters:s}){const[o,a]=F.useState(""),u=F.useMemo(()=>{const c=n.filter(f=>f.name.toLowerCase().includes(o.toLowerCase())),h={};return vw.forEach(f=>{h[f]=[]}),h.other=[],c.forEach(f=>{const p=f.type||"other";h[p]||(h[p]=[]),h[p].push(f)}),h},[n,o]);return t?d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#1a1a1a] w-full max-w-4xl max-h-[85vh] rounded-2xl border border-gray-800 shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-200",onClick:c=>c.stopPropagation(),children:[d.jsxs("div",{className:"p-4 sm:p-6 border-b border-gray-800 flex items-center justify-between bg-[#1a1a1a]",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"bg-purple-500/20 p-2 rounded-lg",children:d.jsx(M1,{className:"w-5 h-5 text-purple-400"})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Filtrar por Categorías"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Selecciona múltiples opciones para refinar tu búsqueda"})]})]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white hover:bg-gray-800 p-2 rounded-lg transition-all",children:d.jsx(In,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"p-4 border-b border-gray-800 bg-[#151515]",children:d.jsxs("div",{className:"relative",children:[d.jsx(mc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),d.jsx("input",{type:"text",placeholder:"Buscar categorías...",value:o,onChange:c=>a(c.target.value),className:"w-full bg-[#0f0f0f] border border-gray-700/50 rounded-lg pl-10 pr-4 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-purple-500/50 focus:ring-1 focus:ring-purple-500/50 transition-all"})]})}),d.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-8 custom-scrollbar",children:vw.map(c=>{const h=u[c];return!h||h.length===0?null:d.jsxs("div",{className:"animate-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("h3",{className:"text-sm font-bold text-purple-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[d.jsx("span",{className:"w-1 h-4 bg-purple-500 rounded-full"}),EO[c]||c]}),d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2",children:h.sort((f,p)=>f.name.localeCompare(p.name)).map(f=>{const p=r.includes(f.name);return d.jsxs("button",{onClick:()=>i(f.name),className:` + relative group flex items-center justify-between px-3 py-2 rounded-lg text-sm text-left transition-all duration-200 border + ${p?"bg-purple-500/20 border-purple-500/50 text-purple-100 shadow-[0_0_15px_-3px_rgba(168,85,247,0.3)]":"bg-[#252525] border-transparent text-gray-300 hover:bg-[#2a2a2a] hover:border-gray-700"} + `,children:[d.jsx("span",{className:"truncate mr-2 font-medium",children:f.name}),p&&d.jsx("div",{className:"bg-purple-500 rounded-full p-0.5 animate-in zoom-in duration-200",children:d.jsx(wl,{className:"w-3 h-3 text-white"})})]},f.id)})})]},c)})}),d.jsxs("div",{className:"p-4 border-t border-gray-800 bg-[#1a1a1a] flex items-center justify-between",children:[d.jsxs("div",{className:"text-sm text-gray-400",children:[r.length," seleccionada",r.length!==1?"s":""]}),d.jsxs("div",{className:"flex items-center gap-3",children:[r.length>0&&d.jsx("button",{onClick:s,className:"px-4 py-2 text-sm text-gray-400 hover:text-white transition-colors",children:"Limpiar todo"}),d.jsx("button",{onClick:e,className:"px-6 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg text-sm font-semibold shadow-lg shadow-purple-900/20 transition-all hover:scale-105 active:scale-95",children:"Listo"})]})]})]})}):null}const xw={random:"Aleatorio",name:"Nombre",date:"Fecha de creación",modified:"Última modificación",pages:"Páginas",views:"Vistas"};function TO({value:t,onChange:e,placeholder:n="Buscar manga...",sortType:r="random",onSortTypeChange:i,sortDirection:s="asc",onSortDirectionChange:o,onOpenFilter:a}){const[u,c]=F.useState(!1),h=()=>{e("")},f=()=>{const _=["modified","name","date","pages","views","random"],R=(_.indexOf(r)+1)%_.length,y=_[R];i==null||i(y),window.innerWidth<640&&kt.success(`Ordenado por: ${xw[y]}`,{position:"top-center",duration:1500,className:"bg-purple-900/90 text-white border-purple-500/50"})},p=()=>{const _=s==="asc"?"desc":"asc";if(o==null||o(_),window.innerWidth<640){let T=_==="asc"?"Ascendente (A-Z)":"Descendente (Z-A)";r==="views"?T=_==="asc"?"Menos vistos primero":"Más vistos primero":r==="date"||r==="modified"?T=_==="asc"?"Más antiguos primero":"Más recientes primero":r==="pages"&&(T=_==="asc"?"Menos páginas":"Más páginas"),kt.success(`Orden: ${T}`,{position:"top-center",duration:1500,className:"bg-purple-900/90 text-white border-purple-500/50"})}},g=()=>r==="views"?s==="asc"?"Menos vistos":"Más vistos":s==="asc"?"ASC":"DESC";return d.jsxs("div",{className:"w-full flex gap-2 items-center",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(mc,{className:`absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 pointer-events-none ${u?"text-purple-400":"text-gray-400"}`}),d.jsx("input",{type:"text",placeholder:n,value:t,onChange:_=>e(_.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),className:"w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-10 py-2.5 text-sm placeholder-gray-400 border border-gray-700/50 focus:border-purple-500 focus:outline-none"}),t&&d.jsx("button",{onClick:h,className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-purple-400 transition-all p-1 hover:scale-125 hover:rotate-90 duration-300",title:"Limpiar búsqueda",children:d.jsx(In,{className:"w-4 h-4"})})]}),d.jsx("button",{onClick:a,className:"bg-gray-800 hover:bg-gray-700 border border-gray-700 hover:border-purple-500/50 text-white p-2.5 rounded-lg transition-all duration-300 hover:shadow-lg hover:shadow-purple-500/10 group",title:"Filtrar por categorías",children:d.jsx(M1,{className:"w-4 h-4 text-gray-400 group-hover:text-purple-400 transition-colors"})}),d.jsxs("button",{onClick:f,className:"bg-gradient-to-r from-gray-700/40 to-gray-600/40 hover:from-gray-700/60 hover:to-gray-600/60 border border-gray-600/50 hover:border-purple-500/50 text-white px-2.5 py-2.5 rounded-lg flex items-center justify-center gap-1.5 font-medium text-xs transition-all duration-300 active:scale-95 whitespace-nowrap hover:scale-110 hover:shadow-lg hover:shadow-purple-500/20 hover:border-purple-500",title:"Cambiar tipo de ordenamiento",children:[d.jsx(s2,{className:"w-3.5 h-3.5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:xw[r]})]}),d.jsxs("button",{onClick:p,className:"bg-gradient-to-r from-gray-700/40 to-gray-600/40 hover:from-gray-700/60 hover:to-gray-600/60 border border-gray-600/50 hover:border-purple-500/50 text-white px-2.5 py-2.5 rounded-lg flex items-center justify-center gap-1.5 font-medium text-xs transition-all duration-300 active:scale-95 whitespace-nowrap hover:scale-110 hover:shadow-lg hover:shadow-purple-500/20 hover:border-purple-500",title:s==="asc"?"Cambiar a descendente":"Cambiar a ascendente",children:[d.jsx(r2,{className:`w-3.5 h-3.5 transition-all duration-500 ${s==="desc"?"rotate-180":""} hover:scale-125`}),d.jsx("span",{className:"hidden sm:inline text-[10px]",children:g()})]})]})}function IO(){return d.jsxs("div",{className:"flex flex-col w-full max-w-xs",children:[d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden aspect-[2/3] mb-2",children:d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"30px",height:"30px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})})}),d.jsxs("div",{className:"flex flex-col gap-2 items-center animate-pulse",children:[d.jsx("div",{className:"h-4 bg-gray-800 rounded w-3/4"}),d.jsx("div",{className:"h-3 bg-gray-800 rounded w-1/2"})]})]})}const Gh=24;function kO({items:t,searchTerm:e,isSearching:n,onSelectComic:r,onEditManga:i,onDeleteManga:s,isLoading:o=!1,isCategoryPlusEnabled:a=!1,selectedMangaIds:u=[],onToggleSelectManga:c}){const[h,f]=F.useState(()=>{const y=new URLSearchParams(window.location.search).get("page");return y?Math.max(1,Number(y)):1});F.useEffect(()=>{const R=()=>{const w=new URLSearchParams(window.location.search).get("page");f(w?Math.max(1,Number(w)):1)};return window.addEventListener("popstate",R),()=>window.removeEventListener("popstate",R)},[]);const p=Math.ceil(t.length/Gh);F.useEffect(()=>{if(p>0&&h>p){f(p);const R=new URL(window.location.href);R.searchParams.set("page",String(p)),window.history.replaceState({},"",R)}},[p,h]),F.useEffect(()=>{if(e){f(1);const R=new URL(window.location.href);R.searchParams.delete("page"),window.history.replaceState({},"",R)}},[e]);const g=t.slice((h-1)*Gh,h*Gh),_=R=>{f(R);const y=new URL(window.location.href);y.searchParams.set("page",String(R)),window.history.pushState({},"",y),window.scrollTo({top:0,behavior:"smooth"})},T=()=>{if(p<=1)return null;const R=[],y=5;let w=Math.max(1,h-Math.floor(y/2)),k=Math.min(p,w+y-1);k-w+1_(1),disabled:h===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Primera página",children:d.jsx(j1,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>_(h-1),disabled:h===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Anterior",children:d.jsx(nd,{className:"w-4 h-4"})}),w>1&&d.jsx("span",{className:"text-gray-500 px-1",children:"..."}),R.map(L=>d.jsx("button",{onClick:()=>_(L),className:`w-8 h-8 rounded-lg text-sm font-medium transition-colors ${h===L?"bg-[#bb86fc] text-white":"bg-[#1a1a1a] text-gray-400 hover:bg-[#333] hover:text-white"}`,children:L},L)),k_(h+1),disabled:h===p,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Siguiente",children:d.jsx(rd,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>_(p),disabled:h===p,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Última página",children:d.jsx(L1,{className:"w-4 h-4"})})]})};return n&&e?d.jsx("div",{className:"flex flex-col items-center justify-center py-16 animate-in fade-in duration-300",children:d.jsxs("div",{className:"text-gray-400 text-sm animate-pulse",children:['Buscando "',e,'"...']})}):o?d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 justify-center items-start animate-in fade-in duration-300",children:Array.from({length:12}).map((R,y)=>d.jsx(IO,{},y))}):e&&t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 animate-in fade-in duration-300",children:[d.jsx(nl,{className:"w-16 h-16 text-gray-600 mb-4 animate-bounce"}),d.jsx("p",{className:"text-gray-400 text-lg mb-2",children:"No se encontraron resultados"}),d.jsx("p",{className:"text-gray-500 text-sm",children:"Intenta con otros términos de búsqueda"})]}):!e&&t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-20 animate-in fade-in duration-300",children:[d.jsx(nl,{className:"w-16 h-16 text-gray-600 mb-4 animate-bounce"}),d.jsx("p",{className:"text-gray-400 text-lg mb-2",children:"No hay mangas disponibles"}),d.jsx("p",{className:"text-gray-500 text-sm",children:'Crea tu primer manga usando el botón "Nuevo"'})]}):d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 justify-center items-start",children:g.map(R=>d.jsx("div",{children:d.jsx(IS,{id:R.id,title:R.title,author:R.author,pageCount:R.pageCount,thumbnail:R.thumbnail,manga:R.manga,onSelect:()=>r(R.id),onEdit:i,onDelete:s?()=>s(R.id):void 0,isCategoryPlusEnabled:a,isSelected:u.includes(R.id),onToggleSelect:c?()=>c(R.id):void 0})},R.id))}),T()]})}function ro(t){return t.toLowerCase().trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Kh(t,e){const n=ro(t),r=ro(e);if(n===r)return 1;if(n.length<2||r.length<2)return n.includes(r)?.8:0;const i=n.length>r.length?n:r,s=n.length>r.length?r:n,o=CO(s,i);return(i.length-o)/i.length}function CO(t,e){const n=[];for(let r=0;r<=t.length;r++){let i=r;for(let s=0;s<=e.length;s++)if(r===0)n[s]=s;else if(s>0){let o=n[s-1];t.charAt(r-1)!==e.charAt(s-1)&&(o=Math.min(Math.min(o,i),n[s])+1),n[s-1]=i,i=o}r>0&&(n[e.length]=i)}return n[e.length]}function NO(t,e,n={}){const{minChars:r=1,fuzzyMatch:i=!0}=n;if(!e.trim()||e.length{let u=0;const c=Kh(a.title,e),h=Kh(a.author,e),f=ro(a.title).includes(s)?.3:0,p=ro(a.author).includes(s)?.2:0;let g=0,_=0;if(a.categories&&a.categories.length>0){const T=a.categories.map(y=>Kh(y,e));g=Math.max(...T),_=a.categories.some(y=>ro(y).includes(s))?.3:0}return u=Math.max(c*.6+f,h*.4+p,g*.5+_),{item:a,score:u}}).filter(a=>i?a.score>.3:a.score>.7).sort((a,u)=>u.score-a.score).map(a=>a.item);return{items:o,query:e,resultCount:o.length}}function AO(){const[t,e]=F.useState(!1),[n,r]=F.useState(!1),[i,s]=F.useState(!1),[o,a]=F.useState(!1),[u,c]=F.useState(null),[h,f]=F.useState(!1),[p,g]=F.useState(!1),[_,T]=F.useState(!1),[R,y]=F.useState([]),[w,k]=F.useState(!1),[L,U]=F.useState(null),[j,b]=F.useState([]),[x,E]=F.useState(null),[I,N]=F.useState([]),[D,C]=F.useState(!1),[ge,ie]=F.useState(!1),[fe,we]=F.useState(!0),[G,se]=F.useState(""),[A,pe]=F.useState([]),[_e,P]=F.useState([]),[$,Y]=F.useState(()=>localStorage.getItem("sortType")||"modified"),[re,Ce]=F.useState(()=>localStorage.getItem("sortDirection")||"desc");F.useEffect(()=>{const K=new URLSearchParams(window.location.search).get("admin")==="true";a(K)},[]),F.useEffect(()=>{localStorage.setItem("sortType",$)},[$]),F.useEffect(()=>{localStorage.setItem("sortDirection",re)},[re]),F.useEffect(()=>{var me;(me=window.Telegram)!=null&&me.WebApp&&window.Telegram.WebApp.ready(),de();const V=window.location.hash.slice(1);if(V&&V.startsWith("manga/"))if(V.endsWith("/hd")){const O=V.replace("manga/","").replace("/hd","");U(O),C(!0)}else{const O=V.replace("manga/","");U(O),C(!1)}else V==="info"&&ie(!0);const K=()=>{const O=window.location.hash.slice(1);if(!O)U(null),E(null),ie(!1),C(!1);else if(O.startsWith("manga/")){if(O.endsWith("/hd")){const B=O.replace("manga/","").replace("/hd","");U(B),C(!0)}else{const B=O.replace("manga/","");U(B),C(!1)}E(null),ie(!1)}else O==="info"&&(ie(!0),U(null),E(null))};return window.addEventListener("hashchange",K),()=>window.removeEventListener("hashchange",K)},[]),F.useEffect(()=>{!h&&!p&&!_&&y([])},[h,p,_]);async function de(){try{we(!0);const V=await Rd();N(V)}catch(V){console.error("Error loading mangas:",V)}finally{we(!1)}}const Qe=F.useMemo(()=>{const V=new Map;return I.forEach(K=>{var me;(me=K.categories)==null||me.forEach(O=>{V.has(O.id)||V.set(O.id,O)})}),Array.from(V.values())},[I]),Ze=F.useMemo(()=>G.trim()?NO(I.map(V=>({id:V.id,title:V.title,author:V.author,categories:V.categories?V.categories.map(K=>K.name):[]})),G,{fuzzyMatch:!0,minChars:1}):{items:I,query:"",resultCount:I.length},[I,G]),dt=F.useMemo(()=>{let V=Ze.items.length>0?Ze.items.map(me=>I.find(O=>O.id===me.id)).filter(Boolean):[];A.length>0&&(V=V.filter(me=>A.some(O=>{var B;return(B=me.categories)==null?void 0:B.some(oe=>oe.name===O)}))),_e.length>0&&(V=V.filter(me=>_e.includes(me.author)));const K=[...V];return $==="random"?K.sort(()=>Math.random()-.5):(K.sort((me,O)=>{var oe,le;let B=0;if($==="name")B=me.title.localeCompare(O.title);else if($==="date"){const he=new Date(me.created_at||0).getTime(),$e=new Date(O.created_at||0).getTime();B=he-$e}else if($==="modified"){const he=new Date(me.updated_at||me.created_at||0).getTime(),$e=new Date(O.updated_at||O.created_at||0).getTime();B=he-$e}else if($==="pages"){const he=((oe=me.chapters)==null?void 0:oe.reduce((je,He)=>{var et;return je+(((et=He.pages)==null?void 0:et.length)||0)},0))||0,$e=((le=O.chapters)==null?void 0:le.reduce((je,He)=>{var et;return je+(((et=He.pages)==null?void 0:et.length)||0)},0))||0;B=he-$e}else $==="views"&&(B=(me.views||0)-(O.views||0));return re==="asc"?B:-B}),K)},[I,G,Ze.items,$,re,A,_e]),Vt=V=>{c(V),e(!0)},xt=async V=>{try{await Sx(V),await de()}catch(K){console.error("Error deleting manga:",K),alert("Error al eliminar el manga. Por favor intenta de nuevo.")}},Rt=V=>{y(K=>K.includes(V)?K.filter(me=>me!==V):[...K,V])},ln=V=>{if(h||p||_){Rt(V);return}window.location.hash=`manga/${V}`,U(V),C(!1)},St=()=>{window.location.hash="",U(null),ie(!1)},st=V=>{L&&b([...j,L]),window.location.hash=`manga / ${V} `,U(V)},Ht=V=>{pe(K=>K.includes(V)?K.filter(me=>me!==V):[...K,V]),St()},Oe=V=>{pe(K=>K.filter(me=>me!==V))},Ye=V=>{P(K=>K.includes(V)?K.filter(me=>me!==V):[...K,V]),St()},ee=V=>{P(K=>K.filter(me=>me!==V))},Q=F.useMemo(()=>dt.map(V=>{var O,B;const K=((O=V.chapters)==null?void 0:O.length)||0,me=((B=V.chapters)==null?void 0:B.reduce((oe,le)=>{var he;return oe+(((he=le.pages)==null?void 0:he.length)||0)},0))||0;return{id:V.id,title:V.title,author:V.author,chapterCount:K,pageCount:me,thumbnail:V.cover_url||V.thumbnail_url||void 0,manga:V}}),[dt]);if(x)return d.jsx(Nj,{manga:x.manga,chapter:x.chapter,onBack:()=>E(null)});if(ge)return d.jsx(wO,{onBack:St,isAdmin:o});if(L!==null){let V=I.find(K=>K.id===L);return D&&V?d.jsx(c2,{manga:V,onBack:()=>{window.history.back()}}):d.jsx(Cj,{id:L,onBack:()=>{if(j.length>0){const K=j[j.length-1];b(j.slice(0,-1)),window.location.hash=`manga / ${K} `,U(K)}else St()},onReadChapter:K=>{V&&E({manga:V,chapter:K})},onMangaLoaded:K=>{V||(V=K)},onNavigateToManga:st,onSelectCategory:Ht,onSelectAuthor:Ye,isAdmin:o})}return d.jsxs("div",{className:"min-h-screen bg-[#121212] text-white flex flex-col",children:[d.jsx("header",{className:"border-b border-gray-800/50 px-3 sm:px-6 md:px-12 py-4 sm:py-6 flex-shrink-0 transition-all duration-300",children:d.jsxs("div",{className:"max-w-[1800px] mx-auto flex items-center justify-between gap-2 sm:gap-0",children:[d.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 group cursor-pointer",children:[d.jsx("img",{src:"/icons/icones.png",alt:"Twisted Brody Logo",className:"w-10 h-10 sm:w-14 sm:h-14 object-contain transition-all duration-300 group-hover:rotate-12 group-hover:scale-110"}),d.jsx("h1",{className:"text-lg sm:text-2xl font-bold text-white transition-colors duration-300 group-hover:text-[#bb86fc]",children:"Twisted Brody MangaFlow"})]}),d.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3",children:[(h||p||_)&&d.jsxs("div",{className:"hidden sm:flex items-center gap-2 mr-2 px-3 py-1.5 bg-purple-500/10 rounded-lg border border-purple-500/20",children:[d.jsx(F1,{className:"w-4 h-4 text-purple-400"}),d.jsx("span",{className:"text-xs font-semibold text-purple-300",children:p?"Modo Copiar Activo":_?"Modo Eliminar Activo":"Modo Plus Activo"}),d.jsx("span",{className:"text-xs bg-purple-500/20 px-2 py-0.5 rounded text-purple-200",children:R.length})]}),o&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>r(!0),className:"bg-gray-800 hover:bg-gray-700 active:scale-95 text-white px-2 py-2 sm:px-4 sm:py-2.5 rounded-lg flex items-center gap-1.5 sm:gap-2 font-semibold transition-all duration-300 border border-gray-700/50 hover:border-gray-600 text-xs sm:text-sm hover:scale-110 hover:shadow-lg hover:shadow-700/50",title:"Ajustes y Admin",children:[d.jsx($1,{className:"w-4 h-4 sm:w-5 sm:h-5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:"Ajustes"})]}),d.jsxs("button",{onClick:()=>e(!0),className:"bg-purple-600 hover:bg-purple-700 active:scale-95 text-white px-2 py-2 sm:px-4 sm:py-2.5 rounded-lg flex items-center gap-1.5 sm:gap-2 font-semibold transition-all duration-300 shadow-lg shadow-purple-600/30 hover:shadow-purple-600/50 text-xs sm:text-sm hover:scale-110",children:[d.jsx(co,{className:"w-4 h-4 sm:w-5 sm:h-5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:"Nuevo Manga"})]})]})]})]})}),d.jsxs("main",{className:"flex-1 px-4 sm:px-6 md:px-12 py-8",children:[d.jsx(Tj,{isAdmin:o}),d.jsxs("div",{className:"max-w-[1800px] mx-auto mb-8 flex-shrink-0",children:[d.jsx(TO,{value:G,onChange:se,placeholder:"Buscar por título, autor...",sortType:$,onSortTypeChange:Y,sortDirection:re,onSortDirectionChange:Ce,onOpenFilter:()=>s(!0)}),G&&d.jsxs("div",{className:"mt-2 text-sm text-gray-400",children:[Ze.resultCount," resultado",Ze.resultCount!==1?"s":""," encontrado",Ze.resultCount!==1?"s":""]}),(A.length>0||_e.length>0)&&d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2 animate-in fade-in slide-in-from-top-2 duration-300",children:[d.jsx("span",{className:"text-sm text-gray-400",children:"Filtrado por:"}),A.map(V=>d.jsxs("button",{onClick:()=>Oe(V),className:"bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 px-3 py-1 rounded-full text-sm font-medium flex items-center gap-2 border border-purple-500/30 hover:border-purple-500/50 transition-all group",children:[V,d.jsx("div",{className:"bg-purple-500/20 rounded-full p-0.5 group-hover:bg-purple-500/40 transition-colors",children:d.jsx(co,{className:"w-3 h-3 transform rotate-45"})})]},V)),_e.map(V=>d.jsxs("button",{onClick:()=>ee(V),className:"bg-[#bb86fc]/20 hover:bg-[#bb86fc]/30 text-[#bb86fc] px-3 py-1 rounded-full text-sm font-medium flex items-center gap-2 border border-[#bb86fc]/30 hover:border-[#bb86fc]/50 transition-all group",children:[d.jsx(Cm,{size:14}),V,d.jsx("div",{className:"bg-[#bb86fc]/20 rounded-full p-0.5 group-hover:bg-[#bb86fc]/40 transition-colors",children:d.jsx(co,{className:"w-3 h-3 transform rotate-45"})})]},V)),(A.length>0||_e.length>0)&&d.jsx("button",{onClick:()=>{pe([]),P([])},className:"text-xs text-gray-400 hover:text-white underline decoration-gray-600 hover:decoration-white transition-colors ml-2",children:"Limpiar todo"})]})]}),d.jsx("div",{className:"max-w-[1800px] mx-auto",children:d.jsxs(d.Fragment,{children:[d.jsx("link",{rel:"preconnect",href:"https://i.ibb.co"}),d.jsx(kO,{items:Q,searchTerm:G,isSearching:!1,isLoading:fe,onSelectComic:ln,onEditManga:o?Vt:void 0,onDeleteManga:o?xt:void 0,isCategoryPlusEnabled:h||p||_,selectedMangaIds:R,onToggleSelectManga:Rt})]})})]}),(h||p||_)&&R.length>0&&d.jsx("div",{className:"fixed bottom-6 left-1/2 transform -translate-x-1/2 z-40 animate-in slide-in-from-bottom-4 duration-200",children:d.jsxs("div",{className:"bg-[#1a1a1a] border border-gray-700/50 shadow-2xl rounded-xl px-6 py-3 flex items-center gap-4",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsxs("span",{className:"text-sm font-bold text-white",children:[R.length," seleccionados"]}),d.jsx("span",{className:"text-xs text-gray-400",children:"Listos para acción"})]}),d.jsx("div",{className:"h-8 w-px bg-gray-700"}),d.jsx("button",{onClick:()=>y([]),className:"text-gray-400 hover:text-white text-sm font-semibold transition-colors",children:"Cancelar"}),d.jsxs("div",{className:"flex gap-2",children:[h&&d.jsx("button",{onClick:()=>k(!0),className:"bg-[#bb86fc] hover:bg-[#9966dd] text-white px-4 py-2 rounded-lg text-sm font-bold shadow-lg shadow-purple-500/20 transition-all transform hover:scale-105 active:scale-95",children:"Aplicar Categorías"}),p&&d.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(R.join(", ")),kt.success("IDs copiados al portapapeles"),y([])},className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm font-bold shadow-lg shadow-blue-500/20 transition-all transform hover:scale-105 active:scale-95 flex items-center gap-2",children:[d.jsx(O1,{className:"w-4 h-4"}),"Copiar IDs"]}),_&&d.jsx("button",{onClick:async()=>{if(window.confirm(`¿Seguro que quieres eliminar ${R.length} mangas de forma masiva? Esta acción no se puede deshacer.`))try{for(const V of R)await Sx(V);kt.success(`Se eliminaron ${R.length} mangas correctamente.`),y([]),de()}catch(V){console.error("Error in bulk delete:",V),kt.error("Ocurrió un error al intentar eliminar los mangas")}},className:"bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg text-sm font-bold shadow-lg shadow-red-500/20 transition-all transform hover:scale-105 active:scale-95",children:"Eliminar Selección"})]})]})}),d.jsx(id,{}),d.jsx(bj,{isOpen:t,onClose:()=>{e(!1),c(null)},editingManga:u,onMangaCreated:V=>{de(),c(null),V&&!u&&setTimeout(()=>{ln(V)},500)},onDelete:o?xt:void 0}),d.jsx(bO,{isOpen:w,onClose:()=>k(!1),selectedMangaIds:R,onSaveComplete:()=>{de(),y([])}}),d.jsx(Sj,{isOpen:n,onClose:()=>r(!1),isAdmin:o,onAdminChange:a,isCategoryPlusEnabled:h,onCategoryPlusChange:f,isCopyIdsEnabled:p,onCopyIdsChange:g,isDeletePlusEnabled:_,onDeletePlusChange:T}),d.jsx(SO,{isOpen:i,onClose:()=>s(!1),categories:Qe,selectedCategories:A,onToggleCategory:Ht,onClearFilters:()=>pe([])}),d.jsx(wj,{position:"top-center",richColors:!0,theme:"dark"})]})}D1(document.getElementById("root")).render(d.jsx(F.StrictMode,{children:d.jsx(AO,{})})); diff --git a/dist/assets/index-DfHziy0I.css b/dist/assets/index-DfHziy0I.css new file mode 100644 index 0000000000000000000000000000000000000000..a144f9fafabc7ed954807f853733d8aabebf8797 --- /dev/null +++ b/dist/assets/index-DfHziy0I.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-1\.5{left:.375rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.right-8{right:2rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-6{top:1.5rem}.top-8{top:2rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-\[2\/3\]{aspect-ratio:2/3}.aspect-\[3\/4\]{aspect-ratio:3/4}.h-1{height:.25rem}.h-1\/3{height:33.333333%}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[500px\]{height:500px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-40{max-height:10rem}.max-h-60{max-height:15rem}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-\[100px\]{min-height:100px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[300\%\]{width:300%}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[3ch\]{min-width:3ch}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[150px\]{max-width:150px}.max-w-\[1800px\]{max-width:1800px}.max-w-\[1920px\]{max-width:1920px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-left{transform-origin:left}.origin-right{transform-origin:right}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-\[fadeIn_0\.7s_ease-out_forwards\]{animation:fadeIn .7s ease-out forwards}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#bb86fc\]{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.border-\[\#bb86fc\]\/30{border-color:#bb86fc4d}.border-\[\#bb86fc\]\/40{border-color:#bb86fc66}.border-\[\#bb86fc\]\/50{border-color:#bb86fc80}.border-blue-500\/30{border-color:#3b82f64d}.border-gray-500\/30{border-color:#6b72804d}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-600\/50{border-color:#4b556380}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-700\/30{border-color:#3741514d}.border-gray-700\/40{border-color:#37415166}.border-gray-700\/50{border-color:#37415180}.border-gray-700\/60{border-color:#37415199}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-gray-800\/50{border-color:#1f293780}.border-gray-900{--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-pink-500\/30{border-color:#ec48994d}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-purple-500\/50{border-color:#a855f780}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-transparent{border-color:transparent}.border-white\/50{border-color:#ffffff80}.border-t-transparent{border-top-color:transparent}.bg-\[\#050505\]{--tw-bg-opacity: 1;background-color:rgb(5 5 5 / var(--tw-bg-opacity, 1))}.bg-\[\#0a0a0a\]{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-\[\#0f0f0f\]{--tw-bg-opacity: 1;background-color:rgb(15 15 15 / var(--tw-bg-opacity, 1))}.bg-\[\#121212\]{--tw-bg-opacity: 1;background-color:rgb(18 18 18 / var(--tw-bg-opacity, 1))}.bg-\[\#121212\]\/90{background-color:#121212e6}.bg-\[\#151515\]{--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#1f1f1f\]{--tw-bg-opacity: 1;background-color:rgb(31 31 31 / var(--tw-bg-opacity, 1))}.bg-\[\#252525\]{--tw-bg-opacity: 1;background-color:rgb(37 37 37 / var(--tw-bg-opacity, 1))}.bg-\[\#bb86fc\]{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.bg-\[\#bb86fc\]\/10{background-color:#bb86fc1a}.bg-\[\#bb86fc\]\/20{background-color:#bb86fc33}.bg-\[\#bb86fc\]\/90{background-color:#bb86fce6}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/95{background-color:#000000f2}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-700\/40{background-color:#37415166}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600\/90{background-color:#16a34ae6}.bg-pink-500\/20{background-color:#ec489933}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-600\/80{background-color:#dc2626cc}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-\[\#1a1a1a\]{--tw-gradient-from: #1a1a1a var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 26 26 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#1f1f1f\]{--tw-gradient-from: #1f1f1f var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 31 31 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#1f1f1f\]\/80{--tw-gradient-from: rgb(31 31 31 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 31 31 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#242424\]{--tw-gradient-from: #242424 var(--tw-gradient-from-position);--tw-gradient-to: rgb(36 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#2a2a2a\]{--tw-gradient-from: #2a2a2a var(--tw-gradient-from-position);--tw-gradient-to: rgb(42 42 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#2a2a2a\]\/80{--tw-gradient-from: rgb(42 42 42 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(42 42 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#9966dd\]{--tw-gradient-from: #9966dd var(--tw-gradient-from-position);--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#bb86fc\]{--tw-gradient-from: #bb86fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(187 134 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#bb86fc\]\/20{--tw-gradient-from: rgb(187 134 252 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(187 134 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-700\/40{--tw-gradient-from: rgb(55 65 81 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(55 65 81 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800{--tw-gradient-from: #1f2937 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-\[\#9966dd\]{--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #9966dd var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/20{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-\[\#0f0f0f\]{--tw-gradient-to: #0f0f0f var(--tw-gradient-to-position)}.to-\[\#121212\]{--tw-gradient-to: #121212 var(--tw-gradient-to-position)}.to-\[\#1a1a1a\]{--tw-gradient-to: #1a1a1a var(--tw-gradient-to-position)}.to-\[\#1a1a1a\]\/80{--tw-gradient-to: rgb(26 26 26 / .8) var(--tw-gradient-to-position)}.to-\[\#1f1f1f\]\/80{--tw-gradient-to: rgb(31 31 31 / .8) var(--tw-gradient-to-position)}.to-\[\#252525\]{--tw-gradient-to: #252525 var(--tw-gradient-to-position)}.to-\[\#7744cc\]{--tw-gradient-to: #7744cc var(--tw-gradient-to-position)}.to-\[\#9966dd\]{--tw-gradient-to: #9966dd var(--tw-gradient-to-position)}.to-\[\#bb86fc\]{--tw-gradient-to: #bb86fc var(--tw-gradient-to-position)}.to-gray-400{--tw-gradient-to: #9ca3af var(--tw-gradient-to-position)}.to-gray-600\/40{--tw-gradient-to: rgb(75 85 99 / .4) var(--tw-gradient-to-position)}.to-gray-900{--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-left{-o-object-position:left;object-position:left}.object-right{-o-object-position:right;object-position:right}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\[\#bb86fc\]{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-pink-300{--tw-text-opacity: 1;color:rgb(249 168 212 / var(--tw-text-opacity, 1))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.text-purple-100{--tw-text-opacity: 1;color:rgb(243 232 255 / var(--tw-text-opacity, 1))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/40{color:#fff6}.text-white\/70{color:#ffffffb3}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.decoration-gray-600{text-decoration-color:#4b5563}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.accent-\[\#bb86fc\]{accent-color:#bb86fc}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_15px_-3px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow: 0 0 15px -3px rgba(168,85,247,.3);--tw-shadow-colored: 0 0 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[\#bb86fc\]\/10{--tw-shadow-color: rgb(187 134 252 / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/20{--tw-shadow-color: rgb(187 134 252 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/30{--tw-shadow-color: rgb(187 134 252 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/40{--tw-shadow-color: rgb(187 134 252 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-black\/50{--tw-shadow-color: rgb(0 0 0 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/40{--tw-shadow-color: rgb(34 197 94 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/20{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-600\/30{--tw-shadow-color: rgb(147 51 234 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-900\/20{--tw-shadow-color: rgb(88 28 135 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/20{--tw-shadow-color: rgb(239 68 68 / .2);--tw-shadow: var(--tw-shadow-colored)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-\[\#bb86fc\]{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 134 252 / var(--tw-ring-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes quickFadeIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}.animate-quick-fade-in{animation:quickFadeIn .15s ease-out forwards}@keyframes smoothFadeIn{0%{opacity:0;transform:scale(.98)}50%{opacity:.5}to{opacity:1;transform:scale(1)}}.animate-smooth-fade-in{animation:smoothFadeIn 1.2s ease-out forwards}.masonry-container{-moz-column-count:2;column-count:2;-moz-column-gap:4px;column-gap:4px}@media (min-width: 640px){.masonry-container{-moz-column-count:3;column-count:3}}@media (min-width: 768px){.masonry-container{-moz-column-count:4;column-count:4}}@media (min-width: 1024px){.masonry-container{-moz-column-count:5;column-count:5}}@media (min-width: 1280px){.masonry-container{-moz-column-count:6;column-count:6}}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.animate-shimmer{animation:shimmer 2.5s infinite}.masonry-item{-moz-column-break-inside:avoid;break-inside:avoid;margin-bottom:4px;display:inline-block;width:100%}@keyframes slideInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideInLeft{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes slideInRight{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes glow{0%,to{box-shadow:0 0 5px #8b5cf61a}50%{box-shadow:0 0 20px #8b5cf64d}}@keyframes pulse-color{0%,to{color:currentColor}50%{color:#8b5cf699}}.animate-slide-in-up{animation:slideInUp .5s ease-out forwards}.animate-slide-in-down{animation:slideInDown .5s ease-out forwards}.animate-slide-in-left{animation:slideInLeft .5s ease-out forwards}.animate-slide-in-right{animation:slideInRight .5s ease-out forwards}.animate-glow{animation:glow 2s ease-in-out infinite}.animate-pulse-color{animation:pulse-color 2s ease-in-out infinite}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:rotate-180:hover{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:rotate-90:hover{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[\#24A1DE\]:hover{--tw-border-opacity: 1;border-color:rgb(36 161 222 / var(--tw-border-opacity, 1))}.hover\:border-\[\#FF424D\]:hover{--tw-border-opacity: 1;border-color:rgb(255 66 77 / var(--tw-border-opacity, 1))}.hover\:border-\[\#bb86fc\]:hover{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.hover\:border-\[\#bb86fc\]\/50:hover{border-color:#bb86fc80}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:border-gray-500:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:border-gray-600\/70:hover{border-color:#4b5563b3}.hover\:border-gray-700:hover{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.hover\:border-gray-700\/60:hover{border-color:#37415199}.hover\:border-purple-500:hover{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.hover\:border-purple-500\/50:hover{border-color:#a855f780}.hover\:border-red-500\/40:hover{border-color:#ef444466}.hover\:border-white:hover{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#1f1f1f\]:hover{--tw-bg-opacity: 1;background-color:rgb(31 31 31 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#242424\]:hover{--tw-bg-opacity: 1;background-color:rgb(36 36 36 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#2a2a2a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 42 42 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#333\]:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#9966dd\]:hover{--tw-bg-opacity: 1;background-color:rgb(153 102 221 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#bb86fc\]:hover{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#bb86fc\]\/10:hover{background-color:#bb86fc1a}.hover\:bg-\[\#bb86fc\]\/20:hover{background-color:#bb86fc33}.hover\:bg-\[\#bb86fc\]\/30:hover{background-color:#bb86fc4d}.hover\:bg-\[\#bb86fc\]\/5:hover{background-color:#bb86fc0d}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-500\/30:hover{background-color:#a855f74d}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-700:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/20:hover{background-color:#ef444433}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:from-\[\#9966dd\]:hover{--tw-gradient-from: #9966dd var(--tw-gradient-from-position);--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-gray-700\/60:hover{--tw-gradient-from: rgb(55 65 81 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(55 65 81 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-\[\#7744cc\]:hover{--tw-gradient-to: #7744cc var(--tw-gradient-to-position)}.hover\:to-gray-600\/60:hover{--tw-gradient-to: rgb(75 85 99 / .6) var(--tw-gradient-to-position)}.hover\:text-\[\#24A1DE\]:hover{--tw-text-opacity: 1;color:rgb(36 161 222 / var(--tw-text-opacity, 1))}.hover\:text-\[\#FF424D\]:hover{--tw-text-opacity: 1;color:rgb(255 66 77 / var(--tw-text-opacity, 1))}.hover\:text-\[\#bb86fc\]:hover{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.hover\:text-purple-400:hover{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-white:hover{text-decoration-color:#fff}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-\[\#bb86fc\]\/60:hover{--tw-shadow-color: rgb(187 134 252 / .6);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/10:hover{--tw-shadow-color: rgb(168 85 247 / .1);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/20:hover{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-600\/50:hover{--tw-shadow-color: rgb(147 51 234 / .5);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-\[\#bb86fc\]:focus{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.focus\:border-purple-500:focus{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.focus\:border-purple-500\/50:focus{border-color:#a855f780}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[\#bb86fc\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 134 252 / var(--tw-ring-opacity, 1))}.focus\:ring-\[\#bb86fc\]\/30:focus{--tw-ring-color: rgb(187 134 252 / .3)}.focus\:ring-purple-500\/50:focus{--tw-ring-color: rgb(168 85 247 / .5)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-70:disabled{opacity:.7}.disabled\:hover\:border-gray-700:hover:disabled{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.disabled\:hover\:bg-\[\#1a1a1a\]:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.disabled\:hover\:text-gray-500:hover:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[1\.08\]{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[1\.10\]{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:bg-purple-500\/40{background-color:#a855f766}.group:hover .group-hover\:text-\[\#bb86fc\]{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-white\/60{color:#fff9}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:shadow-\[\#bb86fc\]\/30{--tw-shadow-color: rgb(187 134 252 / .3);--tw-shadow: var(--tw-shadow-colored)}.group:hover .group-hover\:shadow-\[\#bb86fc\]\/60{--tw-shadow-color: rgb(187 134 252 / .6);--tw-shadow: var(--tw-shadow-colored)}.peer:checked~.peer-checked\:bg-\[\#bb86fc\]{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.peer:focus~.peer-focus\:ring-purple-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(216 180 254 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:left-8{left:2rem}.sm\:right-8{right:2rem}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:mt-12{margin-top:3rem}.sm\:mt-2{margin-top:.5rem}.sm\:mt-8{margin-top:2rem}.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-14{height:3.5rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:w-10{width:2.5rem}.sm\:w-14{width:3.5rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-64{width:16rem}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:gap-0{gap:0px}.sm\:gap-1\.5{gap:.375rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:p-12{padding:3rem}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pt-12{padding-top:3rem}.sm\:pt-8{padding-top:2rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:right-8{right:2rem}.md\:flex{display:flex}.md\:hidden{display:none}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-3{gap:.75rem}.md\:p-12{padding:3rem}.md\:px-12{padding-left:3rem;padding-right:3rem}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (prefers-color-scheme: dark){.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 33 168 / var(--tw-ring-opacity, 1))}} diff --git a/dist/assets/index-KKRSwvot.css b/dist/assets/index-KKRSwvot.css new file mode 100644 index 0000000000000000000000000000000000000000..d578fb28f4771d34fb224cf63c1612bad7ea89a7 --- /dev/null +++ b/dist/assets/index-KKRSwvot.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-1\.5{left:.375rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.right-8{right:2rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-6{top:1.5rem}.top-8{top:2rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-\[2\/3\]{aspect-ratio:2/3}.aspect-\[3\/4\]{aspect-ratio:3/4}.h-1{height:.25rem}.h-1\/3{height:33.333333%}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[500px\]{height:500px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-60{max-height:15rem}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[300\%\]{width:300%}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[3ch\]{min-width:3ch}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[150px\]{max-width:150px}.max-w-\[1800px\]{max-width:1800px}.max-w-\[1920px\]{max-width:1920px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-left{transform-origin:left}.origin-right{transform-origin:right}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-\[fadeIn_0\.7s_ease-out_forwards\]{animation:fadeIn .7s ease-out forwards}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#bb86fc\]{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.border-\[\#bb86fc\]\/30{border-color:#bb86fc4d}.border-\[\#bb86fc\]\/40{border-color:#bb86fc66}.border-\[\#bb86fc\]\/50{border-color:#bb86fc80}.border-blue-500\/30{border-color:#3b82f64d}.border-gray-500\/30{border-color:#6b72804d}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-600\/50{border-color:#4b556380}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-700\/30{border-color:#3741514d}.border-gray-700\/40{border-color:#37415166}.border-gray-700\/50{border-color:#37415180}.border-gray-700\/60{border-color:#37415199}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-gray-800\/50{border-color:#1f293780}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-pink-500\/30{border-color:#ec48994d}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-purple-500\/50{border-color:#a855f780}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-transparent{border-color:transparent}.border-white\/50{border-color:#ffffff80}.border-t-transparent{border-top-color:transparent}.bg-\[\#050505\]{--tw-bg-opacity: 1;background-color:rgb(5 5 5 / var(--tw-bg-opacity, 1))}.bg-\[\#0a0a0a\]{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-\[\#0f0f0f\]{--tw-bg-opacity: 1;background-color:rgb(15 15 15 / var(--tw-bg-opacity, 1))}.bg-\[\#121212\]{--tw-bg-opacity: 1;background-color:rgb(18 18 18 / var(--tw-bg-opacity, 1))}.bg-\[\#121212\]\/90{background-color:#121212e6}.bg-\[\#151515\]{--tw-bg-opacity: 1;background-color:rgb(21 21 21 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#1a1a1a\]\/50{background-color:#1a1a1a80}.bg-\[\#1f1f1f\]{--tw-bg-opacity: 1;background-color:rgb(31 31 31 / var(--tw-bg-opacity, 1))}.bg-\[\#252525\]{--tw-bg-opacity: 1;background-color:rgb(37 37 37 / var(--tw-bg-opacity, 1))}.bg-\[\#bb86fc\]{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.bg-\[\#bb86fc\]\/10{background-color:#bb86fc1a}.bg-\[\#bb86fc\]\/20{background-color:#bb86fc33}.bg-\[\#bb86fc\]\/90{background-color:#bb86fce6}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/95{background-color:#000000f2}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-700\/40{background-color:#37415166}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600\/90{background-color:#16a34ae6}.bg-pink-500\/20{background-color:#ec489933}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.bg-purple-900\/90{background-color:#581c87e6}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-600\/80{background-color:#dc2626cc}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-\[\#1a1a1a\]{--tw-gradient-from: #1a1a1a var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 26 26 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#1f1f1f\]{--tw-gradient-from: #1f1f1f var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 31 31 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#1f1f1f\]\/80{--tw-gradient-from: rgb(31 31 31 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 31 31 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#242424\]{--tw-gradient-from: #242424 var(--tw-gradient-from-position);--tw-gradient-to: rgb(36 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#2a2a2a\]{--tw-gradient-from: #2a2a2a var(--tw-gradient-from-position);--tw-gradient-to: rgb(42 42 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#2a2a2a\]\/80{--tw-gradient-from: rgb(42 42 42 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(42 42 42 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#9966dd\]{--tw-gradient-from: #9966dd var(--tw-gradient-from-position);--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#bb86fc\]{--tw-gradient-from: #bb86fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(187 134 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#bb86fc\]\/20{--tw-gradient-from: rgb(187 134 252 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(187 134 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-700\/40{--tw-gradient-from: rgb(55 65 81 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(55 65 81 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-800{--tw-gradient-from: #1f2937 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 41 55 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-\[\#9966dd\]{--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #9966dd var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/20{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-\[\#0f0f0f\]{--tw-gradient-to: #0f0f0f var(--tw-gradient-to-position)}.to-\[\#121212\]{--tw-gradient-to: #121212 var(--tw-gradient-to-position)}.to-\[\#1a1a1a\]{--tw-gradient-to: #1a1a1a var(--tw-gradient-to-position)}.to-\[\#1a1a1a\]\/80{--tw-gradient-to: rgb(26 26 26 / .8) var(--tw-gradient-to-position)}.to-\[\#1f1f1f\]{--tw-gradient-to: #1f1f1f var(--tw-gradient-to-position)}.to-\[\#1f1f1f\]\/80{--tw-gradient-to: rgb(31 31 31 / .8) var(--tw-gradient-to-position)}.to-\[\#252525\]{--tw-gradient-to: #252525 var(--tw-gradient-to-position)}.to-\[\#7744cc\]{--tw-gradient-to: #7744cc var(--tw-gradient-to-position)}.to-\[\#9966dd\]{--tw-gradient-to: #9966dd var(--tw-gradient-to-position)}.to-\[\#bb86fc\]{--tw-gradient-to: #bb86fc var(--tw-gradient-to-position)}.to-gray-400{--tw-gradient-to: #9ca3af var(--tw-gradient-to-position)}.to-gray-600\/40{--tw-gradient-to: rgb(75 85 99 / .4) var(--tw-gradient-to-position)}.to-gray-900{--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-left{-o-object-position:left;object-position:left}.object-right{-o-object-position:right;object-position:right}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\[\#bb86fc\]{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-pink-300{--tw-text-opacity: 1;color:rgb(249 168 212 / var(--tw-text-opacity, 1))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.text-purple-100{--tw-text-opacity: 1;color:rgb(243 232 255 / var(--tw-text-opacity, 1))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/40{color:#fff6}.text-white\/70{color:#ffffffb3}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.decoration-gray-600{text-decoration-color:#4b5563}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.accent-\[\#bb86fc\]{accent-color:#bb86fc}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_15px_-3px_rgba\(168\,85\,247\,0\.3\)\]{--tw-shadow: 0 0 15px -3px rgba(168,85,247,.3);--tw-shadow-colored: 0 0 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[\#bb86fc\]\/10{--tw-shadow-color: rgb(187 134 252 / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/20{--tw-shadow-color: rgb(187 134 252 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/30{--tw-shadow-color: rgb(187 134 252 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[\#bb86fc\]\/40{--tw-shadow-color: rgb(187 134 252 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-black\/50{--tw-shadow-color: rgb(0 0 0 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/40{--tw-shadow-color: rgb(34 197 94 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/20{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-600\/30{--tw-shadow-color: rgb(147 51 234 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-900\/20{--tw-shadow-color: rgb(88 28 135 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/20{--tw-shadow-color: rgb(239 68 68 / .2);--tw-shadow: var(--tw-shadow-colored)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-\[\#bb86fc\]{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 134 252 / var(--tw-ring-opacity, 1))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-none{transition-property:none}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes quickFadeIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}.animate-quick-fade-in{animation:quickFadeIn .15s ease-out forwards}@keyframes smoothFadeIn{0%{opacity:0;transform:scale(.98)}50%{opacity:.5}to{opacity:1;transform:scale(1)}}.animate-smooth-fade-in{animation:smoothFadeIn 1.2s ease-out forwards}.masonry-container{-moz-column-count:2;column-count:2;-moz-column-gap:4px;column-gap:4px}@media (min-width: 640px){.masonry-container{-moz-column-count:3;column-count:3}}@media (min-width: 768px){.masonry-container{-moz-column-count:4;column-count:4}}@media (min-width: 1024px){.masonry-container{-moz-column-count:5;column-count:5}}@media (min-width: 1280px){.masonry-container{-moz-column-count:6;column-count:6}}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.animate-shimmer{animation:shimmer 2.5s infinite}.masonry-item{-moz-column-break-inside:avoid;break-inside:avoid;margin-bottom:4px;display:inline-block;width:100%}@keyframes slideInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideInLeft{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes slideInRight{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes glow{0%,to{box-shadow:0 0 5px #8b5cf61a}50%{box-shadow:0 0 20px #8b5cf64d}}@keyframes pulse-color{0%,to{color:currentColor}50%{color:#8b5cf699}}.animate-slide-in-up{animation:slideInUp .5s ease-out forwards}.animate-slide-in-down{animation:slideInDown .5s ease-out forwards}.animate-slide-in-left{animation:slideInLeft .5s ease-out forwards}.animate-slide-in-right{animation:slideInRight .5s ease-out forwards}.animate-glow{animation:glow 2s ease-in-out infinite}.animate-pulse-color{animation:pulse-color 2s ease-in-out infinite}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:rotate-180:hover{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:rotate-90:hover{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[\#24A1DE\]:hover{--tw-border-opacity: 1;border-color:rgb(36 161 222 / var(--tw-border-opacity, 1))}.hover\:border-\[\#FF424D\]:hover{--tw-border-opacity: 1;border-color:rgb(255 66 77 / var(--tw-border-opacity, 1))}.hover\:border-\[\#bb86fc\]:hover{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.hover\:border-\[\#bb86fc\]\/50:hover{border-color:#bb86fc80}.hover\:border-gray-500:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:border-gray-600\/70:hover{border-color:#4b5563b3}.hover\:border-gray-700:hover{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.hover\:border-gray-700\/60:hover{border-color:#37415199}.hover\:border-purple-500:hover{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.hover\:border-purple-500\/50:hover{border-color:#a855f780}.hover\:border-red-500\/40:hover{border-color:#ef444466}.hover\:border-white:hover{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#1f1f1f\]:hover{--tw-bg-opacity: 1;background-color:rgb(31 31 31 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#242424\]:hover{--tw-bg-opacity: 1;background-color:rgb(36 36 36 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#2a2a2a\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 42 42 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#333\]:hover{--tw-bg-opacity: 1;background-color:rgb(51 51 51 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#9966dd\]:hover{--tw-bg-opacity: 1;background-color:rgb(153 102 221 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#bb86fc\]:hover{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#bb86fc\]\/10:hover{background-color:#bb86fc1a}.hover\:bg-\[\#bb86fc\]\/20:hover{background-color:#bb86fc33}.hover\:bg-\[\#bb86fc\]\/30:hover{background-color:#bb86fc4d}.hover\:bg-\[\#bb86fc\]\/5:hover{background-color:#bb86fc0d}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-500\/30:hover{background-color:#a855f74d}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-700:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/20:hover{background-color:#ef444433}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:from-\[\#9966dd\]:hover{--tw-gradient-from: #9966dd var(--tw-gradient-from-position);--tw-gradient-to: rgb(153 102 221 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-gray-700\/60:hover{--tw-gradient-from: rgb(55 65 81 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(55 65 81 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-\[\#7744cc\]:hover{--tw-gradient-to: #7744cc var(--tw-gradient-to-position)}.hover\:to-gray-600\/60:hover{--tw-gradient-to: rgb(75 85 99 / .6) var(--tw-gradient-to-position)}.hover\:text-\[\#24A1DE\]:hover{--tw-text-opacity: 1;color:rgb(36 161 222 / var(--tw-text-opacity, 1))}.hover\:text-\[\#FF424D\]:hover{--tw-text-opacity: 1;color:rgb(255 66 77 / var(--tw-text-opacity, 1))}.hover\:text-\[\#bb86fc\]:hover{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.hover\:text-purple-400:hover{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-white:hover{text-decoration-color:#fff}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-\[\#bb86fc\]\/60:hover{--tw-shadow-color: rgb(187 134 252 / .6);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/10:hover{--tw-shadow-color: rgb(168 85 247 / .1);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/20:hover{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-600\/50:hover{--tw-shadow-color: rgb(147 51 234 / .5);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-\[\#bb86fc\]:focus{--tw-border-opacity: 1;border-color:rgb(187 134 252 / var(--tw-border-opacity, 1))}.focus\:border-purple-500:focus{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.focus\:border-purple-500\/50:focus{border-color:#a855f780}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[\#bb86fc\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 134 252 / var(--tw-ring-opacity, 1))}.focus\:ring-\[\#bb86fc\]\/30:focus{--tw-ring-color: rgb(187 134 252 / .3)}.focus\:ring-purple-500\/50:focus{--tw-ring-color: rgb(168 85 247 / .5)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:border-gray-700:hover:disabled{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.disabled\:hover\:bg-\[\#1a1a1a\]:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.disabled\:hover\:text-gray-500:hover:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[1\.08\]{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[1\.10\]{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:bg-\[\#bb86fc\]\/40{background-color:#bb86fc66}.group:hover .group-hover\:bg-purple-500\/40{background-color:#a855f766}.group:hover .group-hover\:text-\[\#bb86fc\]{--tw-text-opacity: 1;color:rgb(187 134 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-white\/60{color:#fff9}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:shadow-\[\#bb86fc\]\/30{--tw-shadow-color: rgb(187 134 252 / .3);--tw-shadow: var(--tw-shadow-colored)}.group:hover .group-hover\:shadow-\[\#bb86fc\]\/60{--tw-shadow-color: rgb(187 134 252 / .6);--tw-shadow: var(--tw-shadow-colored)}.peer:checked~.peer-checked\:bg-\[\#bb86fc\]{--tw-bg-opacity: 1;background-color:rgb(187 134 252 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.peer:focus~.peer-focus\:ring-purple-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(216 180 254 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:left-8{left:2rem}.sm\:right-8{right:2rem}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:mt-12{margin-top:3rem}.sm\:mt-2{margin-top:.5rem}.sm\:mt-8{margin-top:2rem}.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-14{height:3.5rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:w-10{width:2.5rem}.sm\:w-14{width:3.5rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-64{width:16rem}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:gap-0{gap:0px}.sm\:gap-1\.5{gap:.375rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:p-12{padding:3rem}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pt-12{padding-top:3rem}.sm\:pt-8{padding-top:2rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:right-8{right:2rem}.md\:flex{display:flex}.md\:hidden{display:none}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-3{gap:.75rem}.md\:p-12{padding:3rem}.md\:px-12{padding-left:3rem;padding-right:3rem}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (prefers-color-scheme: dark){.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.peer:focus~.dark\:peer-focus\:ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 33 168 / var(--tw-ring-opacity, 1))}} diff --git a/dist/assets/index-qBndKydj.js b/dist/assets/index-qBndKydj.js new file mode 100644 index 0000000000000000000000000000000000000000..cfad9673608f1ce7ba13080e733e208283114932 --- /dev/null +++ b/dist/assets/index-qBndKydj.js @@ -0,0 +1,3687 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ec=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Uw={exports:{}},Xc={},zw={exports:{}},ze={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Tl=Symbol.for("react.element"),YT=Symbol.for("react.portal"),XT=Symbol.for("react.fragment"),JT=Symbol.for("react.strict_mode"),ZT=Symbol.for("react.profiler"),eS=Symbol.for("react.provider"),tS=Symbol.for("react.context"),nS=Symbol.for("react.forward_ref"),rS=Symbol.for("react.suspense"),iS=Symbol.for("react.memo"),sS=Symbol.for("react.lazy"),Ky=Symbol.iterator;function oS(t){return t===null||typeof t!="object"?null:(t=Ky&&t[Ky]||t["@@iterator"],typeof t=="function"?t:null)}var Bw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$w=Object.assign,Hw={};function Fo(t,e,n){this.props=t,this.context=e,this.refs=Hw,this.updater=n||Bw}Fo.prototype.isReactComponent={};Fo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Fo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function qw(){}qw.prototype=Fo.prototype;function Gp(t,e,n){this.props=t,this.context=e,this.refs=Hw,this.updater=n||Bw}var Kp=Gp.prototype=new qw;Kp.constructor=Gp;$w(Kp,Fo.prototype);Kp.isPureReactComponent=!0;var Qy=Array.isArray,Ww=Object.prototype.hasOwnProperty,Qp={current:null},Gw={key:!0,ref:!0,__self:!0,__source:!0};function Kw(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Ww.call(e,r)&&!Gw.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,ye=q[ge];if(0>>1;gei(Z,k))iei(Te,Z)?(q[ge]=Te,q[ie]=k,ge=ie):(q[ge]=Z,q[$]=k,ge=$);else if(iei(Te,k))q[ge]=Te,q[ie]=k,ge=ie;else break e}}return oe}function i(q,oe){var k=q.sortIndex-oe.sortIndex;return k!==0?k:q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var u=[],c=[],f=1,h=null,p=3,g=!1,_=!1,S=!1,P=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(q){for(var oe=n(c);oe!==null;){if(oe.callback===null)r(c);else if(oe.startTime<=q)r(c),oe.sortIndex=oe.expirationTime,e(u,oe);else break;oe=n(c)}}function O(q){if(S=!1,E(q),!_)if(n(u)!==null)_=!0,le(L);else{var oe=n(c);oe!==null&&me(O,oe.startTime-q)}}function L(q,oe){_=!1,S&&(S=!1,v(w),w=-1),g=!0;var k=p;try{for(E(oe),h=n(u);h!==null&&(!(h.expirationTime>oe)||q&&!N());){var ge=h.callback;if(typeof ge=="function"){h.callback=null,p=h.priorityLevel;var ye=ge(h.expirationTime<=oe);oe=t.unstable_now(),typeof ye=="function"?h.callback=ye:h===n(u)&&r(u),E(oe)}else r(u);h=n(u)}if(h!==null)var R=!0;else{var $=n(c);$!==null&&me(O,$.startTime-oe),R=!1}return R}finally{h=null,p=k,g=!1}}var D=!1,b=null,w=-1,T=5,A=-1;function N(){return!(t.unstable_now()-Aq||125ge?(q.sortIndex=k,e(c,q),n(u)===null&&q===n(c)&&(S?(v(w),w=-1):S=!0,me(O,k-ge))):(q.sortIndex=ye,e(u,q),_||g||(_=!0,le(L))),q},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(q){var oe=p;return function(){var k=p;p=oe;try{return q.apply(this,arguments)}finally{p=k}}}})(Zw);Jw.exports=Zw;var yS=Jw.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vS=F,Fn=yS;function Y(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),df=Object.prototype.hasOwnProperty,xS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Xy={},Jy={};function wS(t){return df.call(Jy,t)?!0:df.call(Xy,t)?!1:xS.test(t)?Jy[t]=!0:(Xy[t]=!0,!1)}function _S(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function bS(t,e,n,r){if(e===null||typeof e>"u"||_S(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function mn(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Zt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Zt[t]=new mn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Zt[e]=new mn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Zt[t]=new mn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Zt[t]=new mn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Zt[t]=new mn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Zt[t]=new mn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Zt[t]=new mn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Zt[t]=new mn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Zt[t]=new mn(t,5,!1,t.toLowerCase(),null,!1,!1)});var Xp=/[\-:]([a-z])/g;function Jp(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Xp,Jp);Zt[e]=new mn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Xp,Jp);Zt[e]=new mn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Xp,Jp);Zt[e]=new mn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Zt[t]=new mn(t,1,!1,t.toLowerCase(),null,!1,!1)});Zt.xlinkHref=new mn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Zt[t]=new mn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Zp(t,e,n,r){var i=Zt.hasOwnProperty(e)?Zt[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var u=` +`+i[o].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=o&&0<=a);break}}}finally{fh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wa(t):""}function ES(t){switch(t.tag){case 5:return wa(t.type);case 16:return wa("Lazy");case 13:return wa("Suspense");case 19:return wa("SuspenseList");case 0:case 2:case 15:return t=ph(t.type,!1),t;case 11:return t=ph(t.type.render,!1),t;case 1:return t=ph(t.type,!0),t;default:return""}}function mf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Xs:return"Fragment";case Ys:return"Portal";case hf:return"Profiler";case em:return"StrictMode";case ff:return"Suspense";case pf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case n_:return(t.displayName||"Context")+".Consumer";case t_:return(t._context.displayName||"Context")+".Provider";case tm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case nm:return e=t.displayName||null,e!==null?e:mf(t.type)||"Memo";case yi:e=t._payload,t=t._init;try{return mf(t(e))}catch{}}return null}function IS(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mf(e);case 8:return e===em?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ui(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function i_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function TS(t){var e=i_(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tu(t){t._valueTracker||(t._valueTracker=TS(t))}function s_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=i_(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function tc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gf(t,e){var n=e.checked;return gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function e0(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ui(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function o_(t,e){e=e.checked,e!=null&&Zp(t,"checked",e,!1)}function yf(t,e){o_(t,e);var n=Ui(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?vf(t,e.type,n):e.hasOwnProperty("defaultValue")&&vf(t,e.type,Ui(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function t0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function vf(t,e,n){(e!=="number"||tc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var _a=Array.isArray;function uo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=nu.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ya(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Aa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},SS=["Webkit","ms","Moz","O"];Object.keys(Aa).forEach(function(t){SS.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Aa[e]=Aa[t]})});function c_(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Aa.hasOwnProperty(t)&&Aa[t]?(""+e).trim():e+"px"}function d_(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=c_(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var kS=gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _f(t,e){if(e){if(kS[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Y(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Y(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Y(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Y(62))}}function bf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ef=null;function rm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var If=null,co=null,ho=null;function i0(t){if(t=Cl(t)){if(typeof If!="function")throw Error(Y(280));var e=t.stateNode;e&&(e=nd(e),If(t.stateNode,t.type,e))}}function h_(t){co?ho?ho.push(t):ho=[t]:co=t}function f_(){if(co){var t=co,e=ho;if(ho=co=null,i0(t),e)for(t=0;t>>=0,t===0?32:31-(VS(t)/FS|0)|0}var ru=64,iu=4194304;function ba(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function sc(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ba(a):(s&=o,s!==0&&(r=ba(s)))}else o=n&~i,o!==0?r=ba(o):s!==0&&(r=ba(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Sl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ar(e),t[e]=n}function $S(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Ra),f0=" ",p0=!1;function D_(t,e){switch(t){case"keyup":return yk.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function j_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Js=!1;function xk(t,e){switch(t){case"compositionend":return j_(e);case"keypress":return e.which!==32?null:(p0=!0,f0);case"textInput":return t=e.data,t===f0&&p0?null:t;default:return null}}function wk(t,e){if(Js)return t==="compositionend"||!dm&&D_(t,e)?(t=P_(),Du=lm=Ii=null,Js=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=v0(n)}}function V_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?V_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function F_(){for(var t=window,e=tc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=tc(t.document)}return e}function hm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Nk(t){var e=F_(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&V_(n.ownerDocument.documentElement,n)){if(r!==null&&hm(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=x0(n,s);var o=x0(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Zs=null,Af=null,ja=null,Pf=!1;function w0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pf||Zs==null||Zs!==tc(r)||(r=Zs,"selectionStart"in r&&hm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ja&&nl(ja,r)||(ja=r,r=lc(Af,"onSelect"),0no||(t.current=Mf[no],Mf[no]=null,no--)}function ot(t,e){no++,Mf[no]=t.current,t.current=e}var zi={},un=Yi(zi),En=Yi(!1),Es=zi;function Eo(t,e){var n=t.type.contextTypes;if(!n)return zi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function In(t){return t=t.childContextTypes,t!=null}function cc(){ct(En),ct(un)}function k0(t,e,n){if(un.current!==zi)throw Error(Y(168));ot(un,e),ot(En,n)}function K_(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Y(108,IS(t)||"Unknown",i));return gt({},n,r)}function dc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||zi,Es=un.current,ot(un,t),ot(En,En.current),!0}function C0(t,e,n){var r=t.stateNode;if(!r)throw Error(Y(169));n?(t=K_(t,e,Es),r.__reactInternalMemoizedMergedChildContext=t,ct(En),ct(un),ot(un,t)):ct(En),ot(En,n)}var Mr=null,rd=!1,Ch=!1;function Q_(t){Mr===null?Mr=[t]:Mr.push(t)}function zk(t){rd=!0,Q_(t)}function Xi(){if(!Ch&&Mr!==null){Ch=!0;var t=0,e=et;try{var n=Mr;for(et=1;t>=o,i-=o,Fr=1<<32-ar(e)+i|n<w?(T=b,b=null):T=b.sibling;var A=p(v,b,E[w],O);if(A===null){b===null&&(b=T);break}t&&b&&A.alternate===null&&e(v,b),x=s(A,x,w),D===null?L=A:D.sibling=A,D=A,b=T}if(w===E.length)return n(v,b),dt&&us(v,w),L;if(b===null){for(;ww?(T=b,b=null):T=b.sibling;var N=p(v,b,A.value,O);if(N===null){b===null&&(b=T);break}t&&b&&N.alternate===null&&e(v,b),x=s(N,x,w),D===null?L=N:D.sibling=N,D=N,b=T}if(A.done)return n(v,b),dt&&us(v,w),L;if(b===null){for(;!A.done;w++,A=E.next())A=h(v,A.value,O),A!==null&&(x=s(A,x,w),D===null?L=A:D.sibling=A,D=A);return dt&&us(v,w),L}for(b=r(v,b);!A.done;w++,A=E.next())A=g(b,v,w,A.value,O),A!==null&&(t&&A.alternate!==null&&b.delete(A.key===null?w:A.key),x=s(A,x,w),D===null?L=A:D.sibling=A,D=A);return t&&b.forEach(function(j){return e(v,j)}),dt&&us(v,w),L}function P(v,x,E,O){if(typeof E=="object"&&E!==null&&E.type===Xs&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case eu:e:{for(var L=E.key,D=x;D!==null;){if(D.key===L){if(L=E.type,L===Xs){if(D.tag===7){n(v,D.sibling),x=i(D,E.props.children),x.return=v,v=x;break e}}else if(D.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===yi&&P0(L)===D.type){n(v,D.sibling),x=i(D,E.props),x.ref=fa(v,D,E),x.return=v,v=x;break e}n(v,D);break}else e(v,D);D=D.sibling}E.type===Xs?(x=xs(E.props.children,v.mode,O,E.key),x.return=v,v=x):(O=zu(E.type,E.key,E.props,null,v.mode,O),O.ref=fa(v,x,E),O.return=v,v=O)}return o(v);case Ys:e:{for(D=E.key;x!==null;){if(x.key===D)if(x.tag===4&&x.stateNode.containerInfo===E.containerInfo&&x.stateNode.implementation===E.implementation){n(v,x.sibling),x=i(x,E.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else e(v,x);x=x.sibling}x=Lh(E,v.mode,O),x.return=v,v=x}return o(v);case yi:return D=E._init,P(v,x,D(E._payload),O)}if(_a(E))return _(v,x,E,O);if(la(E))return S(v,x,E,O);du(v,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,x!==null&&x.tag===6?(n(v,x.sibling),x=i(x,E),x.return=v,v=x):(n(v,x),x=Oh(E,v.mode,O),x.return=v,v=x),o(v)):n(v,x)}return P}var To=Z_(!0),e1=Z_(!1),pc=Yi(null),mc=null,so=null,gm=null;function ym(){gm=so=mc=null}function vm(t){var e=pc.current;ct(pc),t._currentValue=e}function Uf(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function po(t,e){mc=t,gm=so=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(bn=!0),t.firstContext=null)}function Jn(t){var e=t._currentValue;if(gm!==t)if(t={context:t,memoizedValue:e,next:null},so===null){if(mc===null)throw Error(Y(308));so=t,mc.dependencies={lanes:0,firstContext:t}}else so=so.next=t;return e}var ps=null;function xm(t){ps===null?ps=[t]:ps.push(t)}function t1(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,xm(e)):(n.next=i.next,i.next=n),e.interleaved=n,Yr(t,r)}function Yr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var vi=!1;function wm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n1(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Hr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ri(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ke&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Yr(t,n)}return i=r.interleaved,i===null?(e.next=e,xm(r)):(e.next=i.next,i.next=e),r.interleaved=e,Yr(t,n)}function Ou(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,sm(t,n)}}function R0(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function gc(t,e,n,r){var i=t.updateQueue;vi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=u))}if(s!==null){var h=i.baseState;o=0,f=c=u=null,a=s;do{var p=a.lane,g=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=t,S=a;switch(p=e,g=n,S.tag){case 1:if(_=S.payload,typeof _=="function"){h=_.call(g,h,p);break e}h=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=S.payload,p=typeof _=="function"?_.call(g,h,p):_,p==null)break e;h=gt({},h,p);break e;case 2:vi=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=g,u=h):f=f.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ss|=o,t.lanes=o,t.memoizedState=h}}function D0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Ah.transition;Ah.transition={};try{t(!1),e()}finally{et=n,Ah.transition=r}}function x1(){return Zn().memoizedState}function qk(t,e,n){var r=ji(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},w1(t))_1(e,n);else if(n=t1(t,e,n,r),n!==null){var i=fn();lr(n,t,r,i),b1(n,e,r)}}function Wk(t,e,n){var r=ji(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(w1(t))_1(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,cr(a,o)){var u=e.interleaved;u===null?(i.next=i,xm(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=t1(t,e,i,r),n!==null&&(i=fn(),lr(n,t,r,i),b1(n,e,r))}}function w1(t){var e=t.alternate;return t===mt||e!==null&&e===mt}function _1(t,e){Oa=vc=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function b1(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,sm(t,n)}}var xc={readContext:Jn,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},Gk={readContext:Jn,useCallback:function(t,e){return yr().memoizedState=[t,e===void 0?null:e],t},useContext:Jn,useEffect:O0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Mu(4194308,4,p1.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Mu(4194308,4,t,e)},useInsertionEffect:function(t,e){return Mu(4,2,t,e)},useMemo:function(t,e){var n=yr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=yr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=qk.bind(null,mt,t),[r.memoizedState,t]},useRef:function(t){var e=yr();return t={current:t},e.memoizedState=t},useState:j0,useDebugValue:Cm,useDeferredValue:function(t){return yr().memoizedState=t},useTransition:function(){var t=j0(!1),e=t[0];return t=Hk.bind(null,t[1]),yr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=mt,i=yr();if(dt){if(n===void 0)throw Error(Y(407));n=n()}else{if(n=e(),$t===null)throw Error(Y(349));Ts&30||o1(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,O0(l1.bind(null,r,s,t),[t]),r.flags|=2048,cl(9,a1.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=yr(),e=$t.identifierPrefix;if(dt){var n=Ur,r=Fr;n=(r&~(1<<32-ar(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ll++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[wr]=e,t[sl]=r,R1(t,e,!1,!1),e.stateNode=t;e:{switch(o=bf(n,r),n){case"dialog":ut("cancel",t),ut("close",t),i=r;break;case"iframe":case"object":case"embed":ut("load",t),i=r;break;case"video":case"audio":for(i=0;iCo&&(e.flags|=128,r=!0,pa(s,!1),e.lanes=4194304)}else{if(!r)if(t=yc(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),pa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dt)return rn(e),null}else 2*St()-s.renderingStartTime>Co&&n!==1073741824&&(e.flags|=128,r=!0,pa(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=St(),e.sibling=null,n=pt.current,ot(pt,r?n&1|2:n&1),e):(rn(e),null);case 22:case 23:return jm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Dn&1073741824&&(rn(e),e.subtreeFlags&6&&(e.flags|=8192)):rn(e),null;case 24:return null;case 25:return null}throw Error(Y(156,e.tag))}function t2(t,e){switch(pm(e),e.tag){case 1:return In(e.type)&&cc(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return So(),ct(En),ct(un),Em(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return bm(e),null;case 13:if(ct(pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Y(340));Io()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(pt),null;case 4:return So(),null;case 10:return vm(e.type._context),null;case 22:case 23:return jm(),null;case 24:return null;default:return null}}var fu=!1,an=!1,n2=typeof WeakSet=="function"?WeakSet:Set,ce=null;function oo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Et(t,e,r)}else n.current=null}function Qf(t,e,n){try{n()}catch(r){Et(t,e,r)}}var W0=!1;function r2(t,e){if(Rf=oc,t=F_(),hm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,f=0,h=t,p=null;t:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(u=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===t)break t;if(p===n&&++c===i&&(a=o),p===s&&++f===r&&(u=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Df={focusedElem:t,selectionRange:n},oc=!1,ce=e;ce!==null;)if(e=ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ce=t;else for(;ce!==null;){e=ce;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,P=_.memoizedState,v=e.stateNode,x=v.getSnapshotBeforeUpdate(e.elementType===e.type?S:nr(e.type,S),P);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(O){Et(e,e.return,O)}if(t=e.sibling,t!==null){t.return=e.return,ce=t;break}ce=e.return}return _=W0,W0=!1,_}function La(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Qf(e,n,s)}i=i.next}while(i!==r)}}function od(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Yf(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function O1(t){var e=t.alternate;e!==null&&(t.alternate=null,O1(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[wr],delete e[sl],delete e[Lf],delete e[Fk],delete e[Uk])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function L1(t){return t.tag===5||t.tag===3||t.tag===4}function G0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||L1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xf(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=uc));else if(r!==4&&(t=t.child,t!==null))for(Xf(t,e,n),t=t.sibling;t!==null;)Xf(t,e,n),t=t.sibling}function Jf(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Jf(t,e,n),t=t.sibling;t!==null;)Jf(t,e,n),t=t.sibling}var Qt=null,rr=!1;function fi(t,e,n){for(n=n.child;n!==null;)M1(t,e,n),n=n.sibling}function M1(t,e,n){if(br&&typeof br.onCommitFiberUnmount=="function")try{br.onCommitFiberUnmount(Jc,n)}catch{}switch(n.tag){case 5:an||oo(n,e);case 6:var r=Qt,i=rr;Qt=null,fi(t,e,n),Qt=r,rr=i,Qt!==null&&(rr?(t=Qt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qt.removeChild(n.stateNode));break;case 18:Qt!==null&&(rr?(t=Qt,n=n.stateNode,t.nodeType===8?kh(t.parentNode,n):t.nodeType===1&&kh(t,n),el(t)):kh(Qt,n.stateNode));break;case 4:r=Qt,i=rr,Qt=n.stateNode.containerInfo,rr=!0,fi(t,e,n),Qt=r,rr=i;break;case 0:case 11:case 14:case 15:if(!an&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Qf(n,e,o),i=i.next}while(i!==r)}fi(t,e,n);break;case 1:if(!an&&(oo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Et(n,e,a)}fi(t,e,n);break;case 21:fi(t,e,n);break;case 22:n.mode&1?(an=(r=an)||n.memoizedState!==null,fi(t,e,n),an=r):fi(t,e,n);break;default:fi(t,e,n)}}function K0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new n2),e.forEach(function(r){var i=h2.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function tr(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=St()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s2(r/1960))-r,10t?16:t,Ti===null)var r=!1;else{if(t=Ti,Ti=null,bc=0,Ke&6)throw Error(Y(331));var i=Ke;for(Ke|=4,ce=t.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uSt()-Rm?vs(t,0):Pm|=n),Tn(t,e)}function q1(t,e){e===0&&(t.mode&1?(e=iu,iu<<=1,!(iu&130023424)&&(iu=4194304)):e=1);var n=fn();t=Yr(t,e),t!==null&&(Sl(t,e,n),Tn(t,n))}function d2(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),q1(t,n)}function h2(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Y(314))}r!==null&&r.delete(e),q1(t,n)}var W1;W1=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||En.current)bn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return bn=!1,Zk(t,e,n);bn=!!(t.flags&131072)}else bn=!1,dt&&e.flags&1048576&&Y_(e,fc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Vu(t,e),t=e.pendingProps;var i=Eo(e,un.current);po(e,n),i=Tm(null,e,r,t,i,n);var s=Sm();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,In(r)?(s=!0,dc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,wm(e),i.updater=sd,e.stateNode=i,i._reactInternals=e,Bf(e,r,t,n),e=qf(null,e,r,!0,s,n)):(e.tag=0,dt&&s&&fm(e),hn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Vu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=p2(r),t=nr(r,t),i){case 0:e=Hf(null,e,r,t,n);break e;case 1:e=$0(null,e,r,t,n);break e;case 11:e=z0(null,e,r,t,n);break e;case 14:e=B0(null,e,r,nr(r.type,t),n);break e}throw Error(Y(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nr(r,i),Hf(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nr(r,i),$0(t,e,r,i,n);case 3:e:{if(N1(e),t===null)throw Error(Y(387));r=e.pendingProps,s=e.memoizedState,i=s.element,n1(t,e),gc(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=ko(Error(Y(423)),e),e=H0(t,e,r,n,i);break e}else if(r!==i){i=ko(Error(Y(424)),e),e=H0(t,e,r,n,i);break e}else for(jn=Pi(e.stateNode.containerInfo.firstChild),Mn=e,dt=!0,ir=null,n=e1(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),r===i){e=Xr(t,e,n);break e}hn(t,e,r,n)}e=e.child}return e;case 5:return r1(e),t===null&&Ff(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,jf(r,i)?o=null:s!==null&&jf(r,s)&&(e.flags|=32),C1(t,e),hn(t,e,o,n),e.child;case 6:return t===null&&Ff(e),null;case 13:return A1(t,e,n);case 4:return _m(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=To(e,null,r,n):hn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nr(r,i),z0(t,e,r,i,n);case 7:return hn(t,e,e.pendingProps,n),e.child;case 8:return hn(t,e,e.pendingProps.children,n),e.child;case 12:return hn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,ot(pc,r._currentValue),r._currentValue=o,s!==null)if(cr(s.value,o)){if(s.children===i.children&&!En.current){e=Xr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Hr(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Uf(s.return,n,e),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Y(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Uf(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}hn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,po(e,n),i=Jn(i),r=r(i),e.flags|=1,hn(t,e,r,n),e.child;case 14:return r=e.type,i=nr(r,e.pendingProps),i=nr(r.type,i),B0(t,e,r,i,n);case 15:return S1(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nr(r,i),Vu(t,e),e.tag=1,In(r)?(t=!0,dc(e)):t=!1,po(e,n),E1(e,r,i),Bf(e,r,i,n),qf(null,e,r,!0,t,n);case 19:return P1(t,e,n);case 22:return k1(t,e,n)}throw Error(Y(156,e.tag))};function G1(t,e){return w_(t,e)}function f2(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(t,e,n,r){return new f2(t,e,n,r)}function Lm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function p2(t){if(typeof t=="function")return Lm(t)?1:0;if(t!=null){if(t=t.$$typeof,t===tm)return 11;if(t===nm)return 14}return 2}function Oi(t,e){var n=t.alternate;return n===null?(n=Gn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function zu(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")Lm(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Xs:return xs(n.children,i,s,e);case em:o=8,i|=8;break;case hf:return t=Gn(12,n,e,i|2),t.elementType=hf,t.lanes=s,t;case ff:return t=Gn(13,n,e,i),t.elementType=ff,t.lanes=s,t;case pf:return t=Gn(19,n,e,i),t.elementType=pf,t.lanes=s,t;case r_:return ld(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case t_:o=10;break e;case n_:o=9;break e;case tm:o=11;break e;case nm:o=14;break e;case yi:o=16,r=null;break e}throw Error(Y(130,t==null?t:typeof t,""))}return e=Gn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function xs(t,e,n,r){return t=Gn(7,t,r,e),t.lanes=n,t}function ld(t,e,n,r){return t=Gn(22,t,r,e),t.elementType=r_,t.lanes=n,t.stateNode={isHidden:!1},t}function Oh(t,e,n){return t=Gn(6,t,null,e),t.lanes=n,t}function Lh(t,e,n){return e=Gn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function m2(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gh(0),this.expirationTimes=gh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Mm(t,e,n,r,i,s,o,a,u){return t=new m2(t,e,n,a,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Gn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wm(s),t}function g2(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X1)}catch(t){console.error(t)}}X1(),Xw.exports=Un;var J1=Xw.exports;const _2=Yc(J1);var Z1,nv=J1;Z1=nv.createRoot,nv.hydrateRoot;/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var b2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const E2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ke=(t,e)=>{const n=F.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,...c},f)=>F.createElement("svg",{ref:f,...b2,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${E2(t)}`,a].join(" "),...c},[...e.map(([h,p])=>F.createElement(h,p)),...Array.isArray(u)?u:[u]]));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const No=ke("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I2=ke("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rv=ke("BookMarked",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["polyline",{points:"10 2 10 10 13 7 16 10 16 2",key:"13o6vz"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hl=ke("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T2=ke("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fd=ke("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pd=ke("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const md=ke("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eb=ke("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=ke("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const S2=ke("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const k2=ke("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ga=ke("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rp=ke("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ya=ke("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nb=ke("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ip=ke("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sp=ke("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iv=ke("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sv=ke("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rb=ke("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const C2=ke("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=ke("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N2=ke("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const A2=ke("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const P2=ke("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=ke("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ob=ke("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fl=ke("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ab=ke("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const op=ke("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zm=ke("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tc=ke("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R2=ke("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ov=ke("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lb=ke("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const av=ke("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D2=ke("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zr=ke("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j2=ke("Unlock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O2=ke("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L2=ke("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M2=ke("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vn=ke("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bm=ke("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $m=ke("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function Kn({src:t,alt:e,className:n="",imgClassName:r="",objectFit:i="contain",aspectRatio:s,loading:o,draggable:a}){const[u,c]=F.useState(!1);return d.jsxs("div",{className:`relative w-full h-full overflow-hidden ${n}`,style:s&&s!=="auto"?{aspectRatio:s}:void 0,children:[d.jsx("div",{className:`absolute inset-0 flex items-center justify-center transition-opacity duration-500 ${u?"opacity-0 pointer-events-none":"opacity-100"}`,children:d.jsx("div",{className:"w-8 h-8 border-2 border-purple-500 border-t-transparent rounded-full animate-spin"})}),d.jsx("img",{src:t,alt:e,loading:o,draggable:a,className:`w-full h-full object-${i} transition-all duration-1000 ease-linear ${r} ${u?"opacity-100":"opacity-0"}`,onLoad:()=>c(!0)})]})}function ub({images:t,initialIndex:e,onClose:n}){const[r,i]=F.useState(e),[s,o]=F.useState(!1),[a,u]=F.useState(0),[c,f]=F.useState(1),[h,p]=F.useState({x:0,y:0}),[g,_]=F.useState(!1),[S,P]=F.useState({x:0,y:0}),[v,x]=F.useState(null),[E,O]=F.useState(1),L=F.useRef(null);F.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}),[]);const D=$=>{const Z=t.length;return($%Z+Z)%Z},b=$=>Math.hypot($[0].clientX-$[1].clientX,$[0].clientY-$[1].clientY),w=($,Z)=>{const ie=window.innerWidth,Te=window.innerHeight,fe=(ie*Z-ie)/2,Fe=(Te*Z-Te)/2;return{x:Math.min(Math.max($.x,-fe),fe),y:Math.min(Math.max($.y,-Fe),Fe)}},T=s?2:1,A=()=>{i($=>D($-T)),u(0),f(1),p({x:0,y:0})},N=()=>{i($=>D($+T)),u(0),f(1),p({x:0,y:0})},j=($,Z)=>{_(!0),P({x:$,y:Z})},C=($,Z)=>{if(g)if(c>1){const ie=$-S.x,Te=Z-S.y;p(fe=>({x:fe.x+ie,y:fe.y+Te})),P({x:$,y:Z})}else{const ie=$-S.x;u(ie)}},se=()=>{var ie;if(_(!1),x(null),c>1)return;const Z=(((ie=L.current)==null?void 0:ie.clientWidth)||window.innerWidth)*.25;Math.abs(a)>Z?a>0?A():N():u(0)},he=$=>{$.preventDefault(),j($.clientX,$.clientY)},le=$=>{$.preventDefault(),C($.clientX,$.clientY)},me=()=>se(),q=$=>{if($.touches.length===2){const Z=b($.touches);x(Z),O(c),_(!1)}else $.touches.length===1&&j($.touches[0].clientX,$.touches[0].clientY)},oe=$=>{if($.touches.length===2&&v!==null){const ie=b($.touches)/v,Te=Math.min(Math.max(E*ie,1),4);f(Te),p(fe=>w(fe,Te))}else $.touches.length===1&&C($.touches[0].clientX,$.touches[0].clientY)},k=$=>{if(v!==null&&$.touches.length<2){x(null);return}se()};F.useEffect(()=>{function $(Z){Z.key==="Escape"?n():Z.key==="ArrowLeft"?A():Z.key==="ArrowRight"?N():Z.key==="+"||Z.key==="="?f(ie=>{const Te=Math.min(ie+.5,4);return p(fe=>w(fe,Te)),Te}):Z.key==="-"&&f(ie=>{const Te=Math.max(ie-.5,1);return p(fe=>w(fe,Te)),Te})}return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[c,s]);let ge=`translateX(calc(-33.333333% + ${a}px))`,ye=g?"none":"transform 0.1s ease-out";a===0&&(ye="none");const R=$=>{const Z=D($);if(s){const ie=D($+1);return d.jsxs("div",{className:"flex w-full h-full items-center justify-center px-2 sm:px-10",children:[d.jsx("div",{className:"flex-1 h-full flex items-center justify-end",children:d.jsx(Kn,{src:t[Z],alt:`Página ${Z+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-lg origin-right object-right"})}),d.jsx("div",{className:"flex-1 h-full flex items-center justify-start",children:d.jsx(Kn,{src:t[ie],alt:`Página ${ie+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-lg origin-left object-left"})})]})}else return d.jsx(Kn,{src:t[Z],alt:`Página ${Z+1}`,aspectRatio:"auto",objectFit:"contain",loading:"lazy",draggable:!1,imgClassName:"max-w-full max-h-screen object-contain select-none shadow-2xl"})};return d.jsxs("div",{className:"fixed inset-0 bg-black/95 flex items-center justify-center z-50 select-none touch-none overflow-hidden",style:{touchAction:"none"},ref:L,onWheel:$=>{$.stopPropagation();const Z=$.deltaY<0?.5:-.5;f(ie=>{const Te=Math.min(Math.max(ie+Z,1),4);return p(fe=>w(fe,Te)),Te})},onMouseDown:he,onMouseMove:le,onMouseUp:me,onMouseLeave:()=>{_(!1),c===1&&u(0)},onTouchStart:q,onTouchMove:oe,onTouchEnd:k,children:[d.jsxs("div",{className:"absolute top-6 right-6 flex items-center gap-4 z-50",children:[d.jsxs("div",{className:"flex items-center gap-2 bg-black/50 rounded-lg p-1",children:[d.jsx("button",{onClick:()=>o(!s),className:`p-2 transition-colors ${s?"text-[#bb86fc]":"text-white hover:text-[#bb86fc]"}`,title:s?"Vista Individual":"Vista de Libro",children:s?d.jsx(hl,{className:"w-5 h-5"}):d.jsx(T2,{className:"w-5 h-5"})}),d.jsx("div",{className:"w-px h-4 bg-white/20 mx-1"}),d.jsx("button",{onClick:()=>f($=>{const Z=Math.max($-.5,1);return p(ie=>w(ie,Z)),Z}),className:"p-2 text-white hover:text-[#bb86fc] transition-colors",children:d.jsx($m,{className:"w-5 h-5"})}),d.jsxs("span",{className:"text-white text-sm min-w-[3ch] text-center",children:[Math.round(c*100),"%"]}),d.jsx("button",{onClick:()=>f($=>{const Z=Math.min($+.5,4);return p(ie=>w(ie,Z)),Z}),className:"p-2 text-white hover:text-[#bb86fc] transition-colors",children:d.jsx(Bm,{className:"w-5 h-5"})})]}),d.jsx("button",{onClick:n,className:"p-2 rounded-lg bg-white/10 hover:bg-white/20 text-white transition-all duration-200",children:d.jsx(Vn,{className:"w-6 h-6"})})]}),d.jsxs("div",{className:"flex h-full w-[300%] absolute top-0 left-0",style:{transform:ge,transition:ye,willChange:"transform"},children:[d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:R(r-T)}),d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:d.jsx("div",{className:"relative flex items-center justify-center w-full h-full",style:{transform:`translate(${h.x}px, ${h.y}px) scale(${c})`,transition:g?"none":"transform 0.1s ease-out",cursor:c>1?g?"grabbing":"grab":"default"},onDoubleClick:$=>{$.stopPropagation(),f(Z=>Z>1?1:2.5),p({x:0,y:0})},children:R(r)})}),d.jsx("div",{className:"w-1/3 h-full flex items-center justify-center relative",children:R(r+T)})]}),c===1&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:$=>{$.stopPropagation(),A()},className:"absolute left-4 sm:left-8 top-1/2 -translate-y-1/2 p-3 sm:p-4 rounded-lg text-white opacity-40 hover:opacity-100 transition-opacity duration-200 z-40",children:d.jsx(pd,{className:"w-8 h-8 sm:w-10 sm:h-10"})}),d.jsx("button",{onClick:$=>{$.stopPropagation(),N()},className:"absolute right-4 sm:right-8 top-1/2 -translate-y-1/2 p-3 sm:p-4 rounded-lg text-white opacity-40 hover:opacity-100 transition-opacity duration-200 z-40",children:d.jsx(md,{className:"w-8 h-8 sm:w-10 sm:h-10"})})]}),d.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 text-white px-4 py-2 rounded-lg text-sm font-medium z-40 pointer-events-none",children:s?`${r+1}-${Math.min(r+2,t.length)} / ${t.length}`:`${r+1} / ${t.length}`})]})}function gd(){return d.jsxs("footer",{className:"py-6 border-t border-gray-800/50 flex flex-col md:flex-row items-center justify-between gap-4 text-gray-400 text-sm mt-auto w-full px-8 relative",children:[d.jsxs("div",{className:"flex flex-wrap justify-center gap-6 mx-auto",children:[d.jsxs("a",{href:"https://t.me/twistedbrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.295-.605.295l.213-3.054 5.56-5.022c.242-.213-.054-.333-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z"})}),"Twisted Brody"]}),d.jsxs("a",{href:"https://t.me/+CmmZFHM9hpViYzMx",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.295-.605.295l.213-3.054 5.56-5.022c.242-.213-.054-.333-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z"})}),"Canal Hub"]}),d.jsxs("a",{href:"https://x.com/TwistedBrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X"]}),d.jsxs("a",{href:"https://www.patreon.com/cw/Twistedbrody",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M0 .48v23.04h4.22V.48zm15.385 0c-4.764 0-8.641 3.88-8.641 8.65 0 4.755 3.877 8.623 8.641 8.623 4.75 0 8.615-3.868 8.615-8.623C24 4.36 20.136.48 15.385.48z"})}),"Patreon"]}),d.jsxs("button",{onClick:()=>{window.location.hash="info"},className:"flex items-center gap-2 hover:text-[#bb86fc] transition-colors",children:[d.jsx(rb,{className:"w-4 h-4"}),d.jsx("span",{children:"Info"})]})]}),d.jsxs("div",{className:"md:absolute md:right-8 text-xs opacity-50",children:["Twisted Brody MangaFlow © ",new Date().getFullYear()]})]})}function V2({manga:t,onBack:e}){const n=t.chapters&&t.chapters.length>0?t.chapters[0]:null,r=n?n.original_pages&&n.original_pages.length>0?n.original_pages:n.pages:[],[i,s]=F.useState("vertical"),[o,a]=F.useState(1),[u,c]=F.useState(!1),[f,h]=F.useState(0);if(!r||r.length===0)return d.jsxs("div",{className:"min-h-screen bg-[#121212] flex flex-col items-center justify-center",children:[d.jsx("button",{onClick:e,className:"absolute top-6 left-6 p-2 hover:bg-[#333] rounded-lg transition-colors text-white",children:d.jsx(No,{className:"w-6 h-6"})}),d.jsx("div",{className:"text-gray-400 text-lg",children:"No hay páginas disponibles"})]});const p=()=>a(S=>Math.min(S+.25,3)),g=()=>a(S=>Math.max(S-.25,.5)),_=()=>a(1);return d.jsxs("div",{className:"min-h-screen flex flex-col bg-[#121212]",children:[d.jsxs("header",{className:"sticky top-0 z-50 bg-[#121212]/90 backdrop-blur-md border-b border-gray-800 px-4 py-3 flex items-center justify-between gap-4",children:[d.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:d.jsxs("button",{onClick:e,className:"p-2 hover:bg-[#333] rounded-lg transition-colors text-white flex items-center gap-2",children:[d.jsx(No,{className:"w-5 h-5"}),d.jsx("span",{className:"font-semibold text-sm hidden sm:inline",children:"Volver"})]})}),d.jsx("div",{className:"flex-1 flex justify-center min-w-0",children:d.jsxs("h1",{className:"text-white font-bold truncate text-center max-w-full",children:[t.title," ",d.jsx("span",{className:"text-[#bb86fc] text-xs ml-2 border border-[#bb86fc] px-1 rounded",children:"HD"})]})}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1 hidden md:flex",children:[d.jsx("button",{onClick:()=>s("vertical"),className:`p-2 rounded-md transition-all duration-200 ${i==="vertical"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Vertical",children:d.jsx(op,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>s("gallery"),className:`p-2 rounded-md transition-all duration-200 ${i==="gallery"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Galería",children:d.jsx(ip,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>s("grid"),className:`p-2 rounded-md transition-all duration-200 ${i==="grid"?"bg-[#bb86fc] text-white":"text-gray-400 hover:text-white"}`,title:"Cuadrícula",children:d.jsx(sp,{className:"w-4 h-4"})})]}),i==="vertical"&&d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsx("button",{onClick:g,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",children:d.jsx($m,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-xs text-gray-300 w-8 text-center",children:[Math.round(o*100),"%"]}),d.jsx("button",{onClick:p,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",children:d.jsx(Bm,{className:"w-4 h-4"})}),d.jsx("button",{onClick:_,className:"p-2 text-gray-400 hover:text-white hover:bg-[#333] rounded",title:"Reset",children:d.jsx(ab,{className:"w-3 h-3"})})]})]})]}),d.jsx("div",{className:"md:hidden px-4 py-2 border-b border-gray-800 bg-[#121212] flex justify-center",children:d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsxs("button",{onClick:()=>s("vertical"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="vertical"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(op,{className:"w-3 h-3"})," Vertical"]}),d.jsxs("button",{onClick:()=>s("gallery"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="gallery"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(ip,{className:"w-3 h-3"})," Galería"]}),d.jsxs("button",{onClick:()=>s("grid"),className:`px-3 py-1.5 rounded-md flex items-center gap-2 text-xs font-medium ${i==="grid"?"bg-[#bb86fc] text-white":"text-gray-400"}`,children:[d.jsx(sp,{className:"w-3 h-3"})," Cuadrícula"]})]})}),d.jsx("main",{className:"flex-1 w-full max-w-[1920px] mx-auto px-0 sm:px-4 py-6",children:d.jsx("div",{className:` + bg-[#050505] min-h-screen transition-all duration-150 ease-out + ${i==="vertical"?"flex flex-col items-center gap-1":""} + ${i==="gallery"?"masonry-container p-2":""} + ${i==="grid"?"grid grid-cols-3 md:grid-cols-5 gap-2 p-2":""} + `,children:r.map((S,P)=>{const v=S;return i==="vertical"?d.jsx("div",{className:"relative transition-all duration-200",style:{width:o===1?"100%":`${100*o}%`,maxWidth:o>1?"none":"80rem"},children:d.jsx("div",{className:`mx-auto ${o<=1?"max-w-5xl":""}`,children:d.jsx(Kn,{src:v,alt:`Página ${P+1}`,aspectRatio:"auto",objectFit:"contain",loading:P<3?"eager":"lazy",className:"w-full h-auto",imgClassName:"w-full h-auto block"})})},P):d.jsx("div",{className:` + group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02] + ${i==="gallery"?"masonry-item":""} + `,onClick:()=>{h(P),c(!0)},children:d.jsx(Kn,{src:v,alt:`Página ${P+1}`,aspectRatio:i==="grid"?"1/1":"auto",objectFit:i==="grid"?"cover":"contain",loading:P<5?"eager":"lazy",className:"w-full h-auto rounded-lg",imgClassName:"group-hover:scale-110"})},P)})})}),d.jsx(gd,{}),u&&d.jsx(ub,{images:r,initialIndex:f,onClose:()=>c(!1)})]})}async function lv(t,e,n){const r=await F2(t),i=U2(t);try{const s=await fetch("/api/process-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:r,name:t.name,index:e,total:n})});if(!s.ok)throw new Error(`Server processing failed: ${s.statusText}`);const o=await s.json();if(!o.success||!o.data)throw new Error("Invalid response from processing server");return{thumbnail:o.data.thumbnail,original:r,webpDisplay:o.data.webp,webpCover:o.data.webp,originalFormat:i,originalBase64:r,originalUnmodified:r}}catch(s){throw console.error("Error processing image on server, falling back to local:",s),s}}async function F2(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{var s;return e((s=i.target)==null?void 0:s.result)},r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(t)})}function U2(t){var r;const e=t.type;if(e==="image/png")return"png";if(e==="image/jpeg")return"jpg";if(e==="image/gif")return"gif";if(e==="image/webp")return"webp";const n=(r=t.name.split(".").pop())==null?void 0:r.toLowerCase();return n&&["png","jpg","jpeg","gif","webp"].includes(n)?n==="jpeg"?"jpg":n:"jpg"}async function z2(t){return new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const i=r.width/r.height;i<.9?e("portrait"):i>1.1?e("landscape"):e("square")},r.onerror=()=>n(new Error("Failed to load image")),r.src=t})}const Hm="userApiKey";function B2(t){if(!t||t.trim()==="")throw new Error("API key no puede estar vacía");localStorage.setItem(Hm,t.trim())}function cb(){return localStorage.getItem(Hm)}function $2(){localStorage.removeItem(Hm)}const db="imageBatchSize",uv=10;function gu(t){if(t<0)throw new Error("El tamaño del lote no puede ser negativo");localStorage.setItem(db,t.toString())}function hb(){const t=localStorage.getItem(db);if(!t)return uv;const e=parseInt(t,10);return isNaN(e)||e<0?uv:e>=999999?0:e}const H2="90ba8efe6890e9e76175089dc182a22a",q2="https://api.imgbb.com/1/upload";function W2(){return cb()||H2}async function Sc(t,e){const n=t.includes(",")?t.split(",")[1]:t,r=W2(),i=`${q2}?key=${r}`,s=new FormData;s.append("image",n),e&&s.append("name",e);const o=await fetch(i,{method:"POST",body:s});if(!o.ok){const u=await o.text();throw o.status===429||u.includes("rate limit")?new Error("API_BURNED"):o.status===403||o.status===401?new Error("API_INVALID_KEY"):new Error(`Error al subir imagen a ImgBB: ${u}`)}const a=await o.json();if(!a.success)throw new Error("API_BURNED");return a}async function yu(t,e,n){const r=hb(),i=[];if(r===0||r>=t.length){const s=t.map((a,u)=>{const c=e?`${e}_${u+1}`:void 0;return Sc(a,c)}),o=await Promise.all(s);i.push(...o),n&&n(t.length,t.length)}else for(let s=0;s{const h=s+f,p=e?`${e}_${h+1}`:void 0;return Sc(c,p)}),u=await Promise.all(a);i.push(...u),n&&n(Math.min(s+r,t.length),t.length)}return i}const G2=()=>{};var cv={};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const fb=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},K2=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],a=t[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},pb={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,h=(s&3)<<4|a>>4;let p=(a&15)<<2|c>>6,g=c&63;u||(g=64,o||(p=64)),r.push(n[f],n[h],n[p],n[g])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(fb(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):K2(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(p),c!==64){const g=a<<4&240|c>>2;if(r.push(g),h!==64){const _=c<<6&192|h;r.push(_)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class Q2 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Y2=function(t){const e=fb(t);return pb.encodeByteArray(e,!0)},kc=function(t){return Y2(t).replace(/\./g,"")},mb=function(t){try{return pb.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */function X2(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */const J2=()=>X2().__FIREBASE_DEFAULTS__,Z2=()=>{if(typeof process>"u"||typeof cv>"u")return;const t=cv.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},eC=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&mb(t[1]);return e&&JSON.parse(e)},yd=()=>{try{return G2()||J2()||Z2()||eC()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},gb=t=>{var e,n;return(n=(e=yd())==null?void 0:e.emulatorHosts)==null?void 0:n[t]},yb=t=>{const e=gb(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},vb=()=>{var t;return(t=yd())==null?void 0:t.config},xb=t=>{var e;return(e=yd())==null?void 0:e[`_${t}`]};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class tC{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** + * @license + * Copyright 2025 Google LLC + * + * 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. + */function Ls(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function qm(t){return(await fetch(t,{credentials:"include"})).ok}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function wb(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...t};return[kc(JSON.stringify(n)),kc(JSON.stringify(o)),""].join(".")}const Fa={};function nC(){const t={prod:[],emulator:[]};for(const e of Object.keys(Fa))Fa[e]?t.emulator.push(e):t.prod.push(e);return t}function rC(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let dv=!1;function Wm(t,e){if(typeof window>"u"||typeof document>"u"||!Ls(window.location.host)||Fa[t]===e||Fa[t]||dv)return;Fa[t]=e;function n(p){return`__firebase__banner__${p}`}const r="__firebase__banner",s=nC().prod.length>0;function o(){const p=document.getElementById(r);p&&p.remove()}function a(p){p.style.display="flex",p.style.background="#7faaf0",p.style.position="fixed",p.style.bottom="5px",p.style.left="5px",p.style.padding=".5em",p.style.borderRadius="5px",p.style.alignItems="center"}function u(p,g){p.setAttribute("width","24"),p.setAttribute("id",g),p.setAttribute("height","24"),p.setAttribute("viewBox","0 0 24 24"),p.setAttribute("fill","none"),p.style.marginLeft="-6px"}function c(){const p=document.createElement("span");return p.style.cursor="pointer",p.style.marginLeft="16px",p.style.fontSize="24px",p.innerHTML=" ×",p.onclick=()=>{dv=!0,o()},p}function f(p,g){p.setAttribute("id",g),p.innerText="Learn more",p.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",p.setAttribute("target","__blank"),p.style.paddingLeft="5px",p.style.textDecoration="underline"}function h(){const p=rC(r),g=n("text"),_=document.getElementById(g)||document.createElement("span"),S=n("learnmore"),P=document.getElementById(S)||document.createElement("a"),v=n("preprendIcon"),x=document.getElementById(v)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.created){const E=p.element;a(E),f(P,S);const O=c();u(x,v),E.append(x,_,P,O),document.body.appendChild(E)}s?(_.innerText="Preview backend disconnected.",x.innerHTML=` + + + + + + +`):(x.innerHTML=` + + + + + + +`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",g)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function cn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function iC(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(cn())}function sC(){var e;const t=(e=yd())==null?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function oC(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function aC(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function lC(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function uC(){const t=cn();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function cC(){return!sC()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function dC(){try{return typeof indexedDB=="object"}catch{return!1}}function hC(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)==null?void 0:s.message)||"")}}catch(n){e(n)}})}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const fC="FirebaseError";class Dr extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=fC,Object.setPrototypeOf(this,Dr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Al.prototype.create)}}class Al{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?pC(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Dr(i,a,r)}}function pC(t,e){return t.replace(mC,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const mC=/\{\$([^}]+)}/g;function gC(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Jr(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(hv(s)&&hv(o)){if(!Jr(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function hv(t){return t!==null&&typeof t=="object"}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function Pl(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Ia(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function Ta(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function yC(t,e){const n=new vC(t,e);return n.subscribe.bind(n)}class vC{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");xC(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=Mh),i.error===void 0&&(i.error=Mh),i.complete===void 0&&(i.complete=Mh);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function xC(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Mh(){}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function Ft(t){return t&&t._delegate?t._delegate:t}class Bi{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const ds="[DEFAULT]";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class wC{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new tC;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(bC(e))try{this.getOrInitializeService({instanceIdentifier:ds})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=ds){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ds){return this.instances.has(e)}getOptions(e=ds){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:_C(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ds){return this.component?this.component.multipleInstances?e:ds:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function _C(t){return t===ds?void 0:t}function bC(t){return t.instantiationMode==="EAGER"}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class EC{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new wC(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */var Be;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Be||(Be={}));const IC={debug:Be.DEBUG,verbose:Be.VERBOSE,info:Be.INFO,warn:Be.WARN,error:Be.ERROR,silent:Be.SILENT},TC=Be.INFO,SC={[Be.DEBUG]:"log",[Be.VERBOSE]:"log",[Be.INFO]:"info",[Be.WARN]:"warn",[Be.ERROR]:"error"},kC=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let fv,pv;function NC(){return fv||(fv=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function AC(){return pv||(pv=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const _b=new WeakMap,ap=new WeakMap,bb=new WeakMap,Vh=new WeakMap,Km=new WeakMap;function PC(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Li(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&_b.set(n,t)}).catch(()=>{}),Km.set(e,t),e}function RC(t){if(ap.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});ap.set(t,e)}let lp={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return ap.get(t);if(e==="objectStoreNames")return t.objectStoreNames||bb.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Li(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function DC(t){lp=t(lp)}function jC(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(Fh(this),e,...n);return bb.set(r,e.sort?e.sort():[e]),Li(r)}:AC().includes(t)?function(...e){return t.apply(Fh(this),e),Li(_b.get(this))}:function(...e){return Li(t.apply(Fh(this),e))}}function OC(t){return typeof t=="function"?jC(t):(t instanceof IDBTransaction&&RC(t),CC(t,NC())?new Proxy(t,lp):t)}function Li(t){if(t instanceof IDBRequest)return PC(t);if(Vh.has(t))return Vh.get(t);const e=OC(t);return e!==t&&(Vh.set(t,e),Km.set(e,t)),e}const Fh=t=>Km.get(t);function LC(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Li(o);return r&&o.addEventListener("upgradeneeded",u=>{r(Li(o.result),u.oldVersion,u.newVersion,Li(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const MC=["get","getKey","getAll","getAllKeys","count"],VC=["put","add","delete","clear"],Uh=new Map;function mv(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Uh.get(e))return Uh.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=VC.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||MC.includes(n)))return;const s=async function(o,...a){const u=this.transaction(o,i?"readwrite":"readonly");let c=u.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&u.done]))[0]};return Uh.set(e,s),s}DC(t=>({...t,get:(e,n,r)=>mv(e,n)||t.get(e,n,r),has:(e,n)=>!!mv(e,n)||t.has(e,n)}));/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class FC{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(UC(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function UC(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const up="@firebase/app",gv="0.14.6";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Zr=new Gm("@firebase/app"),zC="@firebase/app-compat",BC="@firebase/analytics-compat",$C="@firebase/analytics",HC="@firebase/app-check-compat",qC="@firebase/app-check",WC="@firebase/auth",GC="@firebase/auth-compat",KC="@firebase/database",QC="@firebase/data-connect",YC="@firebase/database-compat",XC="@firebase/functions",JC="@firebase/functions-compat",ZC="@firebase/installations",eN="@firebase/installations-compat",tN="@firebase/messaging",nN="@firebase/messaging-compat",rN="@firebase/performance",iN="@firebase/performance-compat",sN="@firebase/remote-config",oN="@firebase/remote-config-compat",aN="@firebase/storage",lN="@firebase/storage-compat",uN="@firebase/firestore",cN="@firebase/ai",dN="@firebase/firestore-compat",hN="firebase",fN="12.6.0";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const cp="[DEFAULT]",pN={[up]:"fire-core",[zC]:"fire-core-compat",[$C]:"fire-analytics",[BC]:"fire-analytics-compat",[qC]:"fire-app-check",[HC]:"fire-app-check-compat",[WC]:"fire-auth",[GC]:"fire-auth-compat",[KC]:"fire-rtdb",[QC]:"fire-data-connect",[YC]:"fire-rtdb-compat",[XC]:"fire-fn",[JC]:"fire-fn-compat",[ZC]:"fire-iid",[eN]:"fire-iid-compat",[tN]:"fire-fcm",[nN]:"fire-fcm-compat",[rN]:"fire-perf",[iN]:"fire-perf-compat",[sN]:"fire-rc",[oN]:"fire-rc-compat",[aN]:"fire-gcs",[lN]:"fire-gcs-compat",[uN]:"fire-fst",[dN]:"fire-fst-compat",[cN]:"fire-vertex","fire-js":"fire-js",[hN]:"fire-js-all"};/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Cc=new Map,mN=new Map,dp=new Map;function yv(t,e){try{t.container.addComponent(e)}catch(n){Zr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Cs(t){const e=t.name;if(dp.has(e))return Zr.debug(`There were multiple attempts to register component ${e}.`),!1;dp.set(e,t);for(const n of Cc.values())yv(n,t);for(const n of mN.values())yv(n,t);return!0}function vd(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function wn(t){return t==null?!1:t.settings!==void 0}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const gN={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Mi=new Al("app","Firebase",gN);/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class yN{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Bi("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Mi.create("app-deleted",{appName:this._name})}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const Ms=fN;function Eb(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:cp,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw Mi.create("bad-app-name",{appName:String(i)});if(n||(n=vb()),!n)throw Mi.create("no-options");const s=Cc.get(i);if(s){if(Jr(n,s.options)&&Jr(r,s.config))return s;throw Mi.create("duplicate-app",{appName:i})}const o=new EC(i);for(const u of dp.values())o.addComponent(u);const a=new yN(n,r,o);return Cc.set(i,a),a}function Qm(t=cp){const e=Cc.get(t);if(!e&&t===cp&&vb())return Eb();if(!e)throw Mi.create("no-app",{appName:t});return e}function Ir(t,e,n){let r=pN[t]??t;n&&(r+=`-${n}`);const i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){const o=[`Unable to register library "${r}" with version "${e}":`];i&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&o.push("and"),s&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Zr.warn(o.join(" "));return}Cs(new Bi(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const vN="firebase-heartbeat-database",xN=1,pl="firebase-heartbeat-store";let zh=null;function Ib(){return zh||(zh=LC(vN,xN,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(pl)}catch(n){console.warn(n)}}}}).catch(t=>{throw Mi.create("idb-open",{originalErrorMessage:t.message})})),zh}async function wN(t){try{const n=(await Ib()).transaction(pl),r=await n.objectStore(pl).get(Tb(t));return await n.done,r}catch(e){if(e instanceof Dr)Zr.warn(e.message);else{const n=Mi.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Zr.warn(n.message)}}}async function vv(t,e){try{const r=(await Ib()).transaction(pl,"readwrite");await r.objectStore(pl).put(e,Tb(t)),await r.done}catch(n){if(n instanceof Dr)Zr.warn(n.message);else{const r=Mi.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Zr.warn(r.message)}}}function Tb(t){return`${t.name}!${t.options.appId}`}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const _N=1024,bN=30;class EN{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new TN(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=xv();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>bN){const o=SN(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Zr.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=xv(),{heartbeatsToSend:r,unsentEntries:i}=IN(this._heartbeatsCache.heartbeats),s=kc(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(n){return Zr.warn(n),""}}}function xv(){return new Date().toISOString().substring(0,10)}function IN(t,e=_N){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),wv(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),wv(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class TN{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return dC()?hC().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await wN(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return vv(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return vv(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function wv(t){return kc(JSON.stringify({version:2,heartbeats:t})).length}function SN(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;rnew FC(e),"PRIVATE")),Cs(new Bi("heartbeat",e=>new EN(e),"PRIVATE")),Ir(up,gv,t),Ir(up,gv,"esm2020"),Ir("fire-js","")}kN("");var CN="firebase",NN="12.6.0";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */Ir(CN,NN,"app");var _v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var Vi,Sb;(function(){var t;/** @license + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/function e(b,w){function T(){}T.prototype=w.prototype,b.F=w.prototype,b.prototype=new T,b.prototype.constructor=b,b.D=function(A,N,j){for(var C=Array(arguments.length-2),se=2;se>>25),C=j+(N^w&(T^N))+A[1]+3905402710&4294967295,j=w+(C<<12&4294967295|C>>>20),C=N+(T^j&(w^T))+A[2]+606105819&4294967295,N=j+(C<<17&4294967295|C>>>15),C=T+(w^N&(j^w))+A[3]+3250441966&4294967295,T=N+(C<<22&4294967295|C>>>10),C=w+(j^T&(N^j))+A[4]+4118548399&4294967295,w=T+(C<<7&4294967295|C>>>25),C=j+(N^w&(T^N))+A[5]+1200080426&4294967295,j=w+(C<<12&4294967295|C>>>20),C=N+(T^j&(w^T))+A[6]+2821735955&4294967295,N=j+(C<<17&4294967295|C>>>15),C=T+(w^N&(j^w))+A[7]+4249261313&4294967295,T=N+(C<<22&4294967295|C>>>10),C=w+(j^T&(N^j))+A[8]+1770035416&4294967295,w=T+(C<<7&4294967295|C>>>25),C=j+(N^w&(T^N))+A[9]+2336552879&4294967295,j=w+(C<<12&4294967295|C>>>20),C=N+(T^j&(w^T))+A[10]+4294925233&4294967295,N=j+(C<<17&4294967295|C>>>15),C=T+(w^N&(j^w))+A[11]+2304563134&4294967295,T=N+(C<<22&4294967295|C>>>10),C=w+(j^T&(N^j))+A[12]+1804603682&4294967295,w=T+(C<<7&4294967295|C>>>25),C=j+(N^w&(T^N))+A[13]+4254626195&4294967295,j=w+(C<<12&4294967295|C>>>20),C=N+(T^j&(w^T))+A[14]+2792965006&4294967295,N=j+(C<<17&4294967295|C>>>15),C=T+(w^N&(j^w))+A[15]+1236535329&4294967295,T=N+(C<<22&4294967295|C>>>10),C=w+(N^j&(T^N))+A[1]+4129170786&4294967295,w=T+(C<<5&4294967295|C>>>27),C=j+(T^N&(w^T))+A[6]+3225465664&4294967295,j=w+(C<<9&4294967295|C>>>23),C=N+(w^T&(j^w))+A[11]+643717713&4294967295,N=j+(C<<14&4294967295|C>>>18),C=T+(j^w&(N^j))+A[0]+3921069994&4294967295,T=N+(C<<20&4294967295|C>>>12),C=w+(N^j&(T^N))+A[5]+3593408605&4294967295,w=T+(C<<5&4294967295|C>>>27),C=j+(T^N&(w^T))+A[10]+38016083&4294967295,j=w+(C<<9&4294967295|C>>>23),C=N+(w^T&(j^w))+A[15]+3634488961&4294967295,N=j+(C<<14&4294967295|C>>>18),C=T+(j^w&(N^j))+A[4]+3889429448&4294967295,T=N+(C<<20&4294967295|C>>>12),C=w+(N^j&(T^N))+A[9]+568446438&4294967295,w=T+(C<<5&4294967295|C>>>27),C=j+(T^N&(w^T))+A[14]+3275163606&4294967295,j=w+(C<<9&4294967295|C>>>23),C=N+(w^T&(j^w))+A[3]+4107603335&4294967295,N=j+(C<<14&4294967295|C>>>18),C=T+(j^w&(N^j))+A[8]+1163531501&4294967295,T=N+(C<<20&4294967295|C>>>12),C=w+(N^j&(T^N))+A[13]+2850285829&4294967295,w=T+(C<<5&4294967295|C>>>27),C=j+(T^N&(w^T))+A[2]+4243563512&4294967295,j=w+(C<<9&4294967295|C>>>23),C=N+(w^T&(j^w))+A[7]+1735328473&4294967295,N=j+(C<<14&4294967295|C>>>18),C=T+(j^w&(N^j))+A[12]+2368359562&4294967295,T=N+(C<<20&4294967295|C>>>12),C=w+(T^N^j)+A[5]+4294588738&4294967295,w=T+(C<<4&4294967295|C>>>28),C=j+(w^T^N)+A[8]+2272392833&4294967295,j=w+(C<<11&4294967295|C>>>21),C=N+(j^w^T)+A[11]+1839030562&4294967295,N=j+(C<<16&4294967295|C>>>16),C=T+(N^j^w)+A[14]+4259657740&4294967295,T=N+(C<<23&4294967295|C>>>9),C=w+(T^N^j)+A[1]+2763975236&4294967295,w=T+(C<<4&4294967295|C>>>28),C=j+(w^T^N)+A[4]+1272893353&4294967295,j=w+(C<<11&4294967295|C>>>21),C=N+(j^w^T)+A[7]+4139469664&4294967295,N=j+(C<<16&4294967295|C>>>16),C=T+(N^j^w)+A[10]+3200236656&4294967295,T=N+(C<<23&4294967295|C>>>9),C=w+(T^N^j)+A[13]+681279174&4294967295,w=T+(C<<4&4294967295|C>>>28),C=j+(w^T^N)+A[0]+3936430074&4294967295,j=w+(C<<11&4294967295|C>>>21),C=N+(j^w^T)+A[3]+3572445317&4294967295,N=j+(C<<16&4294967295|C>>>16),C=T+(N^j^w)+A[6]+76029189&4294967295,T=N+(C<<23&4294967295|C>>>9),C=w+(T^N^j)+A[9]+3654602809&4294967295,w=T+(C<<4&4294967295|C>>>28),C=j+(w^T^N)+A[12]+3873151461&4294967295,j=w+(C<<11&4294967295|C>>>21),C=N+(j^w^T)+A[15]+530742520&4294967295,N=j+(C<<16&4294967295|C>>>16),C=T+(N^j^w)+A[2]+3299628645&4294967295,T=N+(C<<23&4294967295|C>>>9),C=w+(N^(T|~j))+A[0]+4096336452&4294967295,w=T+(C<<6&4294967295|C>>>26),C=j+(T^(w|~N))+A[7]+1126891415&4294967295,j=w+(C<<10&4294967295|C>>>22),C=N+(w^(j|~T))+A[14]+2878612391&4294967295,N=j+(C<<15&4294967295|C>>>17),C=T+(j^(N|~w))+A[5]+4237533241&4294967295,T=N+(C<<21&4294967295|C>>>11),C=w+(N^(T|~j))+A[12]+1700485571&4294967295,w=T+(C<<6&4294967295|C>>>26),C=j+(T^(w|~N))+A[3]+2399980690&4294967295,j=w+(C<<10&4294967295|C>>>22),C=N+(w^(j|~T))+A[10]+4293915773&4294967295,N=j+(C<<15&4294967295|C>>>17),C=T+(j^(N|~w))+A[1]+2240044497&4294967295,T=N+(C<<21&4294967295|C>>>11),C=w+(N^(T|~j))+A[8]+1873313359&4294967295,w=T+(C<<6&4294967295|C>>>26),C=j+(T^(w|~N))+A[15]+4264355552&4294967295,j=w+(C<<10&4294967295|C>>>22),C=N+(w^(j|~T))+A[6]+2734768916&4294967295,N=j+(C<<15&4294967295|C>>>17),C=T+(j^(N|~w))+A[13]+1309151649&4294967295,T=N+(C<<21&4294967295|C>>>11),C=w+(N^(T|~j))+A[4]+4149444226&4294967295,w=T+(C<<6&4294967295|C>>>26),C=j+(T^(w|~N))+A[11]+3174756917&4294967295,j=w+(C<<10&4294967295|C>>>22),C=N+(w^(j|~T))+A[2]+718787259&4294967295,N=j+(C<<15&4294967295|C>>>17),C=T+(j^(N|~w))+A[9]+3951481745&4294967295,b.g[0]=b.g[0]+w&4294967295,b.g[1]=b.g[1]+(N+(C<<21&4294967295|C>>>11))&4294967295,b.g[2]=b.g[2]+N&4294967295,b.g[3]=b.g[3]+j&4294967295}r.prototype.v=function(b,w){w===void 0&&(w=b.length);const T=w-this.blockSize,A=this.C;let N=this.h,j=0;for(;j>>A&255;return b};function s(b,w){var T=a;return Object.prototype.hasOwnProperty.call(T,b)?T[b]:T[b]=w(b)}function o(b,w){this.h=w;const T=[];let A=!0;for(let N=b.length-1;N>=0;N--){const j=b[N]|0;A&&j==w||(T[N]=j,A=!1)}this.g=T}var a={};function u(b){return-128<=b&&b<128?s(b,function(w){return new o([w|0],w<0?-1:0)}):new o([b|0],b<0?-1:0)}function c(b){if(isNaN(b)||!isFinite(b))return h;if(b<0)return P(c(-b));const w=[];let T=1;for(let A=0;b>=T;A++)w[A]=b/T|0,T*=4294967296;return new o(w,0)}function f(b,w){if(b.length==0)throw Error("number format error: empty string");if(w=w||10,w<2||36=0)throw Error('number format error: interior "-" character');const T=c(Math.pow(w,8));let A=h;for(let j=0;j=0?A:4294967296+A)*w,w*=4294967296}return b},t.toString=function(b){if(b=b||10,b<2||360?T.g[0]:T.h)>>>0).toString(b);if(T=N,_(T))return j+A;for(;j.length<6;)j="0"+j;A=j+A}},t.i=function(b){return b<0?0:b>>16)+(this.i(N)>>>16)+(b.i(N)>>>16);A=C>>>16,j&=65535,C&=65535,T[N]=C<<16|j}return new o(T,T[T.length-1]&-2147483648?-1:0)};function v(b,w){return b.add(P(w))}t.j=function(b){if(_(this)||_(b))return h;if(S(this))return S(b)?P(this).j(P(b)):P(P(this).j(b));if(S(b))return P(this.j(P(b)));if(this.l(g)<0&&b.l(g)<0)return c(this.m()*b.m());const w=this.g.length+b.g.length,T=[];for(var A=0;A<2*w;A++)T[A]=0;for(A=0;A>>16,C=this.i(A)&65535,se=b.i(N)>>>16,he=b.i(N)&65535;T[2*A+2*N]+=C*he,x(T,2*A+2*N),T[2*A+2*N+1]+=j*he,x(T,2*A+2*N+1),T[2*A+2*N+1]+=C*se,x(T,2*A+2*N+1),T[2*A+2*N+2]+=j*se,x(T,2*A+2*N+2)}for(b=0;b>>16,b[w]&=65535,w++}function E(b,w){this.g=b,this.h=w}function O(b,w){if(_(w))throw Error("division by zero");if(_(b))return new E(h,h);if(S(b))return w=O(P(b),w),new E(P(w.g),P(w.h));if(S(w))return w=O(b,P(w)),new E(P(w.g),w.h);if(b.g.length>30){if(S(b)||S(w))throw Error("slowDivide_ only works with positive integers.");for(var T=p,A=w;A.l(b)<=0;)T=L(T),A=L(A);var N=D(T,1),j=D(A,1);for(A=D(A,2),T=D(T,2);!_(A);){var C=j.add(A);C.l(b)<=0&&(N=N.add(T),j=C),A=D(A,1),T=D(T,1)}return w=v(b,N.j(w)),new E(N,w)}for(N=h;b.l(w)>=0;){for(T=Math.max(1,Math.floor(b.m()/w.m())),A=Math.ceil(Math.log(T)/Math.LN2),A=A<=48?1:Math.pow(2,A-48),j=c(T),C=j.j(w);S(C)||C.l(b)>0;)T-=A,j=c(T),C=j.j(w);_(j)&&(j=p),N=N.add(j),b=v(b,C)}return new E(N,b)}t.B=function(b){return O(this,b).h},t.and=function(b){const w=Math.max(this.g.length,b.g.length),T=[];for(let A=0;A>>31;return new o(T,b.h)}function D(b,w){const T=w>>5;w%=32;const A=b.g.length-T,N=[];for(let j=0;j0?b.i(j+T)>>>w|b.i(j+T+1)<<32-w:b.i(j+T);return new o(N,b.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,Sb=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.B,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=f,Vi=o}).apply(typeof _v<"u"?_v:typeof self<"u"?self:typeof window<"u"?window:{});var vu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +Copyright The Closure Library Authors. +SPDX-License-Identifier: Apache-2.0 +*/var kb,Sa,Cb,Bu,hp,Nb,Ab,Pb;(function(){var t,e=Object.defineProperty;function n(l){l=[typeof globalThis=="object"&&globalThis,l,typeof window=="object"&&window,typeof self=="object"&&self,typeof vu=="object"&&vu];for(var m=0;ml&&AsyncContext.Snapshot.wrap(l):l=>l;function g(l){const m=l.length;if(m>0){const y=Array(m);for(let I=0;I0?(this.h--,m=this.g,this.g=m.next,m.next=null):m=this.i(),m}}function P(l){o.setTimeout(()=>{throw l},0)}function v(){var l=b;let m=null;return l.g&&(m=l.g,l.g=l.g.next,l.g||(l.h=null),m.next=null),m}class x{constructor(){this.h=this.g=null}add(m,y){const I=E.get();I.set(m,y),this.h?this.h.next=I:this.g=I,this.h=I}}var E=new S(()=>new O,l=>l.reset());class O{constructor(){this.next=this.g=this.h=null}set(m,y){this.h=m,this.g=y,this.next=null}reset(){this.next=this.g=this.h=null}}let L,D=!1,b=new x,w=()=>{const l=Promise.resolve(void 0);L=()=>{l.then(T)}};function T(){for(var l;l=v();){try{l.h.call(l.g)}catch(y){P(y)}var m=E;m.j(l),m.h<100&&(m.h++,l.next=m.g,m.g=l)}D=!1}function A(){this.u=this.u,this.C=this.C}A.prototype.u=!1,A.prototype.dispose=function(){this.u||(this.u=!0,this.N())},A.prototype[Symbol.dispose]=function(){this.dispose()},A.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function N(l,m){this.type=l,this.g=this.target=m,this.defaultPrevented=!1}N.prototype.h=function(){this.defaultPrevented=!0};var j=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var l=!1,m=Object.defineProperty({},"passive",{get:function(){l=!0}});try{const y=()=>{};o.addEventListener("test",y,m),o.removeEventListener("test",y,m)}catch{}return l}();function C(l){return/^[\s\xa0]*$/.test(l)}function se(l,m){N.call(this,l?l.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,l&&this.init(l,m)}h(se,N),se.prototype.init=function(l,m){const y=this.type=l.type,I=l.changedTouches&&l.changedTouches.length?l.changedTouches[0]:null;this.target=l.target||l.srcElement,this.g=m,m=l.relatedTarget,m||(y=="mouseover"?m=l.fromElement:y=="mouseout"&&(m=l.toElement)),this.relatedTarget=m,I?(this.clientX=I.clientX!==void 0?I.clientX:I.pageX,this.clientY=I.clientY!==void 0?I.clientY:I.pageY,this.screenX=I.screenX||0,this.screenY=I.screenY||0):(this.clientX=l.clientX!==void 0?l.clientX:l.pageX,this.clientY=l.clientY!==void 0?l.clientY:l.pageY,this.screenX=l.screenX||0,this.screenY=l.screenY||0),this.button=l.button,this.key=l.key||"",this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.pointerId=l.pointerId||0,this.pointerType=l.pointerType,this.state=l.state,this.i=l,l.defaultPrevented&&se.Z.h.call(this)},se.prototype.h=function(){se.Z.h.call(this);const l=this.i;l.preventDefault?l.preventDefault():l.returnValue=!1};var he="closure_listenable_"+(Math.random()*1e6|0),le=0;function me(l,m,y,I,M){this.listener=l,this.proxy=null,this.src=m,this.type=y,this.capture=!!I,this.ha=M,this.key=++le,this.da=this.fa=!1}function q(l){l.da=!0,l.listener=null,l.proxy=null,l.src=null,l.ha=null}function oe(l,m,y){for(const I in l)m.call(y,l[I],I,l)}function k(l,m){for(const y in l)m.call(void 0,l[y],y,l)}function ge(l){const m={};for(const y in l)m[y]=l[y];return m}const ye="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function R(l,m){let y,I;for(let M=1;M-1?(m=l[ne],y||(m.fa=!1)):(m=new me(m,this.src,U,!!I,M),m.fa=y,l.push(m)),m};function Z(l,m){const y=m.type;if(y in l.g){var I=l.g[y],M=Array.prototype.indexOf.call(I,m,void 0),U;(U=M>=0)&&Array.prototype.splice.call(I,M,1),U&&(q(m),l.g[y].length==0&&(delete l.g[y],l.h--))}}function ie(l,m,y,I){for(let M=0;M-1&&(q(m[y]),Array.prototype.splice.call(m,y,1),m.length==0&&(delete l.g[U],l.h--)))):l&&(l=ve(l))&&(m=l.g[m.toString()],l=-1,m&&(l=ie(m,y,I,M)),(y=l>-1?m[l]:null)&&Dt(y))}function Dt(l){if(typeof l!="number"&&l&&!l.da){var m=l.src;if(m&&m[he])Z(m.i,l);else{var y=l.type,I=l.proxy;m.removeEventListener?m.removeEventListener(y,I,l.capture):m.detachEvent?m.detachEvent(jt(y),I):m.addListener&&m.removeListener&&m.removeListener(I),(y=ve(m))?(Z(y,l),y.h==0&&(y.src=null,m[Te]=null)):q(l)}}}function jt(l){return l in fe?fe[l]:fe[l]="on"+l}function te(l,m){if(l.da)l=!0;else{m=new se(m,this);const y=l.listener,I=l.ha||l.src;l.fa&&Dt(l),l=y.call(I,m)}return l}function ve(l){return l=l[Te],l instanceof $?l:null}var Ae="__closure_events_fn_"+(Math.random()*1e9>>>0);function Le(l){return typeof l=="function"?l:(l[Ae]||(l[Ae]=function(m){return l.handleEvent(m)}),l[Ae])}function we(){A.call(this),this.i=new $(this),this.M=this,this.G=null}h(we,A),we.prototype[he]=!0,we.prototype.removeEventListener=function(l,m,y,I){tt(this,l,m,y,I)};function Qe(l,m){var y,I=l.G;if(I)for(y=[];I;I=I.G)y.push(I);if(l=l.M,I=m.type||m,typeof m=="string")m=new N(m,l);else if(m instanceof N)m.target=m.target||l;else{var M=m;m=new N(I,l),R(m,M)}M=!0;let U,ne;if(y)for(ne=y.length-1;ne>=0;ne--)U=m.g=y[ne],M=Ht(U,I,!0,m)&&M;if(U=m.g=l,M=Ht(U,I,!0,m)&&M,M=Ht(U,I,!1,m)&&M,y)for(ne=0;ne2147483647?-1:o.setTimeout(l,m||0)}function ht(l){l.g=Xe(()=>{l.g=null,l.i&&(l.i=!1,ht(l))},l.l);const m=l.h;l.h=null,l.m.apply(null,m)}class tn extends A{constructor(m,y){super(),this.m=m,this.l=y,this.h=null,this.i=!1,this.g=null}j(m){this.h=arguments,this.g?this.i=!0:ht(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function qt(l){A.call(this),this.h=l,this.g={}}h(qt,A);var z=[];function V(l){oe(l.g,function(m,y){this.g.hasOwnProperty(y)&&Dt(m)},l),l.g={}}qt.prototype.N=function(){qt.Z.N.call(this),V(this)},qt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var B=o.JSON.stringify,K=o.JSON.parse,J=class{stringify(l){return o.JSON.stringify(l,void 0)}parse(l){return o.JSON.parse(l,void 0)}};function je(){}function Ue(){}var De={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function H(){N.call(this,"d")}h(H,N);function Q(){N.call(this,"c")}h(Q,N);var de={},Ie=null;function pe(){return Ie=Ie||new we}de.Ia="serverreachability";function qe(l){N.call(this,de.Ia,l)}h(qe,N);function nt(l){const m=pe();Qe(m,new qe(m))}de.STAT_EVENT="statevent";function ft(l,m){N.call(this,de.STAT_EVENT,l),this.stat=m}h(ft,N);function xt(l){const m=pe();Qe(m,new ft(m,l))}de.Ja="timingevent";function Or(l,m){N.call(this,de.Ja,l),this.size=m}h(Or,N);function _e(l,m){if(typeof l!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){l()},m)}function Pe(){this.g=!0}Pe.prototype.ua=function(){this.g=!1};function wt(l,m,y,I,M,U){l.info(function(){if(l.g)if(U){var ne="",Ve=U.split("&");for(let rt=0;rt1){const Ut=Ot[0];Ot=Ot[1];const pr=Ut.split("_");ne=pr.length>=2&&pr[1]=="type"?ne+(Ut+"="+Ot+"&"):ne+(Ut+"=redacted&")}}}else ne=null;else ne=U;return"XMLHTTP REQ ("+I+") [attempt "+M+"]: "+m+` +`+y+` +`+ne})}function Wt(l,m,y,I,M,U,ne){l.info(function(){return"XMLHTTP RESP ("+I+") [ attempt "+M+"]: "+m+` +`+y+` +`+U+" "+ne})}function Nn(l,m,y,I){l.info(function(){return"XMLHTTP TEXT ("+m+"): "+Gt(l,y)+(I?" "+I:"")})}function _t(l,m){l.info(function(){return"TIMEOUT: "+m})}Pe.prototype.info=function(){};function Gt(l,m){if(!l.g)return m;if(!m)return null;try{const U=JSON.parse(m);if(U){for(l=0;l0&&l.length;)y.push(l.shift()),m--;return l.length&&y.push(l.join(":")),y}function ai(l,m,y,I){this.j=l,this.i=m,this.l=y,this.S=I||1,this.V=new qt(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new dy}function dy(){this.i=null,this.g="",this.h=!1}var hy={},Jd={};function Zd(l,m,y){l.M=1,l.A=ql(fr(m)),l.u=y,l.R=!0,fy(l,null)}function fy(l,m){l.F=Date.now(),Hl(l),l.B=fr(l.A);var y=l.B,I=l.S;Array.isArray(I)||(I=[String(I)]),Sy(y.i,"t",I),l.C=0,y=l.j.L,l.h=new dy,l.g=Hy(l.j,y?m:null,!l.u),l.P>0&&(l.O=new tn(c(l.Y,l,l.g),l.P)),m=l.V,y=l.g,I=l.ba;var M="readystatechange";Array.isArray(M)||(M&&(z[0]=M.toString()),M=z);for(let U=0;U0&&!this.W){this.W=!0;var ne=this.j;ne.g==this&&ne.aa&&!ne.P&&(ne.j.info("Great, no buffering proxy detected. Bytes received: "+y.length),uh(ne),ne.P=!0,xt(11))}}else Nn(this.i,this.l,y,null),th(this,y);Ve==4&&ss(this),this.o&&!this.K&&(Ve==4?Uy(this.j,this):(this.o=!1,Hl(this)))}else KT(this.g),m==400&&y.indexOf("Unknown SID")>0?(this.m=3,xt(12)):(this.m=0,xt(13)),ss(this),Jo(this)}}}catch{}finally{}};function DT(l){if(!py(l))return l.g.la();const m=Dy(l.g);if(m==="")return"";let y="";const I=m.length,M=ci(l.g)==4;if(!l.h.i){if(typeof TextDecoder>"u")return ss(l),Jo(l),"";l.h.i=new o.TextDecoder}for(let U=0;Um.length?Jd:(m=m.slice(I,I+y),l.C=I+y,m)))}ai.prototype.cancel=function(){this.K=!0,ss(this)};function Hl(l){l.T=Date.now()+l.H,my(l,l.H)}function my(l,m){if(l.D!=null)throw Error("WatchDog timer not null");l.D=_e(c(l.aa,l),m)}function eh(l){l.D&&(o.clearTimeout(l.D),l.D=null)}ai.prototype.aa=function(){this.D=null;const l=Date.now();l-this.T>=0?(_t(this.i,this.B),this.M!=2&&(nt(),xt(17)),ss(this),this.m=2,Jo(this)):my(this,this.T-l)};function Jo(l){l.j.I==0||l.K||Uy(l.j,l)}function ss(l){eh(l);var m=l.O;m&&typeof m.dispose=="function"&&m.dispose(),l.O=null,V(l.V),l.g&&(m=l.g,l.g=null,m.abort(),m.dispose())}function th(l,m){try{var y=l.j;if(y.I!=0&&(y.g==l||nh(y.h,l))){if(!l.L&&nh(y.h,l)&&y.I==3){try{var I=y.Ba.g.parse(m)}catch{I=null}if(Array.isArray(I)&&I.length==3){var M=I;if(M[0]==0){e:if(!y.v){if(y.g)if(y.g.F+3e30&&(I=1.5*di,y.O=I,y.j.info("backChannelRequestTimeoutMs_="+I)),I=y;const hi=l.g;if(hi){const Jl=hi.g?hi.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Jl){var U=I.h;U.g||Jl.indexOf("spdy")==-1&&Jl.indexOf("quic")==-1&&Jl.indexOf("h2")==-1||(U.j=U.l,U.g=new Set,U.h&&(rh(U,U.h),U.h=null))}if(I.G){const ch=hi.g?hi.g.getResponseHeader("X-HTTP-Session-Id"):null;ch&&(I.wa=ch,lt(I.J,I.G,ch))}}y.I=3,y.l&&y.l.ra(),y.aa&&(y.T=Date.now()-l.F,y.j.info("Handshake RTT: "+y.T+"ms")),I=y;var ne=l;if(I.na=$y(I,I.L?I.ba:null,I.W),ne.L){xy(I.h,ne);var Ve=ne,Ot=I.O;Ot&&(Ve.H=Ot),Ve.D&&(eh(Ve),Hl(Ve)),I.g=ne}else Vy(I);y.i.length>0&&Ql(y)}else rt[0]!="stop"&&rt[0]!="close"||as(y,7);else y.I==3&&(rt[0]=="stop"||rt[0]=="close"?rt[0]=="stop"?as(y,7):ah(y):rt[0]!="noop"&&y.l&&y.l.qa(rt),y.A=0)}}nt(4)}catch{}}var OT=class{constructor(l,m){this.g=l,this.map=m}};function gy(l){this.l=l||10,o.PerformanceNavigationTiming?(l=o.performance.getEntriesByType("navigation"),l=l.length>0&&(l[0].nextHopProtocol=="hq"||l[0].nextHopProtocol=="h2")):l=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=l?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function yy(l){return l.h?!0:l.g?l.g.size>=l.j:!1}function vy(l){return l.h?1:l.g?l.g.size:0}function nh(l,m){return l.h?l.h==m:l.g?l.g.has(m):!1}function rh(l,m){l.g?l.g.add(m):l.h=m}function xy(l,m){l.h&&l.h==m?l.h=null:l.g&&l.g.has(m)&&l.g.delete(m)}gy.prototype.cancel=function(){if(this.i=wy(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const l of this.g.values())l.cancel();this.g.clear()}};function wy(l){if(l.h!=null)return l.i.concat(l.h.G);if(l.g!=null&&l.g.size!==0){let m=l.i;for(const y of l.g.values())m=m.concat(y.G);return m}return g(l.i)}var _y=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function LT(l,m){if(l){l=l.split("&");for(let y=0;y=0?(M=l[y].substring(0,I),U=l[y].substring(I+1)):M=l[y],m(M,U?decodeURIComponent(U.replace(/\+/g," ")):"")}}}function li(l){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let m;l instanceof li?(this.l=l.l,Zo(this,l.j),this.o=l.o,this.g=l.g,ea(this,l.u),this.h=l.h,ih(this,ky(l.i)),this.m=l.m):l&&(m=String(l).match(_y))?(this.l=!1,Zo(this,m[1]||"",!0),this.o=ta(m[2]||""),this.g=ta(m[3]||"",!0),ea(this,m[4]),this.h=ta(m[5]||"",!0),ih(this,m[6]||"",!0),this.m=ta(m[7]||"")):(this.l=!1,this.i=new ra(null,this.l))}li.prototype.toString=function(){const l=[];var m=this.j;m&&l.push(na(m,by,!0),":");var y=this.g;return(y||m=="file")&&(l.push("//"),(m=this.o)&&l.push(na(m,by,!0),"@"),l.push(An(y).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),y=this.u,y!=null&&l.push(":",String(y))),(y=this.h)&&(this.g&&y.charAt(0)!="/"&&l.push("/"),l.push(na(y,y.charAt(0)=="/"?FT:VT,!0))),(y=this.i.toString())&&l.push("?",y),(y=this.m)&&l.push("#",na(y,zT)),l.join("")},li.prototype.resolve=function(l){const m=fr(this);let y=!!l.j;y?Zo(m,l.j):y=!!l.o,y?m.o=l.o:y=!!l.g,y?m.g=l.g:y=l.u!=null;var I=l.h;if(y)ea(m,l.u);else if(y=!!l.h){if(I.charAt(0)!="/")if(this.g&&!this.h)I="/"+I;else{var M=m.h.lastIndexOf("/");M!=-1&&(I=m.h.slice(0,M+1)+I)}if(M=I,M==".."||M==".")I="";else if(M.indexOf("./")!=-1||M.indexOf("/.")!=-1){I=M.lastIndexOf("/",0)==0,M=M.split("/");const U=[];for(let ne=0;ne1||U.length==1&&U[0]!="")&&U.pop(),I&&ne==M.length&&U.push("")):(U.push(Ve),I=!0)}I=U.join("/")}else I=M}return y?m.h=I:y=l.i.toString()!=="",y?ih(m,ky(l.i)):y=!!l.m,y&&(m.m=l.m),m};function fr(l){return new li(l)}function Zo(l,m,y){l.j=y?ta(m,!0):m,l.j&&(l.j=l.j.replace(/:$/,""))}function ea(l,m){if(m){if(m=Number(m),isNaN(m)||m<0)throw Error("Bad port number "+m);l.u=m}else l.u=null}function ih(l,m,y){m instanceof ra?(l.i=m,BT(l.i,l.l)):(y||(m=na(m,UT)),l.i=new ra(m,l.l))}function lt(l,m,y){l.i.set(m,y)}function ql(l){return lt(l,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),l}function ta(l,m){return l?m?decodeURI(l.replace(/%25/g,"%2525")):decodeURIComponent(l):""}function na(l,m,y){return typeof l=="string"?(l=encodeURI(l).replace(m,MT),y&&(l=l.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),l):null}function MT(l){return l=l.charCodeAt(0),"%"+(l>>4&15).toString(16)+(l&15).toString(16)}var by=/[#\/\?@]/g,VT=/[#\?:]/g,FT=/[#\?]/g,UT=/[#\?@]/g,zT=/#/g;function ra(l,m){this.h=this.g=null,this.i=l||null,this.j=!!m}function os(l){l.g||(l.g=new Map,l.h=0,l.i&<(l.i,function(m,y){l.add(decodeURIComponent(m.replace(/\+/g," ")),y)}))}t=ra.prototype,t.add=function(l,m){os(this),this.i=null,l=Bs(this,l);let y=this.g.get(l);return y||this.g.set(l,y=[]),y.push(m),this.h+=1,this};function Ey(l,m){os(l),m=Bs(l,m),l.g.has(m)&&(l.i=null,l.h-=l.g.get(m).length,l.g.delete(m))}function Iy(l,m){return os(l),m=Bs(l,m),l.g.has(m)}t.forEach=function(l,m){os(this),this.g.forEach(function(y,I){y.forEach(function(M){l.call(m,M,I,this)},this)},this)};function Ty(l,m){os(l);let y=[];if(typeof m=="string")Iy(l,m)&&(y=y.concat(l.g.get(Bs(l,m))));else for(l=Array.from(l.g.values()),m=0;m0?String(l[0]):m):m};function Sy(l,m,y){Ey(l,m),y.length>0&&(l.i=null,l.g.set(Bs(l,m),g(y)),l.h+=y.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const l=[],m=Array.from(this.g.keys());for(let I=0;I{I.abort(),ui(y,"TestPingServer: timeout",!1,m)},1e4);fetch(l,{signal:I.signal}).then(U=>{clearTimeout(M),U.ok?ui(y,"TestPingServer: ok",!0,m):ui(y,"TestPingServer: server error",!1,m)}).catch(()=>{clearTimeout(M),ui(y,"TestPingServer: error",!1,m)})}function ui(l,m,y,I,M){try{M&&(M.onload=null,M.onerror=null,M.onabort=null,M.ontimeout=null),I(y)}catch{}}function qT(){this.g=new J}function sh(l){this.i=l.Sb||null,this.h=l.ab||!1}h(sh,je),sh.prototype.g=function(){return new Wl(this.i,this.h)};function Wl(l,m){we.call(this),this.H=l,this.o=m,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}h(Wl,we),t=Wl.prototype,t.open=function(l,m){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=l,this.D=m,this.readyState=1,sa(this)},t.send=function(l){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const m={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};l&&(m.body=l),(this.H||o).fetch(new Request(this.D,m)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,ia(this)),this.readyState=0},t.Pa=function(l){if(this.g&&(this.l=l,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=l.headers,this.readyState=2,sa(this)),this.g&&(this.readyState=3,sa(this),this.g)))if(this.responseType==="arraybuffer")l.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in l){if(this.j=l.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;Cy(this)}else l.text().then(this.Oa.bind(this),this.ga.bind(this))};function Cy(l){l.j.read().then(l.Ma.bind(l)).catch(l.ga.bind(l))}t.Ma=function(l){if(this.g){if(this.o&&l.value)this.response.push(l.value);else if(!this.o){var m=l.value?l.value:new Uint8Array(0);(m=this.B.decode(m,{stream:!l.done}))&&(this.response=this.responseText+=m)}l.done?ia(this):sa(this),this.readyState==3&&Cy(this)}},t.Oa=function(l){this.g&&(this.response=this.responseText=l,ia(this))},t.Na=function(l){this.g&&(this.response=l,ia(this))},t.ga=function(){this.g&&ia(this)};function ia(l){l.readyState=4,l.l=null,l.j=null,l.B=null,sa(l)}t.setRequestHeader=function(l,m){this.A.append(l,m)},t.getResponseHeader=function(l){return this.h&&this.h.get(l.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const l=[],m=this.h.entries();for(var y=m.next();!y.done;)y=y.value,l.push(y[0]+": "+y[1]),y=m.next();return l.join(`\r +`)};function sa(l){l.onreadystatechange&&l.onreadystatechange.call(l)}Object.defineProperty(Wl.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(l){this.m=l?"include":"same-origin"}});function Ny(l){let m="";return oe(l,function(y,I){m+=I,m+=":",m+=y,m+=`\r +`}),m}function oh(l,m,y){e:{for(I in y){var I=!1;break e}I=!0}I||(y=Ny(y),typeof l=="string"?y!=null&&An(y):lt(l,m,y))}function bt(l){we.call(this),this.headers=new Map,this.L=l||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}h(bt,we);var WT=/^https?$/i,GT=["POST","PUT"];t=bt.prototype,t.Fa=function(l){this.H=l},t.ea=function(l,m,y,I){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+l);m=m?m.toUpperCase():"GET",this.D=l,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Me.g(),this.g.onreadystatechange=p(c(this.Ca,this));try{this.B=!0,this.g.open(m,String(l),!0),this.B=!1}catch(U){Ay(this,U);return}if(l=y||"",y=new Map(this.headers),I)if(Object.getPrototypeOf(I)===Object.prototype)for(var M in I)y.set(M,I[M]);else if(typeof I.keys=="function"&&typeof I.get=="function")for(const U of I.keys())y.set(U,I.get(U));else throw Error("Unknown input type for opt_headers: "+String(I));I=Array.from(y.keys()).find(U=>U.toLowerCase()=="content-type"),M=o.FormData&&l instanceof o.FormData,!(Array.prototype.indexOf.call(GT,m,void 0)>=0)||I||M||y.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[U,ne]of y)this.g.setRequestHeader(U,ne);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(l),this.v=!1}catch(U){Ay(this,U)}};function Ay(l,m){l.h=!1,l.g&&(l.j=!0,l.g.abort(),l.j=!1),l.l=m,l.o=5,Py(l),Gl(l)}function Py(l){l.A||(l.A=!0,Qe(l,"complete"),Qe(l,"error"))}t.abort=function(l){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=l||7,Qe(this,"complete"),Qe(this,"abort"),Gl(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Gl(this,!0)),bt.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?Ry(this):this.Xa())},t.Xa=function(){Ry(this)};function Ry(l){if(l.h&&typeof s<"u"){if(l.v&&ci(l)==4)setTimeout(l.Ca.bind(l),0);else if(Qe(l,"readystatechange"),ci(l)==4){l.h=!1;try{const U=l.ca();e:switch(U){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var m=!0;break e;default:m=!1}var y;if(!(y=m)){var I;if(I=U===0){let ne=String(l.D).match(_y)[1]||null;!ne&&o.self&&o.self.location&&(ne=o.self.location.protocol.slice(0,-1)),I=!WT.test(ne?ne.toLowerCase():"")}y=I}if(y)Qe(l,"complete"),Qe(l,"success");else{l.o=6;try{var M=ci(l)>2?l.g.statusText:""}catch{M=""}l.l=M+" ["+l.ca()+"]",Py(l)}}finally{Gl(l)}}}}function Gl(l,m){if(l.g){l.m&&(clearTimeout(l.m),l.m=null);const y=l.g;l.g=null,m||Qe(l,"ready");try{y.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function ci(l){return l.g?l.g.readyState:0}t.ca=function(){try{return ci(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(l){if(this.g){var m=this.g.responseText;return l&&m.indexOf(l)==0&&(m=m.substring(l.length)),K(m)}};function Dy(l){try{if(!l.g)return null;if("response"in l.g)return l.g.response;switch(l.F){case"":case"text":return l.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in l.g)return l.g.mozResponseArrayBuffer}return null}catch{return null}}function KT(l){const m={};l=(l.g&&ci(l)>=2&&l.g.getAllResponseHeaders()||"").split(`\r +`);for(let I=0;I0&&(this.ia=l.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=jy.prototype,t.ka=8,t.I=1,t.connect=function(l,m,y,I){xt(0),this.W=l,this.H=m||{},y&&I!==void 0&&(this.H.OSID=y,this.H.OAID=I),this.F=this.X,this.J=$y(this,null,this.W),Ql(this)};function ah(l){if(Oy(l),l.I==3){var m=l.V++,y=fr(l.J);if(lt(y,"SID",l.M),lt(y,"RID",m),lt(y,"TYPE","terminate"),aa(l,y),m=new ai(l,l.j,m),m.M=2,m.A=ql(fr(y)),y=!1,o.navigator&&o.navigator.sendBeacon)try{y=o.navigator.sendBeacon(m.A.toString(),"")}catch{}!y&&o.Image&&(new Image().src=m.A,y=!0),y||(m.g=Hy(m.j,null),m.g.ea(m.A)),m.F=Date.now(),Hl(m)}By(l)}function Kl(l){l.g&&(uh(l),l.g.cancel(),l.g=null)}function Oy(l){Kl(l),l.v&&(o.clearTimeout(l.v),l.v=null),Yl(l),l.h.cancel(),l.m&&(typeof l.m=="number"&&o.clearTimeout(l.m),l.m=null)}function Ql(l){if(!yy(l.h)&&!l.m){l.m=!0;var m=l.Ea;L||w(),D||(L(),D=!0),b.add(m,l),l.D=0}}function QT(l,m){return vy(l.h)>=l.h.j-(l.m?1:0)?!1:l.m?(l.i=m.G.concat(l.i),!0):l.I==1||l.I==2||l.D>=(l.Sa?0:l.Ta)?!1:(l.m=_e(c(l.Ea,l,m),zy(l,l.D)),l.D++,!0)}t.Ea=function(l){if(this.m)if(this.m=null,this.I==1){if(!l){this.V=Math.floor(Math.random()*1e5),l=this.V++;const M=new ai(this,this.j,l);let U=this.o;if(this.U&&(U?(U=ge(U),R(U,this.U)):U=this.U),this.u!==null||this.R||(M.J=U,U=null),this.S)e:{for(var m=0,y=0;y4096){m=y;break e}if(m===4096||y===this.i.length-1){m=y+1;break e}}m=1e3}else m=1e3;m=My(this,M,m),y=fr(this.J),lt(y,"RID",l),lt(y,"CVER",22),this.G&<(y,"X-HTTP-Session-Id",this.G),aa(this,y),U&&(this.R?m="headers="+An(Ny(U))+"&"+m:this.u&&oh(y,this.u,U)),rh(this.h,M),this.Ra&<(y,"TYPE","init"),this.S?(lt(y,"$req",m),lt(y,"SID","null"),M.U=!0,Zd(M,y,null)):Zd(M,y,m),this.I=2}}else this.I==3&&(l?Ly(this,l):this.i.length==0||yy(this.h)||Ly(this))};function Ly(l,m){var y;m?y=m.l:y=l.V++;const I=fr(l.J);lt(I,"SID",l.M),lt(I,"RID",y),lt(I,"AID",l.K),aa(l,I),l.u&&l.o&&oh(I,l.u,l.o),y=new ai(l,l.j,y,l.D+1),l.u===null&&(y.J=l.o),m&&(l.i=m.G.concat(l.i)),m=My(l,y,1e3),y.H=Math.round(l.va*.5)+Math.round(l.va*.5*Math.random()),rh(l.h,y),Zd(y,I,m)}function aa(l,m){l.H&&oe(l.H,function(y,I){lt(m,I,y)}),l.l&&oe({},function(y,I){lt(m,I,y)})}function My(l,m,y){y=Math.min(l.i.length,y);const I=l.l?c(l.l.Ka,l.l,l):null;e:{var M=l.i;let Ve=-1;for(;;){const Ot=["count="+y];Ve==-1?y>0?(Ve=M[0].g,Ot.push("ofs="+Ve)):Ve=0:Ot.push("ofs="+Ve);let rt=!0;for(let Ut=0;Ut=3?!1:(l.Y++,l.v=_e(c(l.Da,l),zy(l,l.A)),l.A++,!0)}t.Da=function(){if(this.v=null,Fy(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var l=4*this.T;this.j.info("BP detection timer enabled: "+l),this.B=_e(c(this.Wa,this),l)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,xt(10),Kl(this),Fy(this))};function uh(l){l.B!=null&&(o.clearTimeout(l.B),l.B=null)}function Fy(l){l.g=new ai(l,l.j,"rpc",l.Y),l.u===null&&(l.g.J=l.o),l.g.P=0;var m=fr(l.na);lt(m,"RID","rpc"),lt(m,"SID",l.M),lt(m,"AID",l.K),lt(m,"CI",l.F?"0":"1"),!l.F&&l.ia&<(m,"TO",l.ia),lt(m,"TYPE","xmlhttp"),aa(l,m),l.u&&l.o&&oh(m,l.u,l.o),l.O&&(l.g.H=l.O);var y=l.g;l=l.ba,y.M=1,y.A=ql(fr(m)),y.u=null,y.R=!0,fy(y,l)}t.Va=function(){this.C!=null&&(this.C=null,Kl(this),lh(this),xt(19))};function Yl(l){l.C!=null&&(o.clearTimeout(l.C),l.C=null)}function Uy(l,m){var y=null;if(l.g==m){Yl(l),uh(l),l.g=null;var I=2}else if(nh(l.h,m))y=m.G,xy(l.h,m),I=1;else return;if(l.I!=0){if(m.o)if(I==1){y=m.u?m.u.length:0,m=Date.now()-m.F;var M=l.D;I=pe(),Qe(I,new Or(I,y)),Ql(l)}else Vy(l);else if(M=m.m,M==3||M==0&&m.X>0||!(I==1&&QT(l,m)||I==2&&lh(l)))switch(y&&y.length>0&&(m=l.h,m.i=m.i.concat(y)),M){case 1:as(l,5);break;case 4:as(l,10);break;case 3:as(l,6);break;default:as(l,2)}}}function zy(l,m){let y=l.Qa+Math.floor(Math.random()*l.Za);return l.isActive()||(y*=2),y*m}function as(l,m){if(l.j.info("Error code "+m),m==2){var y=c(l.bb,l),I=l.Ua;const M=!I;I=new li(I||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Zo(I,"https"),ql(I),M?$T(I.toString(),y):HT(I.toString(),y)}else xt(2);l.I=0,l.l&&l.l.pa(m),By(l),Oy(l)}t.bb=function(l){l?(this.j.info("Successfully pinged google.com"),xt(2)):(this.j.info("Failed to ping google.com"),xt(1))};function By(l){if(l.I=0,l.ja=[],l.l){const m=wy(l.h);(m.length!=0||l.i.length!=0)&&(_(l.ja,m),_(l.ja,l.i),l.h.i.length=0,g(l.i),l.i.length=0),l.l.oa()}}function $y(l,m,y){var I=y instanceof li?fr(y):new li(y);if(I.g!="")m&&(I.g=m+"."+I.g),ea(I,I.u);else{var M=o.location;I=M.protocol,m=m?m+"."+M.hostname:M.hostname,M=+M.port;const U=new li(null);I&&Zo(U,I),m&&(U.g=m),M&&ea(U,M),y&&(U.h=y),I=U}return y=l.G,m=l.wa,y&&m&<(I,y,m),lt(I,"VER",l.ka),aa(l,I),I}function Hy(l,m,y){if(m&&!l.L)throw Error("Can't create secondary domain capable XhrIo object.");return m=l.Aa&&!l.ma?new bt(new sh({ab:y})):new bt(l.ma),m.Fa(l.L),m}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function qy(){}t=qy.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function Xl(){}Xl.prototype.g=function(l,m){return new Pn(l,m)};function Pn(l,m){we.call(this),this.g=new jy(m),this.l=l,this.h=m&&m.messageUrlParams||null,l=m&&m.messageHeaders||null,m&&m.clientProtocolHeaderRequired&&(l?l["X-Client-Protocol"]="webchannel":l={"X-Client-Protocol":"webchannel"}),this.g.o=l,l=m&&m.initMessageHeaders||null,m&&m.messageContentType&&(l?l["X-WebChannel-Content-Type"]=m.messageContentType:l={"X-WebChannel-Content-Type":m.messageContentType}),m&&m.sa&&(l?l["X-WebChannel-Client-Profile"]=m.sa:l={"X-WebChannel-Client-Profile":m.sa}),this.g.U=l,(l=m&&m.Qb)&&!C(l)&&(this.g.u=l),this.A=m&&m.supportsCrossDomainXhr||!1,this.v=m&&m.sendRawJson||!1,(m=m&&m.httpSessionIdParam)&&!C(m)&&(this.g.G=m,l=this.h,l!==null&&m in l&&(l=this.h,m in l&&delete l[m])),this.j=new $s(this)}h(Pn,we),Pn.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Pn.prototype.close=function(){ah(this.g)},Pn.prototype.o=function(l){var m=this.g;if(typeof l=="string"){var y={};y.__data__=l,l=y}else this.v&&(y={},y.__data__=B(l),l=y);m.i.push(new OT(m.Ya++,l)),m.I==3&&Ql(m)},Pn.prototype.N=function(){this.g.l=null,delete this.j,ah(this.g),delete this.g,Pn.Z.N.call(this)};function Wy(l){H.call(this),l.__headers__&&(this.headers=l.__headers__,this.statusCode=l.__status__,delete l.__headers__,delete l.__status__);var m=l.__sm__;if(m){e:{for(const y in m){l=y;break e}l=void 0}(this.i=l)&&(l=this.i,m=m!==null&&l in m?m[l]:void 0),this.data=m}else this.data=l}h(Wy,H);function Gy(){Q.call(this),this.status=1}h(Gy,Q);function $s(l){this.g=l}h($s,qy),$s.prototype.ra=function(){Qe(this.g,"a")},$s.prototype.qa=function(l){Qe(this.g,new Wy(l))},$s.prototype.pa=function(l){Qe(this.g,new Gy)},$s.prototype.oa=function(){Qe(this.g,"b")},Xl.prototype.createWebChannel=Xl.prototype.g,Pn.prototype.send=Pn.prototype.o,Pn.prototype.open=Pn.prototype.m,Pn.prototype.close=Pn.prototype.close,Pb=function(){return new Xl},Ab=function(){return pe()},Nb=de,hp={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Bn.NO_ERROR=0,Bn.TIMEOUT=8,Bn.HTTP_ERROR=6,Bu=Bn,Kt.COMPLETE="complete",Cb=Kt,Ue.EventType=De,De.OPEN="a",De.CLOSE="b",De.ERROR="c",De.MESSAGE="d",we.prototype.listen=we.prototype.J,Sa=Ue,bt.prototype.listenOnce=bt.prototype.K,bt.prototype.getLastError=bt.prototype.Ha,bt.prototype.getLastErrorCode=bt.prototype.ya,bt.prototype.getStatus=bt.prototype.ca,bt.prototype.getResponseJson=bt.prototype.La,bt.prototype.getResponseText=bt.prototype.la,bt.prototype.send=bt.prototype.ea,bt.prototype.setWithCredentials=bt.prototype.Fa,kb=bt}).apply(typeof vu<"u"?vu:typeof self<"u"?self:typeof window<"u"?window:{});const bv="@firebase/firestore",Ev="4.9.2";/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class on{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}on.UNAUTHENTICATED=new on(null),on.GOOGLE_CREDENTIALS=new on("google-credentials-uid"),on.FIRST_PARTY=new on("first-party-uid"),on.MOCK_USER=new on("mock-user");/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */let Bo="12.3.0";/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Ns=new Gm("@firebase/firestore");function Ws(){return Ns.logLevel}function ue(t,...e){if(Ns.logLevel<=Be.DEBUG){const n=e.map(Ym);Ns.debug(`Firestore (${Bo}): ${t}`,...n)}}function ei(t,...e){if(Ns.logLevel<=Be.ERROR){const n=e.map(Ym);Ns.error(`Firestore (${Bo}): ${t}`,...n)}}function Ao(t,...e){if(Ns.logLevel<=Be.WARN){const n=e.map(Ym);Ns.warn(`Firestore (${Bo}): ${t}`,...n)}}function Ym(t){if(typeof t=="string")return t;try{/** +* @license +* Copyright 2020 Google LLC +* +* 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. +*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function Ee(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,Rb(t,r,n)}function Rb(t,e,n){let r=`FIRESTORE (${Bo}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw ei(r),new Error(r)}function Ze(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||Rb(e,i,r)}function Re(t,e){return t}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const W={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class ae extends Dr{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class qr{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Db{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class AN{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(on.UNAUTHENTICATED))}shutdown(){}}class PN{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class RN{constructor(e){this.t=e,this.currentUser=on.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){Ze(this.o===void 0,42304);let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let s=new qr;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new qr,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const u=s;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},a=u=>{ue("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(u=>a(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?a(u):(ue("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new qr)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(ue("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Ze(typeof r.accessToken=="string",31837,{l:r}),new Db(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Ze(e===null||typeof e=="string",2055,{h:e}),new on(e)}}class DN{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=on.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class jN{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new DN(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(on.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Iv{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class ON{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,wn(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){Ze(this.o===void 0,3512);const r=s=>{s.error!=null&&ue("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.m;return this.m=s.token,ue("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{ue("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.V.getImmediate({optional:!0});s?i(s):ue("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new Iv(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Ze(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new Iv(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function LN(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function fp(t,e){const n=Math.min(t.length,e.length);for(let r=0;r=MN&&e<=VN}function Po(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Tv="__name__";class xr{constructor(e,n,r){n===void 0?n=0:n>e.length&&Ee(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&Ee(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return xr.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof xr?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length=0)throw new ae(W.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new st(n)}static emptyPath(){return new st([])}}const FN=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Xt extends xr{construct(e,n,r){return new Xt(e,n,r)}static isValidIdentifier(e){return FN.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Xt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===Tv}static keyField(){return new Xt([Tv])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new ae(W.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&st.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return st.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new xe(new st(e.slice()))}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function jb(t,e,n){if(!n)throw new ae(W.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function UN(t,e,n,r){if(e===!0&&r===!0)throw new ae(W.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Sv(t){if(!xe.isDocumentKey(t))throw new ae(W.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function kv(t){if(xe.isDocumentKey(t))throw new ae(W.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Ob(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function xd(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Ee(12329,{type:typeof t})}function Sn(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ae(W.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=xd(t);throw new ae(W.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** + * @license + * Copyright 2025 Google LLC + * + * 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. + */function Rt(t,e){const n={typeString:t};return e&&(n.value=e),n}function Rl(t,e){if(!Ob(t))throw new ae(W.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const i=e[r].typeString,s="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const o=t[r];if(i&&typeof o!==i){n=`JSON field '${r}' must be a ${i}.`;break}if(s!==void 0&&o!==s.value){n=`Expected '${r}' field to equal '${s.value}'`;break}}if(n)throw new ae(W.INVALID_ARGUMENT,n);return!0}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Cv=-62135596800,Nv=1e6;class Je{static now(){return Je.fromMillis(Date.now())}static fromDate(e){return Je.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*Nv);return new Je(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new ae(W.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new ae(W.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e=253402300800)throw new ae(W.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Nv}_compareTo(e){return this.seconds===e.seconds?$e(this.nanoseconds,e.nanoseconds):$e(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Je._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Rl(e,Je._jsonSchema))return new Je(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Cv;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Je._jsonSchemaVersion="firestore/timestamp/1.0",Je._jsonSchema={type:Rt("string",Je._jsonSchemaVersion),seconds:Rt("number"),nanoseconds:Rt("number")};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Ne{static fromTimestamp(e){return new Ne(e)}static min(){return new Ne(new Je(0,0))}static max(){return new Ne(new Je(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const ml=-1;function zN(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=Ne.fromTimestamp(r===1e9?new Je(n+1,0):new Je(n,r));return new $i(i,xe.empty(),e)}function BN(t){return new $i(t.readTime,t.key,ml)}class $i{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new $i(Ne.min(),xe.empty(),ml)}static max(){return new $i(Ne.max(),xe.empty(),ml)}}function $N(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=xe.comparator(t.documentKey,e.documentKey),n!==0?n:$e(t.largestBatchId,e.largestBatchId))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const HN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class qN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */async function $o(t){if(t.code!==W.FAILED_PRECONDITION||t.message!==HN)throw t;ue("LocalStore","Unexpectedly lost primary lease")}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class G{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&Ee(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new G((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof G?n:G.resolve(n)}catch(n){return G.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):G.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):G.reject(n)}static resolve(e){return new G((n,r)=>{n(e)})}static reject(e){return new G((n,r)=>{r(e)})}static waitFor(e){return new G((n,r)=>{let i=0,s=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++s,o&&s===i&&n()},u=>r(u))}),o=!0,s===i&&n()})}static or(e){let n=G.resolve(!1);for(const r of e)n=n.next(i=>i?G.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new G((r,i)=>{const s=e.length,o=new Array(s);let a=0;for(let u=0;u{o[c]=f,++a,a===s&&r(o)},f=>i(f))}})}static doWhile(e,n){return new G((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function WN(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function Ho(t){return t.name==="IndexedDbTransactionError"}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */class wd{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>n.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}wd.ce=-1;/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Jm=-1;function _d(t){return t==null}function Nc(t){return t===0&&1/t==-1/0}function GN(t){return typeof t=="number"&&Number.isInteger(t)&&!Nc(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Lb="";function KN(t){let e="";for(let n=0;n0&&(e=Av(e)),e=QN(t.get(n),e);return Av(e)}function QN(t,e){let n=e;const r=t.length;for(let i=0;i0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new xu(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new xu(this.root,e,this.comparator,!1)}getReverseIterator(){return new xu(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new xu(this.root,e,this.comparator,!0)}}class xu{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Yt{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??Yt.RED,this.left=i??Yt.EMPTY,this.right=s??Yt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new Yt(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Yt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Yt.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Yt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Yt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Ee(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Ee(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Ee(27949);return e+(this.isRed()?0:1)}}Yt.EMPTY=null,Yt.RED=!0,Yt.BLACK=!1;Yt.EMPTY=new class{constructor(){this.size=0}get key(){throw Ee(57766)}get value(){throw Ee(16141)}get color(){throw Ee(16727)}get left(){throw Ee(29726)}get right(){throw Ee(36894)}copy(e,n,r,i,s){return this}insert(e,n,r){return new Yt(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Vt{constructor(e){this.comparator=e,this.data=new yt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new Rv(this.data.getIterator())}getIteratorFrom(e){return new Rv(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof Vt)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new Vt(this.comparator);return n.data=e,n}}class Rv{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class On{constructor(e){this.fields=e,e.sort(Xt.comparator)}static empty(){return new On([])}unionWith(e){let n=new Vt(Xt.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new On(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Po(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */class Vb extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class en{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new Vb("Invalid base64 string: "+s):s}}(e);return new en(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;oeAr(n,e))!==void 0}function Ro(t,e){if(t===e)return 0;const n=Wi(t),r=Wi(e);if(n!==r)return $e(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return $e(t.booleanValue,e.booleanValue);case 2:return function(s,o){const a=Tt(s.integerValue||s.doubleValue),u=Tt(o.integerValue||o.doubleValue);return au?1:a===u?0:isNaN(a)?isNaN(u)?0:-1:1}(t,e);case 3:return Dv(t.timestampValue,e.timestampValue);case 4:return Dv(gl(t),gl(e));case 5:return fp(t.stringValue,e.stringValue);case 6:return function(s,o){const a=qi(s),u=qi(o);return a.compareTo(u)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const a=s.split("/"),u=o.split("/");for(let c=0;ci+$u(s),0)}(t.arrayValue);case 10:case 11:return function(r){let i=0;return Ji(r.fields,(s,o)=>{i+=s.length+$u(o)}),i}(t.mapValue);default:throw Ee(13486,{value:t})}}function Ov(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function mp(t){return!!t&&"integerValue"in t}function eg(t){return!!t&&"arrayValue"in t}function Lv(t){return!!t&&"nullValue"in t}function Mv(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Hu(t){return!!t&&"mapValue"in t}function ZN(t){var n,r;return((r=(((n=t==null?void 0:t.mapValue)==null?void 0:n.fields)||{})[$b])==null?void 0:r.stringValue)===Hb}function Ua(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return Ji(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=Ua(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Ua(t.arrayValue.values[n]);return e}return{...t}}function eA(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===JN}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class _n{constructor(e){this.value=e}static empty(){return new _n({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(a)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=Ua(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());Hu(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Ar(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[i]=s);for(const i of r)delete e[i]}clone(){return new _n(Ua(this.value))}}function qb(t){const e=[];return Ji(t.fields,(n,r)=>{const i=new Xt([n]);if(Hu(r)){const s=qb(r.mapValue).fields;if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new On(e)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ln{constructor(e,n,r,i,s,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=a}static newInvalidDocument(e){return new ln(e,0,Ne.min(),Ne.min(),Ne.min(),_n.empty(),0)}static newFoundDocument(e,n,r,i){return new ln(e,1,n,Ne.min(),r,i,0)}static newNoDocument(e,n){return new ln(e,2,n,Ne.min(),Ne.min(),_n.empty(),0)}static newUnknownDocument(e,n){return new ln(e,3,n,Ne.min(),Ne.min(),_n.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(Ne.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=_n.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=_n.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Ne.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof ln&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new ln(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class Rc{constructor(e,n){this.position=e,this.inclusive=n}}function Vv(t,e,n){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return Ee(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class dr extends Wb{constructor(e,n){super(),this.filters=e,this.op=n,this.Pe=null}static create(e,n){return new dr(e,n)}matches(e){return Gb(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Gb(t){return t.op==="and"}function Kb(t){return nA(t)&&Gb(t)}function nA(t){for(const e of t.filters)if(e instanceof dr)return!1;return!0}function gp(t){if(t instanceof Pt)return t.field.canonicalString()+t.op.toString()+Do(t.value);if(Kb(t))return t.filters.map(e=>gp(e)).join(",");{const e=t.filters.map(n=>gp(n)).join(",");return`${t.op}(${e})`}}function Qb(t,e){return t instanceof Pt?function(r,i){return i instanceof Pt&&r.op===i.op&&r.field.isEqual(i.field)&&Ar(r.value,i.value)}(t,e):t instanceof dr?function(r,i){return i instanceof dr&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&Qb(o,i.filters[a]),!0):!1}(t,e):void Ee(19439)}function Yb(t){return t instanceof Pt?function(n){return`${n.field.canonicalString()} ${n.op} ${Do(n.value)}`}(t):t instanceof dr?function(n){return n.op.toString()+" {"+n.getFilters().map(Yb).join(" ,")+"}"}(t):"Filter"}class rA extends Pt{constructor(e,n,r){super(e,n,r),this.key=xe.fromName(r.referenceValue)}matches(e){const n=xe.comparator(e.key,this.key);return this.matchesComparison(n)}}class iA extends Pt{constructor(e,n){super(e,"in",n),this.keys=Xb("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class sA extends Pt{constructor(e,n){super(e,"not-in",n),this.keys=Xb("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function Xb(t,e){var n;return(((n=e.arrayValue)==null?void 0:n.values)||[]).map(r=>xe.fromName(r.referenceValue))}class oA extends Pt{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return eg(n)&&vl(n.arrayValue,this.value)}}class aA extends Pt{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&vl(this.value.arrayValue,n)}}class lA extends Pt{constructor(e,n){super(e,"not-in",n)}matches(e){if(vl(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!vl(this.value.arrayValue,n)}}class uA extends Pt{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!eg(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>vl(this.value.arrayValue,r))}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class cA{constructor(e,n=null,r=[],i=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.Te=null}}function Uv(t,e=null,n=[],r=[],i=null,s=null,o=null){return new cA(t,e,n,r,i,s,o)}function tg(t){const e=Re(t);if(e.Te===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>gp(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),_d(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>Do(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>Do(r)).join(",")),e.Te=n}return e.Te}function ng(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Vt(Xt.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.Ie.push(new xl(s,r))}),n.has(Xt.keyField().canonicalString())||e.Ie.push(new xl(Xt.keyField(),r))}return e.Ie}function Tr(t){const e=Re(t);return e.Ee||(e.Ee=hA(e,za(t))),e.Ee}function hA(t,e){if(t.limitType==="F")return Uv(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new xl(i.field,s)});const n=t.endAt?new Rc(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Rc(t.startAt.position,t.startAt.inclusive):null;return Uv(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function vp(t,e){const n=t.filters.concat([e]);return new qo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function xp(t,e,n){return new qo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Id(t,e){return ng(Tr(t),Tr(e))&&t.limitType===e.limitType}function Zb(t){return`${tg(Tr(t))}|lt:${t.limitType}`}function Gs(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>Yb(i)).join(", ")}]`),_d(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>Do(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>Do(i)).join(",")),`Target(${r})`}(Tr(t))}; limitType=${t.limitType})`}function Td(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):xe.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of za(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,a,u){const c=Vv(o,a,u);return o.inclusive?c<=0:c<0}(r.startAt,za(r),i)||r.endAt&&!function(o,a,u){const c=Vv(o,a,u);return o.inclusive?c>=0:c>0}(r.endAt,za(r),i))}(t,e)}function fA(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function eE(t){return(e,n)=>{let r=!1;for(const i of za(t)){const s=pA(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function pA(t,e,n){const r=t.field.isKeyField()?xe.comparator(e.key,n.key):function(s,o,a){const u=o.data.field(s),c=a.data.field(s);return u!==null&&c!==null?Ro(u,c):Ee(42886)}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return Ee(19790,{direction:t.dir})}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Vs{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s{for(const[i,s]of r)e(i,s)})}isEmpty(){return Mb(this.inner)}size(){return this.innerSize}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const mA=new yt(xe.comparator);function ti(){return mA}const tE=new yt(xe.comparator);function ka(...t){let e=tE;for(const n of t)e=e.insert(n.key,n);return e}function nE(t){let e=tE;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function gs(){return Ba()}function rE(){return Ba()}function Ba(){return new Vs(t=>t.toString(),(t,e)=>t.isEqual(e))}const gA=new yt(xe.comparator),yA=new Vt(xe.comparator);function He(...t){let e=yA;for(const n of t)e=e.add(n);return e}const vA=new Vt($e);function xA(){return vA}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function rg(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Nc(e)?"-0":e}}function iE(t){return{integerValue:""+t}}function sE(t,e){return GN(e)?iE(e):rg(t,e)}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */class Sd{constructor(){this._=void 0}}function wA(t,e,n){return t instanceof Dc?function(i,s){const o={fields:{[Ub]:{stringValue:Fb},[Bb]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&Zm(s)&&(s=bd(s)),s&&(o.fields[zb]=s),{mapValue:o}}(n,e):t instanceof jo?aE(t,e):t instanceof Oo?lE(t,e):function(i,s){const o=oE(i,s),a=Bv(o)+Bv(i.Ae);return mp(o)&&mp(i.Ae)?iE(a):rg(i.serializer,a)}(t,e)}function _A(t,e,n){return t instanceof jo?aE(t,e):t instanceof Oo?lE(t,e):n}function oE(t,e){return t instanceof wl?function(r){return mp(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class Dc extends Sd{}class jo extends Sd{constructor(e){super(),this.elements=e}}function aE(t,e){const n=uE(e);for(const r of t.elements)n.some(i=>Ar(i,r))||n.push(r);return{arrayValue:{values:n}}}class Oo extends Sd{constructor(e){super(),this.elements=e}}function lE(t,e){let n=uE(e);for(const r of t.elements)n=n.filter(i=>!Ar(i,r));return{arrayValue:{values:n}}}class wl extends Sd{constructor(e,n){super(),this.serializer=e,this.Ae=n}}function Bv(t){return Tt(t.integerValue||t.doubleValue)}function uE(t){return eg(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ig{constructor(e,n){this.field=e,this.transform=n}}function bA(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof jo&&i instanceof jo||r instanceof Oo&&i instanceof Oo?Po(r.elements,i.elements,Ar):r instanceof wl&&i instanceof wl?Ar(r.Ae,i.Ae):r instanceof Dc&&i instanceof Dc}(t.transform,e.transform)}class EA{constructor(e,n){this.version=e,this.transformResults=n}}class Yn{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new Yn}static exists(e){return new Yn(void 0,e)}static updateTime(e){return new Yn(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function qu(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class kd{}function cE(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new sg(t.key,Yn.none()):new Dl(t.key,t.data,Yn.none());{const n=t.data,r=_n.empty();let i=new Vt(Xt.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new Zi(t.key,r,new On(i.toArray()),Yn.none())}}function IA(t,e,n){t instanceof Dl?function(i,s,o){const a=i.value.clone(),u=Hv(i.fieldTransforms,s,o.transformResults);a.setAll(u),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof Zi?function(i,s,o){if(!qu(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=Hv(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(dE(i)),u.setAll(a),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function $a(t,e,n,r){return t instanceof Dl?function(s,o,a,u){if(!qu(s.precondition,o))return a;const c=s.value.clone(),f=qv(s.fieldTransforms,u,o);return c.setAll(f),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof Zi?function(s,o,a,u){if(!qu(s.precondition,o))return a;const c=qv(s.fieldTransforms,u,o),f=o.data;return f.setAll(dE(s)),f.setAll(c),o.convertToFoundDocument(o.version,f).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(h=>h.field))}(t,e,n,r):function(s,o,a){return qu(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function TA(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=oE(r.transform,i||null);s!=null&&(n===null&&(n=_n.empty()),n.set(r.field,s))}return n||null}function $v(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&Po(r,i,(s,o)=>bA(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Dl extends kd{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Zi extends kd{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function dE(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function Hv(t,e,n){const r=new Map;Ze(t.length===n.length,32656,{Re:n.length,Ve:t.length});for(let i=0;i{const s=e.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const u=cE(o,a);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(Ne.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),He())}isEqual(e){return this.batchId===e.batchId&&Po(this.mutations,e.mutations,(n,r)=>$v(n,r))&&Po(this.baseMutations,e.baseMutations,(n,r)=>$v(n,r))}}class og{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){Ze(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let i=function(){return gA}();const s=e.mutations;for(let o=0;o=8)throw new Ca(`Invalid padding: ${n}`);if(r<0)throw new Ca(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new Ca(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new Ca(`Invalid padding when bitmap length is 0: ${n}`);this.ge=8*e.length-n,this.pe=Vi.fromNumber(this.ge)}ye(e,n,r){let i=e.add(n.multiply(Vi.fromNumber(r)));return i.compare(RA)===1&&(i=new Vi([i.getBits(0),i.getBits(1)],0)),i.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<o.insert(a)),o}insert(e){if(this.ge===0)return;const n=Wv(e),[r,i]=Gv(n);for(let s=0;s0&&(this.Oe=!0,this.Me=e)}ke(){let e=He(),n=He(),r=He();return this.Fe.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:Ee(38017,{changeType:s})}}),new jl(this.Me,this.xe,e,n,r)}qe(){this.Oe=!1,this.Fe=Qv()}Qe(e,n){this.Oe=!0,this.Fe=this.Fe.insert(e,n)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,Ze(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class DA{constructor(e){this.Ge=e,this.ze=new Map,this.je=ti(),this.Je=_u(),this.He=_u(),this.Ye=new yt($e)}Ze(e){for(const n of e.be)e.De&&e.De.isFoundDocument()?this.Xe(n,e.De):this.et(n,e.key,e.De);for(const n of e.removedTargetIds)this.et(n,e.key,e.De)}tt(e){this.forEachTarget(e,n=>{const r=this.nt(n);switch(e.state){case 0:this.rt(n)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(n);break;case 3:this.rt(n)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(n)&&(this.it(n),r.Le(e.resumeToken));break;default:Ee(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.ze.forEach((r,i)=>{this.rt(i)&&n(i)})}st(e){const n=e.targetId,r=e.Ce.count,i=this.ot(n);if(i){const s=i.target;if(yp(s))if(r===0){const o=new xe(s.path);this.et(n,o,ln.newNoDocument(o,Ne.min()))}else Ze(r===1,20013,{expectedCount:r});else{const o=this._t(n);if(o!==r){const a=this.ut(e),u=a?this.ct(a,e,o):1;if(u!==0){this.it(n);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(n,c)}}}}}ut(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=qi(r).toUint8Array()}catch(u){if(u instanceof Vb)return Ao("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{a=new ag(o,i,s)}catch(u){return Ao(u instanceof Ca?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return a.ge===0?null:a}ct(e,n,r){return n.Ce.count===r-this.Pt(e,n.targetId)?0:2}Pt(e,n){const r=this.Ge.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.et(n,s,null),i++)}),i}Tt(e){const n=new Map;this.ze.forEach((s,o)=>{const a=this.ot(o);if(a){if(s.current&&yp(a.target)){const u=new xe(a.target.path);this.It(u).has(o)||this.Et(o,u)||this.et(o,u,ln.newNoDocument(u,e))}s.Be&&(n.set(o,s.ke()),s.qe())}});let r=He();this.He.forEach((s,o)=>{let a=!0;o.forEachWhile(u=>{const c=this.ot(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(s))}),this.je.forEach((s,o)=>o.setReadTime(e));const i=new Cd(e,n,this.Ye,this.je,r);return this.je=ti(),this.Je=_u(),this.He=_u(),this.Ye=new yt($e),i}Xe(e,n){if(!this.rt(e))return;const r=this.Et(e,n.key)?2:0;this.nt(e).Qe(n.key,r),this.je=this.je.insert(n.key,n),this.Je=this.Je.insert(n.key,this.It(n.key).add(e)),this.He=this.He.insert(n.key,this.dt(n.key).add(e))}et(e,n,r){if(!this.rt(e))return;const i=this.nt(e);this.Et(e,n)?i.Qe(n,1):i.$e(n),this.He=this.He.insert(n,this.dt(n).delete(e)),this.He=this.He.insert(n,this.dt(n).add(e)),r&&(this.je=this.je.insert(n,r))}removeTarget(e){this.ze.delete(e)}_t(e){const n=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let n=this.ze.get(e);return n||(n=new Kv,this.ze.set(e,n)),n}dt(e){let n=this.He.get(e);return n||(n=new Vt($e),this.He=this.He.insert(e,n)),n}It(e){let n=this.Je.get(e);return n||(n=new Vt($e),this.Je=this.Je.insert(e,n)),n}rt(e){const n=this.ot(e)!==null;return n||ue("WatchChangeAggregator","Detected inactive target",e),n}ot(e){const n=this.ze.get(e);return n&&n.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new Kv),this.Ge.getRemoteKeysForTarget(e).forEach(n=>{this.et(e,n,null)})}Et(e,n){return this.Ge.getRemoteKeysForTarget(e).has(n)}}function _u(){return new yt(xe.comparator)}function Qv(){return new yt(xe.comparator)}const jA={asc:"ASCENDING",desc:"DESCENDING"},OA={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},LA={and:"AND",or:"OR"};class MA{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function wp(t,e){return t.useProto3Json||_d(e)?e:{value:e}}function jc(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function mE(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function VA(t,e){return jc(t,e.toTimestamp())}function Sr(t){return Ze(!!t,49232),Ne.fromTimestamp(function(n){const r=Hi(n);return new Je(r.seconds,r.nanos)}(t))}function lg(t,e){return _p(t,e).canonicalString()}function _p(t,e){const n=function(i){return new st(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function gE(t){const e=st.fromString(t);return Ze(_E(e),10190,{key:e.toString()}),e}function bp(t,e){return lg(t.databaseId,e.path)}function $h(t,e){const n=gE(e);if(n.get(1)!==t.databaseId.projectId)throw new ae(W.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ae(W.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new xe(vE(n))}function yE(t,e){return lg(t.databaseId,e)}function FA(t){const e=gE(t);return e.length===4?st.emptyPath():vE(e)}function Ep(t){return new st(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function vE(t){return Ze(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function Yv(t,e,n){return{name:bp(t,e),fields:n.value.mapValue.fields}}function UA(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:Ee(39313,{state:c})}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(c,f){return c.useProto3Json?(Ze(f===void 0||typeof f=="string",58123),en.fromBase64String(f||"")):(Ze(f===void 0||f instanceof Buffer||f instanceof Uint8Array,16193),en.fromUint8Array(f||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const f=c.code===void 0?W.UNKNOWN:hE(c.code);return new ae(f,c.message||"")}(o);n=new pE(r,i,s,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=$h(t,r.document.name),s=Sr(r.document.updateTime),o=r.document.createTime?Sr(r.document.createTime):Ne.min(),a=new _n({mapValue:{fields:r.document.fields}}),u=ln.newFoundDocument(i,s,o,a),c=r.targetIds||[],f=r.removedTargetIds||[];n=new Wu(c,f,u.key,u)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=$h(t,r.document),s=r.readTime?Sr(r.readTime):Ne.min(),o=ln.newNoDocument(i,s),a=r.removedTargetIds||[];n=new Wu([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=$h(t,r.document),s=r.removedTargetIds||[];n=new Wu([],s,i,null)}else{if(!("filter"in e))return Ee(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new NA(i,s),a=r.targetId;n=new fE(a,o)}}return n}function zA(t,e){let n;if(e instanceof Dl)n={update:Yv(t,e.key,e.value)};else if(e instanceof sg)n={delete:bp(t,e.key)};else if(e instanceof Zi)n={update:Yv(t,e.key,e.data),updateMask:YA(e.fieldMask)};else{if(!(e instanceof SA))return Ee(16599,{Vt:e.type});n={verify:bp(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof Dc)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof jo)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof Oo)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof wl)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw Ee(20930,{transform:o.transform})}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:VA(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:Ee(27497)}(t,e.precondition)),n}function BA(t,e){return t&&t.length>0?(Ze(e!==void 0,14353),t.map(n=>function(i,s){let o=i.updateTime?Sr(i.updateTime):Sr(s);return o.isEqual(Ne.min())&&(o=Sr(s)),new EA(o,i.transformResults||[])}(n,e))):[]}function $A(t,e){return{documents:[yE(t,e.path)]}}function HA(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=yE(t,i);const s=function(c){if(c.length!==0)return wE(dr.create(c,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(f=>function(p){return{field:Ks(p.field),direction:GA(p.dir)}}(f))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=wp(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{ft:n,parent:i}}function qA(t){let e=FA(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Ze(r===1,65062);const f=n.from[0];f.allDescendants?i=f.collectionId:e=e.child(f.collectionId)}let s=[];n.where&&(s=function(h){const p=xE(h);return p instanceof dr&&Kb(p)?p.getFilters():[p]}(n.where));let o=[];n.orderBy&&(o=function(h){return h.map(p=>function(_){return new xl(Qs(_.field),function(P){switch(P){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(_.direction))}(p))}(n.orderBy));let a=null;n.limit&&(a=function(h){let p;return p=typeof h=="object"?h.value:h,_d(p)?null:p}(n.limit));let u=null;n.startAt&&(u=function(h){const p=!!h.before,g=h.values||[];return new Rc(g,p)}(n.startAt));let c=null;return n.endAt&&(c=function(h){const p=!h.before,g=h.values||[];return new Rc(g,p)}(n.endAt)),dA(e,i,o,s,a,"F",u,c)}function WA(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Ee(28987,{purpose:i})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function xE(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Qs(n.unaryFilter.field);return Pt.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Qs(n.unaryFilter.field);return Pt.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Qs(n.unaryFilter.field);return Pt.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Qs(n.unaryFilter.field);return Pt.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Ee(61313);default:return Ee(60726)}}(t):t.fieldFilter!==void 0?function(n){return Pt.create(Qs(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return Ee(58110);default:return Ee(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return dr.create(n.compositeFilter.filters.map(r=>xE(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return Ee(1026)}}(n.compositeFilter.op))}(t):Ee(30097,{filter:t})}function GA(t){return jA[t]}function KA(t){return OA[t]}function QA(t){return LA[t]}function Ks(t){return{fieldPath:t.canonicalString()}}function Qs(t){return Xt.fromServerFormat(t.fieldPath)}function wE(t){return t instanceof Pt?function(n){if(n.op==="=="){if(Mv(n.value))return{unaryFilter:{field:Ks(n.field),op:"IS_NAN"}};if(Lv(n.value))return{unaryFilter:{field:Ks(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(Mv(n.value))return{unaryFilter:{field:Ks(n.field),op:"IS_NOT_NAN"}};if(Lv(n.value))return{unaryFilter:{field:Ks(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ks(n.field),op:KA(n.op),value:n.value}}}(t):t instanceof dr?function(n){const r=n.getFilters().map(i=>wE(i));return r.length===1?r[0]:{compositeFilter:{op:QA(n.op),filters:r}}}(t):Ee(54877,{filter:t})}function YA(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function _E(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Si{constructor(e,n,r,i,s=Ne.min(),o=Ne.min(),a=en.EMPTY_BYTE_STRING,u=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=u}withSequenceNumber(e){return new Si(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Si(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Si(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Si(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class XA{constructor(e){this.yt=e}}function JA(t){const e=qA({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?xp(e,e.limit,"L"):e}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class ZA{constructor(){this.Cn=new eP}addToCollectionParentIndex(e,n){return this.Cn.add(n),G.resolve()}getCollectionParents(e,n){return G.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return G.resolve()}deleteFieldIndex(e,n){return G.resolve()}deleteAllFieldIndexes(e){return G.resolve()}createTargetIndexes(e,n){return G.resolve()}getDocumentsMatchingTarget(e,n){return G.resolve(null)}getIndexType(e,n){return G.resolve(0)}getFieldIndexes(e,n){return G.resolve([])}getNextCollectionGroupToUpdate(e){return G.resolve(null)}getMinOffset(e,n){return G.resolve($i.min())}getMinOffsetFromCollectionGroup(e,n){return G.resolve($i.min())}updateCollectionGroup(e,n,r){return G.resolve()}updateIndexEntries(e,n){return G.resolve()}}class eP{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new Vt(st.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new Vt(st.comparator)).toArray()}}/** + * @license + * Copyright 2018 Google LLC + * + * 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. + */const Xv={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},bE=41943040;class vn{static withCacheSize(e){return new vn(e,vn.DEFAULT_COLLECTION_PERCENTILE,vn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */vn.DEFAULT_COLLECTION_PERCENTILE=10,vn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,vn.DEFAULT=new vn(bE,vn.DEFAULT_COLLECTION_PERCENTILE,vn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),vn.DISABLED=new vn(-1,0,0);/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Lo{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new Lo(0)}static cr(){return new Lo(-1)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Jv="LruGarbageCollector",tP=1048576;function Zv([t,e],[n,r]){const i=$e(t,n);return i===0?$e(e,r):i}class nP{constructor(e){this.Ir=e,this.buffer=new Vt(Zv),this.Er=0}dr(){return++this.Er}Ar(e){const n=[e,this.dr()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){Ho(n)?ue(Jv,"Ignoring IndexedDB error during garbage collection: ",n):await $o(n)}await this.Vr(3e5)})}}class iP{constructor(e,n){this.mr=e,this.params=n}calculateTargetCount(e,n){return this.mr.gr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return G.resolve(wd.ce);const r=new nP(n);return this.mr.forEachTarget(e,i=>r.Ar(i.sequenceNumber)).next(()=>this.mr.pr(e,i=>r.Ar(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.mr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.mr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(ue("LruGarbageCollector","Garbage collection skipped; disabled"),G.resolve(Xv)):this.getCacheSize(e).next(r=>r(h>this.params.maximumSequenceNumbersToCollect?(ue("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),i=this.params.maximumSequenceNumbersToCollect):i=h,o=Date.now(),this.nthSequenceNumber(e,i))).next(h=>(r=h,a=Date.now(),this.removeTargets(e,r,n))).next(h=>(s=h,u=Date.now(),this.removeOrphanedDocuments(e,r))).next(h=>(c=Date.now(),Ws()<=Be.DEBUG&&ue("LruGarbageCollector",`LRU Garbage Collection + Counted targets in ${o-f}ms + Determined least recently used ${i} in `+(a-o)+`ms + Removed ${s} targets in `+(u-a)+`ms + Removed ${h} documents in `+(c-u)+`ms +Total Duration: ${c-f}ms`),G.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:s,documentsRemoved:h})))}}function sP(t,e){return new iP(t,e)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class oP{constructor(){this.changes=new Vs(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,ln.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?G.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + *//** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class aP{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class lP{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&$a(r.mutation,i,On.empty(),Je.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,He()).next(()=>r))}getLocalViewOfDocuments(e,n,r=He()){const i=gs();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=ka();return s.forEach((a,u)=>{o=o.insert(a,u.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=gs();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,He()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,r,i){let s=ti();const o=Ba(),a=function(){return Ba()}();return n.forEach((u,c)=>{const f=r.get(c.key);i.has(c.key)&&(f===void 0||f.mutation instanceof Zi)?s=s.insert(c.key,c):f!==void 0?(o.set(c.key,f.mutation.getFieldMask()),$a(f.mutation,c,f.mutation.getFieldMask(),Je.now())):o.set(c.key,On.empty())}),this.recalculateAndSaveOverlays(e,s).next(u=>(u.forEach((c,f)=>o.set(c,f)),n.forEach((c,f)=>a.set(c,new aP(f,o.get(c)??null))),a))}recalculateAndSaveOverlays(e,n){const r=Ba();let i=new yt((o,a)=>o-a),s=He();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(u=>{const c=n.get(u);if(c===null)return;let f=r.get(u)||On.empty();f=a.applyToLocalView(c,f),r.set(u,f);const h=(i.get(a.batchId)||He()).add(u);i=i.insert(a.batchId,h)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),c=u.key,f=u.value,h=rE();f.forEach(p=>{if(!s.has(p)){const g=cE(n.get(p),r.get(p));g!==null&&h.set(p,g),s=s.add(p)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,h))}return G.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return xe.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):Jb(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):G.resolve(gs());let a=ml,u=s;return o.next(c=>G.forEach(c,(f,h)=>(a{u=u.insert(f,p)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,u,c,He())).next(f=>({batchId:a,changes:nE(f)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new xe(n)).next(r=>{let i=ka();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=ka();return this.indexManager.getCollectionParents(e,s).next(a=>G.forEach(a,u=>{const c=function(h,p){return new qo(p,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(f=>{f.forEach((h,p)=>{o=o.insert(h,p)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((u,c)=>{const f=c.getKey();o.get(f)===null&&(o=o.insert(f,ln.newInvalidDocument(f)))});let a=ka();return o.forEach((u,c)=>{const f=s.get(u);f!==void 0&&$a(f.mutation,c,On.empty(),Je.now()),Td(n,c)&&(a=a.insert(u,c))}),a})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class uP{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,n){return G.resolve(this.Lr.get(n))}saveBundleMetadata(e,n){return this.Lr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Sr(i.createTime)}}(n)),G.resolve()}getNamedQuery(e,n){return G.resolve(this.kr.get(n))}saveNamedQuery(e,n){return this.kr.set(n.name,function(i){return{name:i.name,query:JA(i.bundledQuery),readTime:Sr(i.readTime)}}(n)),G.resolve()}}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class cP{constructor(){this.overlays=new yt(xe.comparator),this.qr=new Map}getOverlay(e,n){return G.resolve(this.overlays.get(n))}getOverlays(e,n){const r=gs();return G.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.St(e,n,s)}),G.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.qr.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.qr.delete(r)),G.resolve()}getOverlaysForCollection(e,n,r){const i=gs(),s=n.length+1,o=new xe(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const u=a.getNext().value,c=u.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===s&&u.largestBatchId>r&&i.set(u.getKey(),u)}return G.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new yt((c,f)=>c-f);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let f=s.get(c.largestBatchId);f===null&&(f=gs(),s=s.insert(c.largestBatchId,f)),f.set(c.getKey(),c)}}const a=gs(),u=s.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((c,f)=>a.set(c,f)),!(a.size()>=i)););return G.resolve(a)}St(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.qr.get(i.largestBatchId).delete(r.key);this.qr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new CA(n,r));let s=this.qr.get(n);s===void 0&&(s=He(),this.qr.set(n,s)),this.qr.set(n,s.add(r.key))}}/** + * @license + * Copyright 2024 Google LLC + * + * 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. + */class dP{constructor(){this.sessionToken=en.EMPTY_BYTE_STRING}getSessionToken(e){return G.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,G.resolve()}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ug{constructor(){this.Qr=new Vt(zt.$r),this.Ur=new Vt(zt.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,n){const r=new zt(e,n);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Gr(new zt(e,n))}zr(e,n){e.forEach(r=>this.removeReference(r,n))}jr(e){const n=new xe(new st([])),r=new zt(n,e),i=new zt(n,e+1),s=[];return this.Ur.forEachInRange([r,i],o=>{this.Gr(o),s.push(o.key)}),s}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const n=new xe(new st([])),r=new zt(n,e),i=new zt(n,e+1);let s=He();return this.Ur.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new zt(e,0),r=this.Qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class zt{constructor(e,n){this.key=e,this.Yr=n}static $r(e,n){return xe.comparator(e.key,n.key)||$e(e.Yr,n.Yr)}static Kr(e,n){return $e(e.Yr,n.Yr)||xe.comparator(e.key,n.key)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class hP{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.tr=1,this.Zr=new Vt(zt.$r)}checkEmpty(e){return G.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new kA(s,n,r,i);this.mutationQueue.push(o);for(const a of i)this.Zr=this.Zr.add(new zt(a.key,s)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return G.resolve(o)}lookupMutationBatch(e,n){return G.resolve(this.Xr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.ei(r),s=i<0?0:i;return G.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return G.resolve(this.mutationQueue.length===0?Jm:this.tr-1)}getAllMutationBatches(e){return G.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new zt(n,0),i=new zt(n,Number.POSITIVE_INFINITY),s=[];return this.Zr.forEachInRange([r,i],o=>{const a=this.Xr(o.Yr);s.push(a)}),G.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Vt($e);return n.forEach(i=>{const s=new zt(i,0),o=new zt(i,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([s,o],a=>{r=r.add(a.Yr)})}),G.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;xe.isDocumentKey(s)||(s=s.child(""));const o=new zt(new xe(s),0);let a=new Vt($e);return this.Zr.forEachWhile(u=>{const c=u.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(u.Yr)),!0)},o),G.resolve(this.ti(a))}ti(e){const n=[];return e.forEach(r=>{const i=this.Xr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Ze(this.ni(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return G.forEach(n.mutations,i=>{const s=new zt(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,n){const r=new zt(n,0),i=this.Zr.firstAfterOrEqual(r);return G.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,G.resolve()}ni(e,n){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const n=this.ei(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class fP{constructor(e){this.ri=e,this.docs=function(){return new yt(xe.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.ri(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return G.resolve(r?r.document.mutableCopy():ln.newInvalidDocument(n))}getEntries(e,n){let r=ti();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():ln.newInvalidDocument(i))}),G.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=ti();const o=n.path,a=new xe(o.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(a);for(;u.hasNext();){const{key:c,value:{document:f}}=u.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||$N(BN(f),r)<=0||(i.has(f.key)||Td(n,f))&&(s=s.insert(f.key,f.mutableCopy()))}return G.resolve(s)}getAllFromCollectionGroup(e,n,r,i){Ee(9500)}ii(e,n){return G.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new pP(this)}getSize(e){return G.resolve(this.size)}}class pP extends oP{constructor(e){super(),this.Nr=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Nr.addEntry(e,i)):this.Nr.removeEntry(r)}),G.waitFor(n)}getFromCache(e,n){return this.Nr.getEntry(e,n)}getAllFromCache(e,n){return this.Nr.getEntries(e,n)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class mP{constructor(e){this.persistence=e,this.si=new Vs(n=>tg(n),ng),this.lastRemoteSnapshotVersion=Ne.min(),this.highestTargetId=0,this.oi=0,this._i=new ug,this.targetCount=0,this.ai=Lo.ur()}forEachTarget(e,n){return this.si.forEach((r,i)=>n(i)),G.resolve()}getLastRemoteSnapshotVersion(e){return G.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return G.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),G.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.oi&&(this.oi=n),G.resolve()}Pr(e){this.si.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ai=new Lo(n),this.highestTargetId=n),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,n){return this.Pr(n),this.targetCount+=1,G.resolve()}updateTargetData(e,n){return this.Pr(n),G.resolve()}removeTargetData(e,n){return this.si.delete(n.target),this._i.jr(n.targetId),this.targetCount-=1,G.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.si.forEach((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.si.delete(o),s.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),G.waitFor(s).next(()=>i)}getTargetCount(e){return G.resolve(this.targetCount)}getTargetData(e,n){const r=this.si.get(n)||null;return G.resolve(r)}addMatchingKeys(e,n,r){return this._i.Wr(n,r),G.resolve()}removeMatchingKeys(e,n,r){this._i.zr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),G.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this._i.jr(n),G.resolve()}getMatchingKeysForTargetId(e,n){const r=this._i.Hr(n);return G.resolve(r)}containsKey(e,n){return G.resolve(this._i.containsKey(n))}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class EE{constructor(e,n){this.ui={},this.overlays={},this.ci=new wd(0),this.li=!1,this.li=!0,this.hi=new dP,this.referenceDelegate=e(this),this.Pi=new mP(this),this.indexManager=new ZA,this.remoteDocumentCache=function(i){return new fP(i)}(r=>this.referenceDelegate.Ti(r)),this.serializer=new XA(n),this.Ii=new uP(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new cP,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ui[e.toKey()];return r||(r=new hP(n,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,n,r){ue("MemoryPersistence","Starting transaction:",e);const i=new gP(this.ci.next());return this.referenceDelegate.Ei(),r(i).next(s=>this.referenceDelegate.di(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Ai(e,n){return G.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,n)))}}class gP extends qN{constructor(e){super(),this.currentSequenceNumber=e}}class cg{constructor(e){this.persistence=e,this.Ri=new ug,this.Vi=null}static mi(e){return new cg(e)}get fi(){if(this.Vi)return this.Vi;throw Ee(60996)}addReference(e,n,r){return this.Ri.addReference(r,n),this.fi.delete(r.toString()),G.resolve()}removeReference(e,n,r){return this.Ri.removeReference(r,n),this.fi.add(r.toString()),G.resolve()}markPotentiallyOrphaned(e,n){return this.fi.add(n.toString()),G.resolve()}removeTarget(e,n){this.Ri.jr(n.targetId).forEach(i=>this.fi.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.fi.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}Ei(){this.Vi=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return G.forEach(this.fi,r=>{const i=xe.fromPath(r);return this.gi(e,i).next(s=>{s||n.removeEntry(i,Ne.min())})}).next(()=>(this.Vi=null,n.apply(e)))}updateLimboDocument(e,n){return this.gi(e,n).next(r=>{r?this.fi.delete(n.toString()):this.fi.add(n.toString())})}Ti(e){return 0}gi(e,n){return G.or([()=>G.resolve(this.Ri.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ai(e,n)])}}class Oc{constructor(e,n){this.persistence=e,this.pi=new Vs(r=>KN(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=sP(this,n)}static mi(e,n){return new Oc(e,n)}Ei(){}di(e){return G.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}gr(e){const n=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}wr(e){let n=0;return this.pr(e,r=>{n++}).next(()=>n)}pr(e,n){return G.forEach(this.pi,(r,i)=>this.br(e,r,i).next(s=>s?G.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const i=this.persistence.getRemoteDocumentCache(),s=i.newChangeBuffer();return i.ii(e,o=>this.br(e,o,n).next(a=>{a||(r++,s.removeEntry(o,Ne.min()))})).next(()=>s.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.pi.set(n,e.currentSequenceNumber),G.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),G.resolve()}removeReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),G.resolve()}updateLimboDocument(e,n){return this.pi.set(n,e.currentSequenceNumber),G.resolve()}Ti(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=$u(e.data.value)),n}br(e,n,r){return G.or([()=>this.persistence.Ai(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const i=this.pi.get(n);return G.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class dg{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.Es=r,this.ds=i}static As(e,n){let r=He(),i=He();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new dg(e,n.fromCache,r,i)}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */class yP{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class vP{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){return cC()?8:WN(cn())>0?6:4}()}initialize(e,n){this.ps=e,this.indexManager=n,this.Rs=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.ys(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.ws(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new yP;return this.Ss(e,n,o).next(a=>{if(s.result=a,this.Vs)return this.bs(e,n,o,a.size)})}).next(()=>s.result)}bs(e,n,r,i){return r.documentReadCountthis.gs*i?(Ws()<=Be.DEBUG&&ue("QueryEngine","The SDK decides to create cache indexes for query:",Gs(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Tr(n))):G.resolve())}ys(e,n){if(zv(n))return G.resolve(null);let r=Tr(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=xp(n,null,"F"),r=Tr(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=He(...s);return this.ps.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,r).next(u=>{const c=this.Ds(n,a);return this.Cs(n,c,o,u.readTime)?this.ys(e,xp(n,null,"F")):this.vs(e,c,n,u)}))})))}ws(e,n,r,i){return zv(n)||i.isEqual(Ne.min())?G.resolve(null):this.ps.getDocuments(e,r).next(s=>{const o=this.Ds(n,s);return this.Cs(n,o,r,i)?G.resolve(null):(Ws()<=Be.DEBUG&&ue("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Gs(n)),this.vs(e,o,n,zN(i,ml)).next(a=>a))})}Ds(e,n){let r=new Vt(eE(e));return n.forEach((i,s)=>{Td(e,s)&&(r=r.add(s))}),r}Cs(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Ss(e,n,r){return Ws()<=Be.DEBUG&&ue("QueryEngine","Using full collection scan to execute query:",Gs(n)),this.ps.getDocumentsMatchingQuery(e,n,$i.min(),r)}vs(e,n,r,i){return this.ps.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const hg="LocalStore",xP=3e8;class wP{constructor(e,n,r,i){this.persistence=e,this.Fs=n,this.serializer=i,this.Ms=new yt($e),this.xs=new Vs(s=>tg(s),ng),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new lP(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.Ms))}}function _P(t,e,n,r){return new wP(t,e,n,r)}async function IE(t,e){const n=Re(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.Bs(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let u=He();for(const c of i){o.push(c.batchId);for(const f of c.mutations)u=u.add(f.key)}for(const c of s){a.push(c.batchId);for(const f of c.mutations)u=u.add(f.key)}return n.localDocuments.getDocuments(r,u).next(c=>({Ls:c,removedBatchIds:o,addedBatchIds:a}))})})}function bP(t,e){const n=Re(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.Ns.newChangeBuffer({trackRemovals:!0});return function(a,u,c,f){const h=c.batch,p=h.keys();let g=G.resolve();return p.forEach(_=>{g=g.next(()=>f.getEntry(u,_)).next(S=>{const P=c.docVersions.get(_);Ze(P!==null,48541),S.version.compareTo(P)<0&&(h.applyToRemoteDocument(S,c),S.isValidDocument()&&(S.setReadTime(c.commitVersion),f.addEntry(S)))})}),g.next(()=>a.mutationQueue.removeMutationBatch(u,h))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let u=He();for(let c=0;c0&&(u=u.add(a.batch.mutations[c].key));return u}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function TE(t){const e=Re(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Pi.getLastRemoteSnapshotVersion(n))}function EP(t,e){const n=Re(t),r=e.snapshotVersion;let i=n.Ms;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.Ns.newChangeBuffer({trackRemovals:!0});i=n.Ms;const a=[];e.targetChanges.forEach((f,h)=>{const p=i.get(h);if(!p)return;a.push(n.Pi.removeMatchingKeys(s,f.removedDocuments,h).next(()=>n.Pi.addMatchingKeys(s,f.addedDocuments,h)));let g=p.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(h)!==null?g=g.withResumeToken(en.EMPTY_BYTE_STRING,Ne.min()).withLastLimboFreeSnapshotVersion(Ne.min()):f.resumeToken.approximateByteSize()>0&&(g=g.withResumeToken(f.resumeToken,r)),i=i.insert(h,g),function(S,P,v){return S.resumeToken.approximateByteSize()===0||P.snapshotVersion.toMicroseconds()-S.snapshotVersion.toMicroseconds()>=xP?!0:v.addedDocuments.size+v.modifiedDocuments.size+v.removedDocuments.size>0}(p,g,f)&&a.push(n.Pi.updateTargetData(s,g))});let u=ti(),c=He();if(e.documentUpdates.forEach(f=>{e.resolvedLimboDocuments.has(f)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,f))}),a.push(IP(s,o,e.documentUpdates).next(f=>{u=f.ks,c=f.qs})),!r.isEqual(Ne.min())){const f=n.Pi.getLastRemoteSnapshotVersion(s).next(h=>n.Pi.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(f)}return G.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,c)).next(()=>u)}).then(s=>(n.Ms=i,s))}function IP(t,e,n){let r=He(),i=He();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=ti();return n.forEach((a,u)=>{const c=s.get(a);u.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),u.isNoDocument()&&u.version.isEqual(Ne.min())?(e.removeEntry(a,u.readTime),o=o.insert(a,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(a,u)):ue(hg,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",u.version)}),{ks:o,qs:i}})}function TP(t,e){const n=Re(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=Jm),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function SP(t,e){const n=Re(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Pi.getTargetData(r,e).next(s=>s?(i=s,G.resolve(i)):n.Pi.allocateTargetId(r).next(o=>(i=new Si(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Pi.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.Ms.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(r.targetId,r),n.xs.set(e,r.targetId)),r})}async function Ip(t,e,n){const r=Re(t),i=r.Ms.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!Ho(o))throw o;ue(hg,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Ms=r.Ms.remove(e),r.xs.delete(i.target)}function ex(t,e,n){const r=Re(t);let i=Ne.min(),s=He();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,c,f){const h=Re(u),p=h.xs.get(f);return p!==void 0?G.resolve(h.Ms.get(p)):h.Pi.getTargetData(c,f)}(r,o,Tr(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(o,a.targetId).next(u=>{s=u})}).next(()=>r.Fs.getDocumentsMatchingQuery(o,e,n?i:Ne.min(),n?s:He())).next(a=>(kP(r,fA(e),a),{documents:a,Qs:s})))}function kP(t,e,n){let r=t.Os.get(e)||Ne.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.Os.set(e,r)}class tx{constructor(){this.activeTargetIds=xA()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class CP{constructor(){this.Mo=new tx,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,n,r){this.xo[e]=n}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new tx,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class NP{Oo(e){}shutdown(){}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const nx="ConnectivityMonitor";class rx{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){ue(nx,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){ue(nx,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */let bu=null;function Tp(){return bu===null?bu=function(){return 268435456+Math.round(2147483648*Math.random())}():bu++,"0x"+bu.toString(16)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Hh="RestConnection",AP={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class PP{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Uo=n+"://"+e.host,this.Ko=`projects/${r}/databases/${i}`,this.Wo=this.databaseId.database===Ac?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Go(e,n,r,i,s){const o=Tp(),a=this.zo(e,n.toUriEncodedString());ue(Hh,`Sending RPC '${e}' ${o}:`,a,r);const u={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(u,i,s);const{host:c}=new URL(a),f=Ls(c);return this.Jo(e,a,u,r,f).then(h=>(ue(Hh,`Received RPC '${e}' ${o}: `,h),h),h=>{throw Ao(Hh,`RPC '${e}' ${o} failed with error: `,h,"url: ",a,"request:",r),h})}Ho(e,n,r,i,s,o){return this.Go(e,n,r,i,s)}jo(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Bo}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,s)=>e[s]=i),r&&r.headers.forEach((i,s)=>e[s]=i)}zo(e,n){const r=AP[e];return`${this.Uo}/v1/${n}:${r}`}terminate(){}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class RP{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const sn="WebChannelConnection";class DP extends PP{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,i,s){const o=Tp();return new Promise((a,u)=>{const c=new kb;c.setWithCredentials(!0),c.listenOnce(Cb.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Bu.NO_ERROR:const h=c.getResponseJson();ue(sn,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(h)),a(h);break;case Bu.TIMEOUT:ue(sn,`RPC '${e}' ${o} timed out`),u(new ae(W.DEADLINE_EXCEEDED,"Request time out"));break;case Bu.HTTP_ERROR:const p=c.getStatus();if(ue(sn,`RPC '${e}' ${o} failed with status:`,p,"response text:",c.getResponseText()),p>0){let g=c.getResponseJson();Array.isArray(g)&&(g=g[0]);const _=g==null?void 0:g.error;if(_&&_.status&&_.message){const S=function(v){const x=v.toLowerCase().replace(/_/g,"-");return Object.values(W).indexOf(x)>=0?x:W.UNKNOWN}(_.status);u(new ae(S,_.message))}else u(new ae(W.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new ae(W.UNAVAILABLE,"Connection failed."));break;default:Ee(9055,{l_:e,streamId:o,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{ue(sn,`RPC '${e}' ${o} completed.`)}});const f=JSON.stringify(i);ue(sn,`RPC '${e}' ${o} sending request:`,i),c.send(n,"POST",f,r,15)})}T_(e,n,r){const i=Tp(),s=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=Pb(),a=Ab(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(u.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(u.useFetchStreams=!0),this.jo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const f=s.join("");ue(sn,`Creating RPC '${e}' stream ${i}: ${f}`,u);const h=o.createWebChannel(f,u);this.I_(h);let p=!1,g=!1;const _=new RP({Yo:P=>{g?ue(sn,`Not sending because RPC '${e}' stream ${i} is closed:`,P):(p||(ue(sn,`Opening RPC '${e}' stream ${i} transport.`),h.open(),p=!0),ue(sn,`RPC '${e}' stream ${i} sending:`,P),h.send(P))},Zo:()=>h.close()}),S=(P,v,x)=>{P.listen(v,E=>{try{x(E)}catch(O){setTimeout(()=>{throw O},0)}})};return S(h,Sa.EventType.OPEN,()=>{g||(ue(sn,`RPC '${e}' stream ${i} transport opened.`),_.o_())}),S(h,Sa.EventType.CLOSE,()=>{g||(g=!0,ue(sn,`RPC '${e}' stream ${i} transport closed`),_.a_(),this.E_(h))}),S(h,Sa.EventType.ERROR,P=>{g||(g=!0,Ao(sn,`RPC '${e}' stream ${i} transport errored. Name:`,P.name,"Message:",P.message),_.a_(new ae(W.UNAVAILABLE,"The operation could not be completed")))}),S(h,Sa.EventType.MESSAGE,P=>{var v;if(!g){const x=P.data[0];Ze(!!x,16349);const E=x,O=(E==null?void 0:E.error)||((v=E[0])==null?void 0:v.error);if(O){ue(sn,`RPC '${e}' stream ${i} received error:`,O);const L=O.status;let D=function(T){const A=kt[T];if(A!==void 0)return hE(A)}(L),b=O.message;D===void 0&&(D=W.INTERNAL,b="Unknown error status: "+L+" with message "+O.message),g=!0,_.a_(new ae(D,b)),h.close()}else ue(sn,`RPC '${e}' stream ${i} received:`,x),_.u_(x)}}),S(a,Nb.STAT_EVENT,P=>{P.stat===hp.PROXY?ue(sn,`RPC '${e}' stream ${i} detected buffering proxy`):P.stat===hp.NOPROXY&&ue(sn,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{_.__()},0),_}terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(n=>n===e)}}function qh(){return typeof document<"u"?document:null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Nd(t){return new MA(t,!0)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class SE{constructor(e,n,r=1e3,i=1.5,s=6e4){this.Mi=e,this.timerId=n,this.d_=r,this.A_=i,this.R_=s,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const n=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),i=Math.max(0,n-r);i>0&&ue("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.V_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const ix="PersistentStream";class kE{constructor(e,n,r,i,s,o,a,u){this.Mi=e,this.S_=r,this.b_=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new SE(e,n)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():n&&n.code===W.RESOURCE_EXHAUSTED?(ei(n.toString()),ei("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):n&&n.code===W.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(n)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),n=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.D_===n&&this.G_(r,i)},r=>{e(()=>{const i=new ae(W.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(i)})})}G_(e,n){const r=this.W_(this.D_);this.stream=this.j_(e,n),this.stream.Xo(()=>{r(()=>this.listener.Xo())}),this.stream.t_(()=>{r(()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.t_()))}),this.stream.r_(i=>{r(()=>this.z_(i))}),this.stream.onMessage(i=>{r(()=>++this.F_==1?this.J_(i):this.onNext(i))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return ue(ix,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return n=>{this.Mi.enqueueAndForget(()=>this.D_===e?n():(ue(ix,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class jP extends kE{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}j_(e,n){return this.connection.T_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const n=UA(this.serializer,e),r=function(s){if(!("targetChange"in s))return Ne.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?Ne.min():o.readTime?Sr(o.readTime):Ne.min()}(e);return this.listener.H_(n,r)}Y_(e){const n={};n.database=Ep(this.serializer),n.addTarget=function(s,o){let a;const u=o.target;if(a=yp(u)?{documents:$A(s,u)}:{query:HA(s,u).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=mE(s,o.resumeToken);const c=wp(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(Ne.min())>0){a.readTime=jc(s,o.snapshotVersion.toTimestamp());const c=wp(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const r=WA(this.serializer,e);r&&(n.labels=r),this.q_(n)}Z_(e){const n={};n.database=Ep(this.serializer),n.removeTarget=e,this.q_(n)}}class OP extends kE{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}get X_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}K_(){this.X_&&this.ea([])}j_(e,n){return this.connection.T_("Write",e,n)}J_(e){return Ze(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Ze(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){Ze(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const n=BA(e.writeResults,e.commitTime),r=Sr(e.commitTime);return this.listener.na(r,n)}ra(){const e={};e.database=Ep(this.serializer),this.q_(e)}ea(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>zA(this.serializer,r))};this.q_(n)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class LP{}class MP extends LP{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new ae(W.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,n,r,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Go(e,_p(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===W.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new ae(W.UNKNOWN,s.toString())})}Ho(e,n,r,i,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Ho(e,_p(n,r),i,o,a,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===W.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new ae(W.UNKNOWN,o.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class VP{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const n=`Could not reach Cloud Firestore backend. ${e} +This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(ei(n),this.aa=!1):ue("OnlineStateTracker",n)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const As="RemoteStore";class FP{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=s,this.Aa.Oo(o=>{r.enqueueAndForget(async()=>{Fs(this)&&(ue(As,"Restarting streams for network reachability change."),await async function(u){const c=Re(u);c.Ea.add(4),await Ol(c),c.Ra.set("Unknown"),c.Ea.delete(4),await Ad(c)}(this))})}),this.Ra=new VP(r,i)}}async function Ad(t){if(Fs(t))for(const e of t.da)await e(!0)}async function Ol(t){for(const e of t.da)await e(!1)}function CE(t,e){const n=Re(t);n.Ia.has(e.targetId)||(n.Ia.set(e.targetId,e),gg(n)?mg(n):Wo(n).O_()&&pg(n,e))}function fg(t,e){const n=Re(t),r=Wo(n);n.Ia.delete(e),r.O_()&&NE(n,e),n.Ia.size===0&&(r.O_()?r.L_():Fs(n)&&n.Ra.set("Unknown"))}function pg(t,e){if(t.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Ne.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Wo(t).Y_(e)}function NE(t,e){t.Va.Ue(e),Wo(t).Z_(e)}function mg(t){t.Va=new DA({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),At:e=>t.Ia.get(e)||null,ht:()=>t.datastore.serializer.databaseId}),Wo(t).start(),t.Ra.ua()}function gg(t){return Fs(t)&&!Wo(t).x_()&&t.Ia.size>0}function Fs(t){return Re(t).Ea.size===0}function AE(t){t.Va=void 0}async function UP(t){t.Ra.set("Online")}async function zP(t){t.Ia.forEach((e,n)=>{pg(t,e)})}async function BP(t,e){AE(t),gg(t)?(t.Ra.ha(e),mg(t)):t.Ra.set("Unknown")}async function $P(t,e,n){if(t.Ra.set("Online"),e instanceof pE&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.Ia.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.Ia.delete(a),i.Va.removeTarget(a))}(t,e)}catch(r){ue(As,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await Lc(t,r)}else if(e instanceof Wu?t.Va.Ze(e):e instanceof fE?t.Va.st(e):t.Va.tt(e),!n.isEqual(Ne.min()))try{const r=await TE(t.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.Va.Tt(o);return a.targetChanges.forEach((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const f=s.Ia.get(c);f&&s.Ia.set(c,f.withResumeToken(u.resumeToken,o))}}),a.targetMismatches.forEach((u,c)=>{const f=s.Ia.get(u);if(!f)return;s.Ia.set(u,f.withResumeToken(en.EMPTY_BYTE_STRING,f.snapshotVersion)),NE(s,u);const h=new Si(f.target,u,c,f.sequenceNumber);pg(s,h)}),s.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(r){ue(As,"Failed to raise snapshot:",r),await Lc(t,r)}}async function Lc(t,e,n){if(!Ho(e))throw e;t.Ea.add(1),await Ol(t),t.Ra.set("Offline"),n||(n=()=>TE(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{ue(As,"Retrying IndexedDB access"),await n(),t.Ea.delete(1),await Ad(t)})}function PE(t,e){return e().catch(n=>Lc(t,n,e))}async function Pd(t){const e=Re(t),n=Gi(e);let r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Jm;for(;HP(e);)try{const i=await TP(e.localStore,r);if(i===null){e.Ta.length===0&&n.L_();break}r=i.batchId,qP(e,i)}catch(i){await Lc(e,i)}RE(e)&&DE(e)}function HP(t){return Fs(t)&&t.Ta.length<10}function qP(t,e){t.Ta.push(e);const n=Gi(t);n.O_()&&n.X_&&n.ea(e.mutations)}function RE(t){return Fs(t)&&!Gi(t).x_()&&t.Ta.length>0}function DE(t){Gi(t).start()}async function WP(t){Gi(t).ra()}async function GP(t){const e=Gi(t);for(const n of t.Ta)e.ea(n.mutations)}async function KP(t,e,n){const r=t.Ta.shift(),i=og.from(r,e,n);await PE(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await Pd(t)}async function QP(t,e){e&&Gi(t).X_&&await async function(r,i){if(function(o){return AA(o)&&o!==W.ABORTED}(i.code)){const s=r.Ta.shift();Gi(r).B_(),await PE(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await Pd(r)}}(t,e),RE(t)&&DE(t)}async function sx(t,e){const n=Re(t);n.asyncQueue.verifyOperationInProgress(),ue(As,"RemoteStore received new credentials");const r=Fs(n);n.Ea.add(3),await Ol(n),r&&n.Ra.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ea.delete(3),await Ad(n)}async function YP(t,e){const n=Re(t);e?(n.Ea.delete(2),await Ad(n)):e||(n.Ea.add(2),await Ol(n),n.Ra.set("Unknown"))}function Wo(t){return t.ma||(t.ma=function(n,r,i){const s=Re(n);return s.sa(),new jP(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Xo:UP.bind(null,t),t_:zP.bind(null,t),r_:BP.bind(null,t),H_:$P.bind(null,t)}),t.da.push(async e=>{e?(t.ma.B_(),gg(t)?mg(t):t.Ra.set("Unknown")):(await t.ma.stop(),AE(t))})),t.ma}function Gi(t){return t.fa||(t.fa=function(n,r,i){const s=Re(n);return s.sa(),new OP(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Xo:()=>Promise.resolve(),t_:WP.bind(null,t),r_:QP.bind(null,t),ta:GP.bind(null,t),na:KP.bind(null,t)}),t.da.push(async e=>{e?(t.fa.B_(),await Pd(t)):(await t.fa.stop(),t.Ta.length>0&&(ue(As,`Stopping write stream with ${t.Ta.length} pending writes`),t.Ta=[]))})),t.fa}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class yg{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new qr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,a=new yg(e,n,o,i,s);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ae(W.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function vg(t,e){if(ei("AsyncQueue",`${e}: ${t}`),Ho(t))return new ae(W.UNAVAILABLE,`${e}: ${t}`);throw t}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class go{static emptySet(e){return new go(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||xe.comparator(n.key,r.key):(n,r)=>xe.comparator(n.key,r.key),this.keyedMap=ka(),this.sortedSet=new yt(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof go)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( + `+e.join(` +`)+` +)`}copy(e,n){const r=new go;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class ox{constructor(){this.ga=new yt(xe.comparator)}track(e){const n=e.doc.key,r=this.ga.get(n);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(n,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(n):e.type===1&&r.type===2?this.ga=this.ga.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):Ee(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(n,e)}ya(){const e=[];return this.ga.inorderTraversal((n,r)=>{e.push(r)}),e}}class Mo{constructor(e,n,r,i,s,o,a,u,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new Mo(e,n,go.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Id(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;ie.Da())}}class JP{constructor(){this.queries=ax(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const i=Re(n),s=i.queries;i.queries=ax(),s.forEach((o,a)=>{for(const u of a.Sa)u.onError(r)})})(this,new ae(W.ABORTED,"Firestore shutting down"))}}function ax(){return new Vs(t=>Zb(t),Id)}async function xg(t,e){const n=Re(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.ba()&&e.Da()&&(r=2):(s=new XP,r=e.Da()?0:1);try{switch(r){case 0:s.wa=await n.onListen(i,!0);break;case 1:s.wa=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const a=vg(o,`Initialization of query '${Gs(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,s),s.Sa.push(e),e.va(n.onlineState),s.wa&&e.Fa(s.wa)&&_g(n)}async function wg(t,e){const n=Re(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.Sa.indexOf(e);o>=0&&(s.Sa.splice(o,1),s.Sa.length===0?i=e.Da()?0:1:!s.ba()&&e.Da()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function ZP(t,e){const n=Re(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.Sa)a.Fa(i)&&(r=!0);o.wa=i}}r&&_g(n)}function eR(t,e,n){const r=Re(t),i=r.queries.get(e);if(i)for(const s of i.Sa)s.onError(n);r.queries.delete(e)}function _g(t){t.Ca.forEach(e=>{e.next()})}var Sp,lx;(lx=Sp||(Sp={})).Ma="default",lx.Cache="cache";class bg{constructor(e,n,r){this.query=e,this.xa=n,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new Mo(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),n=!0):this.La(e,this.onlineState)&&(this.ka(e),n=!0),this.Na=e,n}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let n=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),n=!0),n}La(e,n){if(!e.fromCache||!this.Da())return!0;const r=n!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const n=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}ka(e){e=Mo.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==Sp.Cache}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class jE{constructor(e){this.key=e}}class OE{constructor(e){this.key=e}}class tR{constructor(e,n){this.query=e,this.Ya=n,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=He(),this.mutatedKeys=He(),this.eu=eE(e),this.tu=new go(this.eu)}get nu(){return this.Ya}ru(e,n){const r=n?n.iu:new ox,i=n?n.tu:this.tu;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((f,h)=>{const p=i.get(f),g=Td(this.query,h)?h:null,_=!!p&&this.mutatedKeys.has(p.key),S=!!g&&(g.hasLocalMutations||this.mutatedKeys.has(g.key)&&g.hasCommittedMutations);let P=!1;p&&g?p.data.isEqual(g.data)?_!==S&&(r.track({type:3,doc:g}),P=!0):this.su(p,g)||(r.track({type:2,doc:g}),P=!0,(u&&this.eu(g,u)>0||c&&this.eu(g,c)<0)&&(a=!0)):!p&&g?(r.track({type:0,doc:g}),P=!0):p&&!g&&(r.track({type:1,doc:p}),P=!0,(u||c)&&(a=!0)),P&&(g?(o=o.add(g),s=S?s.add(f):s.delete(f)):(o=o.delete(f),s=s.delete(f)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const f=this.query.limitType==="F"?o.last():o.first();o=o.delete(f.key),s=s.delete(f.key),r.track({type:1,doc:f})}return{tu:o,iu:r,Cs:a,mutatedKeys:s}}su(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort((f,h)=>function(g,_){const S=P=>{switch(P){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Ee(20277,{Rt:P})}};return S(g)-S(_)}(f.type,h.type)||this.eu(f.doc,h.doc)),this.ou(r),i=i??!1;const a=n&&!i?this._u():[],u=this.Xa.size===0&&this.current&&!i?1:0,c=u!==this.Za;return this.Za=u,o.length!==0||c?{snapshot:new Mo(this.query,e.tu,s,o,e.mutatedKeys,u===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new ox,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach(n=>this.Ya=this.Ya.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ya=this.Ya.delete(n)),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=He(),this.tu.forEach(r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))});const n=[];return e.forEach(r=>{this.Xa.has(r)||n.push(new OE(r))}),this.Xa.forEach(r=>{e.has(r)||n.push(new jE(r))}),n}cu(e){this.Ya=e.Qs,this.Xa=He();const n=this.ru(e.documents);return this.applyChanges(n,!0)}lu(){return Mo.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const Eg="SyncEngine";class nR{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class rR{constructor(e){this.key=e,this.hu=!1}}class iR{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new Vs(a=>Zb(a),Id),this.Iu=new Map,this.Eu=new Set,this.du=new yt(xe.comparator),this.Au=new Map,this.Ru=new ug,this.Vu={},this.mu=new Map,this.fu=Lo.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function sR(t,e,n=!0){const r=zE(t);let i;const s=r.Tu.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.lu()):i=await LE(r,e,n,!0),i}async function oR(t,e){const n=zE(t);await LE(n,e,!0,!1)}async function LE(t,e,n,r){const i=await SP(t.localStore,Tr(e)),s=i.targetId,o=t.sharedClientState.addLocalQueryTarget(s,n);let a;return r&&(a=await aR(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&CE(t.remoteStore,i),a}async function aR(t,e,n,r,i){t.pu=(h,p,g)=>async function(S,P,v,x){let E=P.view.ru(v);E.Cs&&(E=await ex(S.localStore,P.query,!1).then(({documents:b})=>P.view.ru(b,E)));const O=x&&x.targetChanges.get(P.targetId),L=x&&x.targetMismatches.get(P.targetId)!=null,D=P.view.applyChanges(E,S.isPrimaryClient,O,L);return cx(S,P.targetId,D.au),D.snapshot}(t,h,p,g);const s=await ex(t.localStore,e,!0),o=new tR(e,s.Qs),a=o.ru(s.documents),u=jl.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=o.applyChanges(a,t.isPrimaryClient,u);cx(t,n,c.au);const f=new nR(e,n,o);return t.Tu.set(e,f),t.Iu.has(n)?t.Iu.get(n).push(e):t.Iu.set(n,[e]),c.snapshot}async function lR(t,e,n){const r=Re(t),i=r.Tu.get(e),s=r.Iu.get(i.targetId);if(s.length>1)return r.Iu.set(i.targetId,s.filter(o=>!Id(o,e))),void r.Tu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await Ip(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&fg(r.remoteStore,i.targetId),kp(r,i.targetId)}).catch($o)):(kp(r,i.targetId),await Ip(r.localStore,i.targetId,!0))}async function uR(t,e){const n=Re(t),r=n.Tu.get(e),i=n.Iu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),fg(n.remoteStore,r.targetId))}async function cR(t,e,n){const r=yR(t);try{const i=await function(o,a){const u=Re(o),c=Je.now(),f=a.reduce((g,_)=>g.add(_.key),He());let h,p;return u.persistence.runTransaction("Locally write mutations","readwrite",g=>{let _=ti(),S=He();return u.Ns.getEntries(g,f).next(P=>{_=P,_.forEach((v,x)=>{x.isValidDocument()||(S=S.add(v))})}).next(()=>u.localDocuments.getOverlayedDocuments(g,_)).next(P=>{h=P;const v=[];for(const x of a){const E=TA(x,h.get(x.key).overlayedDocument);E!=null&&v.push(new Zi(x.key,E,qb(E.value.mapValue),Yn.exists(!0)))}return u.mutationQueue.addMutationBatch(g,c,v,a)}).next(P=>{p=P;const v=P.applyToLocalDocumentSet(h,S);return u.documentOverlayCache.saveOverlays(g,P.batchId,v)})}).then(()=>({batchId:p.batchId,changes:nE(h)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,u){let c=o.Vu[o.currentUser.toKey()];c||(c=new yt($e)),c=c.insert(a,u),o.Vu[o.currentUser.toKey()]=c}(r,i.batchId,n),await Ll(r,i.changes),await Pd(r.remoteStore)}catch(i){const s=vg(i,"Failed to persist write");n.reject(s)}}async function ME(t,e){const n=Re(t);try{const r=await EP(n.localStore,e);e.targetChanges.forEach((i,s)=>{const o=n.Au.get(s);o&&(Ze(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?o.hu=!0:i.modifiedDocuments.size>0?Ze(o.hu,14607):i.removedDocuments.size>0&&(Ze(o.hu,42227),o.hu=!1))}),await Ll(n,r,e)}catch(r){await $o(r)}}function ux(t,e,n){const r=Re(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.Tu.forEach((s,o)=>{const a=o.view.va(e);a.snapshot&&i.push(a.snapshot)}),function(o,a){const u=Re(o);u.onlineState=a;let c=!1;u.queries.forEach((f,h)=>{for(const p of h.Sa)p.va(a)&&(c=!0)}),c&&_g(u)}(r.eventManager,e),i.length&&r.Pu.H_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function dR(t,e,n){const r=Re(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Au.get(e),s=i&&i.key;if(s){let o=new yt(xe.comparator);o=o.insert(s,ln.newNoDocument(s,Ne.min()));const a=He().add(s),u=new Cd(Ne.min(),new Map,new yt($e),o,a);await ME(r,u),r.du=r.du.remove(s),r.Au.delete(e),Ig(r)}else await Ip(r.localStore,e,!1).then(()=>kp(r,e,n)).catch($o)}async function hR(t,e){const n=Re(t),r=e.batch.batchId;try{const i=await bP(n.localStore,e);FE(n,r,null),VE(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Ll(n,i)}catch(i){await $o(i)}}async function fR(t,e,n){const r=Re(t);try{const i=await function(o,a){const u=Re(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let f;return u.mutationQueue.lookupMutationBatch(c,a).next(h=>(Ze(h!==null,37113),f=h.keys(),u.mutationQueue.removeMutationBatch(c,h))).next(()=>u.mutationQueue.performConsistencyCheck(c)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(c,f,a)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,f)).next(()=>u.localDocuments.getDocuments(c,f))})}(r.localStore,e);FE(r,e,n),VE(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await Ll(r,i)}catch(i){await $o(i)}}function VE(t,e){(t.mu.get(e)||[]).forEach(n=>{n.resolve()}),t.mu.delete(e)}function FE(t,e,n){const r=Re(t);let i=r.Vu[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.Vu[r.currentUser.toKey()]=i}}function kp(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Iu.get(e))t.Tu.delete(r),n&&t.Pu.yu(r,n);t.Iu.delete(e),t.isPrimaryClient&&t.Ru.jr(e).forEach(r=>{t.Ru.containsKey(r)||UE(t,r)})}function UE(t,e){t.Eu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(fg(t.remoteStore,n),t.du=t.du.remove(e),t.Au.delete(n),Ig(t))}function cx(t,e,n){for(const r of n)r instanceof jE?(t.Ru.addReference(r.key,e),pR(t,r)):r instanceof OE?(ue(Eg,"Document no longer in limbo: "+r.key),t.Ru.removeReference(r.key,e),t.Ru.containsKey(r.key)||UE(t,r.key)):Ee(19791,{wu:r})}function pR(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Eu.has(r)||(ue(Eg,"New document in limbo: "+n),t.Eu.add(r),Ig(t))}function Ig(t){for(;t.Eu.size>0&&t.du.size{o.push(r.pu(u,e,n).then(c=>{var f;if((c||n)&&r.isPrimaryClient){const h=c?!c.fromCache:(f=n==null?void 0:n.targetChanges.get(u.targetId))==null?void 0:f.current;r.sharedClientState.updateQueryState(u.targetId,h?"current":"not-current")}if(c){i.push(c);const h=dg.As(u.targetId,c);s.push(h)}}))}),await Promise.all(o),r.Pu.H_(i),await async function(u,c){const f=Re(u);try{await f.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>G.forEach(c,p=>G.forEach(p.Es,g=>f.persistence.referenceDelegate.addReference(h,p.targetId,g)).next(()=>G.forEach(p.ds,g=>f.persistence.referenceDelegate.removeReference(h,p.targetId,g)))))}catch(h){if(!Ho(h))throw h;ue(hg,"Failed to update sequence numbers: "+h)}for(const h of c){const p=h.targetId;if(!h.fromCache){const g=f.Ms.get(p),_=g.snapshotVersion,S=g.withLastLimboFreeSnapshotVersion(_);f.Ms=f.Ms.insert(p,S)}}}(r.localStore,s))}async function mR(t,e){const n=Re(t);if(!n.currentUser.isEqual(e)){ue(Eg,"User change. New user:",e.toKey());const r=await IE(n.localStore,e);n.currentUser=e,function(s,o){s.mu.forEach(a=>{a.forEach(u=>{u.reject(new ae(W.CANCELLED,o))})}),s.mu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Ll(n,r.Ls)}}function gR(t,e){const n=Re(t),r=n.Au.get(e);if(r&&r.hu)return He().add(r.key);{let i=He();const s=n.Iu.get(e);if(!s)return i;for(const o of s){const a=n.Tu.get(o);i=i.unionWith(a.view.nu)}return i}}function zE(t){const e=Re(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=ME.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=gR.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=dR.bind(null,e),e.Pu.H_=ZP.bind(null,e.eventManager),e.Pu.yu=eR.bind(null,e.eventManager),e}function yR(t){const e=Re(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=hR.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=fR.bind(null,e),e}class Mc{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Nd(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,n){return null}Mu(e,n){return null}vu(e){return _P(this.persistence,new vP,e.initialUser,this.serializer)}Cu(e){return new EE(cg.mi,this.serializer)}Du(e){return new CP}async terminate(){var e,n;(e=this.gcScheduler)==null||e.stop(),(n=this.indexBackfillerScheduler)==null||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Mc.provider={build:()=>new Mc};class vR extends Mc{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,n){Ze(this.persistence.referenceDelegate instanceof Oc,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new rP(r,e.asyncQueue,n)}Cu(e){const n=this.cacheSizeBytes!==void 0?vn.withCacheSize(this.cacheSizeBytes):vn.DEFAULT;return new EE(r=>Oc.mi(r,n),this.serializer)}}class Cp{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>ux(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=mR.bind(null,this.syncEngine),await YP(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new JP}()}createDatastore(e){const n=Nd(e.databaseInfo.databaseId),r=function(s){return new DP(s)}(e.databaseInfo);return function(s,o,a,u){return new MP(s,o,a,u)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,a){return new FP(r,i,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>ux(this.syncEngine,n,0),function(){return rx.v()?new rx:new NP}())}createSyncEngine(e,n){return function(i,s,o,a,u,c,f){const h=new iR(i,s,o,a,u,c);return f&&(h.gu=!0),h}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const s=Re(i);ue(As,"RemoteStore shutting down."),s.Ea.add(5),await Ol(s),s.Aa.shutdown(),s.Ra.set("Unknown")}(this.remoteStore),(e=this.datastore)==null||e.terminate(),(n=this.eventManager)==null||n.terminate()}}Cp.provider={build:()=>new Cp};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + *//** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class Tg{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):ei("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const Ki="FirestoreClient";class xR{constructor(e,n,r,i,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=on.UNAUTHENTICATED,this.clientId=Xm.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async o=>{ue(Ki,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(ue(Ki,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new qr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=vg(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function Wh(t,e){t.asyncQueue.verifyOperationInProgress(),ue(Ki,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await IE(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function dx(t,e){t.asyncQueue.verifyOperationInProgress();const n=await wR(t);ue(Ki,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>sx(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>sx(e.remoteStore,i)),t._onlineComponents=e}async function wR(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){ue(Ki,"Using user provided OfflineComponentProvider");try{await Wh(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===W.FAILED_PRECONDITION||i.code===W.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;Ao("Error using user provided cache. Falling back to memory cache: "+n),await Wh(t,new Mc)}}else ue(Ki,"Using default OfflineComponentProvider"),await Wh(t,new vR(void 0));return t._offlineComponents}async function BE(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(ue(Ki,"Using user provided OnlineComponentProvider"),await dx(t,t._uninitializedComponentsProvider._online)):(ue(Ki,"Using default OnlineComponentProvider"),await dx(t,new Cp))),t._onlineComponents}function _R(t){return BE(t).then(e=>e.syncEngine)}async function Vc(t){const e=await BE(t),n=e.eventManager;return n.onListen=sR.bind(null,e.syncEngine),n.onUnlisten=lR.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=oR.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=uR.bind(null,e.syncEngine),n}function bR(t,e,n={}){const r=new qr;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,c){const f=new Tg({next:p=>{f.Nu(),o.enqueueAndForget(()=>wg(s,h));const g=p.docs.has(a);!g&&p.fromCache?c.reject(new ae(W.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&p.fromCache&&u&&u.source==="server"?c.reject(new ae(W.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(p)},error:p=>c.reject(p)}),h=new bg(Ed(a.path),f,{includeMetadataChanges:!0,qa:!0});return xg(s,h)}(await Vc(t),t.asyncQueue,e,n,r)),r.promise}function ER(t,e,n={}){const r=new qr;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,u,c){const f=new Tg({next:p=>{f.Nu(),o.enqueueAndForget(()=>wg(s,h)),p.fromCache&&u.source==="server"?c.reject(new ae(W.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(p)},error:p=>c.reject(p)}),h=new bg(a,f,{includeMetadataChanges:!0,qa:!0});return xg(s,h)}(await Vc(t),t.asyncQueue,e,n,r)),r.promise}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */function $E(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const hx=new Map;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const HE="firestore.googleapis.com",fx=!0;class px{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new ae(W.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=HE,this.ssl=fx}else this.host=e.host,this.ssl=e.ssl??fx;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=bE;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new ae(W.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Rd{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new px({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new ae(W.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new ae(W.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new px(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new AN;switch(r.type){case"firstParty":return new jN(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new ae(W.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=hx.get(n);r&&(ue("ComponentProvider","Removing Datastore"),hx.delete(n),r.terminate())}(this),Promise.resolve()}}function IR(t,e,n,r={}){var c;t=Sn(t,Rd);const i=Ls(e),s=t._getSettings(),o={...s,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;i&&(qm(`https://${a}`),Wm("Firestore",!0)),s.host!==HE&&s.host!==a&&Ao("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u={...s,host:a,ssl:i,emulatorOptions:r};if(!Jr(u,o)&&(t._setSettings(u),r.mockUserToken)){let f,h;if(typeof r.mockUserToken=="string")f=r.mockUserToken,h=on.MOCK_USER;else{f=wb(r.mockUserToken,(c=t._app)==null?void 0:c.options.projectId);const p=r.mockUserToken.sub||r.mockUserToken.user_id;if(!p)throw new ae(W.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new on(p)}t._authCredentials=new PN(new Db(f,h))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class es{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new es(this.firestore,e,this._query)}}class It{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Fi(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new It(this.firestore,e,this._key)}toJSON(){return{type:It._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(Rl(n,It._jsonSchema))return new It(e,r||null,new xe(st.fromString(n.referencePath)))}}It._jsonSchemaVersion="firestore/documentReference/1.0",It._jsonSchema={type:Rt("string",It._jsonSchemaVersion),referencePath:Rt("string")};class Fi extends es{constructor(e,n,r){super(e,n,Ed(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new It(this.firestore,null,new xe(e))}withConverter(e){return new Fi(this.firestore,e,this._path)}}function Xn(t,e,...n){if(t=Ft(t),jb("collection","path",e),t instanceof Rd){const r=st.fromString(e,...n);return kv(r),new Fi(t,null,r)}{if(!(t instanceof It||t instanceof Fi))throw new ae(W.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(st.fromString(e,...n));return kv(r),new Fi(t.firestore,null,r)}}function vt(t,e,...n){if(t=Ft(t),arguments.length===1&&(e=Xm.newId()),jb("doc","path",e),t instanceof Rd){const r=st.fromString(e,...n);return Sv(r),new It(t,null,new xe(r))}{if(!(t instanceof It||t instanceof Fi))throw new ae(W.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(st.fromString(e,...n));return Sv(r),new It(t.firestore,t instanceof Fi?t.converter:null,new xe(r))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const mx="AsyncQueue";class gx{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new SE(this,"async_queue_retry"),this._c=()=>{const r=qh();r&&ue(mx,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const n=qh();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const n=qh();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const n=new qr;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!Ho(e))throw e;ue(mx,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){const n=this.ac.then(()=>(this.rc=!0,e().catch(r=>{throw this.nc=r,this.rc=!1,ei("INTERNAL UNHANDLED ERROR: ",yx(r)),r}).then(r=>(this.rc=!1,r))));return this.ac=n,n}enqueueAfterDelay(e,n,r){this.uc(),this.oc.indexOf(e)>-1&&(n=0);const i=yg.createAndSchedule(this,e,n,r,s=>this.hc(s));return this.tc.push(i),i}uc(){this.nc&&Ee(47125,{Pc:yx(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const n of this.tc)if(n.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.tc)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){const n=this.tc.indexOf(e);this.tc.splice(n,1)}}function yx(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+` +`+t.stack),e}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function vx(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class ni extends Rd{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new gx,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new gx(e),this._firestoreClient=void 0,await e}}}function TR(t,e){const n=typeof t=="object"?t:Qm(),r=typeof t=="string"?t:Ac,i=vd(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=yb("firestore");s&&IR(i,...s)}return i}function Dd(t){if(t._terminated)throw new ae(W.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||SR(t),t._firestoreClient}function SR(t){var r,i,s;const e=t._freezeSettings(),n=function(a,u,c,f){return new XN(a,u,c,f.host,f.ssl,f.experimentalForceLongPolling,f.experimentalAutoDetectLongPolling,$E(f.experimentalLongPollingOptions),f.useFetchStreams,f.isUsingEmulator)}(t._databaseId,((r=t._app)==null?void 0:r.options.appId)||"",t._persistenceKey,e);t._componentsProvider||(i=e.localCache)!=null&&i._offlineComponentProvider&&((s=e.localCache)!=null&&s._onlineComponentProvider)&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new xR(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&function(a){const u=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(u),_online:u}}(t._componentsProvider))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Wn{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Wn(en.fromBase64String(e))}catch(n){throw new ae(W.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new Wn(en.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Wn._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Rl(e,Wn._jsonSchema))return Wn.fromBase64String(e.bytes)}}Wn._jsonSchemaVersion="firestore/bytes/1.0",Wn._jsonSchema={type:Rt("string",Wn._jsonSchemaVersion),bytes:Rt("string")};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class jd{constructor(...e){for(let n=0;n90)throw new ae(W.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new ae(W.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return $e(this._lat,e._lat)||$e(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:kr._jsonSchemaVersion}}static fromJSON(e){if(Rl(e,kr._jsonSchema))return new kr(e.latitude,e.longitude)}}kr._jsonSchemaVersion="firestore/geoPoint/1.0",kr._jsonSchema={type:Rt("string",kr._jsonSchemaVersion),latitude:Rt("number"),longitude:Rt("number")};/** + * @license + * Copyright 2024 Google LLC + * + * 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. + */class Cr{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let s=0;stypeof n=="number"))return new Cr(e.vectorValues);throw new ae(W.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Cr._jsonSchemaVersion="firestore/vectorValue/1.0",Cr._jsonSchema={type:Rt("string",Cr._jsonSchemaVersion),vectorValues:Rt("object")};/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const kR=/^__.*__$/;class CR{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Zi(e,this.data,this.fieldMask,n,this.fieldTransforms):new Dl(e,this.data,n,this.fieldTransforms)}}class qE{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new Zi(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function WE(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Ee(40011,{Ac:t})}}class Od{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Rc(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new Od({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){var i;const n=(i=this.path)==null?void 0:i.child(e),r=this.Vc({path:n,fc:!1});return r.gc(e),r}yc(e){var i;const n=(i=this.path)==null?void 0:i.child(e),r=this.Vc({path:n,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return Fc(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Rc(){if(this.path)for(let e=0;eu.covers(h.field))}else u=null,c=o.fieldTransforms;return new CR(new _n(a),u,c)}class Md extends Go{_toFieldTransform(e){if(e.Ac!==2)throw e.Ac===1?e.Sc(`${this._methodName}() can only appear at the top level of your update data`):e.Sc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Md}}function KE(t,e,n){return new Od({Ac:3,Dc:e.settings.Dc,methodName:t._methodName,fc:n},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class Sg extends Go{constructor(e,n){super(e),this.vc=n}_toFieldTransform(e){const n=KE(this,e,!0),r=this.vc.map(s=>Us(s,n)),i=new jo(r);return new ig(e.path,i)}isEqual(e){return e instanceof Sg&&Jr(this.vc,e.vc)}}class kg extends Go{constructor(e,n){super(e),this.vc=n}_toFieldTransform(e){const n=KE(this,e,!0),r=this.vc.map(s=>Us(s,n)),i=new Oo(r);return new ig(e.path,i)}isEqual(e){return e instanceof kg&&Jr(this.vc,e.vc)}}class Cg extends Go{constructor(e,n){super(e),this.Fc=n}_toFieldTransform(e){const n=new wl(e.serializer,sE(e.serializer,this.Fc));return new ig(e.path,n)}isEqual(e){return e instanceof Cg&&this.Fc===e.Fc}}function AR(t,e,n,r){const i=t.Cc(1,e,n);Ng("Data must be an object, but it was:",i,r);const s=[],o=_n.empty();Ji(r,(u,c)=>{const f=Ag(e,u,n);c=Ft(c);const h=i.yc(f);if(c instanceof Md)s.push(f);else{const p=Us(c,h);p!=null&&(s.push(f),o.set(f,p))}});const a=new On(s);return new qE(o,a,i.fieldTransforms)}function PR(t,e,n,r,i,s){const o=t.Cc(1,e,n),a=[Np(e,r,n)],u=[i];if(s.length%2!=0)throw new ae(W.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let p=0;p=0;--p)if(!XE(c,a[p])){const g=a[p];let _=u[p];_=Ft(_);const S=o.yc(g);if(_ instanceof Md)c.push(g);else{const P=Us(_,S);P!=null&&(c.push(g),f.set(g,P))}}const h=new On(c);return new qE(f,h,o.fieldTransforms)}function RR(t,e,n,r=!1){return Us(n,t.Cc(r?4:3,e))}function Us(t,e){if(YE(t=Ft(t)))return Ng("Unsupported field value:",e,t),QE(t,e);if(t instanceof Go)return function(r,i){if(!WE(i.Ac))throw i.Sc(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Sc(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.fc&&e.Ac!==4)throw e.Sc("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let u=Us(a,i.wc(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=Ft(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return sE(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=Je.fromDate(r);return{timestampValue:jc(i.serializer,s)}}if(r instanceof Je){const s=new Je(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:jc(i.serializer,s)}}if(r instanceof kr)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Wn)return{bytesValue:mE(i.serializer,r._byteString)};if(r instanceof It){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.Sc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:lg(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof Cr)return function(o,a){return{mapValue:{fields:{[$b]:{stringValue:Hb},[Pc]:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw a.Sc("VectorValues must only contain numeric values.");return rg(a.serializer,c)})}}}}}}(r,i);throw i.Sc(`Unsupported field value: ${xd(r)}`)}(t,e)}function QE(t,e){const n={};return Mb(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ji(t,(r,i)=>{const s=Us(i,e.mc(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function YE(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Je||t instanceof kr||t instanceof Wn||t instanceof It||t instanceof Go||t instanceof Cr)}function Ng(t,e,n){if(!YE(n)||!Ob(n)){const r=xd(n);throw r==="an object"?e.Sc(t+" a custom object"):e.Sc(t+" "+r)}}function Np(t,e,n){if((e=Ft(e))instanceof jd)return e._internalPath;if(typeof e=="string")return Ag(t,e);throw Fc("Field path arguments must be of type string or ",t,!1,void 0,n)}const DR=new RegExp("[~\\*/\\[\\]]");function Ag(t,e,n){if(e.search(DR)>=0)throw Fc(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new jd(...e.split("."))._internalPath}catch{throw Fc(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function Fc(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new ae(W.INVALID_ARGUMENT,a+t+u)}function XE(t,e){return t.some(n=>n.isEqual(e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class JE{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new It(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new jR(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(Vd("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class jR extends JE{data(){return super.data()}}function Vd(t,e){return typeof e=="string"?Ag(t,e):e instanceof jd?e._internalPath:e._delegate._internalPath}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function ZE(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new ae(W.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Pg{}class eI extends Pg{}function Ps(t,e,...n){let r=[];e instanceof Pg&&r.push(e),r=r.concat(n),function(s){const o=s.filter(u=>u instanceof Rg).length,a=s.filter(u=>u instanceof Fd).length;if(o>1||o>0&&a>0)throw new ae(W.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)t=i._apply(t);return t}class Fd extends eI{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new Fd(e,n,r)}_apply(e){const n=this._parse(e);return tI(e._query,n),new es(e.firestore,e.converter,vp(e._query,n))}_parse(e){const n=Ld(e.firestore);return function(s,o,a,u,c,f,h){let p;if(c.isKeyField()){if(f==="array-contains"||f==="array-contains-any")throw new ae(W.INVALID_ARGUMENT,`Invalid Query. You can't perform '${f}' queries on documentId().`);if(f==="in"||f==="not-in"){wx(h,f);const _=[];for(const S of h)_.push(xx(u,s,S));p={arrayValue:{values:_}}}else p=xx(u,s,h)}else f!=="in"&&f!=="not-in"&&f!=="array-contains-any"||wx(h,f),p=RR(a,o,h,f==="in"||f==="not-in");return Pt.create(c,f,p)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function Ko(t,e,n){const r=e,i=Vd("where",t);return Fd._create(i,r,n)}class Rg extends Pg{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new Rg(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:dr.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,s){let o=i;const a=s.getFlattenedFilters();for(const u of a)tI(o,u),o=vp(o,u)}(e._query,n),new es(e.firestore,e.converter,vp(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class Dg extends eI{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new Dg(e,n)}_apply(e){const n=function(i,s,o){if(i.startAt!==null)throw new ae(W.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new ae(W.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new xl(s,o)}(e._query,this._field,this._direction);return new es(e.firestore,e.converter,function(i,s){const o=i.explicitOrderBy.concat([s]);return new qo(i.path,i.collectionGroup,o,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function OR(t,e="asc"){const n=e,r=Vd("orderBy",t);return Dg._create(r,n)}function xx(t,e,n){if(typeof(n=Ft(n))=="string"){if(n==="")throw new ae(W.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Jb(e)&&n.indexOf("/")!==-1)throw new ae(W.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(st.fromString(n));if(!xe.isDocumentKey(r))throw new ae(W.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Ov(t,new xe(r))}if(n instanceof It)return Ov(t,n._key);throw new ae(W.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${xd(n)}.`)}function wx(t,e){if(!Array.isArray(t)||t.length===0)throw new ae(W.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function tI(t,e){const n=function(i,s){for(const o of i)for(const a of o.getFlattenedFilters())if(s.indexOf(a.op)>=0)return a.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new ae(W.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new ae(W.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class LR{convertValue(e,n="none"){switch(Wi(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Tt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(qi(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw Ee(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Ji(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertVectorValue(e){var r,i,s;const n=(s=(i=(r=e.fields)==null?void 0:r[Pc].arrayValue)==null?void 0:i.values)==null?void 0:s.map(o=>Tt(o.doubleValue));return new Cr(n)}convertGeoPoint(e){return new kr(Tt(e.latitude),Tt(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=bd(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(gl(e));default:return null}}convertTimestamp(e){const n=Hi(e);return new Je(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=st.fromString(e);Ze(_E(r),9688,{name:e});const i=new yl(r.get(1),r.get(3)),s=new xe(r.popFirst(5));return i.isEqual(n)||ei(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function nI(t,e,n){let r;return r=t?t.toFirestore(e):e,r}class Na{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class ws extends JE{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Gu(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(Vd("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new ae(W.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=ws._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}ws._jsonSchemaVersion="firestore/documentSnapshot/1.0",ws._jsonSchema={type:Rt("string",ws._jsonSchemaVersion),bundleSource:Rt("string","DocumentSnapshot"),bundleName:Rt("string"),bundle:Rt("string")};class Gu extends ws{data(e={}){return super.data(e)}}class _s{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new Na(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Gu(this._firestore,this._userDataWriter,r.key,r,new Na(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new ae(W.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const u=new Gu(i._firestore,i._userDataWriter,a.doc.key,a.doc,new Na(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const u=new Gu(i._firestore,i._userDataWriter,a.doc.key,a.doc,new Na(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,f=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),f=o.indexOf(a.doc.key)),{type:MR(a.type),doc:u,oldIndex:c,newIndex:f}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new ae(W.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=_s._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Xm.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],i=[];return this.docs.forEach(s=>{s._document!==null&&(n.push(s._document),r.push(this._userDataWriter.convertObjectMap(s._document.data.value.mapValue.fields,"previous")),i.push(s.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function MR(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Ee(61501,{type:t})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function hr(t){t=Sn(t,It);const e=Sn(t.firestore,ni);return bR(Dd(e),t._key).then(n=>rI(e,t,n))}_s._jsonSchemaVersion="firestore/querySnapshot/1.0",_s._jsonSchema={type:Rt("string",_s._jsonSchemaVersion),bundleSource:Rt("string","QuerySnapshot"),bundleName:Rt("string"),bundle:Rt("string")};class jg extends LR{constructor(e){super(),this.firestore=e}convertBytes(e){return new Wn(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new It(this.firestore,null,n)}}function Wr(t){t=Sn(t,es);const e=Sn(t.firestore,ni),n=Dd(e),r=new jg(e);return ZE(t._query),ER(n,t._query).then(i=>new _s(e,r,t,i))}function Og(t,e,n){t=Sn(t,It);const r=Sn(t.firestore,ni),i=nI(t.converter,e);return Ud(r,[GE(Ld(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,Yn.none())])}function si(t,e,n,...r){t=Sn(t,It);const i=Sn(t.firestore,ni),s=Ld(i);let o;return o=typeof(e=Ft(e))=="string"||e instanceof jd?PR(s,"updateDoc",t._key,e,n,r):AR(s,"updateDoc",t._key,e),Ud(i,[o.toMutation(t._key,Yn.exists(!0))])}function Ap(t){return Ud(Sn(t.firestore,ni),[new sg(t._key,Yn.none())])}function Lg(t,e){const n=Sn(t.firestore,ni),r=vt(t),i=nI(t.converter,e);return Ud(n,[GE(Ld(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,Yn.exists(!1))]).then(()=>r)}function Mg(t,...e){var u,c,f;t=Ft(t);let n={includeMetadataChanges:!1,source:"default"},r=0;typeof e[r]!="object"||vx(e[r])||(n=e[r++]);const i={includeMetadataChanges:n.includeMetadataChanges,source:n.source};if(vx(e[r])){const h=e[r];e[r]=(u=h.next)==null?void 0:u.bind(h),e[r+1]=(c=h.error)==null?void 0:c.bind(h),e[r+2]=(f=h.complete)==null?void 0:f.bind(h)}let s,o,a;if(t instanceof It)o=Sn(t.firestore,ni),a=Ed(t._key.path),s={next:h=>{e[r]&&e[r](rI(o,t,h))},error:e[r+1],complete:e[r+2]};else{const h=Sn(t,es);o=Sn(h.firestore,ni),a=h._query;const p=new jg(o);s={next:g=>{e[r]&&e[r](new _s(o,p,h,g))},error:e[r+1],complete:e[r+2]},ZE(t._query)}return function(p,g,_,S){const P=new Tg(S),v=new bg(g,P,_);return p.asyncQueue.enqueueAndForget(async()=>xg(await Vc(p),v)),()=>{P.Nu(),p.asyncQueue.enqueueAndForget(async()=>wg(await Vc(p),v))}}(Dd(o),a,i,s)}function Ud(t,e){return function(r,i){const s=new qr;return r.asyncQueue.enqueueAndForget(async()=>cR(await _R(r),i,s)),s.promise}(Dd(t),e)}function rI(t,e,n){const r=n.docs.get(e._key),i=new jg(t);return new ws(t,i,e._key,r,new Na(n.hasPendingWrites,n.fromCache),e.converter)}function VR(...t){return new Sg("arrayUnion",t)}function FR(...t){return new kg("arrayRemove",t)}function UR(t){return new Cg("increment",t)}(function(e,n=!0){(function(i){Bo=i})(Ms),Cs(new Bi("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new ni(new RN(r.getProvider("auth-internal")),new ON(o,r.getProvider("app-check-internal")),function(c,f){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new ae(W.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new yl(c.options.projectId,f)}(o,i),o);return s={useFetchStreams:n,...s},a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Ir(bv,Ev,e),Ir(bv,Ev,"esm2020")})();/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */const iI="firebasestorage.googleapis.com",zR="storageBucket",BR=2*60*1e3,$R=10*60*1e3;/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class jr extends Dr{constructor(e,n,r=0){super(Gh(e),`Firebase Storage: ${n} (${Gh(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,jr.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Gh(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} +${this.customData.serverResponse}`:this.message=this._baseMessage}}var Pr;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Pr||(Pr={}));function Gh(t){return"storage/"+t}function HR(){const t="An unknown error occurred, please check the error payload for server response.";return new jr(Pr.UNKNOWN,t)}function qR(){return new jr(Pr.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function WR(){return new jr(Pr.CANCELED,"User canceled the upload/download.")}function GR(t){return new jr(Pr.INVALID_URL,"Invalid URL '"+t+"'.")}function KR(t){return new jr(Pr.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function _x(t){return new jr(Pr.INVALID_ARGUMENT,t)}function sI(){return new jr(Pr.APP_DELETED,"The Firebase app was deleted.")}function QR(t){return new jr(Pr.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class sr{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=sr.makeFromUrl(e,n)}catch{return new sr(e,"")}if(r.path==="")return r;throw KR(e)}static makeFromUrl(e,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(O){O.path.charAt(O.path.length-1)==="/"&&(O.path_=O.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),u={bucket:1,path:3};function c(O){O.path_=decodeURIComponent(O.path)}const f="v[A-Za-z0-9_]+",h=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",g=new RegExp(`^https?://${h}/${f}/b/${i}/o${p}`,"i"),_={bucket:1,path:3},S=n===iI?"(?:storage.googleapis.com|storage.cloud.google.com)":n,P="([^?#]*)",v=new RegExp(`^https?://${S}/${i}/${P}`,"i"),E=[{regex:a,indices:u,postModify:s},{regex:g,indices:_,postModify:c},{regex:v,indices:{bucket:1,path:2},postModify:c}];for(let O=0;O{i=null,t(g,u())},P)}function p(){s&&clearTimeout(s)}function g(P,...v){if(c){p();return}if(P){p(),f.call(null,P,...v);return}if(u()||o){p(),f.call(null,P,...v);return}r<64&&(r*=2);let E;a===1?(a=2,E=0):E=(r+Math.random())*1e3,h(E)}let _=!1;function S(P){_||(_=!0,p(),!c&&(i!==null?(P||(a=2),clearTimeout(i),h(0)):P||(a=1)))}return h(0),s=setTimeout(()=>{o=!0,S(!0)},n),S}function JR(t){t(!1)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function ZR(t){return t!==void 0}function bx(t,e,n,r){if(rn)throw _x(`Invalid value for '${t}'. Expected ${n} or less.`)}function e4(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n}var Uc;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Uc||(Uc={}));/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */function t4(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return n||i||s}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */class n4{constructor(e,n,r,i,s,o,a,u,c,f,h,p=!0,g=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=u,this.timeout_=c,this.progressCallback_=f,this.connectionFactory_=h,this.retry=p,this.isUsingEmulator=g,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((_,S)=>{this.resolve_=_,this.reject_=S,this.start_()})}start_(){const e=(r,i)=>{if(i){r(!1,new Eu(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const u=a.loaded,c=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(u,c)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===Uc.NO_ERROR,u=s.getStatus();if(!a||t4(u,this.additionalRetryCodes_)&&this.retry){const f=s.getErrorCode()===Uc.ABORT;r(!1,new Eu(!1,null,f));return}const c=this.successCodes_.indexOf(u)!==-1;r(!0,new Eu(c,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const u=this.callback_(a,a.getResponse());ZR(u)?s(u):s()}catch(u){o(u)}else if(a!==null){const u=HR();u.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,u)):o(u)}else if(i.canceled){const u=this.appDelete_?sI():WR();o(u)}else{const u=qR();o(u)}};this.canceled_?n(!1,new Eu(!1,null,!0)):this.backoffId_=XR(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&JR(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Eu{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function r4(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function i4(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function s4(t,e){e&&(t["X-Firebase-GMPID"]=e)}function o4(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function a4(t,e,n,r,i,s,o=!0,a=!1){const u=e4(t.urlParams),c=t.url+u,f=Object.assign({},t.headers);return s4(f,e),r4(f,n),i4(f,s),o4(f,r),new n4(c,t.method,f,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o,a)}/** + * @license + * Copyright 2017 Google LLC + * + * 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. + */function l4(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function u4(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class zc{constructor(e,n){this._service=e,n instanceof sr?this._location=n:this._location=sr.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new zc(e,n)}get root(){const e=new sr(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return u4(this._location.path)}get storage(){return this._service}get parent(){const e=l4(this._location.path);if(e===null)return null;const n=new sr(this._location.bucket,e);return new zc(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw QR(e)}}function Ex(t,e){const n=e==null?void 0:e[zR];return n==null?null:sr.makeFromBucketSpec(n,t)}function c4(t,e,n,r={}){t.host=`${e}:${n}`;const i=Ls(e);i&&(qm(`https://${t.host}/b`),Wm("Storage",!0)),t._isUsingEmulator=!0,t._protocol=i?"https":"http";const{mockUserToken:s}=r;s&&(t._overrideAuthToken=typeof s=="string"?s:wb(s,t.app.options.projectId))}class d4{constructor(e,n,r,i,s,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._isUsingEmulator=o,this._bucket=null,this._host=iI,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=BR,this._maxUploadRetryTime=$R,this._requests=new Set,i!=null?this._bucket=sr.makeFromBucketSpec(i,this._host):this._bucket=Ex(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=sr.makeFromBucketSpec(this._url,e):this._bucket=Ex(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){bx("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){bx("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(wn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new zc(this,e)}_makeRequest(e,n,r,i,s=!0){if(this._deleted)return new YR(sI());{const o=a4(e,this._appId,r,i,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,i).getPromise()}}const Ix="@firebase/storage",Tx="0.14.0";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const oI="storage";function h4(t=Qm(),e){t=Ft(t);const r=vd(t,oI).getImmediate({identifier:e}),i=yb("storage");return i&&f4(r,...i),r}function f4(t,e,n,r={}){c4(t,e,n,r)}function p4(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new d4(n,r,i,e,Ms)}function m4(){Cs(new Bi(oI,p4,"PUBLIC").setMultipleInstances(!0)),Ir(Ix,Tx,""),Ir(Ix,Tx,"esm2020")}m4();function aI(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const g4=aI,lI=new Al("auth","Firebase",aI());/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Bc=new Gm("@firebase/auth");function y4(t,...e){Bc.logLevel<=Be.WARN&&Bc.warn(`Auth (${Ms}): ${t}`,...e)}function Ku(t,...e){Bc.logLevel<=Be.ERROR&&Bc.error(`Auth (${Ms}): ${t}`,...e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function er(t,...e){throw Fg(t,...e)}function ur(t,...e){return Fg(t,...e)}function Vg(t,e,n){const r={...g4(),[e]:n};return new Al("auth","Firebase",r).create(e,{appName:t.name})}function Gr(t){return Vg(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function v4(t,e,n){const r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&er(t,"argument-error"),Vg(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Fg(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return lI.create(t,...e)}function be(t,e,...n){if(!t)throw Fg(e,...n)}function Br(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Ku(e),new Error(e)}function ri(t,e){t||Br(e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Pp(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.href)||""}function x4(){return Sx()==="http:"||Sx()==="https:"}function Sx(){var t;return typeof self<"u"&&((t=self.location)==null?void 0:t.protocol)||null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function w4(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(x4()||aC()||"connection"in navigator)?navigator.onLine:!0}function _4(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Ml{constructor(e,n){this.shortDelay=e,this.longDelay=n,ri(n>e,"Short delay should be less than long delay!"),this.isMobile=iC()||lC()}get(){return w4()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Ug(t,e){ri(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class uI{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Br("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Br("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Br("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const b4={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const E4=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],I4=new Ml(3e4,6e4);function ts(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function ns(t,e,n,r,i={}){return cI(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=Pl({key:t.config.apiKey,...o}).slice(1),u=await t._getAdditionalHeaders();u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode);const c={method:e,headers:u,...s};return oC()||(c.referrerPolicy="no-referrer"),t.emulatorConfig&&Ls(t.emulatorConfig.host)&&(c.credentials="include"),uI.fetch()(await dI(t,t.config.apiHost,n,a),c)})}async function cI(t,e,n){t._canInitEmulator=!1;const r={...b4,...e};try{const i=new S4(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Iu(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[u,c]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw Iu(t,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw Iu(t,"email-already-in-use",o);if(u==="USER_DISABLED")throw Iu(t,"user-disabled",o);const f=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw Vg(t,f,c);er(t,f)}}catch(i){if(i instanceof Dr)throw i;er(t,"network-request-failed",{message:String(i)})}}async function Vl(t,e,n,r,i={}){const s=await ns(t,e,n,r,i);return"mfaPendingCredential"in s&&er(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function dI(t,e,n,r){const i=`${e}${n}?${r}`,s=t,o=s.config.emulator?Ug(t.config,i):`${t.config.apiScheme}://${i}`;return E4.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}function T4(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class S4{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(ur(this.auth,"network-request-failed")),I4.get())})}}function Iu(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=ur(t,e,r);return i.customData._tokenResponse=n,i}function kx(t){return t!==void 0&&t.enterprise!==void 0}class k4{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return T4(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function C4(t,e){return ns(t,"GET","/v2/recaptchaConfig",ts(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function N4(t,e){return ns(t,"POST","/v1/accounts:delete",e)}async function $c(t,e){return ns(t,"POST","/v1/accounts:lookup",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Ha(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function A4(t,e=!1){const n=Ft(t),r=await n.getIdToken(e),i=zg(r);be(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:Ha(Kh(i.auth_time)),issuedAtTime:Ha(Kh(i.iat)),expirationTime:Ha(Kh(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function Kh(t){return Number(t)*1e3}function zg(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Ku("JWT malformed, contained fewer than 3 sections"),null;try{const i=mb(n);return i?JSON.parse(i):(Ku("Failed to decode base64 JWT payload"),null)}catch(i){return Ku("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function Cx(t){const e=zg(t);return be(e,"internal-error"),be(typeof e.exp<"u","internal-error"),be(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function _l(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Dr&&P4(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function P4({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class R4{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Rp{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ha(this.lastLoginAt),this.creationTime=Ha(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */async function Hc(t){var h;const e=t.auth,n=await t.getIdToken(),r=await _l(t,$c(e,{idToken:n}));be(r==null?void 0:r.users.length,e,"internal-error");const i=r.users[0];t._notifyReloadListener(i);const s=(h=i.providerUserInfo)!=null&&h.length?hI(i.providerUserInfo):[],o=j4(t.providerData,s),a=t.isAnonymous,u=!(t.email&&i.passwordHash)&&!(o!=null&&o.length),c=a?u:!1,f={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new Rp(i.createdAt,i.lastLoginAt),isAnonymous:c};Object.assign(t,f)}async function D4(t){const e=Ft(t);await Hc(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function j4(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function hI(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function O4(t,e){const n=await cI(t,{},async()=>{const r=Pl({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=await dI(t,i,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const u={method:"POST",headers:a,body:r};return t.emulatorConfig&&Ls(t.emulatorConfig.host)&&(u.credentials="include"),uI.fetch()(o,u)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function L4(t,e){return ns(t,"POST","/v2/accounts:revokeToken",ts(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class yo{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){be(e.idToken,"internal-error"),be(typeof e.idToken<"u","internal-error"),be(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Cx(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){be(e.length!==0,"internal-error");const n=Cx(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(be(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await O4(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new yo;return r&&(be(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(be(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(be(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new yo,this.toJSON())}_performRefresh(){return Br("not implemented")}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function pi(t,e){be(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class or{constructor({uid:e,auth:n,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new R4(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Rp(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const n=await _l(this,this.stsTokenManager.getToken(this.auth,e));return be(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return A4(this,e)}reload(){return D4(this)}_assign(e){this!==e&&(be(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new or({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){be(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Hc(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(wn(this.auth.app))return Promise.reject(Gr(this.auth));const e=await this.getIdToken();return await _l(this,N4(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){const r=n.displayName??void 0,i=n.email??void 0,s=n.phoneNumber??void 0,o=n.photoURL??void 0,a=n.tenantId??void 0,u=n._redirectEventId??void 0,c=n.createdAt??void 0,f=n.lastLoginAt??void 0,{uid:h,emailVerified:p,isAnonymous:g,providerData:_,stsTokenManager:S}=n;be(h&&S,e,"internal-error");const P=yo.fromJSON(this.name,S);be(typeof h=="string",e,"internal-error"),pi(r,e.name),pi(i,e.name),be(typeof p=="boolean",e,"internal-error"),be(typeof g=="boolean",e,"internal-error"),pi(s,e.name),pi(o,e.name),pi(a,e.name),pi(u,e.name),pi(c,e.name),pi(f,e.name);const v=new or({uid:h,auth:e,email:i,emailVerified:p,displayName:r,isAnonymous:g,photoURL:o,phoneNumber:s,tenantId:a,stsTokenManager:P,createdAt:c,lastLoginAt:f});return _&&Array.isArray(_)&&(v.providerData=_.map(x=>({...x}))),u&&(v._redirectEventId=u),v}static async _fromIdTokenResponse(e,n,r=!1){const i=new yo;i.updateFromServerResponse(n);const s=new or({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Hc(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];be(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?hI(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new yo;a.updateFromIdToken(r);const u=new or({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new Rp(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(u,c),u}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Nx=new Map;function $r(t){ri(t instanceof Function,"Expected a class definition");let e=Nx.get(t);return e?(ri(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Nx.set(t,e),e)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class fI{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}fI.type="NONE";const Ax=fI;/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */function Qu(t,e,n){return`firebase:${t}:${e}:${n}`}class vo{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=Qu(this.userKey,i.apiKey,s),this.fullPersistenceKey=Qu("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await $c(this.auth,{idToken:e}).catch(()=>{});return n?or._fromGetAccountInfoResponse(this.auth,n,e):null}return or._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new vo($r(Ax),e,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||$r(Ax);const o=Qu(r,e.config.apiKey,e.name);let a=null;for(const c of n)try{const f=await c._get(o);if(f){let h;if(typeof f=="string"){const p=await $c(e,{idToken:f}).catch(()=>{});if(!p)break;h=await or._fromGetAccountInfoResponse(e,p,f)}else h=or._fromJSON(e,f);c!==s&&(a=h),s=c;break}}catch{}const u=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new vo(s,e,r):(s=u[0],a&&await s._set(o,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new vo(s,e,r))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Px(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(yI(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(pI(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(xI(e))return"Blackberry";if(wI(e))return"Webos";if(mI(e))return"Safari";if((e.includes("chrome/")||gI(e))&&!e.includes("edge/"))return"Chrome";if(vI(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function pI(t=cn()){return/firefox\//i.test(t)}function mI(t=cn()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function gI(t=cn()){return/crios\//i.test(t)}function yI(t=cn()){return/iemobile/i.test(t)}function vI(t=cn()){return/android/i.test(t)}function xI(t=cn()){return/blackberry/i.test(t)}function wI(t=cn()){return/webos/i.test(t)}function Bg(t=cn()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function M4(t=cn()){var e;return Bg(t)&&!!((e=window.navigator)!=null&&e.standalone)}function V4(){return uC()&&document.documentMode===10}function _I(t=cn()){return Bg(t)||vI(t)||wI(t)||xI(t)||/windows phone/i.test(t)||yI(t)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function bI(t,e=[]){let n;switch(t){case"Browser":n=Px(cn());break;case"Worker":n=`${Px(cn())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ms}/${r}`}/** + * @license + * Copyright 2022 Google LLC + * + * 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. + */class F4{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,a)=>{try{const u=e(s);o(u)}catch(u){a(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */async function U4(t,e={}){return ns(t,"GET","/v2/passwordPolicy",ts(t,e))}/** + * @license + * Copyright 2023 Google LLC + * + * 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. + */const z4=6;class B4{constructor(e){var r;const n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??z4,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=e.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class $4{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Rx(this),this.idTokenSubscription=new Rx(this),this.beforeStateQueue=new F4(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=lI,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=$r(n)),this._initializationPromise=this.queue(async()=>{var r,i,s;if(!this._deleted&&(this.persistenceManager=await vo.create(this,e),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((i=this._popupRedirectResolver)!=null&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((s=this.currentUser)==null?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await $c(this,{idToken:e}),r=await or._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var s;if(wn(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(s=this.redirectUser)==null?void 0:s._redirectEventId,a=r==null?void 0:r._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===a)&&(u!=null&&u.user)&&(r=u.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return be(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Hc(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=_4()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(wn(this.app))return Promise.reject(Gr(this));const n=e?Ft(e):null;return n&&be(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&be(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return wn(this.app)?Promise.reject(Gr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return wn(this.app)?Promise.reject(Gr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence($r(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await U4(this),n=new B4(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Al("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await L4(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&$r(e)||this._popupRedirectResolver;be(n,this,"argument-error"),this.redirectPersistenceManager=await vo.create(this,[$r(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(be(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=e.addObserver(n);return()=>{o=!0,u()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return be(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=bI(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var i;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await((i=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getHeartbeatsHeader());n&&(e["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){var n;if(wn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return e!=null&&e.error&&y4(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function rs(t){return Ft(t)}class Rx{constructor(e){this.auth=e,this.observer=null,this.addObserver=yC(n=>this.observer=n)}get next(){return be(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */let zd={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function H4(t){zd=t}function EI(t){return zd.loadJS(t)}function q4(){return zd.recaptchaEnterpriseScript}function W4(){return zd.gapiScript}function G4(t){return`__${t}${Math.floor(Math.random()*1e6)}`}class K4{constructor(){this.enterprise=new Q4}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}class Q4{ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}const Y4="recaptcha-enterprise",II="NO_RECAPTCHA";class X4{constructor(e){this.type=Y4,this.auth=rs(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{C4(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(u=>{if(u.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const c=new k4(u);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,o(c.siteKey)}}).catch(u=>{a(u)})})}function i(s,o,a){const u=window.grecaptcha;kx(u)?u.enterprise.ready(()=>{u.enterprise.execute(s,{action:e}).then(c=>{o(c)}).catch(()=>{o(II)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new K4().execute("siteKey",{action:"verify"}):new Promise((s,o)=>{r(this.auth).then(a=>{if(!n&&kx(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let u=q4();u.length!==0&&(u+=a),EI(u).then(()=>{i(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function Dx(t,e,n,r=!1,i=!1){const s=new X4(t);let o;if(i)o=II;else try{o=await s.verify(n)}catch{o=await s.verify(n,!0)}const a={...e};if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const u=a.phoneEnrollmentInfo.phoneNumber,c=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:u,recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const u=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:u,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function Dp(t,e,n,r,i){var s;if((s=t._getRecaptchaConfig())!=null&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=await Dx(t,e,n,n==="getOobCode");return r(t,o)}else return r(t,e).catch(async o=>{if(o.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const a=await Dx(t,e,n,n==="getOobCode");return r(t,a)}else return Promise.reject(o)})}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function J4(t,e){const n=vd(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Jr(s,e??{}))return i;er(i,"already-initialized")}return n.initialize({options:e})}function Z4(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map($r);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function eD(t,e,n){const r=rs(t);be(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=TI(e),{host:o,port:a}=tD(e),u=a===null?"":`:${a}`,c={url:`${s}//${o}${u}/`},f=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){be(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),be(Jr(c,r.config.emulator)&&Jr(f,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=c,r.emulatorConfig=f,r.settings.appVerificationDisabledForTesting=!0,Ls(o)?(qm(`${s}//${o}${u}`),Wm("Auth",!0)):nD()}function TI(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function tD(t){const e=TI(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:jx(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:jx(o)}}}function jx(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function nD(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class $g{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Br("not implemented")}_getIdTokenResponse(e){return Br("not implemented")}_linkToIdToken(e,n){return Br("not implemented")}_getReauthenticationResolver(e){return Br("not implemented")}}async function rD(t,e){return ns(t,"POST","/v1/accounts:signUp",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function iD(t,e){return Vl(t,"POST","/v1/accounts:signInWithPassword",ts(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function sD(t,e){return Vl(t,"POST","/v1/accounts:signInWithEmailLink",ts(t,e))}async function oD(t,e){return Vl(t,"POST","/v1/accounts:signInWithEmailLink",ts(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class bl extends $g{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new bl(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new bl(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Dp(e,n,"signInWithPassword",iD);case"emailLink":return sD(e,{email:this._email,oobCode:this._password});default:er(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Dp(e,r,"signUpPassword",rD);case"emailLink":return oD(e,{idToken:n,email:this._email,oobCode:this._password});default:er(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function xo(t,e){return Vl(t,"POST","/v1/accounts:signInWithIdp",ts(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const aD="http://localhost";class Rs extends $g{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new Rs(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):er("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=n;if(!r||!i)return null;const o=new Rs(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return xo(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,xo(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,xo(e,n)}buildRequest(){const e={requestUri:aD,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=Pl(n)}return e}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function lD(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function uD(t){const e=Ia(Ta(t)).link,n=e?Ia(Ta(e)).deep_link_id:null,r=Ia(Ta(t)).deep_link_id;return(r?Ia(Ta(r)).link:null)||r||n||e||t}class Hg{constructor(e){const n=Ia(Ta(e)),r=n.apiKey??null,i=n.oobCode??null,s=lD(n.mode??null);be(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=n.continueUrl??null,this.languageCode=n.lang??null,this.tenantId=n.tenantId??null}static parseLink(e){const n=uD(e);try{return new Hg(n)}catch{return null}}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Qo{constructor(){this.providerId=Qo.PROVIDER_ID}static credential(e,n){return bl._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=Hg.parseLink(n);return be(r,"argument-error"),bl._fromEmailAndCode(e,r.code,r.tenantId)}}Qo.PROVIDER_ID="password";Qo.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Qo.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class qg{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Fl extends qg{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class _i extends Fl{constructor(){super("facebook.com")}static credential(e){return Rs._fromParams({providerId:_i.PROVIDER_ID,signInMethod:_i.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return _i.credentialFromTaggedObject(e)}static credentialFromError(e){return _i.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return _i.credential(e.oauthAccessToken)}catch{return null}}}_i.FACEBOOK_SIGN_IN_METHOD="facebook.com";_i.PROVIDER_ID="facebook.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Vr extends Fl{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return Rs._fromParams({providerId:Vr.PROVIDER_ID,signInMethod:Vr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Vr.credentialFromTaggedObject(e)}static credentialFromError(e){return Vr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Vr.credential(n,r)}catch{return null}}}Vr.GOOGLE_SIGN_IN_METHOD="google.com";Vr.PROVIDER_ID="google.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class bi extends Fl{constructor(){super("github.com")}static credential(e){return Rs._fromParams({providerId:bi.PROVIDER_ID,signInMethod:bi.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return bi.credentialFromTaggedObject(e)}static credentialFromError(e){return bi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return bi.credential(e.oauthAccessToken)}catch{return null}}}bi.GITHUB_SIGN_IN_METHOD="github.com";bi.PROVIDER_ID="github.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Ei extends Fl{constructor(){super("twitter.com")}static credential(e,n){return Rs._fromParams({providerId:Ei.PROVIDER_ID,signInMethod:Ei.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Ei.credentialFromTaggedObject(e)}static credentialFromError(e){return Ei.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Ei.credential(n,r)}catch{return null}}}Ei.TWITTER_SIGN_IN_METHOD="twitter.com";Ei.PROVIDER_ID="twitter.com";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function cD(t,e){return Vl(t,"POST","/v1/accounts:signUp",ts(t,e))}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class Ds{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await or._fromIdTokenResponse(e,r,i),o=Ox(r);return new Ds({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=Ox(r);return new Ds({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function Ox(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class qc extends Dr{constructor(e,n,r,i){super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,qc.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new qc(e,n,r,i)}}function SI(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?qc._fromErrorAndOperation(t,s,e,r):s})}async function dD(t,e,n=!1){const r=await _l(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ds._forOperation(t,"link",r)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */async function hD(t,e,n=!1){const{auth:r}=t;if(wn(r.app))return Promise.reject(Gr(r));const i="reauthenticate";try{const s=await _l(t,SI(r,i,e,t),n);be(s.idToken,r,"internal-error");const o=zg(s.idToken);be(o,r,"internal-error");const{sub:a}=o;return be(t.uid===a,r,"user-mismatch"),Ds._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&er(r,"user-mismatch"),s}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function kI(t,e,n=!1){if(wn(t.app))return Promise.reject(Gr(t));const r="signIn",i=await SI(t,r,e),s=await Ds._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function fD(t,e){return kI(rs(t),e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function CI(t){const e=rs(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function pD(t,e,n){if(wn(t.app))return Promise.reject(Gr(t));const r=rs(t),o=await Dp(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",cD).catch(u=>{throw u.code==="auth/password-does-not-meet-requirements"&&CI(t),u}),a=await Ds._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function mD(t,e,n){return wn(t.app)?Promise.reject(Gr(t)):fD(Ft(t),Qo.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&CI(t),r})}function gD(t,e,n,r){return Ft(t).onIdTokenChanged(e,n,r)}function yD(t,e,n){return Ft(t).beforeAuthStateChanged(e,n)}function Tu(t){return Ft(t).signOut()}const Wc="__sak";/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class NI{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Wc,"1"),this.storage.removeItem(Wc),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const vD=1e3,xD=10;class AI extends NI{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=_I(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,u)=>{this.notifyListeners(o,u)});return}const r=e.key;n?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);V4()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,xD):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},vD)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}AI.type="LOCAL";const wD=AI;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class PI extends NI{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}PI.type="SESSION";const RI=PI;/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */function _D(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Bd{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new Bd(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async c=>c(n.origin,s)),u=await _D(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Bd.receivers=[];/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Wg(t="",e=10){let n="";for(let r=0;r{const c=Wg("",20);i.port1.start();const f=setTimeout(()=>{u(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(h){const p=h;if(p.data.eventId===c)switch(p.data.status){case"ack":clearTimeout(f),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(p.data.response);break;default:clearTimeout(f),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Nr(){return window}function ED(t){Nr().location.href=t}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */function DI(){return typeof Nr().WorkerGlobalScope<"u"&&typeof Nr().importScripts=="function"}async function ID(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function TD(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)==null?void 0:t.controller)||null}function SD(){return DI()?self:null}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */const jI="firebaseLocalStorageDb",kD=1,Gc="firebaseLocalStorage",OI="fbase_key";class Ul{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function $d(t,e){return t.transaction([Gc],e?"readwrite":"readonly").objectStore(Gc)}function CD(){const t=indexedDB.deleteDatabase(jI);return new Ul(t).toPromise()}function jp(){const t=indexedDB.open(jI,kD);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Gc,{keyPath:OI})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Gc)?e(r):(r.close(),await CD(),e(await jp()))})})}async function Lx(t,e,n){const r=$d(t,!0).put({[OI]:e,value:n});return new Ul(r).toPromise()}async function ND(t,e){const n=$d(t,!1).get(e),r=await new Ul(n).toPromise();return r===void 0?null:r.value}function Mx(t,e){const n=$d(t,!0).delete(e);return new Ul(n).toPromise()}const AD=800,PD=3;class LI{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await jp(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>PD)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return DI()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Bd._getInstance(SD()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await ID(),!this.activeServiceWorker)return;this.sender=new bD(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(n=e[0])!=null&&n.fulfilled&&(r=e[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||TD()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await jp();return await Lx(e,Wc,"1"),await Mx(e,Wc),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Lx(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>ND(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Mx(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=$d(i,!1).getAll();return new Ul(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),AD)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}LI.type="LOCAL";const RD=LI;new Ml(3e4,6e4);/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */function MI(t,e){return e?$r(e):(be(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** + * @license + * Copyright 2019 Google LLC + * + * 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. + */class Gg extends $g{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return xo(e,this._buildIdpRequest())}_linkToIdToken(e,n){return xo(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return xo(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function DD(t){return kI(t.auth,new Gg(t),t.bypassAuthState)}function jD(t){const{auth:e,user:n}=t;return be(n,e,"internal-error"),hD(n,new Gg(t),t.bypassAuthState)}async function OD(t){const{auth:e,user:n}=t;return be(n,e,"internal-error"),dD(n,new Gg(t),t.bypassAuthState)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class VI{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(u))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return DD;case"linkViaPopup":case"linkViaRedirect":return OD;case"reauthViaPopup":case"reauthViaRedirect":return jD;default:er(this.auth,"internal-error")}}resolve(e){ri(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ri(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const LD=new Ml(2e3,1e4);async function MD(t,e,n){if(wn(t.app))return Promise.reject(ur(t,"operation-not-supported-in-this-environment"));const r=rs(t);v4(t,e,qg);const i=MI(r,n);return new ys(r,"signInViaPopup",e,i).executeNotNull()}class ys extends VI{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,ys.currentPopupAction&&ys.currentPopupAction.cancel(),ys.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return be(e,this.auth,"internal-error"),e}async onExecution(){ri(this.filter.length===1,"Popup operations only handle one event");const e=Wg();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(ur(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(ur(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ys.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(ur(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,LD.get())};e()}}ys.currentPopupAction=null;/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const VD="pendingRedirect",Yu=new Map;class FD extends VI{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Yu.get(this.auth._key());if(!e){try{const r=await UD(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Yu.set(this.auth._key(),e)}return this.bypassAuthState||Yu.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function UD(t,e){const n=$D(e),r=BD(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function zD(t,e){Yu.set(t._key(),e)}function BD(t){return $r(t._redirectPersistence)}function $D(t){return Qu(VD,t.config.apiKey,t.name)}async function HD(t,e,n=!1){if(wn(t.app))return Promise.reject(Gr(t));const r=rs(t),i=MI(r,e),o=await new FD(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const qD=10*60*1e3;class WD{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!GD(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!FI(e)){const i=((r=e.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(ur(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=qD&&this.cachedEventUids.clear(),this.cachedEventUids.has(Vx(e))}saveEventToCache(e){this.cachedEventUids.add(Vx(e)),this.lastProcessedEventTime=Date.now()}}function Vx(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function FI({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function GD(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return FI(t);default:return!1}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */async function KD(t,e={}){return ns(t,"GET","/v1/projects",e)}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const QD=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,YD=/^https?/;async function XD(t){if(t.config.emulator)return;const{authorizedDomains:e}=await KD(t);for(const n of e)try{if(JD(n))return}catch{}er(t,"unauthorized-domain")}function JD(t){const e=Pp(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!YD.test(n))return!1;if(QD.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const ZD=new Ml(3e4,6e4);function Fx(){const t=Nr().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var i,s,o;function r(){Fx(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Fx(),n(ur(t,"network-request-failed"))},timeout:ZD.get()})}if((s=(i=Nr().gapi)==null?void 0:i.iframes)!=null&&s.Iframe)e(gapi.iframes.getContext());else if((o=Nr().gapi)!=null&&o.load)r();else{const a=G4("iframefcb");return Nr()[a]=()=>{gapi.load?r():n(ur(t,"network-request-failed"))},EI(`${W4()}?onload=${a}`).catch(u=>n(u))}}).catch(e=>{throw Xu=null,e})}let Xu=null;function tj(t){return Xu=Xu||ej(t),Xu}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const nj=new Ml(5e3,15e3),rj="__/auth/iframe",ij="emulator/auth/iframe",sj={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},oj=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function aj(t){const e=t.config;be(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Ug(e,ij):`https://${t.config.authDomain}/${rj}`,r={apiKey:e.apiKey,appName:t.name,v:Ms},i=oj.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${Pl(r).slice(1)}`}async function lj(t){const e=await tj(t),n=Nr().gapi;return be(n,t,"internal-error"),e.open({where:document.body,url:aj(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:sj,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=ur(t,"network-request-failed"),a=Nr().setTimeout(()=>{s(o)},nj.get());function u(){Nr().clearTimeout(a),i(r)}r.ping(u).then(u,()=>{s(o)})}))}/** + * @license + * Copyright 2020 Google LLC. + * + * 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. + */const uj={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},cj=500,dj=600,hj="_blank",fj="http://localhost";class Ux{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function pj(t,e,n,r=cj,i=dj){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u={...uj,width:r.toString(),height:i.toString(),top:s,left:o},c=cn().toLowerCase();n&&(a=gI(c)?hj:n),pI(c)&&(e=e||fj,u.scrollbars="yes");const f=Object.entries(u).reduce((p,[g,_])=>`${p}${g}=${_},`,"");if(M4(c)&&a!=="_self")return mj(e||"",a),new Ux(null);const h=window.open(e||"",a,f);be(h,t,"popup-blocked");try{h.focus()}catch{}return new Ux(h)}function mj(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const gj="__/auth/handler",yj="emulator/auth/handler",vj=encodeURIComponent("fac");async function zx(t,e,n,r,i,s){be(t.config.authDomain,t,"auth-domain-config-required"),be(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Ms,eventId:i};if(e instanceof qg){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",gC(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[f,h]of Object.entries({}))o[f]=h}if(e instanceof Fl){const f=e.getScopes().filter(h=>h!=="");f.length>0&&(o.scopes=f.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const f of Object.keys(a))a[f]===void 0&&delete a[f];const u=await t._getAppCheckToken(),c=u?`#${vj}=${encodeURIComponent(u)}`:"";return`${xj(t)}?${Pl(a).slice(1)}${c}`}function xj({config:t}){return t.emulator?Ug(t,yj):`https://${t.authDomain}/${gj}`}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */const Qh="webStorageSupport";class wj{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=RI,this._completeRedirectFn=HD,this._overrideRedirectResult=zD}async _openPopup(e,n,r,i){var o;ri((o=this.eventManagers[e._key()])==null?void 0:o.manager,"_initialize() not called before _openPopup()");const s=await zx(e,n,r,Pp(),i);return pj(e,s,Wg())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await zx(e,n,r,Pp(),i);return ED(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(ri(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await lj(e),r=new WD(e);return n.register("authEvent",i=>(be(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Qh,{type:Qh},i=>{var o;const s=(o=i==null?void 0:i[0])==null?void 0:o[Qh];s!==void 0&&n(!!s),er(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=XD(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return _I()||mI()||Bg()}}const _j=wj;var Bx="@firebase/auth",$x="1.11.1";/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */class bj{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){be(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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. + */function Ej(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Ij(t){Cs(new Bi("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;be(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:bI(t)},c=new $4(r,i,s,u);return Z4(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Cs(new Bi("auth-internal",e=>{const n=rs(e.getProvider("auth").getImmediate());return(r=>new bj(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ir(Bx,$x,Ej(t)),Ir(Bx,$x,"esm2020")}/** + * @license + * Copyright 2021 Google LLC + * + * 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. + */const Tj=5*60,Sj=xb("authIdTokenMaxAge")||Tj;let Hx=null;const kj=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Sj)return;const i=n==null?void 0:n.token;Hx!==i&&(Hx=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Cj(t=Qm()){const e=vd(t,"auth");if(e.isInitialized())return e.getImmediate();const n=J4(t,{popupRedirectResolver:_j,persistence:[RD,wD,RI]}),r=xb("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=kj(s.toString());yD(n,o,()=>o(n.currentUser)),gD(n,a=>o(a))}}const i=gb("auth");return i&&eD(n,`http://${i}`),n}function Nj(){var t;return((t=document.getElementsByTagName("head"))==null?void 0:t[0])??document}H4({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=ur("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",Nj().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Ij("Browser");const Aj={apiKey:"AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE",authDomain:"twistedbrody-9d163.firebaseapp.com",projectId:"twistedbrody-9d163",storageBucket:"twistedbrody-9d163.firebasestorage.app",messagingSenderId:"733213514129",appId:"1:733213514129:web:e9694684f5c3994ed06230",measurementId:"G-N8TQ7MY42W"},Kg=Eb(Aj),Ge=TR(Kg);h4(Kg);const mi=Cj(Kg),Pj=new Vr;function El(t){if(t!=null){if(Array.isArray(t)){const e=t.map(n=>El(n)).filter(n=>n!=null&&n!=="");return e.length>0?e:void 0}if(typeof t=="object"&&!(t instanceof Je)){const e={};for(const n in t)if(t.hasOwnProperty(n)){const r=El(t[n]);r!=null&&(e[n]=r)}return Object.keys(e).length>0?e:void 0}return t}}const zl={MANGA_PREFIX:"mangalib_detail_v2_"};function Hd(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(n){console.warn(`Error saving ${t} to localStorage`,n)}}function Rj(t){try{localStorage.removeItem(t)}catch(e){console.warn(`Error removing ${t} from localStorage`,e)}}async function qd(){const t=Ps(Xn(Ge,"mangas"),OR("created_at","desc")),e=await Wr(t),r=(await Wr(Xn(Ge,"categories"))).docs.reduce((o,a)=>(o[a.id]={id:a.id,...a.data()},o),{}),i=await Promise.all(e.docs.map(async o=>{var a,u;try{const c=o.data();let f=new Date().toISOString();(a=c.created_at)!=null&&a.toDate?f=c.created_at.toDate().toISOString():c.created_at&&(f=new Date(c.created_at).toISOString());let h=f;(u=c.updated_at)!=null&&u.toDate&&(h=c.updated_at.toDate().toISOString());const p=Ps(Xn(Ge,"chapters"),Ko("manga_id","==",o.id)),_=(await Wr(p)).docs.map(v=>{var L,D;const x=v.data(),E=(L=x.created_at)!=null&&L.toDate?x.created_at.toDate().toISOString():new Date().toISOString(),O=(D=x.updated_at)!=null&&D.toDate?x.updated_at.toDate().toISOString():new Date().toISOString();return{id:v.id,manga_id:x.manga_id,number:x.number,title:x.title,pages:x.pages||[],page_formats:x.page_formats||[],original_pages:x.original_pages||[],created_at:E,updated_at:O}}).sort((v,x)=>v.number-x.number),P=(c.categories||[]).map(v=>r[v]).filter(v=>v!==void 0);return{id:o.id,...c,created_at:f,updated_at:h,categories:P,chapters:_}}catch(c){return console.error(`[DATA ERROR] Skipping corrupt manga ${o.id}:`,c),null}})),s=i.filter(o=>o!==null);return console.log(`[DATA] Loaded ${s.length} mangas (Skipped ${i.length-s.length} corrupt)`),s}const Vo=new Map;async function UI(t){var f,h;const e=vt(Ge,"mangas",t),n=await hr(e);if(!n.exists())return null;const r=n.data(),i=Ps(Xn(Ge,"chapters"),Ko("manga_id","==",t)),o=(await Wr(i)).docs.map(p=>{const g=p.data();return{id:p.id,manga_id:g.manga_id,number:g.number,title:g.title,pages:g.pages||[],page_formats:g.page_formats||[],original_pages:g.original_pages||[],created_at:g.created_at.toDate().toISOString(),updated_at:g.updated_at.toDate().toISOString()}}).sort((p,g)=>p.number-g.number),a=r.categories||[],u=[];for(const p of a){const g=vt(Ge,"categories",p),_=await hr(g);_.exists()&&u.push({id:_.id,..._.data(),created_at:((h=(f=_.data().created_at)==null?void 0:f.toDate)==null?void 0:h.call(f).toISOString())||new Date().toISOString()})}const c={id:n.id,...r,created_at:r.created_at.toDate().toISOString(),categories:u,chapters:o,updated_at:r.updated_at?r.updated_at.toDate().toISOString():r.created_at.toDate().toISOString()};return Vo.set(t,c),Hd(`${zl.MANGA_PREFIX}${t}`,c),c}function Dj(t,e){const n=vt(Ge,"mangas",t);return Mg(n,async r=>{if(!r.exists()){e(null);return}const i=r.data();let s=Vo.get(t),o=(s==null?void 0:s.chapters)||[],a=(s==null?void 0:s.categories)||[];if(!s){const c=Ps(Xn(Ge,"chapters"),Ko("manga_id","==",t));o=(await Wr(c)).docs.map(p=>({id:p.id,...p.data(),created_at:p.data().created_at.toDate().toISOString(),updated_at:p.data().updated_at.toDate().toISOString()})).sort((p,g)=>p.number-g.number);const h=i.categories||[];a=[];for(const p of h){const g=await hr(vt(Ge,"categories",p));g.exists()&&a.push({id:g.id,...g.data()})}}const u={id:r.id,...i,chapters:o,categories:a,created_at:i.created_at.toDate().toISOString(),updated_at:i.updated_at?i.updated_at.toDate().toISOString():i.created_at.toDate().toISOString()};Vo.set(t,u),Hd(`${zl.MANGA_PREFIX}${t}`,u),e(u)})}async function jj(t){const e=Je.now(),n={title:t.title,author:t.author,description:t.description||"",status:t.status||"En curso",categories:t.categoryIds||[],views:0,rating:0,created_at:e,updated_at:e};t.thumbnail_url&&(n.thumbnail_url=t.thumbnail_url),t.cover_url&&(n.cover_url=t.cover_url);const r=await Lg(Xn(Ge,"mangas"),n),i=new Date().toISOString(),s={id:r.id,title:t.title,author:t.author,description:t.description||"",status:t.status||"En curso",categories:t.categoryIds||[],chapters:[],views:0,rating:0,created_at:i,updated_at:i};return t.thumbnail_url&&(s.thumbnail_url=t.thumbnail_url),t.cover_url&&(s.cover_url=t.cover_url),Vo.set(s.id,s),Hd(`${zl.MANGA_PREFIX}${s.id}`,s),s}async function zI(){return(await Wr(Xn(Ge,"categories"))).docs.map(e=>({id:e.id,...e.data()}))}async function BI(t,e="genre"){const n=await Lg(Xn(Ge,"categories"),{name:t,type:e}),r=await hr(n);return{id:r.id,...r.data()}}async function $I(t){const e=vt(Ge,"categories",t);await Ap(e);const n=Ps(Xn(Ge,"mangas"),Ko("categories","array-contains",t)),i=(await Wr(n)).docs.map(s=>{const u=(s.data().categories||[]).filter(c=>c!==t);return si(vt(Ge,"mangas",s.id),{categories:u})});await Promise.all(i)}async function qx(t){const e=Je.now(),n=await Lg(Xn(Ge,"chapters"),{manga_id:t.manga_id,number:t.number,title:t.title,pages:t.pages,page_formats:t.page_formats||[],original_pages:t.original_pages||[],created_at:e,updated_at:e}),r=await hr(n),i=r.data();return{id:r.id,manga_id:i.manga_id,number:i.number,title:i.title,pages:i.pages||[],page_formats:i.page_formats||[],original_pages:i.original_pages||[],created_at:i.created_at.toDate().toISOString(),updated_at:i.updated_at.toDate().toISOString()}}async function Oj(){const e=(await qd()).map(n=>{const r=vt(Ge,"mangas",n.id);return si(r,{views:0})});await Promise.all(e)}async function Lj(t){const e=vt(Ge,"mangas",t);await si(e,{views:UR(1)})}async function HI(t,e){var _,S;const n=vt(Ge,"mangas",t),r=Je.now(),i={title:e.title,author:e.author,categories:e.categoryIds||[],updated_at:r};e.status&&(i.status=e.status),e.description!==void 0&&e.description!==null&&(i.description=e.description),e.thumbnail_url&&(i.thumbnail_url=e.thumbnail_url),e.cover_url&&(i.cover_url=e.cover_url);const s=El(i);await si(n,s);const o=await hr(n);if(!o.exists())throw new Error("Manga no encontrado");const a=o.data(),u=Ps(Xn(Ge,"chapters"),Ko("manga_id","==",t)),f=(await Wr(u)).docs.map(P=>{const v=P.data();return{id:P.id,manga_id:v.manga_id,number:v.number,title:v.title,pages:v.pages||[],page_formats:v.page_formats||[],original_pages:v.original_pages||[],created_at:v.created_at.toDate().toISOString(),updated_at:v.updated_at.toDate().toISOString()}}).sort((P,v)=>P.number-v.number),h=a.categories||[],p=[];for(const P of h){const v=vt(Ge,"categories",P),x=await hr(v);x.exists()&&p.push({id:x.id,...x.data(),created_at:((S=(_=x.data().created_at)==null?void 0:_.toDate)==null?void 0:S.call(_).toISOString())||new Date().toISOString()})}const g={id:o.id,...a,created_at:a.created_at.toDate().toISOString(),categories:p,chapters:f,updated_at:a.updated_at.toDate().toISOString()};return Vo.set(g.id,g),Hd(`${zl.MANGA_PREFIX}${g.id}`,g),g}async function Mj(t){const e=vt(Ge,"mangas",t),n=Ps(Xn(Ge,"chapters"),Ko("manga_id","==",t)),r=await Wr(n);for(const i of r.docs)await Ap(i.ref);await Ap(e),Vo.delete(t),Rj(`${zl.MANGA_PREFIX}${t}`)}async function Vj(t,e){const n=vt(Ge,"mangas",t),r=await hr(n);if(!r.exists())throw new Error("Manga no encontrado");const s={external_links:[...r.data().external_links||[],e]},o=El(s);await si(n,o)}async function Fj(t,e){const n=vt(Ge,"mangas",t),r=await hr(n);if(!r.exists())throw new Error("Manga no encontrado");const s={external_links:(r.data().external_links||[]).filter((a,u)=>u!==e)},o=El(s);await si(n,o)}async function Uj(t,e,n,r){const s=(await qd()).filter(o=>o.id!==t).map(o=>{var S,P;let a=0;const u=((S=o.categories)==null?void 0:S.map(v=>v.id))||[],c=e.filter(v=>u.includes(v));a+=c.length*10;const f=n.toLowerCase().split(/\s+/).filter(v=>v.length>2),h=o.title.toLowerCase().split(/\s+/).filter(v=>v.length>2),p=f.filter(v=>h.includes(v));a+=p.length*5;const g=((P=o.author)==null?void 0:P.toLowerCase().split(/\s+/).filter(v=>v.length>2))||[],_=f.filter(v=>g.includes(v));return a+=_.length*3,{manga:o,score:a}}).filter(o=>o.score>0).sort((o,a)=>{const u=o.manga.title.toLowerCase(),c=a.manga.title.toLowerCase();return u.localeCompare(c)}).map(o=>o.manga);return r?s.slice(0,r):s}function zj(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const Bj=t=>{switch(t){case"success":return qj;case"info":return Gj;case"warning":return Wj;case"error":return Kj;default:return null}},$j=Array(12).fill(0),Hj=({visible:t,className:e})=>re.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},re.createElement("div",{className:"sonner-spinner"},$j.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),qj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Wj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Gj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Kj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Qj=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Yj=()=>{const[t,e]=re.useState(document.hidden);return re.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Op=1;class Xj{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Op++,o=this.toasts.find(u=>u.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...e,id:s,title:r}),{...u,...e,id:s,dismissible:a,title:r}):u):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],re.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(Zj(c)&&!c.ok){s=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,_=typeof h=="object"&&!re.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,..._})}else if(c instanceof Error){s=!1;const h=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,_=typeof h=="object"&&!re.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,..._})}else if(n.success!==void 0){s=!1;const h=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,_=typeof h=="object"&&!re.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:p,..._})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(c):n.error,h=typeof n.description=="function"?await n.description(c):n.description,g=typeof f=="object"&&!re.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((c,f)=>a.then(()=>o[0]==="reject"?f(o[1]):c(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||Op++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const yn=new Xj,Jj=(t,e)=>{const n=(e==null?void 0:e.id)||Op++;return yn.addToast({title:t,...e,id:n}),n},Zj=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",e3=Jj,t3=()=>yn.toasts,n3=()=>yn.getActiveToasts(),Ct=Object.assign(e3,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:t3,getToasts:n3});zj("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Su(t){return t.label!==void 0}const r3=3,i3="24px",s3="16px",Wx=4e3,o3=356,a3=14,l3=45,u3=200;function gr(...t){return t.filter(Boolean).join(" ")}function c3(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const d3=t=>{var e,n,r,i,s,o,a,u,c;const{invert:f,toast:h,unstyled:p,interacting:g,setHeights:_,visibleToasts:S,heights:P,index:v,toasts:x,expanded:E,removeToast:O,defaultRichColors:L,closeButton:D,style:b,cancelButtonStyle:w,actionButtonStyle:T,className:A="",descriptionClassName:N="",duration:j,position:C,gap:se,expandByDefault:he,classNames:le,icons:me,closeButtonAriaLabel:q="Close toast"}=t,[oe,k]=re.useState(null),[ge,ye]=re.useState(null),[R,$]=re.useState(!1),[Z,ie]=re.useState(!1),[Te,fe]=re.useState(!1),[Fe,ee]=re.useState(!1),[Ce,tt]=re.useState(!1),[Dt,jt]=re.useState(0),[te,ve]=re.useState(0),Ae=re.useRef(h.duration||j||Wx),Le=re.useRef(null),we=re.useRef(null),Qe=v===0,Ht=v+1<=S,Xe=h.type,ht=h.dismissible!==!1,tn=h.className||"",qt=h.descriptionClassName||"",z=re.useMemo(()=>P.findIndex(_e=>_e.toastId===h.id)||0,[P,h.id]),V=re.useMemo(()=>{var _e;return(_e=h.closeButton)!=null?_e:D},[h.closeButton,D]),B=re.useMemo(()=>h.duration||j||Wx,[h.duration,j]),K=re.useRef(0),J=re.useRef(0),je=re.useRef(0),Ue=re.useRef(null),[De,H]=C.split("-"),Q=re.useMemo(()=>P.reduce((_e,Pe,wt)=>wt>=z?_e:_e+Pe.height,0),[P,z]),de=Yj(),Ie=h.invert||f,pe=Xe==="loading";J.current=re.useMemo(()=>z*se+Q,[z,Q]),re.useEffect(()=>{Ae.current=B},[B]),re.useEffect(()=>{$(!0)},[]),re.useEffect(()=>{const _e=we.current;if(_e){const Pe=_e.getBoundingClientRect().height;return ve(Pe),_(wt=>[{toastId:h.id,height:Pe,position:h.position},...wt]),()=>_(wt=>wt.filter(Wt=>Wt.toastId!==h.id))}},[_,h.id]),re.useLayoutEffect(()=>{if(!R)return;const _e=we.current,Pe=_e.style.height;_e.style.height="auto";const wt=_e.getBoundingClientRect().height;_e.style.height=Pe,ve(wt),_(Wt=>Wt.find(_t=>_t.toastId===h.id)?Wt.map(_t=>_t.toastId===h.id?{..._t,height:wt}:_t):[{toastId:h.id,height:wt,position:h.position},...Wt])},[R,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const qe=re.useCallback(()=>{ie(!0),jt(J.current),_(_e=>_e.filter(Pe=>Pe.toastId!==h.id)),setTimeout(()=>{O(h)},u3)},[h,O,_,J]);re.useEffect(()=>{if(h.promise&&Xe==="loading"||h.duration===1/0||h.type==="loading")return;let _e;return E||g||de?(()=>{if(je.current{Ae.current!==1/0&&(K.current=new Date().getTime(),_e=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),qe()},Ae.current))})(),()=>clearTimeout(_e)},[E,g,h,Xe,de,qe]),re.useEffect(()=>{h.delete&&(qe(),h.onDismiss==null||h.onDismiss.call(h,h))},[qe,h.delete]);function nt(){var _e;if(me!=null&&me.loading){var Pe;return re.createElement("div",{className:gr(le==null?void 0:le.loader,h==null||(Pe=h.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":Xe==="loading"},me.loading)}return re.createElement(Hj,{className:gr(le==null?void 0:le.loader,h==null||(_e=h.classNames)==null?void 0:_e.loader),visible:Xe==="loading"})}const ft=h.icon||(me==null?void 0:me[Xe])||Bj(Xe);var xt,Or;return re.createElement("li",{tabIndex:0,ref:we,className:gr(A,tn,le==null?void 0:le.toast,h==null||(e=h.classNames)==null?void 0:e.toast,le==null?void 0:le.default,le==null?void 0:le[Xe],h==null||(n=h.classNames)==null?void 0:n[Xe]),"data-sonner-toast":"","data-rich-colors":(xt=h.richColors)!=null?xt:L,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":R,"data-promise":!!h.promise,"data-swiped":Ce,"data-removed":Z,"data-visible":Ht,"data-y-position":De,"data-x-position":H,"data-index":v,"data-front":Qe,"data-swiping":Te,"data-dismissible":ht,"data-type":Xe,"data-invert":Ie,"data-swipe-out":Fe,"data-swipe-direction":ge,"data-expanded":!!(E||he&&R),"data-testid":h.testId,style:{"--index":v,"--toasts-before":v,"--z-index":x.length-v,"--offset":`${Z?Dt:J.current}px`,"--initial-height":he?"auto":`${te}px`,...b,...h.style},onDragEnd:()=>{fe(!1),k(null),Ue.current=null},onPointerDown:_e=>{_e.button!==2&&(pe||!ht||(Le.current=new Date,jt(J.current),_e.target.setPointerCapture(_e.pointerId),_e.target.tagName!=="BUTTON"&&(fe(!0),Ue.current={x:_e.clientX,y:_e.clientY})))},onPointerUp:()=>{var _e,Pe,wt;if(Fe||!ht)return;Ue.current=null;const Wt=Number(((_e=we.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Nn=Number(((Pe=we.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((wt=Le.current)==null?void 0:wt.getTime()),Gt=oe==="x"?Wt:Nn,Bn=Math.abs(Gt)/_t;if(Math.abs(Gt)>=l3||Bn>.11){jt(J.current),h.onDismiss==null||h.onDismiss.call(h,h),ye(oe==="x"?Wt>0?"right":"left":Nn>0?"down":"up"),qe(),ee(!0);return}else{var Kt,Me;(Kt=we.current)==null||Kt.style.setProperty("--swipe-amount-x","0px"),(Me=we.current)==null||Me.style.setProperty("--swipe-amount-y","0px")}tt(!1),fe(!1),k(null)},onPointerMove:_e=>{var Pe,wt,Wt;if(!Ue.current||!ht||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;const _t=_e.clientY-Ue.current.y,Gt=_e.clientX-Ue.current.x;var Bn;const Kt=(Bn=t.swipeDirections)!=null?Bn:c3(C);!oe&&(Math.abs(Gt)>1||Math.abs(_t)>1)&&k(Math.abs(Gt)>Math.abs(_t)?"x":"y");let Me={x:0,y:0};const oi=An=>1/(1.5+Math.abs(An)/20);if(oe==="y"){if(Kt.includes("top")||Kt.includes("bottom"))if(Kt.includes("top")&&_t<0||Kt.includes("bottom")&&_t>0)Me.y=_t;else{const An=_t*oi(_t);Me.y=Math.abs(An)0)Me.x=Gt;else{const An=Gt*oi(Gt);Me.x=Math.abs(An)0||Math.abs(Me.y)>0)&&tt(!0),(wt=we.current)==null||wt.style.setProperty("--swipe-amount-x",`${Me.x}px`),(Wt=we.current)==null||Wt.style.setProperty("--swipe-amount-y",`${Me.y}px`)}},V&&!h.jsx&&Xe!=="loading"?re.createElement("button",{"aria-label":q,"data-disabled":pe,"data-close-button":!0,onClick:pe||!ht?()=>{}:()=>{qe(),h.onDismiss==null||h.onDismiss.call(h,h)},className:gr(le==null?void 0:le.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Or=me==null?void 0:me.close)!=null?Or:Qj):null,(Xe||h.icon||h.promise)&&h.icon!==null&&((me==null?void 0:me[Xe])!==null||h.icon)?re.createElement("div",{"data-icon":"",className:gr(le==null?void 0:le.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||nt():null,h.type!=="loading"?ft:null):null,re.createElement("div",{"data-content":"",className:gr(le==null?void 0:le.content,h==null||(s=h.classNames)==null?void 0:s.content)},re.createElement("div",{"data-title":"",className:gr(le==null?void 0:le.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?re.createElement("div",{"data-description":"",className:gr(N,qt,le==null?void 0:le.description,h==null||(a=h.classNames)==null?void 0:a.description)},typeof h.description=="function"?h.description():h.description):null),re.isValidElement(h.cancel)?h.cancel:h.cancel&&Su(h.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||w,onClick:_e=>{Su(h.cancel)&&ht&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,_e),qe())},className:gr(le==null?void 0:le.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,re.isValidElement(h.action)?h.action:h.action&&Su(h.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||T,onClick:_e=>{Su(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,_e),!_e.defaultPrevented&&qe())},className:gr(le==null?void 0:le.actionButton,h==null||(c=h.classNames)==null?void 0:c.actionButton)},h.action.label):null)};function Gx(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function h3(t,e){const n={};return[t,e].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?s3:i3;function u(c){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(a)}),n}const f3=re.forwardRef(function(e,n){const{id:r,invert:i,position:s="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:u,className:c,offset:f,mobileOffset:h,theme:p="light",richColors:g,duration:_,style:S,visibleToasts:P=r3,toastOptions:v,dir:x=Gx(),gap:E=a3,icons:O,containerAriaLabel:L="Notifications"}=e,[D,b]=re.useState([]),w=re.useMemo(()=>r?D.filter(R=>R.toasterId===r):D.filter(R=>!R.toasterId),[D,r]),T=re.useMemo(()=>Array.from(new Set([s].concat(w.filter(R=>R.position).map(R=>R.position)))),[w,s]),[A,N]=re.useState([]),[j,C]=re.useState(!1),[se,he]=re.useState(!1),[le,me]=re.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=re.useRef(null),oe=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=re.useRef(null),ge=re.useRef(!1),ye=re.useCallback(R=>{b($=>{var Z;return(Z=$.find(ie=>ie.id===R.id))!=null&&Z.delete||yn.dismiss(R.id),$.filter(({id:ie})=>ie!==R.id)})},[]);return re.useEffect(()=>yn.subscribe(R=>{if(R.dismiss){requestAnimationFrame(()=>{b($=>$.map(Z=>Z.id===R.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{_2.flushSync(()=>{b($=>{const Z=$.findIndex(ie=>ie.id===R.id);return Z!==-1?[...$.slice(0,Z),{...$[Z],...R},...$.slice(Z+1)]:[R,...$]})})})}),[D]),re.useEffect(()=>{if(p!=="system"){me(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?me("dark"):me("light")),typeof window>"u")return;const R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:$})=>{me($?"dark":"light")})}catch{R.addListener(({matches:Z})=>{try{me(Z?"dark":"light")}catch(ie){console.error(ie)}})}},[p]),re.useEffect(()=>{D.length<=1&&C(!1)},[D]),re.useEffect(()=>{const R=$=>{var Z;if(o.every(fe=>$[fe]||$.code===fe)){var Te;C(!0),(Te=q.current)==null||Te.focus()}$.code==="Escape"&&(document.activeElement===q.current||(Z=q.current)!=null&&Z.contains(document.activeElement))&&C(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o]),re.useEffect(()=>{if(q.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,ge.current=!1)}},[q.current]),re.createElement("section",{ref:n,"aria-label":`${L} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((R,$)=>{var Z;const[ie,Te]=R.split("-");return w.length?re.createElement("ol",{key:R,dir:x==="auto"?Gx():x,tabIndex:-1,ref:q,className:c,"data-sonner-toaster":!0,"data-sonner-theme":le,"data-y-position":ie,"data-x-position":Te,style:{"--front-toast-height":`${((Z=A[0])==null?void 0:Z.height)||0}px`,"--width":`${o3}px`,"--gap":`${E}px`,...S,...h3(f,h)},onBlur:fe=>{ge.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(ge.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||ge.current||(ge.current=!0,k.current=fe.relatedTarget)},onMouseEnter:()=>C(!0),onMouseMove:()=>C(!0),onMouseLeave:()=>{se||C(!1)},onDragEnd:()=>C(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},w.filter(fe=>!fe.position&&$===0||fe.position===R).map((fe,Fe)=>{var ee,Ce;return re.createElement(d3,{key:fe.id,icons:O,index:Fe,toast:fe,defaultRichColors:g,duration:(ee=v==null?void 0:v.duration)!=null?ee:_,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:i,visibleToasts:P,closeButton:(Ce=v==null?void 0:v.closeButton)!=null?Ce:u,interacting:se,position:R,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:ye,toasts:w.filter(tt=>tt.position==fe.position),heights:A.filter(tt=>tt.position==fe.position),setHeights:N,expandByDefault:a,gap:E,expanded:j,swipeDirections:e.swipeDirections})})):null}))});function ki({label:t,type:e,categories:n,selectedIds:r,onSelect:i,onRemove:s,onCreate:o,onDeleteCategory:a,colorClass:u,placeholder:c="Añadir..."}){const[f,h]=F.useState(""),[p,g]=F.useState(!1),_=F.useRef(null),S=F.useMemo(()=>n.filter(D=>D.type===e||!D.type&&e==="genre"),[n,e]),P=F.useMemo(()=>f.trim()?S.filter(D=>D.name.toLowerCase().includes(f.toLowerCase())):S,[S,f]);F.useEffect(()=>{const D=b=>{_.current&&!_.current.contains(b.target)&&g(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const v=D=>{D.key==="Enter"&&(D.preventDefault(),x())},x=()=>{if(!f.trim())return;const D=S.find(b=>b.name.toLowerCase()===f.trim().toLowerCase());D?r.includes(D.id)||i(D.id):o(f.trim()),h(""),g(!1)},E=(D,b)=>{D.stopPropagation(),Ct("¿Eliminar esta categoría permanentemente?",{description:"Esta acción no se puede deshacer.",action:{label:"Eliminar",onClick:()=>a(b)},cancel:{label:"Cancelar",onClick:()=>{}},duration:5e3})},L=u.includes("blue")?{bg:"bg-blue-500/20",text:"text-blue-300",border:"border-blue-500/30"}:u.includes("green")?{bg:"bg-green-500/20",text:"text-green-300",border:"border-green-500/30"}:u.includes("purple")?{bg:"bg-purple-500/20",text:"text-purple-300",border:"border-purple-500/30"}:u.includes("pink")?{bg:"bg-pink-500/20",text:"text-pink-300",border:"border-pink-500/30"}:{bg:"bg-gray-500/20",text:"text-gray-300",border:"border-gray-500/30"};return d.jsxs("div",{className:"space-y-3 mb-6",ref:_,children:[d.jsx("label",{className:`text-xs uppercase font-bold tracking-wider ${u}`,children:t}),d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx("input",{type:"text",value:f,onChange:D=>{h(D.target.value),g(!0)},onFocus:()=>g(!0),onKeyDown:v,placeholder:c,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all"}),f&&d.jsx("button",{onClick:()=>h(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white",children:d.jsx(Vn,{className:"w-3 h-3"})})]}),d.jsx("button",{onClick:x,disabled:!f.trim(),className:"bg-[#bb86fc]/20 hover:bg-[#bb86fc]/30 text-[#bb86fc] px-3 rounded-lg transition-all",children:d.jsx(fl,{className:"w-5 h-5"})})]}),p&&(P.length>0||f)&&d.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#1a1a1a] border border-gray-700/50 rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto w-full custom-scrollbar",children:P.length>0?P.map(D=>{const b=r.includes(D.id);return d.jsxs("div",{className:"flex items-center justify-between px-4 py-2 hover:bg-white/5 cursor-pointer group",onClick:()=>{b||(i(D.id),h(""),g(!1))},children:[d.jsx("span",{className:`text-sm ${b?"text-[#bb86fc]":"text-gray-300"}`,children:D.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[b&&d.jsx(fd,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsx("button",{onClick:w=>E(w,D.id),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-500/20 text-gray-500 hover:text-red-400 rounded transition-all",title:"Eliminar permanentemente",children:d.jsx(zr,{className:"w-3.5 h-3.5"})})]})]},D.id)}):d.jsxs("div",{className:"px-4 py-3 text-center",children:[d.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"No encontrado."}),d.jsxs("button",{onClick:x,className:"text-xs text-[#bb86fc] hover:underline font-semibold",children:['Crear "',f,'"']})]})})]}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:r.map(D=>{const b=n.find(w=>w.id===D);return!b||b.type!==e&&!(e==="genre"&&!b.type)?null:d.jsxs("span",{className:`px-3 py-1 ${L.bg} ${L.text} text-xs rounded-full border ${L.border} flex items-center gap-2`,children:[b.name,d.jsx("button",{onClick:()=>s(D),className:"hover:text-white",children:d.jsx(Vn,{className:"w-3 h-3"})})]},D)})})]})}function bs({size:t=40,borderWidth:e=2,className:n=""}){return d.jsx("div",{className:`flex items-center justify-center ${n}`,children:d.jsx("div",{className:"relative",style:{width:`${t}px`,height:`${t}px`},children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:`${t}px`,height:`${t}px`,borderWidth:`${e}px`,borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.3)",borderTopColor:"#bb86fc",animation:"spin 1.2s linear infinite",boxShadow:"0 0 20px rgba(139, 92, 246, 0.2)"}})})})}function p3({isOpen:t,onClose:e,onMangaCreated:n,editingManga:r,onDelete:i}){const[s,o]=F.useState({title:"",name:"",description:"",selectedCategories:[]}),[a,u]=F.useState(null),[c,f]=F.useState(!1),[h,p]=F.useState(null),[g,_]=F.useState([]),[S,P]=F.useState(!1),[v,x]=F.useState([]),[E,O]=F.useState(!1),[L,D]=F.useState(null),[b,w]=F.useState(0),[T,A]=F.useState(!1),[N,j]=F.useState(0),[C,se]=F.useState(0),[he,le]=F.useState(0),[me,q]=F.useState(0),[oe,k]=F.useState(0),[ge,ye]=F.useState(!1),[R,$]=F.useState(null),[Z,ie]=F.useState(null),[Te,fe]=F.useState(!1),[Fe,ee]=F.useState(hb()),Ce=!!r;F.useEffect(()=>{var V,B;if(t&&(tt(),r)){o({title:r.title,name:r.author,description:r.description||"",selectedCategories:((V=r.categories)==null?void 0:V.map(J=>typeof J=="string"?J:J.id))||[]}),r.thumbnail_url&&p(r.thumbnail_url);const K=(B=r.chapters)==null?void 0:B[0];if(K!=null&&K.pages&&K.pages.length>0){const J=K.pages,je=K.original_pages||[],Ue=J.map((De,H)=>{var Q;return{thumbnail:De,original:je[H]||De,webpDisplay:De,webpCover:De,originalFormat:((Q=K.page_formats)==null?void 0:Q[H])||"jpg",originalBase64:"",originalUnmodified:""}});x(Ue)}}},[t,r]);async function tt(){try{const V=await zI();_(V)}catch(V){console.error("Error loading categories:",V)}}const Dt=async V=>{const{name:B,value:K}=V.target;o(J=>({...J,[B]:K}))},jt=V=>{o(B=>({...B,selectedCategories:B.selectedCategories.filter(K=>K!==V)}))},te=async(V,B)=>{if(V.trim()){if(B==="tag"){const K=V.split(" ").map(J=>J.trim()).filter(J=>J.length>0);for(const J of K)await ve(J,B);return}await ve(V,B)}},ve=async(V,B)=>{try{const K=g.find(J=>J.name.toLowerCase()===V.trim().toLowerCase()&&J.type===B);if(K)o(J=>J.selectedCategories.includes(K.id)?J:{...J,selectedCategories:[...J.selectedCategories,K.id]});else{const J=await BI(V.trim(),B);_(je=>je.find(Ue=>Ue.id===J.id)?je:[...je,J]),o(je=>je.selectedCategories.includes(J.id)?je:{...je,selectedCategories:[...je.selectedCategories,J.id]})}}catch(K){console.error("Error creating category:",K)}},Ae=async V=>{try{await $I(V),_(B=>B.filter(K=>K.id!==V)),o(B=>({...B,selectedCategories:B.selectedCategories.filter(K=>K!==V)}))}catch(B){console.error("Error deleting category:",B),alert("Error al eliminar la categoría")}},Le=async V=>{var K;const B=(K=V.target.files)==null?void 0:K[0];if(B){f(!0);try{const J=await lv(B);u(J),p(J.originalUnmodified)}catch(J){console.error("Error processing image:",J),alert("Error al procesar la imagen. Intenta con otro archivo.")}finally{f(!1)}}},we=async V=>{const B=V.target.files;if(!(!B||B.length===0)){O(!0),le(0),q(0),k(B.length);try{const K=Array.from(B);let J=0;const je=10,Ue=[];let De=0;const H=async()=>{if(De>=K.length)return;const pe=De++,qe=K[pe];try{const nt=await lv(qe,pe+1,K.length);Ue[pe]=nt}catch(nt){console.error(`Error processing image ${qe.name}:`,nt),Ue[pe]=null}finally{J++,le(Math.round(J/K.length*100)),q(J),await H()}},Q=[];for(let pe=0;pepe!==null);x(pe=>[...pe,...Ie])}catch(K){console.error("Error processing pages:",K),alert("Error al procesar algunas imágenes.")}finally{O(!1),le(0),q(0),k(0),V.target.value=""}}},Qe=V=>{x(B=>B.filter((K,J)=>J!==V))},Ht=V=>{D(V)},Xe=(V,B)=>{if(V.preventDefault(),L===null||L===B)return;const K=[...v],J=K[L];K.splice(L,1),K.splice(B,0,J),x(K),D(B)},ht=()=>{D(null)},tn=async()=>{var V,B,K,J,je;if(!s.title||!s.title.trim()){alert("El título es requerido");return}P(!0);try{let Ue=[...s.selectedCategories],De=(r==null?void 0:r.thumbnail_url)||void 0,H=(r==null?void 0:r.cover_url)||void 0;if(Z)De=Z.thumbnail,H=Z.original;else if(a)try{A(!0),se(2),j(1),w(0);const Q=await Sc(a.thumbnail,`${s.title}_thumb`);w(50),j(2);const de=await Sc(a.originalUnmodified,`${s.title}_cover`);w(100),De=Q.data.url,H=de.data.url}catch(Q){console.error("Error uploading cover images:",Q),Q.message==="API_BURNED"?alert("⚠️ API QUEMADA: La API de ImgBB ha alcanzado su límite. Por favor, usa otra API o intenta más tarde."):Q.message==="API_INVALID_KEY"?alert("❌ Clave API inválida: La clave API que estás usando no es válida."):alert("Error al subir la portada. Continuar sin portada.")}finally{A(!1),w(0)}if(Ce&&r){const Q={title:s.title.trim(),author:((V=s.name)==null?void 0:V.trim())||"",description:((B=s.description)==null?void 0:B.trim())||"",categoryIds:Ue};if(De&&(Q.thumbnail_url=De),H&&(Q.cover_url=H),await HI(r.id,Q),v.length>0){const de=v.some(Ie=>Ie.originalBase64!=="");if(v.length>0)try{A(!0);const Ie=v.filter(Me=>Me.originalBase64!=="");se(Ie.length*2),j(0),w(0);const pe=Ie.map(Me=>Me.webpDisplay),qe=Ie.map(Me=>Me.originalUnmodified),nt=Ie.map(Me=>Me.originalFormat),ft=await yu(pe,`${s.title}_updated_webp`,(Me,oi)=>{j(Me),w(Math.round(Me/(Ie.length*2)*100))}),xt=await yu(qe,`${s.title}_updated_original`,(Me,oi)=>{j(Ie.length+Me),w(Math.round((Ie.length+Me)/(Ie.length*2)*100))}),Or=ft.map(Me=>Me.data.url),_e=xt.map(Me=>Me.data.url),Pe=v.filter(Me=>Me.originalBase64===""),wt=Pe.map(Me=>Me.webpDisplay),Wt=Pe.map(Me=>Me.original),Nn=Pe.map(Me=>Me.originalFormat),_t=[...wt,...Or],Gt=[...Wt,..._e],Bn=[...Nn,...nt];A(!1),w(0);const Kt=(K=r.chapters)==null?void 0:K[0];Kt?await si(vt(Ge,"chapters",Kt.id),{pages:_t,page_formats:Bn,original_pages:Gt,updated_at:Je.now()}):await qx({manga_id:r.id,number:1,title:"Páginas",pages:_t,page_formats:Bn,original_pages:Gt})}catch(Ie){console.error("Error updating chapter:",Ie),Ie.message==="API_BURNED"?alert("⚠️ API QUEMADA: La API de ImgBB ha alcanzado su límite. Por favor, usa otra API o intenta más tarde."):Ie.message==="API_INVALID_KEY"?alert("❌ Clave API inválida: La clave API que estás usando no es válida."):alert("Error al actualizar las páginas.")}}n(r.id)}else{const Q={title:s.title.trim(),author:((J=s.name)==null?void 0:J.trim())||"",categoryIds:Ue};(je=s.description)!=null&&je.trim()&&(Q.description=s.description.trim()),De&&(Q.thumbnail_url=De),H&&(Q.cover_url=H);const de=await jj(Q);if(!de.id)throw new Error("No se pudo obtener el ID del manga creado");const Ie=de.id;if(v.length>0)try{A(!0),se(v.length*2),j(0),w(0);const pe=v.map(Pe=>Pe.webpDisplay),qe=v.map(Pe=>Pe.originalUnmodified),nt=v.map(Pe=>Pe.originalFormat),ft=await yu(pe,`${s.title}_ch1_webp`,(Pe,wt)=>{j(Pe),w(Math.round(Pe/(v.length*2)*100))}),xt=await yu(qe,`${s.title}_ch1_original`,(Pe,wt)=>{j(v.length+Pe),w(Math.round((v.length+Pe)/(v.length*2)*100))}),Or=ft.map(Pe=>Pe.data.url),_e=xt.map(Pe=>Pe.data.url);A(!1),w(0),await qx({manga_id:Ie,number:1,title:"Páginas",pages:Or,page_formats:nt,original_pages:_e})}catch(pe){console.error("Error creating chapter:",pe),pe.message==="API_BURNED"?alert("⚠️ API QUEMADA: La API de ImgBB ha alcanzado su límite. Por favor, usa otra API o intenta más tarde."):pe.message==="API_INVALID_KEY"?alert("❌ Clave API inválida: La clave API que estás usando no es válida."):alert("Error al crear el capítulo. Por favor intenta de nuevo.")}n(Ie)}z()}catch(Ue){console.error("Error creating/updating manga:",Ue);let De="Error al guardar el manga. ";if(Ue.message)De+=Ue.message;else if(Ue.code)switch(Ue.code){case"permission-denied":De+="No tienes permisos para realizar esta operación.";break;case"unavailable":De+="El servicio no está disponible. Verifica tu conexión.";break;case"invalid-argument":De+="Algunos datos no son válidos. Revisa el formulario.";break;default:De+=`Código de error: ${Ue.code}`}else De+="Por favor intenta de nuevo.";alert(De)}finally{P(!1),A(!1),w(0)}},qt=V=>{const B=v[V];if(!B.originalBase64)ie({thumbnail:B.thumbnail,original:B.original}),u(null);else{const J={thumbnail:B.thumbnail,original:B.originalUnmodified,webpDisplay:B.originalUnmodified,webpCover:B.originalUnmodified,originalFormat:B.originalFormat,originalBase64:B.originalBase64,originalUnmodified:B.originalUnmodified};u(J),ie(null)}p(B.thumbnail),$(V),ye(!1)},z=()=>{o({title:"",name:"",description:"",selectedCategories:[]}),u(null),ie(null),p(null),x([]),w(0),A(!1),j(0),se(0),le(0),q(0),ye(!1),$(null),e()};return t?d.jsxs("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-2xl max-h-[90vh] overflow-y-auto shadow-2xl",children:[d.jsxs("div",{className:"sticky top-0 bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-8 py-6 flex items-center justify-between z-10",children:[d.jsxs("div",{children:[d.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-lg shadow-lg shadow-[#bb86fc]/30",children:d.jsx(hl,{className:"w-5 h-5 text-white"})}),Ce?"Editar Manga":"Crear Manga"]}),d.jsx("p",{className:"text-sm text-gray-400 mt-1.5",children:Ce?"Actualiza los detalles de tu obra":"Comparte tu historia con el mundo"})]}),d.jsx("button",{onClick:z,className:"text-gray-500 hover:text-white hover:bg-white/10 transition-all p-2 rounded-lg",children:d.jsx(Vn,{className:"w-6 h-6"})})]}),d.jsxs("div",{className:"p-8 space-y-5",children:[d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Información Principal"})]}),d.jsxs("div",{className:"space-y-3.5",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Título del Manga ",d.jsx("span",{className:"text-red-400 font-bold",children:"*"})]}),d.jsx("input",{type:"text",name:"title",placeholder:"El nombre de tu obra maestra",value:s.title,onChange:Dt,onKeyPress:V=>V.key==="Enter"&&Ce&&!S&&tn(),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Autor ",d.jsx("span",{className:"text-gray-500 font-normal",children:"(opcional)"})]}),d.jsx("input",{type:"text",name:"name",placeholder:"Tu nombre o seudónimo",value:s.name,onChange:Dt,onKeyPress:V=>V.key==="Enter"&&Ce&&!S&&tn(),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-semibold text-gray-200 mb-2",children:["Sinopsis ",d.jsx("span",{className:"text-gray-500 font-normal",children:"(opcional)"})]}),d.jsx("textarea",{name:"description",placeholder:"Cuéntanos de qué trata tu manga, qué lo hace especial...",value:s.description,onChange:Dt,onKeyDown:V=>V.key==="Enter"&&V.ctrlKey&&Ce&&!S&&tn(),rows:3,className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all shadow-md hover:border-gray-600/70 resize-none"})]})]})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Clasificación"})]}),d.jsx(ki,{label:"Personajes",type:"character",categories:g,selectedIds:s.selectedCategories,onSelect:V=>{s.selectedCategories.includes(V)||o(B=>({...B,selectedCategories:[...B.selectedCategories,V]}))},onRemove:jt,onCreate:V=>te(V,"character"),onDeleteCategory:Ae,colorClass:"text-blue-400",placeholder:"Añadir personaje..."}),d.jsx(ki,{label:"Series",type:"series",categories:g,selectedIds:s.selectedCategories,onSelect:V=>{s.selectedCategories.includes(V)||o(B=>({...B,selectedCategories:[...B.selectedCategories,V]}))},onRemove:jt,onCreate:V=>te(V,"series"),onDeleteCategory:Ae,colorClass:"text-green-400",placeholder:"Añadir serie..."}),d.jsx(ki,{label:"Géneros",type:"genre",categories:g,selectedIds:s.selectedCategories,onSelect:V=>{s.selectedCategories.includes(V)||o(B=>({...B,selectedCategories:[...B.selectedCategories,V]}))},onRemove:jt,onCreate:V=>te(V,"genre"),onDeleteCategory:Ae,colorClass:"text-purple-400",placeholder:"Añadir género..."}),d.jsx(ki,{label:"Etiquetas",type:"tag",categories:g,selectedIds:s.selectedCategories,onSelect:V=>{s.selectedCategories.includes(V)||o(B=>({...B,selectedCategories:[...B.selectedCategories,V]}))},onRemove:jt,onCreate:V=>te(V,"tag"),onDeleteCategory:Ae,colorClass:"text-pink-400",placeholder:"Añadir etiqueta..."})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Portada"}),d.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:"Opcional"})]}),c&&d.jsxs("div",{className:"mb-4",children:[d.jsx("div",{className:"flex items-center justify-between mb-2",children:d.jsx("span",{className:"text-xs font-semibold text-[#bb86fc]",children:"Procesando portada..."})}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out animate-pulse",style:{width:"100%"}})})]}),h&&!c&&d.jsxs("div",{className:"mb-4 relative group max-w-xs mx-auto",children:[d.jsx(Kn,{src:h,alt:"Preview",aspectRatio:"3/4",objectFit:"cover",loading:"eager",className:"rounded-xl border border-gray-600 shadow-2xl shadow-[#bb86fc]/20"}),d.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:d.jsx("button",{onClick:()=>{u(null),p(null),$(null)},className:"bg-red-600/80 hover:bg-red-600 text-white p-2 rounded-lg transition-all shadow-lg",children:d.jsx(zr,{className:"w-4 h-4"})})}),R!==null&&d.jsxs("div",{className:"absolute bottom-2 left-2 bg-green-600/90 text-white text-xs px-2.5 py-1 rounded-lg font-semibold",children:["Página ",R+1]})]}),d.jsxs("div",{className:"flex gap-3 mb-4",children:[d.jsxs("label",{className:"flex-1 border-2 border-dashed border-gray-600/50 rounded-xl p-6 cursor-pointer hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all block group",children:[d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl flex items-center justify-center shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:c?d.jsx(bs,{size:24,borderWidth:2}):d.jsx(fl,{className:"w-6 h-6 text-white"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-xs font-semibold text-white mb-0.5",children:c?"Procesando...":"Subir portada"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Archivo"})]})]}),d.jsx("input",{type:"file",accept:"image/*",onChange:Le,disabled:c,className:"hidden"})]}),v.length>0&&d.jsxs("button",{onClick:()=>ye(!ge),className:"flex-1 border-2 border-dashed border-gray-600/50 rounded-xl p-6 hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all group flex flex-col items-center justify-center gap-2 bg-gradient-to-br from-[#1a1a1a] to-[#0f0f0f]",children:[d.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-[#9966dd] to-[#bb86fc] rounded-xl flex items-center justify-center shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:d.jsx(sv,{className:"w-6 h-6 text-white"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-xs font-semibold text-white mb-0.5",children:"Elegir página"}),d.jsxs("p",{className:"text-xs text-gray-400",children:[v.length," disponibles"]})]})]})]})]}),d.jsxs("div",{className:"bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-6 border border-gray-700/40 shadow-lg hover:border-gray-700/60 transition-all",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[d.jsx("div",{className:"w-1 h-5 bg-gradient-to-b from-[#bb86fc] to-[#7744cc] rounded-full"}),d.jsx("h3",{className:"text-sm font-semibold text-white tracking-wide uppercase",children:"Páginas del Capítulo"}),d.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:"Opcional"}),d.jsxs("button",{onClick:()=>fe(!0),className:"bg-[#1a1a1a] hover:bg-[#242424] border border-gray-600/50 hover:border-[#bb86fc]/50 text-gray-300 hover:text-[#bb86fc] p-2 rounded-lg transition-all flex items-center gap-1.5 text-xs font-medium",title:"Configurar tamaño de lote de subida",children:[d.jsx(ov,{className:"w-3.5 h-3.5"}),d.jsxs("span",{className:"hidden sm:inline",children:["Subida: ",Fe===0?"Sin límite":`${Fe} por lote`]})]})]}),E&&d.jsxs("div",{className:"mb-5",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("span",{className:"text-xs font-semibold text-[#bb86fc]",children:["Procesadas ",me," de ",oe]}),d.jsxs("span",{className:"text-xs font-bold text-[#bb86fc]",children:[he,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${he}%`}})})]}),v.length>0&&!E&&d.jsxs("div",{className:"mb-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(iv,{className:"w-3.5 h-3.5 text-gray-500"}),d.jsxs("p",{className:"text-xs text-gray-400",children:[v.length," página",v.length!==1?"s":""," • Arrastra para reordenar"]})]}),d.jsx("div",{className:"grid grid-cols-4 gap-2",children:v.map((V,B)=>d.jsxs("div",{draggable:!0,onDragStart:()=>Ht(B),onDragOver:K=>Xe(K,B),onDragEnd:ht,style:{animationDelay:`${B*40}ms`},className:`relative group cursor-move opacity-0 animate-[fadeIn_0.7s_ease-out_forwards] ${L===B?"opacity-50 scale-95":"hover:scale-105"} transition-all duration-200`,children:[d.jsxs("div",{className:"relative overflow-hidden w-full aspect-[3/4] rounded-lg border border-gray-600/50 shadow-md bg-black",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"24px",height:"24px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})}),d.jsx("img",{src:V.thumbnail,alt:`Página ${B+1}`,className:"w-full h-full object-cover transition-all duration-700 ease-out transform-gpu group-hover:scale-[1.08] group-hover:shadow-[#bb86fc]/30 opacity-0 scale-95",onLoad:K=>{var je;K.currentTarget.classList.remove("opacity-0","scale-95"),K.currentTarget.classList.add("opacity-100","scale-100");const J=(je=K.currentTarget.parentElement)==null?void 0:je.querySelector("div:nth-child(1)");J&&J.classList.add("opacity-0","pointer-events-none")}})]}),d.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity rounded-lg flex items-center justify-center gap-2",children:[d.jsx(iv,{className:"w-4 h-4 text-white/70"}),d.jsx("button",{onClick:()=>Qe(B),className:"bg-red-600/80 hover:bg-red-600 text-white p-1.5 rounded-lg transition-all shadow-lg",children:d.jsx(zr,{className:"w-3.5 h-3.5"})})]}),d.jsx("div",{className:"absolute top-1.5 left-1.5 bg-black/80 text-white text-xs px-2 py-0.5 rounded-md font-semibold",children:B+1})]},B))})]}),d.jsxs("label",{className:"border-2 border-dashed border-gray-600/50 rounded-xl p-8 text-center cursor-pointer hover:border-[#bb86fc]/50 hover:bg-[#bb86fc]/5 transition-all block group",children:[d.jsx("div",{className:"w-14 h-14 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl flex items-center justify-center mx-auto mb-2.5 shadow-lg shadow-[#bb86fc]/40 group-hover:scale-110 group-hover:shadow-[#bb86fc]/60 transition-all",children:E?d.jsx(bs,{size:24,borderWidth:2}):d.jsx(sv,{className:"w-7 h-7 text-white"})}),d.jsx("p",{className:"text-sm font-semibold text-white mb-1",children:E?`Procesando ${me}...`:v.length>0?"Agregar más páginas":"Sube tus páginas"}),d.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"Arrastra o selecciona múltiples imágenes"}),d.jsx("p",{className:"text-xs text-gray-500",children:"Se optimizan automáticamente para mejor rendimiento"}),d.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:we,disabled:E,className:"hidden"})]})]}),T&&d.jsxs("div",{className:"mb-6 bg-gradient-to-br from-[#242424] to-[#1a1a1a] rounded-xl p-5 border border-[#bb86fc]/30 shadow-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(bs,{size:16,borderWidth:2}),d.jsxs("span",{className:"text-sm font-semibold text-white",children:["Subiendo imagen ",N," de ",C]})]}),d.jsxs("span",{className:"text-sm font-bold text-[#bb86fc]",children:[b,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-3 overflow-hidden border border-[#bb86fc]/40 shadow-inner",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] via-[#9966dd] to-[#bb86fc] h-full transition-all duration-500 ease-out relative overflow-hidden",style:{width:`${b}%`},children:d.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-pulse"})})}),d.jsx("p",{className:"text-xs text-gray-400 mt-2 text-center",children:"Por favor no cierres esta ventana..."})]}),d.jsxs("div",{className:"flex gap-3 pt-6 border-t border-gray-700/50",children:[Ce&&i&&d.jsxs("button",{onClick:()=>{window.confirm("¿Estás seguro de que deseas eliminar este manga? Esta acción no se puede deshacer.")&&r&&(i(r.id),e())},className:"bg-red-500/10 border border-red-500/30 hover:bg-red-500/20 text-red-500 px-4 py-3 rounded-lg font-semibold text-sm transition-all flex items-center gap-2 mr-auto",children:[d.jsx(zr,{className:"w-4 h-4"}),"Eliminar"]}),d.jsx("button",{onClick:z,disabled:S||T,className:"flex-1 bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-5 py-3 rounded-lg font-semibold text-sm transition-all shadow-md disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancelar"}),d.jsx("button",{onClick:tn,className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-5 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60 disabled:opacity-50 disabled:cursor-not-allowed active:scale-95",disabled:c||S||T||!s.title.trim(),children:T?"Subiendo imágenes...":S?Ce?"Actualizando...":"Creando...":Ce?"Guardar Cambios":"Crear Manga"})]})]})]}),ge&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-2xl max-h-[80vh] shadow-2xl overflow-hidden flex flex-col",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between flex-shrink-0",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Selecciona portada"}),d.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Elige una página para usar como portada del manga"})]}),d.jsx("button",{onClick:()=>ye(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10 flex-shrink-0",children:d.jsx(Vn,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"overflow-y-auto flex-1 p-6",children:d.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-3",children:v.map((V,B)=>d.jsxs("button",{onClick:()=>qt(B),className:`group relative aspect-[3/4] rounded-lg overflow-hidden transition-all duration-300 hover:scale-105 border-2 ${R===B?"border-green-500 shadow-lg shadow-green-500/40":"border-gray-600/50 hover:border-[#bb86fc]/50"}`,children:[d.jsxs("div",{className:"absolute inset-0 overflow-hidden bg-black flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"20px",height:"20px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})}),d.jsx("img",{src:V.thumbnail,alt:`Página ${B+1}`,className:"w-full h-full object-cover transition-all duration-700 ease-out transform-gpu group-hover:scale-[1.10] opacity-0 scale-95",onLoad:K=>{var je;K.currentTarget.classList.remove("opacity-0","scale-95"),K.currentTarget.classList.add("opacity-100","scale-100");const J=(je=K.currentTarget.parentElement)==null?void 0:je.querySelector("div:nth-child(1)");J&&J.classList.add("opacity-0","pointer-events-none")}})]}),d.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:d.jsx("div",{className:"bg-[#bb86fc]/90 text-white px-3 py-1.5 rounded-lg font-semibold text-sm",children:"Seleccionar"})}),d.jsx("div",{className:"absolute bottom-2 left-2 bg-black/80 text-white text-xs px-2 py-1 rounded-md font-semibold",children:B+1}),R===B&&d.jsxs("div",{className:"absolute top-2 right-2 bg-green-600/90 text-white px-2.5 py-1.5 rounded-lg flex items-center gap-1.5 font-semibold text-xs",children:[d.jsx("div",{className:"w-2 h-2 bg-white rounded-full"}),"Seleccionado"]})]},B))})}),d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f]/80 to-[#1a1a1a]/80 border-t border-gray-700/30 px-6 py-4 flex items-center justify-end gap-3 flex-shrink-0",children:[d.jsx("button",{onClick:()=>ye(!1),className:"bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-4 py-2 rounded-lg font-semibold text-sm transition-all",children:"Cancelar"}),d.jsx("button",{onClick:()=>ye(!1),className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-4 py-2 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Confirmar"})]})]})}),Te&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-md shadow-2xl",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-lg shadow-lg shadow-[#bb86fc]/30",children:d.jsx(ov,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Configurar Subida"}),d.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Tamaño de lote de imágenes"})]})]}),d.jsx("button",{onClick:()=>fe(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10",children:d.jsx(Vn,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border border-gray-700/40 rounded-lg p-4 mb-4",children:[d.jsx("h3",{className:"text-xs font-semibold text-gray-300 mb-2",children:"Opciones disponibles:"}),d.jsxs("ul",{className:"text-xs text-gray-400 space-y-1.5",children:[d.jsx("li",{children:"• 1 por lote: Más lento pero más estable"}),d.jsx("li",{children:"• 10 por lote: Balance entre velocidad y estabilidad (predeterminado)"}),d.jsx("li",{children:"• 50 por lote: Más rápido para muchas imágenes"}),d.jsx("li",{children:"• Sin límite: Sube todas las imágenes simultáneamente"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx("button",{onClick:()=>{ee(1),gu(1)},className:`p-4 rounded-lg border-2 transition-all ${Fe===1?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"1"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{ee(10),gu(10)},className:`p-4 rounded-lg border-2 transition-all ${Fe===10?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"10"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{ee(50),gu(50)},className:`p-4 rounded-lg border-2 transition-all ${Fe===50?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"50"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Por lote"})]})}),d.jsx("button",{onClick:()=>{ee(0),gu(999999)},className:`p-4 rounded-lg border-2 transition-all ${Fe===0||Fe>=999999?"border-[#bb86fc] bg-[#bb86fc]/10 shadow-lg shadow-[#bb86fc]/30":"border-gray-600/50 hover:border-gray-600 bg-[#1a1a1a]"}`,children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:"∞"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin límite"})]})})]}),d.jsx("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-3",children:d.jsxs("p",{className:"text-green-400 text-xs font-semibold",children:["Configuración guardada: ",Fe===0||Fe>=999999?"Sin límite":`${Fe} imagen${Fe!==1?"es":""} por lote`]})}),d.jsx("button",{onClick:()=>fe(!1),className:"w-full bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Cerrar"})]})]})})]}):null}const qI="settings",WI="announcement";async function Kx(t,e){const n=vt(Ge,qI,WI),r=new Date;let i=null;e&&(i=new Date(r.getTime()+e).toISOString());const s={text:t,updatedAt:r.toISOString(),expiresAt:i};await Og(n,s)}function m3(t){const e=vt(Ge,qI,WI);return Mg(e,n=>{n.exists()?t(n.data()):t(null)})}const Wd="general",Gd="admin_settings",qa=["gonzalosalvadorloyolahuarauya@gmail.com","loyolahuarauyagonzalosalvador@gmail.com","brody.loyola@gmail.com"];async function Yh(t){if(!t)return!1;if(qa.includes(t))return!0;try{const e=vt(Ge,Gd,Wd),n=await hr(e);return n.exists()?n.data().allowed_emails.includes(t):!1}catch(e){return console.error("Error checking admin status:",e),!1}}async function g3(){try{const t=vt(Ge,Gd,Wd),e=await hr(t);if(e.exists()){const n=e.data();return Array.from(new Set([...qa,...n.allowed_emails]))}return[...qa]}catch(t){return console.error("Error getting allowed emails:",t),[...qa]}}async function y3(t){const e=vt(Ge,Gd,Wd);try{await si(e,{allowed_emails:VR(t)})}catch(n){if(n.code==="not-found"||n.message.includes("No document to update"))await Og(e,{allowed_emails:[t]});else throw n}}async function v3(t){if(qa.includes(t))throw new Error("No puedes eliminar a un propietario.");const e=vt(Ge,Gd,Wd);await si(e,{allowed_emails:FR(t)})}function x3({isOpen:t,onClose:e,isAdmin:n,onAdminChange:r,isCategoryPlusEnabled:i,onCategoryPlusChange:s}){const[o,a]=F.useState(""),[u,c]=F.useState(!1),[f,h]=F.useState(!1),[p,g]=F.useState(""),[_,S]=F.useState(""),[P,v]=F.useState(""),[x,E]=F.useState([]),[O,L]=F.useState(""),[D,b]=F.useState(null),[w,T]=F.useState(""),[A,N]=F.useState(24),[j,C]=F.useState("hours"),[se,he]=F.useState(!1),[le,me]=F.useState(!1);F.useEffect(()=>{if(t){const ee=cb();ee?(a(ee),c(!0)):(a(""),c(!1)),g(""),S(""),v("");const Ce=mi.currentUser;Ce?(b(Ce.email),n&&q()):n&&r(!1)}},[t]);const q=async()=>{const ee=await g3();E(ee)},oe=()=>{if(!o.trim()){Ct.error("Por favor ingresa una API válida");return}B2(o.trim()),c(!0),Ct.success("API guardada exitosamente.")},k=()=>{$2(),a(""),c(!1),me(!1),Ct.success("API eliminada.")},ge=()=>{me(!0)},ye=async()=>{h(!0),g("");try{const Ce=(await MD(mi,Pj)).user.email;if(!Ce)throw new Error("No se pudo obtener el email.");await Yh(Ce)?(r(!0),b(Ce),await q()):(await Tu(mi),g("Este correo no tiene permisos de administrador."),r(!1))}catch(ee){console.error("Login error:",ee),g(ee.message||"Error al iniciar sesión.")}finally{h(!1)}},R=async()=>{if(!_||!P){g("Por favor ingresa correo y contraseña.");return}h(!0),g("");try{const Ce=(await mD(mi,_.trim(),P)).user.email;if(!Ce)throw new Error("No se pudo obtener el email.");await Yh(Ce)?(r(!0),b(Ce),await q()):(await Tu(mi),g("Este correo no tiene permisos de administrador."),r(!1))}catch(ee){console.error("Login error:",ee),ee.code==="auth/invalid-credential"||ee.code==="auth/user-not-found"?g('Cuenta no encontrada o contraseña incorrecta. Si es tu primera vez, usa "Registrarse".'):g(ee.message||"Error al iniciar sesión.")}finally{h(!1)}},$=async()=>{if(!_||!P){g("Ingresa un correo y contraseña para registrarte.");return}h(!0),g("");try{const Ce=(await pD(mi,_.trim(),P)).user.email;if(!Ce)throw new Error("Error al obtener email.");await Yh(Ce)?(r(!0),b(Ce),await q(),await q(),Ct.success("Cuenta creada y verificada exitosamente.")):(await Tu(mi),g("Cuenta creada, pero tu correo NO está autorizado como administrador."),r(!1))}catch(ee){console.error("Register error:",ee),ee.code==="auth/email-already-in-use"?g('Este correo ya está registrado. Intenta "Ingresar".'):ee.code==="auth/weak-password"?g("La contraseña debe tener al menos 6 caracteres."):g(ee.message||"Error al registrar.")}finally{h(!1)}},Z=async()=>{try{await Tu(mi),r(!1),b(null),E([])}catch(ee){console.error("Logout error:",ee)}},ie=async()=>{if(O.trim())try{await y3(O.trim()),L(""),await q(),await q(),Ct.success("Administrador añadido correctamente.")}catch(ee){Ct.error("Error al añadir: "+ee.message)}},Te=async ee=>{if(window.confirm(`¿Seguro que quieres eliminar a ${ee}?`))try{await v3(ee),await q(),Ct.success(`Administrador ${ee} eliminado.`)}catch(Ce){Ct.error("Error: "+Ce.message)}},fe=async()=>{if(!w.trim()){Ct.error("El texto del anuncio no puede estar vacío");return}let ee=0;j==="seconds"&&(ee=A*1e3),j==="minutes"&&(ee=A*60*1e3),j==="hours"&&(ee=A*60*60*1e3),j==="days"&&(ee=A*24*60*60*1e3);try{await Kx(w,ee),Ct.success("Anuncio publicado exitosamente"),T(""),e()}catch(Ce){console.error(Ce),Ct.error("Error al publicar el anuncio")}},Fe=async()=>{try{await Kx("",null),T(""),he(!1),Ct.success("Anuncio eliminado.")}catch(ee){console.error(ee),Ct.error("Error al eliminar")}};return t?d.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-lg shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-[#bb86fc]/10 rounded-lg text-[#bb86fc]",children:d.jsx(lb,{className:"w-5 h-5"})}),d.jsx("h2",{className:"text-xl font-bold text-white",children:"Ajustes"})]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg",children:d.jsx(Vn,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-8 overflow-y-auto custom-scrollbar",children:[d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`p-2 rounded-lg ${n?"bg-green-500/10 text-green-500":"bg-gray-800 text-gray-400"}`,children:n?d.jsx(j2,{className:"w-5 h-5"}):d.jsx(A2,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Modo Administrador"}),d.jsx("p",{className:"text-xs text-gray-400",children:n?`Conectado como ${D}`:"Requiere acceso autorizado"})]})]}),n&&d.jsx("button",{onClick:Z,className:"text-gray-400 hover:text-white p-2 rounded-lg hover:bg-white/5 transition-colors",title:"Cerrar Sessión",children:d.jsx(P2,{className:"w-5 h-5"})})]}),n?d.jsxs("div",{className:"bg-[#1a1a1a] p-4 rounded-xl border border-gray-800 space-y-4",children:[d.jsxs("h4",{className:"text-sm font-semibold text-white mb-2 flex items-center gap-2",children:[d.jsx(av,{className:"w-4 h-4 text-[#bb86fc]"}),"Gestión de Administradores"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"email",placeholder:"nuevo_admin@gmail.com",value:O,onChange:ee=>L(ee.target.value),className:"flex-1 bg-black/50 border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-[#bb86fc]"}),d.jsx("button",{onClick:ie,disabled:!O.trim(),className:"bg-[#bb86fc]/20 hover:bg-[#bb86fc]/30 text-[#bb86fc] p-2 rounded-lg transition-colors disabled:opacity-50",children:d.jsx(L2,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1 custom-scrollbar",children:x.map(ee=>d.jsxs("div",{className:"flex items-center justify-between bg-black/30 p-2 rounded-lg border border-gray-800/50",children:[d.jsx("span",{className:"text-xs text-gray-300 truncate",children:ee}),d.jsx("button",{onClick:()=>Te(ee),className:"text-gray-500 hover:text-red-400 p-1 hover:bg-white/5 rounded transition-colors",title:"Eliminar admin",children:d.jsx(O2,{className:"w-4 h-4"})})]},ee))})]}):d.jsxs("div",{className:"bg-[#1a1a1a] p-6 rounded-xl border border-gray-800 animate-in slide-in-from-top-2 duration-200 text-center",children:[d.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Inicia sesión con una cuenta autorizada."}),d.jsxs("div",{className:"space-y-3 mb-4",children:[d.jsx("input",{type:"email",placeholder:"Correo electrónico",value:_,onChange:ee=>S(ee.target.value),className:"w-full bg-black/50 border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-[#bb86fc]"}),d.jsx("input",{type:"password",placeholder:"Contraseña",value:P,onChange:ee=>v(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&R(),className:"w-full bg-black/50 border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-[#bb86fc]"}),d.jsx("button",{onClick:R,disabled:f,className:"w-full bg-[#bb86fc] text-white hover:bg-[#9966dd] py-2 rounded-lg font-semibold text-sm transition-colors disabled:opacity-70",children:f?"Verificando...":"Ingresar"}),d.jsx("button",{onClick:$,disabled:f,className:"w-full bg-transparent border border-gray-600 text-gray-300 hover:border-gray-400 hover:text-white py-1.5 rounded-lg text-xs transition-colors disabled:opacity-50",children:"¿Primera vez? Crear cuenta"})]}),d.jsxs("div",{className:"flex items-center gap-2 my-4",children:[d.jsx("div",{className:"h-px bg-gray-800 flex-1"}),d.jsx("span",{className:"text-xs text-gray-500",children:"O usa Google"}),d.jsx("div",{className:"h-px bg-gray-800 flex-1"})]}),d.jsxs("button",{onClick:ye,disabled:f,className:"w-full bg-white text-gray-900 hover:bg-gray-100 py-2.5 rounded-lg font-semibold flex items-center justify-center gap-2 transition-colors disabled:opacity-70",children:[f?d.jsx("div",{className:"w-5 h-5 border-2 border-gray-900 border-t-transparent rounded-full animate-spin"}):d.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[d.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),d.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),d.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.84z"}),d.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Iniciar con Google"]}),p&&d.jsx("p",{className:"text-red-500 text-xs mt-3 bg-red-500/10 p-2 rounded border border-red-500/20",children:p})]})]}),d.jsx("section",{className:"space-y-4 pt-4 border-t border-gray-800",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`p-2 rounded-lg ${i?"bg-purple-500/10 text-purple-400":"bg-gray-800 text-gray-400"}`,children:d.jsx(ib,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold text-white",children:"Categorías Plus"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Habilitar selección múltiple y edición masiva"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",className:"sr-only peer",checked:i,onChange:ee=>s(ee.target.checked)}),d.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-purple-300 dark:peer-focus:ring-purple-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[#bb86fc]"})]})]})}),n&&d.jsxs("section",{className:"space-y-4 pt-4 border-t border-gray-800",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-red-500/10 rounded-lg text-red-500",children:d.jsx(rp,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Gestión de Vistas"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Restablecer contadores de visualización"})]})]}),d.jsx("button",{onClick:async()=>{if(window.confirm("¿Seguro que quieres reiniciar las vistas de TODOS los mangas a 0? Esta acción no se puede deshacer."))try{await Oj(),Ct.success("Vistas reiniciadas correctamente.")}catch(ee){console.error(ee),Ct.error("Error al reiniciar vistas.")}},className:"w-full bg-red-500/10 hover:bg-red-500/20 text-red-500 py-2.5 rounded-lg font-semibold text-sm transition-all border border-red-500/20 hover:border-red-500/40",children:"Reiniciar Vistas a 0"})]}),n&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-px bg-gray-800"}),d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-purple-500/10 rounded-lg text-purple-400",children:d.jsx(sb,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Publicar Anuncio"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Visible para todos los usuarios"})]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("textarea",{value:w,onChange:ee=>T(ee.target.value),placeholder:"Escribe el mensaje del anuncio...",className:"w-full bg-[#1a1a1a] border border-gray-700 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-[#bb86fc] min-h-[100px] resize-none"}),d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("div",{className:"flex-1 bg-[#1a1a1a] border border-gray-700 rounded-lg px-3 py-2 flex items-center gap-2",children:[d.jsx(k2,{className:"w-4 h-4 text-gray-400"}),d.jsx("input",{type:"number",min:"1",value:A,onChange:ee=>N(Number(ee.target.value)),className:"bg-transparent text-white text-sm w-full focus:outline-none"})]}),d.jsxs("select",{value:j,onChange:ee=>C(ee.target.value),className:"bg-[#1a1a1a] border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-[#bb86fc]",children:[d.jsx("option",{value:"seconds",children:"Segundos"}),d.jsx("option",{value:"minutes",children:"Minutos"}),d.jsx("option",{value:"hours",children:"Horas"}),d.jsx("option",{value:"days",children:"Días"})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>he(!0),className:"px-4 py-2.5 rounded-lg font-semibold text-sm bg-red-500/10 text-red-500 border border-red-500/20 hover:bg-red-500/20 transition-colors",title:"Eliminar anuncio",children:d.jsx(zr,{className:"w-5 h-5"})}),d.jsx("button",{onClick:fe,className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] text-white py-2.5 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/20",children:"Publicar Anuncio"})]})]})]})]}),d.jsx("div",{className:"h-px bg-gray-800"}),d.jsxs("section",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[d.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg text-blue-400",children:d.jsx(C2,{className:"w-5 h-5"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"tex-sm font-semibold text-white",children:"Configuración de API"}),d.jsx("p",{className:"text-xs text-gray-400",children:"Gestiona tu clave personal de ImgBB"})]})]}),u&&d.jsx("div",{className:"bg-green-500/10 border border-green-500/20 rounded-lg p-3",children:d.jsxs("p",{className:"text-green-400 text-xs font-medium flex items-center gap-2",children:[d.jsx(av,{className:"w-3 h-3"}),"API personal activa"]})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("input",{type:"text",placeholder:"Pega tu API Key de ImgBB aquí...",value:o,onChange:ee=>a(ee.target.value),className:"w-full bg-[#1a1a1a] border border-gray-700 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-[#bb86fc] focus:ring-1 focus:ring-[#bb86fc] transition-all font-mono"}),d.jsxs("p",{className:"text-xs text-gray-500",children:["Obtén tu API key gratuitamente en ",d.jsx("a",{href:"https://api.imgbb.com/",target:"_blank",rel:"noopener noreferrer",className:"text-[#bb86fc] hover:underline",children:"api.imgbb.com"})]})]}),d.jsxs("div",{className:"flex gap-3",children:[u&&d.jsxs("button",{onClick:ge,className:"flex-1 bg-red-500/10 border border-red-500/30 hover:bg-red-500/20 text-red-500 px-4 py-2.5 rounded-lg font-medium text-sm transition-colors flex items-center justify-center gap-2",children:[d.jsx(zr,{className:"w-4 h-4"}),"Eliminar"]}),d.jsxs("button",{onClick:oe,disabled:!o.trim(),className:"flex-1 bg-[#1a1a1a] border border-gray-700 hover:border-[#bb86fc] hover:text-[#bb86fc] disabled:opacity-50 disabled:hover:border-gray-700 disabled:hover:text-gray-500 text-gray-300 px-4 py-2.5 rounded-lg font-medium text-sm transition-all flex items-center justify-center gap-2 group",children:[d.jsx(zm,{className:"w-4 h-4 group-hover:scale-110 transition-transform"}),"Guardar Cambios"]})]})]})]}),se&&d.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-6 animate-in fade-in duration-200",children:d.jsx("div",{className:"bg-[#1a1a1a] border border-gray-700 w-full max-w-sm rounded-xl shadow-2xl p-6 transform scale-100 animate-in zoom-in-95 duration-200",children:d.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[d.jsx("div",{className:"p-3 bg-red-500/10 rounded-full text-red-500",children:d.jsx(zr,{className:"w-8 h-8"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"¿Eliminar anuncio?"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Esta acción eliminará el anuncio actual inmediatamente. No se puede deshacer."})]}),d.jsxs("div",{className:"flex gap-3 w-full mt-2",children:[d.jsx("button",{onClick:()=>he(!1),className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:bg-gray-800 transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:Fe,className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold bg-red-500 hover:bg-red-600 text-white transition-colors shadow-lg shadow-red-500/20",children:"Eliminar"})]})]})})}),le&&d.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-6 animate-in fade-in duration-200",children:d.jsx("div",{className:"bg-[#1a1a1a] border border-gray-700 w-full max-w-sm rounded-xl shadow-2xl p-6 transform scale-100 animate-in zoom-in-95 duration-200",children:d.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[d.jsx("div",{className:"p-3 bg-red-500/10 rounded-full text-red-500",children:d.jsx(zr,{className:"w-8 h-8"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"¿Eliminar API personal?"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Perderás el acceso a tus subidas privadas hasta que ingreses una clave válida."})]}),d.jsxs("div",{className:"flex gap-3 w-full mt-2",children:[d.jsx("button",{onClick:()=>me(!1),className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:bg-gray-800 transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:k,className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold bg-red-500 hover:bg-red-600 text-white transition-colors shadow-lg shadow-red-500/20",children:"Eliminar"})]})]})})})]})}):null}function w3({isAdmin:t}){const[e,n]=F.useState(""),[r,i]=F.useState(null),[s,o]=F.useState(""),[a,u]=F.useState(!0);return F.useEffect(()=>{const c=m3(f=>{f?(n(f.text),i(f.expiresAt)):(n(""),i(null)),u(!1)});return()=>c()},[]),F.useEffect(()=>{if(!r){o("");return}const c=setInterval(()=>{const f=new Date().getTime(),p=new Date(r).getTime()-f;if(p<=0)n(""),i(null),clearInterval(c);else{const g=Math.floor(p/864e5),_=Math.floor(p%(1e3*60*60*24)/(1e3*60*60)),S=Math.floor(p%(1e3*60*60)/(1e3*60)),P=Math.floor(p%(1e3*60)/1e3);let v="";g>0&&(v+=`${g}d `),v+=`${_.toString().padStart(2,"0")}h ${S.toString().padStart(2,"0")}m ${P.toString().padStart(2,"0")}s`,o(v)}},1e3);return()=>clearInterval(c)},[r]),!e&&!a||!e?null:d.jsx("div",{className:"w-full max-w-[1800px] mx-auto px-4 sm:px-6 md:px-12 mt-6 mb-8 animate-in fade-in slide-in-from-top-4 duration-500 flex justify-center",children:d.jsxs("div",{className:"bg-gradient-to-r from-[#bb86fc]/20 to-[#121212] border border-[#bb86fc]/30 rounded-xl p-6 flex flex-col items-center gap-4 shadow-lg shadow-[#bb86fc]/10 relative group backdrop-blur-sm max-w-2xl w-full text-center",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2.5 bg-[#bb86fc]/20 rounded-lg animate-pulse",children:d.jsx(sb,{className:"w-6 h-6 text-[#bb86fc]"})}),d.jsxs("h3",{className:"text-sm font-bold text-[#bb86fc] uppercase tracking-wider flex items-center gap-2",children:["Información Importante",d.jsx("span",{className:"w-2 h-2 rounded-full bg-[#bb86fc] animate-ping"})]})]}),d.jsx("div",{className:"text-base text-gray-200 leading-relaxed whitespace-pre-wrap font-medium max-w-lg",children:e}),s&&d.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-gray-400 bg-black/30 px-3 py-1.5 rounded-full border border-gray-800",children:[d.jsx(D2,{className:"w-3.5 h-3.5"}),d.jsxs("span",{children:["Expira en: ",s]})]})]})})}const GI=()=>"",_3=t=>{if(!t)return;if(t.startsWith("blob:")||t.startsWith("data:"))return t;const e=GI(),n=new URLSearchParams({url:t,width:"600",quality:"85",format:"webp"});return`${e}/api/image-proxy?${n.toString()}`},b3=(t,e)=>{if(!t)return"";if(t.startsWith("blob:")||t.startsWith("data:"))return t;const n=GI(),r=new URLSearchParams({url:t});return`${n}/api/image-proxy?${r.toString()}`};function KI({id:t,title:e,author:n,pageCount:r,thumbnail:i,manga:s,onSelect:o,onEdit:a,onDelete:u,isCategoryPlusEnabled:c,isSelected:f,onToggleSelect:h}){const[p,g]=F.useState(!1),_=i?_3(i):void 0,S=x=>{x.stopPropagation(),g(!0)},P=x=>{x.stopPropagation(),u==null||u(t),g(!1)},v=x=>{x.stopPropagation(),s&&(a==null||a(s))};return d.jsxs("div",{className:"group cursor-pointer flex flex-col w-full max-w-xs",children:[d.jsxs("div",{onClick:()=>{c&&h?h():(Lj(t),o==null||o(t))},className:`relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02] aspect-[2/3] ${f?"ring-4 ring-[#bb86fc]":""}`,children:[_?d.jsxs(d.Fragment,{children:[d.jsx(Kn,{src:_,alt:e,aspectRatio:"2/3",objectFit:"cover",loading:"lazy",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-gradient-to-br from-gray-800 to-gray-900 rounded-lg group-hover:text-white/60",children:d.jsx(hl,{className:"w-12 h-12"})}),d.jsxs("div",{className:"absolute bottom-2 left-2 bg-black/70 text-white text-xs px-2 py-1 rounded-md font-semibold opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[r," paginas"]}),c&&d.jsx("div",{className:`absolute top-2 left-2 w-6 h-6 rounded-md border-2 flex items-center justify-center transition-all ${f?"bg-[#bb86fc] border-[#bb86fc]":"bg-black/50 border-white/50 hover:border-white"}`,children:f&&d.jsx(fd,{className:"w-4 h-4 text-white"})}),!c&&d.jsxs("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex gap-1",children:[s&&a&&d.jsx("button",{onClick:v,className:"bg-black/60 hover:bg-purple-600 text-white p-1.5 rounded-full transition-colors backdrop-blur-sm",title:"Editar manga",children:d.jsx(ob,{className:"w-3 h-3"})}),u&&d.jsx("button",{onClick:S,className:"bg-black/60 hover:bg-red-600 text-white p-1.5 rounded-full transition-colors backdrop-blur-sm",title:"Eliminar manga",children:d.jsx(zr,{className:"w-3 h-3"})})]}),p&&d.jsxs("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm flex flex-col items-center justify-center gap-3 rounded-lg z-20 animate-in fade-in duration-200",children:[d.jsx("p",{className:"text-white text-sm font-semibold text-center px-3",children:"Eliminar manga?"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:x=>{x.stopPropagation(),g(!1)},className:"bg-gray-600 hover:bg-gray-700 text-white px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200 transform hover:scale-105 active:scale-95",children:"Cancelar"}),d.jsx("button",{onClick:P,className:"bg-red-600 hover:bg-red-700 text-white px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200 transform hover:scale-105 active:scale-95",children:"Eliminar"})]})]})]}),d.jsxs("div",{className:"mt-1 sm:mt-2 flex flex-col gap-0.5 text-center mb-2",children:[d.jsx("h3",{onClick:()=>o==null?void 0:o(t),className:"font-semibold text-xs sm:text-sm text-white line-clamp-2 cursor-pointer text-center group-hover:text-purple-400 transition-colors duration-300 ease-out",children:e}),n&&n.trim()!==""&&n.toLowerCase()!=="anónimo"&&n.toLowerCase()!=="anonimo"&&d.jsx("p",{className:"text-xs text-gray-400 text-center group-hover:text-gray-300 transition-colors duration-300 ease-out",children:n})]})]})}function E3({id:t,onBack:e,onNavigateToManga:n,onMangaLoaded:r,onSelectCategory:i,isAdmin:s=!1}){var K,J,je,Ue,De;const[o,a]=F.useState(null),[u,c]=F.useState(!0),[f,h]=F.useState(!1),[p,g]=F.useState(0),[_,S]=F.useState(!1),[P,v]=F.useState(!1),[x,E]=F.useState(!1),[O,L]=F.useState(0),[D,b]=F.useState(!1),[w,T]=F.useState({name:"",url:""}),[A,N]=F.useState([]),[j,C]=F.useState("portrait"),[se,he]=F.useState("vertical"),[le,me]=F.useState(!1),[q,oe]=F.useState(0),[k,ge]=F.useState([]),[ye,R]=F.useState(!1),[$,Z]=F.useState(""),[ie,Te]=F.useState([]),[fe,Fe]=F.useState(!1),[ee,Ce]=F.useState(!1),[tt,Dt]=F.useState(1),[jt,te]=F.useState(1),ve=6,Ae=()=>te(H=>Math.min(H+.25,3)),Le=()=>te(H=>Math.max(H-.25,.5)),we=()=>te(1);F.useEffect(()=>{tn();const H=Dj(t,de=>{de&&(a(()=>de),c(!1))});Qe(),Z("");const Q=localStorage.getItem("manga-view-mode");return(Q==="vertical"||Q==="gallery"||Q==="grid")&&he(Q),()=>H()},[t]);async function Qe(){try{Fe(!0);const H=await qd();Te(H)}catch(H){console.error("Error loading all mangas:",H)}finally{Fe(!1)}}F.useEffect(()=>{function H(Q){const de=Q.target;_&&!de.closest(".download-menu-container")&&S(!1),P&&!de.closest(".pdf-menu-container")&&v(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[_,P]);const Ht=async()=>{if(w.name.trim()&&w.url.trim()&&o)try{await Vj(o.id,w),N([...A,w]),T({name:"",url:""}),b(!1)}catch(H){console.error("Error al guardar el enlace:",H),alert("Error al guardar el enlace")}},Xe=async H=>{if(o)try{await Fj(o.id,H),N(A.filter((Q,de)=>de!==H))}catch(Q){console.error("Error al eliminar el enlace:",Q),alert("Error al eliminar el enlace")}},ht=H=>{he(H),localStorage.setItem("manga-view-mode",H)};async function tn(){try{c(!0);const H=await UI(t);if(H){if(a(H),N(H.external_links||[]),H.cover_url)try{const Q=await z2(H.cover_url);C(Q)}catch(Q){console.warn("Failed to detect image orientation:",Q),C("portrait")}qt(H)}}catch(H){console.error("Error loading manga:",H)}finally{}}async function qt(H){var Q;try{R(!0);const de=((Q=H.categories)==null?void 0:Q.map(pe=>pe.id))||[],Ie=await Uj(H.id,de,H.title);ge(Ie),Dt(1)}catch(de){console.error("Error loading recommendations:",de)}finally{R(!1)}}async function z(H){const Q=(o==null?void 0:o.id)||t;if(!Q){alert("Error: ID no encontrado.");return}const de=Q;console.log(`🚀 [CLIENTE] Suscribiendo a progreso: ${de}`);const Ie=new EventSource(`/api/download/progress/${de}`);Ie.onmessage=pe=>{const qe=JSON.parse(pe.data);g(qe.progress),qe.progress>=100&&Ie.close()};try{console.log("🚀 [CLIENTE] Iniciando descarga para ID:",Q),h(!0),S(!1),g(0);const pe=await fetch("/api/download/zip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mangaId:Q,mangaTitle:(o==null?void 0:o.title)||"Descarga",format:H,jobId:de})});if(!pe.ok)throw new Error("Error en el servidor");const qe=await pe.blob(),nt=window.URL.createObjectURL(qe),ft=document.createElement("a");ft.href=nt,ft.download=`${(o==null?void 0:o.title)||"manga"}.zip`,document.body.appendChild(ft),ft.click(),ft.remove(),window.URL.revokeObjectURL(nt),console.log("✅ [CLIENTE] Descarga disparada con éxito")}catch(pe){console.error("❌ Error en la descarga:",pe),alert("Hubo un fallo en la matriz de descarga.")}finally{h(!1),Ie.close()}}async function V(H){const Q=(o==null?void 0:o.id)||t;if(!Q){alert("Error: ID no encontrado.");return}const de=Q;console.log(`🚀 [CLIENTE] Suscribiendo a progreso PDF: ${de}`);const Ie=new EventSource(`/api/download/progress/${de}`);Ie.onmessage=pe=>{const qe=JSON.parse(pe.data);qe.progress&&L(qe.progress),qe.progress>=100&&Ie.close()};try{console.log("🚀 [CLIENTE] Iniciando PDF para ID:",Q),E(!0),L(0),v(!1);const pe=await fetch("/api/download/pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mangaId:Q,mangaTitle:(o==null?void 0:o.title)||"Descarga",format:H,jobId:de})});if(!pe.ok)throw new Error("Error en el servidor al generar PDF");const qe=await pe.blob(),nt=window.URL.createObjectURL(qe),ft=document.createElement("a");ft.href=nt,ft.download=`${(o==null?void 0:o.title)||"manga"}.pdf`,document.body.appendChild(ft),ft.click(),ft.remove(),window.URL.revokeObjectURL(nt),console.log("✅ [CLIENTE] PDF descargado con éxito")}catch(pe){console.error("Error initiating PDF generation:",pe),alert("Error al generar PDF (puede que el archivo sea muy grande o Python falló).")}finally{E(!1),Ie.close()}}if(u)return d.jsxs("div",{className:"h-screen bg-[#121212] flex flex-col items-center justify-center gap-4",children:[d.jsx(bs,{size:40,borderWidth:2}),d.jsx("div",{className:"text-gray-400 text-sm",children:"Cargando..."})]});if(!o)return d.jsx("div",{className:"h-screen bg-[#121212] flex items-center justify-center",children:d.jsx("div",{className:"text-gray-400 text-lg",children:"Manga no encontrado"})});const B=$.trim()?ie.filter(H=>{var qe;if(!H.id||!H.title||H.id===o.id)return!1;const Q=$.toLowerCase(),de=H.title.toLowerCase().includes(Q),Ie=H.author?H.author.toLowerCase().includes(Q):!1,pe=((qe=H.categories)==null?void 0:qe.some(nt=>{var ft;return(ft=nt==null?void 0:nt.name)==null?void 0:ft.toLowerCase().includes(Q)}))||!1;return de||Ie||pe}):[];return d.jsxs("div",{className:"h-screen flex flex-col bg-[#121212] overflow-hidden",children:[d.jsx("header",{className:"border-b border-gray-800 z-40 bg-[#121212] flex-shrink-0",children:d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-3 sm:py-4 flex items-center gap-3 sm:gap-4",children:[d.jsx("button",{onClick:e,className:"p-2 hover:bg-[#333] rounded-lg transition-colors text-gray-300 hover:text-white flex-shrink-0",children:d.jsx(No,{className:"w-5 h-5"})}),d.jsx("h1",{className:"text-base sm:text-lg font-bold text-white truncate flex-shrink-0",children:o.title}),d.jsx("div",{className:"flex-1 max-w-md ml-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx(Tc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),d.jsx("input",{type:"text",placeholder:"Buscar comics…",value:$,onChange:H=>Z(H.target.value),className:"w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-3 py-2 text-sm placeholder-gray-400 focus:ring-2 focus:ring-[#bb86fc] focus:outline-none transition-all border border-gray-700/50 focus:border-[#bb86fc]"})]})})]})}),d.jsxs("main",{className:"flex-1 overflow-y-auto bg-[#121212]",children:[d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-4 sm:py-8",children:[!$.trim()&&d.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-6",children:[d.jsx("div",{className:"flex-shrink-0 mx-auto sm:mx-0",children:d.jsx("div",{className:"group w-56 sm:w-64",children:d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",children:o.cover_url?d.jsxs(d.Fragment,{children:[d.jsx(Kn,{src:o.cover_url,alt:o.title,aspectRatio:"2/3",objectFit:"cover",loading:"eager",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-black",children:d.jsx(rv,{className:"w-16 h-16"})})})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h2",{className:"text-2xl sm:text-4xl font-bold text-white mb-3 sm:mb-4",children:o.title}),d.jsx("div",{className:"mb-4",children:d.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[o.author&&o.author.toLowerCase()!=="anónimo"&&o.author.toLowerCase()!=="anonimo"&&d.jsxs(d.Fragment,{children:[d.jsx(M2,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsx("span",{className:"text-sm",children:o.author}),d.jsx("div",{className:"w-1 h-1 bg-gray-600 rounded-full mx-2"})]}),d.jsx(rp,{className:"w-4 h-4 text-[#bb86fc]"}),d.jsxs("span",{className:"text-sm",children:[((K=o.views)==null?void 0:K.toLocaleString())||0," vistas"]})]})}),d.jsxs("div",{className:"mb-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Categorías"}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:(J=o.categories)==null?void 0:J.sort((H,Q)=>{const de={series:1,character:2,genre:3,tag:4,other:5},Ie=H.type||"genre",pe=Q.type||"genre";return(de[Ie]||5)-(de[pe]||5)}).map(H=>{let Q="bg-[#bb86fc]/20 text-[#bb86fc] border-[#bb86fc]/40";return H.type==="character"?Q="bg-blue-500/20 text-blue-300 border-blue-500/30":H.type==="series"?Q="bg-green-500/20 text-green-300 border-green-500/30":H.type==="tag"&&(Q="bg-pink-500/20 text-pink-300 border-pink-500/30"),d.jsx("button",{onClick:()=>i==null?void 0:i(H.name),className:`px-3 py-1.5 text-xs rounded-full border ${Q} hover:opacity-80 transition-opacity cursor-pointer`,children:H.name},H.id)})})]}),o.description&&o.description.trim()!==""&&d.jsxs("div",{className:"mb-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Sinopsis"}),d.jsx("p",{className:"text-sm text-gray-400 leading-relaxed whitespace-pre-wrap",children:o.description})]}),d.jsx("div",{className:"flex flex-col gap-3 sm:gap-4",children:o.chapters&&o.chapters.length>0&&o.chapters[0].pages&&o.chapters[0].pages.length>0&&d.jsxs(d.Fragment,{children:[f&&d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs sm:text-sm font-semibold text-[#bb86fc]",children:"Descargando ZIP"}),d.jsxs("span",{className:"text-xs sm:text-sm font-bold text-[#bb86fc]",children:[p,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${p}%`}})})]}),x&&d.jsxs("div",{className:"w-full",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"text-xs sm:text-sm font-semibold text-[#bb86fc]",children:"Generando PDF"}),d.jsxs("span",{className:"text-xs sm:text-sm font-bold text-[#bb86fc]",children:[O,"%"]})]}),d.jsx("div",{className:"w-full bg-gray-700/40 rounded-full h-2 overflow-hidden border border-[#bb86fc]/30",children:d.jsx("div",{className:"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] h-full transition-all duration-300 ease-out",style:{width:`${O}%`}})})]}),d.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[d.jsxs("div",{className:"relative download-menu-container",children:[d.jsxs("button",{onClick:()=>S(!_),disabled:f,className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx(ga,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:f?`Descargando (${p}%)`:"ZIP"}),d.jsx("span",{className:"sm:hidden",children:"ZIP"})]}),_&&!f&&d.jsxs("div",{className:"absolute top-full mt-2 left-0 bg-[#1f1f1f] border border-gray-700/60 rounded-lg shadow-2xl shadow-black/50 overflow-hidden z-50 min-w-[200px]",children:[d.jsxs("button",{onClick:()=>z("original"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ga,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"Original"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin cambios"})]})]}),d.jsxs("button",{onClick:()=>z("webp"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ga,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"WebP"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Optimizado"})]})]}),d.jsxs("button",{onClick:()=>z("png"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ga,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"PNG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin pérdida"})]})]}),d.jsxs("button",{onClick:()=>z("jpg"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2",children:[d.jsx(ga,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"JPG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Comprimido"})]})]})]})]}),d.jsxs("div",{className:"relative pdf-menu-container",children:[d.jsxs("button",{onClick:()=>v(!P),disabled:x,className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[d.jsx(ya,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:x?`Generando (${O}%)`:"PDF"}),d.jsx("span",{className:"sm:hidden",children:"PDF"})]}),P&&!x&&d.jsxs("div",{className:"absolute top-full mt-2 left-0 bg-[#1f1f1f] border border-gray-700/60 rounded-lg shadow-2xl shadow-black/50 overflow-hidden z-50 min-w-[200px]",children:[d.jsxs("button",{onClick:()=>V("original"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ya,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"Original"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin cambios"})]})]}),d.jsxs("button",{onClick:()=>V("webp"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ya,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"WebP"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Optimizado"})]})]}),d.jsxs("button",{onClick:()=>V("png"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2 border-b border-gray-700/40",children:[d.jsx(ya,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"PNG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Sin pérdida"})]})]}),d.jsxs("button",{onClick:()=>V("jpg"),className:"w-full px-3 py-2 text-left text-xs sm:text-sm text-white hover:bg-[#bb86fc]/20 transition-colors flex items-center gap-2",children:[d.jsx(ya,{className:"w-3 h-3 text-[#bb86fc]"}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold",children:"JPG"}),d.jsx("div",{className:"text-xs text-gray-400",children:"Comprimido"})]})]})]})]}),d.jsxs("button",{onClick:()=>{o!=null&&o.id&&(window.location.hash=`manga/${o.id}/hd`)},className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200",children:[d.jsx(rp,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:"Ver HD"}),d.jsx("span",{className:"sm:hidden",children:"HD"})]}),d.jsxs("button",{onClick:async()=>{try{await navigator.clipboard.writeText(o.id),Ce(!0),setTimeout(()=>Ce(!1),2e3),window.open("https://t.me/waifuofbrodybot","_blank")}catch(H){console.error("Failed to copy:",H)}},className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1 font-semibold text-xs sm:text-sm transition-all duration-200",children:[ee?d.jsx(fd,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}):d.jsx(R2,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"hidden sm:inline",children:ee?"ID Copiado":"Bot Telegram"}),d.jsx("span",{className:"sm:hidden",children:ee?"Copiado":"Bot"})]}),A.map((H,Q)=>d.jsxs("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg flex items-center gap-1.5 font-semibold text-xs sm:text-sm transition-all duration-200 group",children:[d.jsx(N2,{className:"w-3 h-3 sm:w-4 sm:h-4 flex-shrink-0"}),d.jsx("span",{className:"truncate max-w-[150px]",children:H.name}),s&&d.jsx("button",{onClick:de=>{de.preventDefault(),de.stopPropagation(),Xe(Q)},className:"opacity-0 group-hover:opacity-100 hover:text-red-400 transition-all flex-shrink-0",children:d.jsx(Vn,{className:"w-3 h-3 sm:w-4 sm:h-4"})})]},Q)),s&&d.jsx("button",{onClick:()=>b(!0),className:"bg-[#121212] hover:bg-[#1f1f1f] border border-[#bb86fc]/50 hover:border-[#bb86fc] text-[#bb86fc] p-1.5 sm:p-2 rounded-lg transition-all duration-200 flex items-center justify-center",title:"Añadir enlace externo",children:d.jsx(fl,{className:"w-4 h-4 sm:w-5 sm:h-5"})})]})]})})]})]}),$.trim()?d.jsxs("div",{className:"mt-2",children:[d.jsxs("h3",{className:"text-lg font-semibold text-white mb-4",children:["Resultados de búsqueda",B.length>0&&d.jsxs("span",{className:"text-sm text-gray-400 ml-2",children:["(",B.length," ",B.length===1?"resultado":"resultados",")"]})]}),fe?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx(bs,{size:40,borderWidth:2})}):B.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[d.jsx(Tc,{className:"w-12 h-12 text-gray-600 mb-3"}),d.jsxs("p",{className:"text-gray-400 text-sm",children:['No se encontraron comics que coincidan con "',$,'"']})]}):d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3",children:B.map(H=>{var de,Ie;if(!H.id||!H.title)return null;(de=H.chapters)!=null&&de.length;const Q=((Ie=H.chapters)==null?void 0:Ie.reduce((pe,qe)=>{var nt;return pe+(((nt=qe.pages)==null?void 0:nt.length)||0)},0))||0;return d.jsx(KI,{id:H.id,title:H.title,author:H.author||"Desconocido",pageCount:Q,thumbnail:H.cover_url||H.thumbnail_url||void 0,manga:H,onSelect:pe=>{n&&(window.scrollTo({top:0,behavior:"smooth"}),n(pe))}},H.id)})})]}):o.chapters&&o.chapters.length>0&&o.chapters[0].pages&&o.chapters[0].pages.length>0&&d.jsxs("div",{className:"mt-6 sm:mt-8 border-t border-gray-800 pt-6 sm:pt-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4 sm:mb-6",children:[d.jsx("h3",{className:"text-lg font-semibold text-white",children:"Páginas"}),d.jsxs("div",{className:"flex items-center gap-1 bg-[#0a0a0a] border border-gray-800 rounded-lg p-1",children:[d.jsxs("button",{onClick:()=>ht("vertical"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${se==="vertical"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista vertical",children:[d.jsx(op,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Vertical"})]}),d.jsxs("button",{onClick:()=>ht("gallery"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${se==="gallery"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista galería",children:[d.jsx(ip,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Galería"})]}),d.jsxs("button",{onClick:()=>ht("grid"),className:`px-3 py-2 rounded-md flex items-center gap-2 text-xs sm:text-sm font-medium transition-all duration-200 ${se==="grid"?"bg-gradient-to-r from-[#bb86fc] to-[#9966dd] text-white shadow-lg shadow-[#bb86fc]/30":"text-gray-400 hover:text-white hover:bg-[#242424]"}`,title:"Vista cuadrícula",children:[d.jsx(sp,{className:"w-4 h-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Cuadrícula"})]}),se==="vertical"&&d.jsxs("div",{className:"flex items-center gap-1 ml-2 border-l border-gray-700 pl-2",children:[d.jsx("button",{onClick:Le,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Reducir",children:d.jsx($m,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-xs text-gray-300 w-8 text-center hidden sm:inline-block",children:[Math.round(jt*100),"%"]}),d.jsx("button",{onClick:Ae,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Aumentar",children:d.jsx(Bm,{className:"w-4 h-4"})}),d.jsx("button",{onClick:we,className:"p-2 text-gray-400 hover:text-white hover:bg-[#242424] rounded-md transition-colors",title:"Restablecer",children:d.jsx(ab,{className:"w-3 h-3"})})]})]})]}),d.jsx("div",{className:`bg-[#121212] rounded-lg p-2 sm:p-4 transition-all duration-150 ease-out ${se==="vertical"?"flex flex-col items-center gap-4":se==="gallery"?"masonry-container":"grid grid-cols-3 md:grid-cols-5 gap-2"}`,children:se==="gallery"?o.chapters[0].pages.map((H,Q)=>({pageUrl:H,index:Q})).map(({pageUrl:H,index:Q})=>d.jsx("div",{className:"masonry-item group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",onClick:()=>{oe(Q),me(!0)},children:d.jsx(Kn,{src:H,alt:`Página ${Q+1}`,aspectRatio:"auto",objectFit:"contain",loading:Q>2?"lazy":"eager",className:"rounded-lg",imgClassName:"group-hover:scale-110"})},Q)):o.chapters[0].pages.map((H,Q)=>({pageUrl:H,index:Q})).map(({pageUrl:H,index:Q})=>d.jsx("div",{className:se==="vertical"?"relative transition-all duration-200 mx-auto":"group cursor-pointer relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",style:se==="vertical"?{width:`${Math.min(100*jt,100)}%`,maxWidth:jt>1?"none":void 0}:void 0,onClick:()=>{se==="grid"&&(oe(Q),me(!0))},children:d.jsx(Kn,{src:H,alt:`Página ${Q+1}`,aspectRatio:se==="vertical"?"auto":"1/1",objectFit:se==="vertical"?"contain":"cover",loading:Q>2?"lazy":"eager",className:se==="vertical"?"rounded-lg shadow-2xl w-full":"rounded-lg",imgClassName:se==="vertical"?"w-full":"group-hover:scale-110"})},Q))})]}),!$.trim()&&k.length>0&&d.jsxs("div",{className:"mt-8 sm:mt-12 border-t border-gray-800 pt-8 sm:pt-12",children:[d.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-white mb-6",children:"Recomendaciones"}),ye?d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3",children:Array.from({length:6}).map((H,Q)=>d.jsxs("div",{className:"animate-pulse",children:[d.jsx("div",{className:"bg-gray-800 rounded-lg aspect-[2/3] w-full mb-2"}),d.jsx("div",{className:"h-3 bg-gray-800 rounded w-3/4 mx-auto mb-1"}),d.jsx("div",{className:"h-2 bg-gray-800 rounded w-1/2 mx-auto"})]},Q))}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 mb-6 animate-slide-in-right",children:k.slice((tt-1)*ve,tt*ve).map((H,Q)=>d.jsx("div",{children:d.jsxs("div",{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"}),n&&n(H.id)},className:"group cursor-pointer flex flex-col",children:[d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden transition-transform duration-300 hover:scale-[1.02]",children:H.cover_url||H.thumbnail_url?d.jsxs(d.Fragment,{children:[d.jsx(Kn,{src:H.cover_url||H.thumbnail_url||"",alt:H.title,aspectRatio:"2/3",objectFit:"cover",loading:"lazy",imgClassName:"group-hover:scale-110"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none"})]}):d.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center text-white/40 bg-black",children:d.jsx(rv,{className:"w-8 h-8"})})}),d.jsxs("div",{className:"mt-2 flex flex-col gap-0.5",children:[d.jsx("h4",{className:"font-semibold text-xs text-white line-clamp-2 text-center group-hover:text-[#bb86fc] transition-colors duration-300",children:H.title}),H.categories&&H.categories.length>0&&d.jsx("p",{className:"text-xs text-gray-500 text-center truncate",children:(H.categories.find(de=>de.type==="series")||H.categories[0]).name})]})]})},H.id))},tt),k.length>ve&&d.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4 flex-wrap",children:[d.jsx("button",{onClick:()=>Dt(1),disabled:tt===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(eb,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>Dt(H=>Math.max(1,H-1)),disabled:tt===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(pd,{className:"w-4 h-4"})}),d.jsxs("span",{className:"text-sm text-gray-400 px-2",children:["Página ",tt," de ",Math.ceil(k.length/ve)]}),d.jsx("button",{onClick:()=>Dt(H=>Math.min(Math.ceil(k.length/ve),H+1)),disabled:tt===Math.ceil(k.length/ve),className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(md,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>Dt(Math.ceil(k.length/ve)),disabled:tt===Math.ceil(k.length/ve),className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",children:d.jsx(tb,{className:"w-4 h-4"})})]})]})]})]}),d.jsx(gd,{})]}),le&&((Ue=(je=o.chapters)==null?void 0:je[0])==null?void 0:Ue.pages)&&d.jsx(ub,{images:((De=o.chapters)==null?void 0:De[0].pages)||[],initialIndex:q,onClose:()=>me(!1)}),D&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-gradient-to-b from-[#1f1f1f] to-[#121212] rounded-2xl border border-gray-700/40 w-full max-w-md shadow-2xl",children:[d.jsxs("div",{className:"bg-gradient-to-b from-[#2a2a2a]/80 to-[#1f1f1f]/80 border-b border-gray-700/30 px-6 py-4 flex items-center justify-between",children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Añadir Enlace Externo"}),d.jsx("button",{onClick:()=>b(!1),className:"text-gray-500 hover:text-white transition-colors p-1.5 rounded-lg hover:bg-white/10",children:d.jsx(Vn,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-200 mb-2",children:"Nombre del Enlace"}),d.jsx("input",{type:"text",placeholder:"Ej: Servidor Alternativo",value:w.name,onChange:H=>T({...w,name:H.target.value}),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-200 mb-2",children:"URL del Enlace"}),d.jsx("input",{type:"url",placeholder:"https://ejemplo.com/descarga",value:w.url,onChange:H=>T({...w,url:H.target.value}),className:"w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all"})]}),d.jsxs("div",{className:"flex gap-3 pt-2",children:[d.jsx("button",{onClick:()=>b(!1),className:"flex-1 bg-[#1a1a1a] border border-gray-600/50 hover:border-gray-500 hover:bg-[#242424] text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all",children:"Cancelar"}),d.jsx("button",{onClick:Ht,disabled:!w.name.trim()||!w.url.trim(),className:"flex-1 bg-gradient-to-r from-[#bb86fc] to-[#9966dd] hover:from-[#9966dd] hover:to-[#7744cc] disabled:opacity-50 disabled:cursor-not-allowed text-white px-4 py-3 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/40 hover:shadow-[#bb86fc]/60",children:"Añadir Enlace"})]})]})]})})]})}function I3({manga:t,chapter:e,onBack:n}){const[r,i]=F.useState(0);if(!e.pages||e.pages.length===0)return d.jsxs("div",{className:"h-screen bg-[#121212] flex flex-col items-center justify-center",children:[d.jsx("button",{onClick:n,className:"absolute top-6 left-6 p-2 hover:bg-[#333] rounded-lg transition-colors text-gray-300 hover:text-white",children:d.jsx(No,{className:"w-5 h-5"})}),d.jsx("div",{className:"text-gray-400 text-lg",children:"No hay páginas disponibles"})]});const s=()=>{r>0&&i(r-1)},o=()=>{r{const c=u<2,f=b3(a);return d.jsx("div",{className:"w-full flex justify-center",children:d.jsx(Kn,{src:f,alt:`Página ${u+1}`,aspectRatio:"auto",objectFit:"contain",loading:c?"eager":"lazy",className:"max-w-full shadow-2xl",showPlaceholder:u>0})},u)}),d.jsx("div",{className:"w-full mt-8",children:d.jsx(gd,{})})]})}),d.jsx("div",{className:"border-t border-gray-700/60 bg-gradient-to-r from-[#2a2a2a] to-[#252525] px-6 py-6 flex-shrink-0",children:d.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[d.jsxs("button",{onClick:s,disabled:r===0,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-all",children:[d.jsx(pd,{className:"w-5 h-5"}),"Anterior"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"range",min:"0",max:e.pages.length-1,value:r,onChange:a=>i(parseInt(a.target.value)),className:"w-64 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-[#bb86fc]"}),d.jsxs("span",{className:"text-sm text-gray-400 w-12 text-right",children:[r+1,"/",e.pages.length]})]}),d.jsxs("button",{onClick:o,disabled:r===e.pages.length-1,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-all",children:["Siguiente",d.jsx(md,{className:"w-5 h-5"})]})]})})]})}const QI="settings",YI="info",T3=`# Bienvenid@ a Twisted Brody MangaFlow +¡Tu plataforma definitiva para la gestión y lectura de mangas! + +Este proyecto nació con la misión de ofrecer una experiencia de lectura fluida, moderna y sin interrupciones, diseñada por fans para fans. + +## 🌟 Características Principales + +* **⚡ Lectura sin límites:** Disfruta de una interfaz optimizada, rápida y responsiva. +* **📥 Descargas Flexibles:** Baja tus capítulos favoritos en formato **ZIP** o **PDF** para leer offline. +* **🔄 Conversión Inteligente:** Nuestro servidor procesa las imágenes para darte la mejor calidad y compatibilidad. + +## 🤝 Comunidad y Apoyo + +Este es un proyecto **sin fines de lucro**, desarrollado por pura pasión. + +Sin embargo, si valoras mi trabajo y quieres apoyarme para mantener el proyecto vivo, puedes suscribirte a mi **Patreon**. ¡Tu apoyo significa mucho! + +* [**💜 Apóyame en Patreon**](https://www.patreon.com/cw/Twistedbrody) + +### 💡 ¿Tienes nuevas ideas? +¡Quiero escucharlas! Si tienes sugerencias, feedback o ideas locas, háblame directamente: + +* **Telegram:** [@twistedbrodyoficial](https://t.me/twistedbrodyoficial) + +También puedes unirte a nuestros canales: +* [Canal Principal](https://t.me/twistedbrody) +* [Canal Hub](https://t.me/+CmmZFHM9hpViYzMx) +* [X (Twitter)](https://x.com/TwistedBrody) + +--- +> **Disclaimer:** Todo el contenido es propiedad de sus respectivos autores. Apoya el material original siempre que sea posible. + + +`;async function S3(t){const e=vt(Ge,QI,YI),n={content:t,updatedAt:new Date().toISOString()};await Og(e,n)}function k3(t){const e=vt(Ge,QI,YI);return Mg(e,n=>{n.exists()?t(n.data()):t({content:T3,updatedAt:new Date().toISOString()})})}function C3(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const N3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,A3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P3={};function Qx(t,e){return(P3.jsx?A3:N3).test(t)}const R3=/[ \t\n\f\r]/g;function D3(t){return typeof t=="object"?t.type==="text"?Yx(t.value):!1:Yx(t)}function Yx(t){return t.replace(R3,"")===""}class Bl{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Bl.prototype.normal={};Bl.prototype.property={};Bl.prototype.space=void 0;function XI(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bl(n,r,e)}function Lp(t){return t.toLowerCase()}class Cn{constructor(e,n){this.attribute=n,this.property=e}}Cn.prototype.attribute="";Cn.prototype.booleanish=!1;Cn.prototype.boolean=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.defined=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.number=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.property="";Cn.prototype.spaceSeparated=!1;Cn.prototype.space=void 0;let j3=0;const Oe=zs(),Nt=zs(),Mp=zs(),X=zs(),it=zs(),wo=zs(),Rn=zs();function zs(){return 2**++j3}const Vp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:Nt,commaOrSpaceSeparated:Rn,commaSeparated:wo,number:X,overloadedBoolean:Mp,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),Xh=Object.keys(Vp);class Qg extends Cn{constructor(e,n,r,i){let s=-1;if(super(e,n),Xx(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&F3.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Jx,B3);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Jx.test(s)){let o=s.replace(V3,z3);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=Qg}return new i(r,e)}function z3(t){return"-"+t.toLowerCase()}function B3(t){return t.charAt(1).toUpperCase()}const $3=XI([JI,O3,tT,nT,rT],"html"),Yg=XI([JI,L3,tT,nT,rT],"svg");function H3(t){return t.join(" ").trim()}var Xg={},Zx=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,q3=/\n/g,W3=/^\s*/,G3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,K3=/^:\s*/,Q3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Y3=/^[;\s]*/,X3=/^\s+|\s+$/g,J3=` +`,ew="/",tw="*",hs="",Z3="comment",e5="declaration";function t5(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(_){var S=_.match(q3);S&&(n+=S.length);var P=_.lastIndexOf(J3);r=~P?_.length-P:r+_.length}function s(){var _={line:n,column:r};return function(S){return S.position=new o(_),c(),S}}function o(_){this.start=_,this.end={line:n,column:r},this.source=e.source}o.prototype.content=t;function a(_){var S=new Error(e.source+":"+n+":"+r+": "+_);if(S.reason=_,S.filename=e.source,S.line=n,S.column=r,S.source=t,!e.silent)throw S}function u(_){var S=_.exec(t);if(S){var P=S[0];return i(P),t=t.slice(P.length),S}}function c(){u(W3)}function f(_){var S;for(_=_||[];S=h();)S!==!1&&_.push(S);return _}function h(){var _=s();if(!(ew!=t.charAt(0)||tw!=t.charAt(1))){for(var S=2;hs!=t.charAt(S)&&(tw!=t.charAt(S)||ew!=t.charAt(S+1));)++S;if(S+=2,hs===t.charAt(S-1))return a("End of comment missing");var P=t.slice(2,S-2);return r+=2,i(P),t=t.slice(S),r+=2,_({type:Z3,comment:P})}}function p(){var _=s(),S=u(G3);if(S){if(h(),!u(K3))return a("property missing ':'");var P=u(Q3),v=_({type:e5,property:nw(S[0].replace(Zx,hs)),value:P?nw(P[0].replace(Zx,hs)):hs});return u(Y3),v}}function g(){var _=[];f(_);for(var S;S=p();)S!==!1&&(_.push(S),f(_));return _}return c(),g()}function nw(t){return t?t.replace(X3,hs):hs}var n5=t5,r5=ec&&ec.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xg,"__esModule",{value:!0});Xg.default=s5;const i5=r5(n5);function s5(t,e){let n=null;if(!t||typeof t!="string")return n;const r=(0,i5.default)(t),i=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?e(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Kd={};Object.defineProperty(Kd,"__esModule",{value:!0});Kd.camelCase=void 0;var o5=/^--[a-zA-Z0-9_-]+$/,a5=/-([a-z])/g,l5=/^[^-]+$/,u5=/^-(webkit|moz|ms|o|khtml)-/,c5=/^-(ms)-/,d5=function(t){return!t||l5.test(t)||o5.test(t)},h5=function(t,e){return e.toUpperCase()},rw=function(t,e){return"".concat(e,"-")},f5=function(t,e){return e===void 0&&(e={}),d5(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(c5,rw):t=t.replace(u5,rw),t.replace(a5,h5))};Kd.camelCase=f5;var p5=ec&&ec.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},m5=p5(Xg),g5=Kd;function Fp(t,e){var n={};return!t||typeof t!="string"||(0,m5.default)(t,function(r,i){r&&i&&(n[(0,g5.camelCase)(r,e)]=i)}),n}Fp.default=Fp;var y5=Fp;const v5=Yc(y5),iT=sT("end"),Jg=sT("start");function sT(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function x5(t){const e=Jg(t),n=iT(t);if(e&&n)return{start:e,end:n}}function Wa(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?iw(t.position):"start"in t||"end"in t?iw(t):"line"in t||"column"in t?Up(t):""}function Up(t){return sw(t&&t.line)+":"+sw(t&&t.column)}function iw(t){return Up(t&&t.start)+"-"+Up(t&&t.end)}function sw(t){return t&&typeof t=="number"?t:1}class dn extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Wa(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const Zg={}.hasOwnProperty,w5=new Map,_5=/[A-Z]/g,b5=new Set(["table","tbody","thead","tfoot","tr"]),E5=new Set(["td","th"]),oT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function I5(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=R5(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=P5(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Yg:$3,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=aT(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function aT(t,e,n){if(e.type==="element")return T5(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return S5(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return C5(t,e,n);if(e.type==="mdxjsEsm")return k5(t,e);if(e.type==="root")return N5(t,e,n);if(e.type==="text")return A5(t,e)}function T5(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yg,t.schema=i),t.ancestors.push(e);const s=uT(t,e.tagName,!1),o=D5(t,e);let a=ty(t,e);return b5.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!D3(u):!0})),lT(t,o,s,e),ey(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function S5(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Il(t,e.position)}function k5(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Il(t,e.position)}function C5(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Yg,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:uT(t,e.name,!0),o=j5(t,e),a=ty(t,e);return lT(t,o,s,e),ey(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function N5(t,e,n){const r={};return ey(r,ty(t,e)),t.create(e,t.Fragment,r,n)}function A5(t,e){return e.value}function lT(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function ey(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function P5(t,e,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:e;return a?c(s,o,a):c(s,o)}}function R5(t,e){return n;function n(r,i,s,o){const a=Array.isArray(s.children),u=Jg(r);return e(i,s,o,a,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function D5(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Zg.call(e.properties,i)){const s=O5(t,i,e.properties[i]);if(s){const[o,a]=s;t.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&E5.has(e.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function j5(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else Il(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,s=t.evaluater.evaluateExpression(a.expression)}else Il(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function ty(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:w5;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s0?(Rr(t,t.length,0,e),t):e}const lw={}.hasOwnProperty;function $5(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function _o(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _r=is(/[A-Za-z]/),Ln=is(/[\dA-Za-z]/),W5=is(/[#-'*+\--9=?A-Z^-~]/);function zp(t){return t!==null&&(t<32||t===127)}const Bp=is(/\d/),G5=is(/[\dA-Fa-f]/),K5=is(/[!-/:-@[-`{-~]/);function Se(t){return t!==null&&t<-2}function kn(t){return t!==null&&(t<0||t===32)}function Ye(t){return t===-2||t===-1||t===32}const Q5=is(new RegExp("\\p{P}|\\p{S}","u")),Y5=is(/\s/);function is(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Xo(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function at(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return Ye(u)?(t.enter(n),a(u)):e(u)}function a(u){return Ye(u)&&s++o))return;const b=e.events.length;let w=b,T,A;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){if(T){A=e.events[w][1].end;break}T=!0}for(v(r),D=b;DE;){const L=n[O];e.containerState=L[1],L[0].exit.call(e,t)}n.length=E}function x(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function t6(t,e,n){return at(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cw(t){if(t===null||kn(t)||Y5(t))return 1;if(Q5(t))return 2}function ry(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[r][1].end},p={...t[n][1].start};dw(h,-u),dw(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...t[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[r][1].end={...o.start},t[n][1].start={...a.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=qn(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=qn(c,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=qn(c,ry(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=qn(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,c=qn(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,Rr(t,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n0&&Ye(D)?at(t,x,"linePrefix",s+1)(D):x(D)}function x(D){return D===null||Se(D)?t.check(hw,S,O)(D):(t.enter("codeFlowValue"),E(D))}function E(D){return D===null||Se(D)?(t.exit("codeFlowValue"),x(D)):(t.consume(D),E)}function O(D){return t.exit("codeFenced"),e(D)}function L(D,b,w){let T=0;return A;function A(he){return D.enter("lineEnding"),D.consume(he),D.exit("lineEnding"),N}function N(he){return D.enter("codeFencedFence"),Ye(he)?at(D,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(he):j(he)}function j(he){return he===a?(D.enter("codeFencedFenceSequence"),C(he)):w(he)}function C(he){return he===a?(T++,D.consume(he),C):T>=o?(D.exit("codeFencedFenceSequence"),Ye(he)?at(D,se,"whitespace")(he):se(he)):w(he)}function se(he){return he===null||Se(he)?(D.exit("codeFencedFence"),b(he)):w(he)}}}function f6(t,e,n){const r=this;return i;function i(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const Zh={name:"codeIndented",tokenize:m6},p6={partial:!0,tokenize:g6};function m6(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),at(t,s,"linePrefix",5)(c)}function s(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):Se(c)?t.attempt(p6,o,u)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Se(c)?(t.exit("codeFlowValue"),o(c)):(t.consume(c),a)}function u(c){return t.exit("codeIndented"),e(c)}}function g6(t,e,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Se(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):at(t,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):Se(o)?i(o):n(o)}}const y6={name:"codeText",previous:x6,resolve:v6,tokenize:w6};function v6(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&va(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),va(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),va(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(o):t.interrupt(r.parser.constructs.flow,n,e)(o)}}function gT(t,e,n,r,i,s,o,a,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return h;function h(v){return v===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(v),t.exit(s),p):v===null||v===32||v===41||zp(v)?n(v):(t.enter(r),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),S(v))}function p(v){return v===62?(t.enter(s),t.consume(v),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===62?(t.exit("chunkString"),t.exit(a),p(v)):v===null||v===60||Se(v)?n(v):(t.consume(v),v===92?_:g)}function _(v){return v===60||v===62||v===92?(t.consume(v),g):g(v)}function S(v){return!f&&(v===null||v===41||kn(v))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(r),e(v)):f999||g===null||g===91||g===93&&!u||g===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(t.exit(s),t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):Se(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||Se(g)||a++>999?(t.exit("chunkString"),f(g)):(t.consume(g),u||(u=!Ye(g)),g===92?p:h)}function p(g){return g===91||g===92||g===93?(t.consume(g),a++,h):h(g)}}function vT(t,e,n,r,i,s){let o;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),o=p===40?41:p,u):n(p)}function u(p){return p===o?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(s),c(p))}function c(p){return p===o?(t.exit(s),u(o)):p===null?n(p):Se(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),at(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===o||p===null||Se(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?h:f)}function h(p){return p===o||p===92?(t.consume(p),f):f(p)}}function Ga(t,e){let n;return r;function r(i){return Se(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ye(i)?at(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const C6={name:"definition",tokenize:A6},N6={partial:!0,tokenize:P6};function A6(t,e,n){const r=this;let i;return s;function s(g){return t.enter("definition"),o(g)}function o(g){return yT.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return i=_o(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),u):n(g)}function u(g){return kn(g)?Ga(t,c)(g):c(g)}function c(g){return gT(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function f(g){return t.attempt(N6,h,h)(g)}function h(g){return Ye(g)?at(t,p,"whitespace")(g):p(g)}function p(g){return g===null||Se(g)?(t.exit("definition"),r.parser.defined.push(i),e(g)):n(g)}}function P6(t,e,n){return r;function r(a){return kn(a)?Ga(t,i)(a):n(a)}function i(a){return vT(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Ye(a)?at(t,o,"whitespace")(a):o(a)}function o(a){return a===null||Se(a)?e(a):n(a)}}const R6={name:"hardBreakEscape",tokenize:D6};function D6(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return Se(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const j6={name:"headingAtx",resolve:O6,tokenize:L6};function O6(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Rr(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function L6(t,e,n){let r=0;return i;function i(f){return t.enter("atxHeading"),s(f)}function s(f){return t.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(t.consume(f),o):f===null||kn(f)?(t.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(t.enter("atxHeadingSequence"),u(f)):f===null||Se(f)?(t.exit("atxHeading"),e(f)):Ye(f)?at(t,a,"whitespace")(f):(t.enter("atxHeadingText"),c(f))}function u(f){return f===35?(t.consume(f),u):(t.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||kn(f)?(t.exit("atxHeadingText"),a(f)):(t.consume(f),c)}}const M6=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],pw=["pre","script","style","textarea"],V6={concrete:!0,name:"htmlFlow",resolveTo:z6,tokenize:B6},F6={partial:!0,tokenize:H6},U6={partial:!0,tokenize:$6};function z6(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function B6(t,e,n){const r=this;let i,s,o,a,u;return c;function c(R){return f(R)}function f(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),h}function h(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),s=!0,S):R===63?(t.consume(R),i=3,r.interrupt?e:k):_r(R)?(t.consume(R),o=String.fromCharCode(R),P):n(R)}function p(R){return R===45?(t.consume(R),i=2,g):R===91?(t.consume(R),i=5,a=0,_):_r(R)?(t.consume(R),i=4,r.interrupt?e:k):n(R)}function g(R){return R===45?(t.consume(R),r.interrupt?e:k):n(R)}function _(R){const $="CDATA[";return R===$.charCodeAt(a++)?(t.consume(R),a===$.length?r.interrupt?e:j:_):n(R)}function S(R){return _r(R)?(t.consume(R),o=String.fromCharCode(R),P):n(R)}function P(R){if(R===null||R===47||R===62||kn(R)){const $=R===47,Z=o.toLowerCase();return!$&&!s&&pw.includes(Z)?(i=1,r.interrupt?e(R):j(R)):M6.includes(o.toLowerCase())?(i=6,$?(t.consume(R),v):r.interrupt?e(R):j(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):s?x(R):E(R))}return R===45||Ln(R)?(t.consume(R),o+=String.fromCharCode(R),P):n(R)}function v(R){return R===62?(t.consume(R),r.interrupt?e:j):n(R)}function x(R){return Ye(R)?(t.consume(R),x):A(R)}function E(R){return R===47?(t.consume(R),A):R===58||R===95||_r(R)?(t.consume(R),O):Ye(R)?(t.consume(R),E):A(R)}function O(R){return R===45||R===46||R===58||R===95||Ln(R)?(t.consume(R),O):L(R)}function L(R){return R===61?(t.consume(R),D):Ye(R)?(t.consume(R),L):E(R)}function D(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),u=R,b):Ye(R)?(t.consume(R),D):w(R)}function b(R){return R===u?(t.consume(R),u=null,T):R===null||Se(R)?n(R):(t.consume(R),b)}function w(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||kn(R)?L(R):(t.consume(R),w)}function T(R){return R===47||R===62||Ye(R)?E(R):n(R)}function A(R){return R===62?(t.consume(R),N):n(R)}function N(R){return R===null||Se(R)?j(R):Ye(R)?(t.consume(R),N):n(R)}function j(R){return R===45&&i===2?(t.consume(R),le):R===60&&i===1?(t.consume(R),me):R===62&&i===4?(t.consume(R),ge):R===63&&i===3?(t.consume(R),k):R===93&&i===5?(t.consume(R),oe):Se(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(F6,ye,C)(R)):R===null||Se(R)?(t.exit("htmlFlowData"),C(R)):(t.consume(R),j)}function C(R){return t.check(U6,se,ye)(R)}function se(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),he}function he(R){return R===null||Se(R)?C(R):(t.enter("htmlFlowData"),j(R))}function le(R){return R===45?(t.consume(R),k):j(R)}function me(R){return R===47?(t.consume(R),o="",q):j(R)}function q(R){if(R===62){const $=o.toLowerCase();return pw.includes($)?(t.consume(R),ge):j(R)}return _r(R)&&o.length<8?(t.consume(R),o+=String.fromCharCode(R),q):j(R)}function oe(R){return R===93?(t.consume(R),k):j(R)}function k(R){return R===62?(t.consume(R),ge):R===45&&i===2?(t.consume(R),k):j(R)}function ge(R){return R===null||Se(R)?(t.exit("htmlFlowData"),ye(R)):(t.consume(R),ge)}function ye(R){return t.exit("htmlFlow"),e(R)}}function $6(t,e,n){const r=this;return i;function i(o){return Se(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}function H6(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Qd,e,n)}}const q6={name:"htmlText",tokenize:W6};function W6(t,e,n){const r=this;let i,s,o;return a;function a(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),u}function u(k){return k===33?(t.consume(k),c):k===47?(t.consume(k),L):k===63?(t.consume(k),E):_r(k)?(t.consume(k),w):n(k)}function c(k){return k===45?(t.consume(k),f):k===91?(t.consume(k),s=0,_):_r(k)?(t.consume(k),x):n(k)}function f(k){return k===45?(t.consume(k),g):n(k)}function h(k){return k===null?n(k):k===45?(t.consume(k),p):Se(k)?(o=h,me(k)):(t.consume(k),h)}function p(k){return k===45?(t.consume(k),g):h(k)}function g(k){return k===62?le(k):k===45?p(k):h(k)}function _(k){const ge="CDATA[";return k===ge.charCodeAt(s++)?(t.consume(k),s===ge.length?S:_):n(k)}function S(k){return k===null?n(k):k===93?(t.consume(k),P):Se(k)?(o=S,me(k)):(t.consume(k),S)}function P(k){return k===93?(t.consume(k),v):S(k)}function v(k){return k===62?le(k):k===93?(t.consume(k),v):S(k)}function x(k){return k===null||k===62?le(k):Se(k)?(o=x,me(k)):(t.consume(k),x)}function E(k){return k===null?n(k):k===63?(t.consume(k),O):Se(k)?(o=E,me(k)):(t.consume(k),E)}function O(k){return k===62?le(k):E(k)}function L(k){return _r(k)?(t.consume(k),D):n(k)}function D(k){return k===45||Ln(k)?(t.consume(k),D):b(k)}function b(k){return Se(k)?(o=b,me(k)):Ye(k)?(t.consume(k),b):le(k)}function w(k){return k===45||Ln(k)?(t.consume(k),w):k===47||k===62||kn(k)?T(k):n(k)}function T(k){return k===47?(t.consume(k),le):k===58||k===95||_r(k)?(t.consume(k),A):Se(k)?(o=T,me(k)):Ye(k)?(t.consume(k),T):le(k)}function A(k){return k===45||k===46||k===58||k===95||Ln(k)?(t.consume(k),A):N(k)}function N(k){return k===61?(t.consume(k),j):Se(k)?(o=N,me(k)):Ye(k)?(t.consume(k),N):T(k)}function j(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),i=k,C):Se(k)?(o=j,me(k)):Ye(k)?(t.consume(k),j):(t.consume(k),se)}function C(k){return k===i?(t.consume(k),i=void 0,he):k===null?n(k):Se(k)?(o=C,me(k)):(t.consume(k),C)}function se(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||kn(k)?T(k):(t.consume(k),se)}function he(k){return k===47||k===62||kn(k)?T(k):n(k)}function le(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function me(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),q}function q(k){return Ye(k)?at(t,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):oe(k)}function oe(k){return t.enter("htmlTextData"),o(k)}}const iy={name:"labelEnd",resolveAll:Y6,resolveTo:X6,tokenize:J6},G6={tokenize:Z6},K6={tokenize:eO},Q6={tokenize:tO};function Y6(t){let e=-1;const n=[];for(;++e=3&&(c===null||Se(c))?(t.exit("thematicBreak"),e(c)):n(c)}function u(c){return c===i?(t.consume(c),r++,u):(t.exit("thematicBreakSequence"),Ye(c)?at(t,a,"whitespace")(c):a(c))}}const gn={continuation:{tokenize:dO},exit:fO,name:"list",tokenize:cO},lO={partial:!0,tokenize:pO},uO={partial:!0,tokenize:hO};function cO(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(g){const _=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Bp(g)){if(r.containerState.type||(r.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),g===42||g===45?t.check(Ju,n,c)(g):c(g);if(!r.interrupt||g===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(g)}return n(g)}function u(g){return Bp(g)&&++o<10?(t.consume(g),u):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(t.exit("listItemValue"),c(g)):n(g)}function c(g){return t.enter("listItemMarker"),t.consume(g),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,t.check(Qd,r.interrupt?n:f,t.attempt(lO,p,h))}function f(g){return r.containerState.initialBlankLine=!0,s++,p(g)}function h(g){return Ye(g)?(t.enter("listItemPrefixWhitespace"),t.consume(g),t.exit("listItemPrefixWhitespace"),p):n(g)}function p(g){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(g)}}function dO(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Qd,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,at(t,e,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Ye(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(uO,e,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,at(t,t.attempt(gn,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hO(t,e,n){const r=this;return at(t,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?e(s):n(s)}}function fO(t){t.exit(this.containerState.type)}function pO(t,e,n){const r=this;return at(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Ye(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const mw={name:"setextUnderline",resolveTo:mO,tokenize:gO};function mO(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",o,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=o,t.push(["exit",o,e]),t}function gO(t,e,n){const r=this;let i;return s;function s(c){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),Ye(c)?at(t,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Se(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const yO={tokenize:vO};function vO(t){const e=this,n=t.attempt(Qd,r,t.attempt(this.parser.constructs.flowInitial,i,at(t,t.attempt(this.parser.constructs.flow,i,t.attempt(E6,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const xO={resolveAll:wT()},wO=xT("string"),_O=xT("text");function xT(t){return{resolveAll:wT(t==="text"?bO:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,o,a);return o;function o(f){return c(f)?s(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),s(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const h=i[f];let p=-1;if(h)for(;++p-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(t[i].slice(0,s))}return o}function OO(t,e){let n=-1;const r=[];let i;for(;++n0){const je=B.tokenStack[B.tokenStack.length-1];(je[1]||yw).call(B,void 0,je[0])}for(V.position={start:gi(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:gi(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function QO(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function YO(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function XO(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Xo(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let o,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),o=t.footnoteOrder.length):o=s+1,a+=1,t.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,c),t.applyData(e,c)}function JO(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ZO(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ET(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function eL(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ET(t,e);const i={src:Xo(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function tL(t,e){const n={src:Xo(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function nL(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function rL(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ET(t,e);const i={href:Xo(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function iL(t,e){const n={href:Xo(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function sL(t,e,n){const r=t.all(e),i=n?oL(n):IT(e),s={},o=[];if(typeof e.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a1}function aL(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=Jg(e.children[1]),u=iT(e.children[e.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function hL(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:e.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(ww(e.slice(i),i>0,!1)),s.join("")}function ww(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===vw||s===xw;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===vw||s===xw;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function mL(t,e){const n={type:"text",value:pL(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function gL(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const yL={blockquote:WO,break:GO,code:KO,delete:QO,emphasis:YO,footnoteReference:XO,heading:JO,html:ZO,imageReference:eL,image:tL,inlineCode:nL,linkReference:rL,link:iL,listItem:sL,list:aL,paragraph:lL,root:uL,strong:cL,table:dL,tableCell:fL,tableRow:hL,text:mL,thematicBreak:gL,toml:ku,yaml:ku,definition:ku,footnoteDefinition:ku};function ku(){}const TT=-1,Yd=0,Ka=1,Kc=2,sy=3,oy=4,ay=5,ly=6,ST=7,kT=8,_w=typeof self=="object"?self:globalThis,vL=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,o]=e[i];switch(s){case Yd:case TT:return n(o,i);case Ka:{const a=n([],i);for(const u of o)a.push(r(u));return a}case Kc:{const a=n({},i);for(const[u,c]of o)a[r(u)]=r(c);return a}case sy:return n(new Date(o),i);case oy:{const{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case ay:{const a=n(new Map,i);for(const[u,c]of o)a.set(r(u),r(c));return a}case ly:{const a=n(new Set,i);for(const u of o)a.add(r(u));return a}case ST:{const{name:a,message:u}=o;return n(new _w[a](u),i)}case kT:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new _w[s](o),i)};return r},bw=t=>vL(new Map,t)(0),qs="",{toString:xL}={},{keys:wL}=Object,xa=t=>{const e=typeof t;if(e!=="object"||!t)return[Yd,e];const n=xL.call(t).slice(8,-1);switch(n){case"Array":return[Ka,qs];case"Object":return[Kc,qs];case"Date":return[sy,qs];case"RegExp":return[oy,qs];case"Map":return[ay,qs];case"Set":return[ly,qs];case"DataView":return[Ka,n]}return n.includes("Array")?[Ka,n]:n.includes("Error")?[ST,n]:[Kc,n]},Cu=([t,e])=>t===Yd&&(e==="function"||e==="symbol"),_L=(t,e,n,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return n.set(a,u),u},s=o=>{if(n.has(o))return n.get(o);let[a,u]=xa(o);switch(a){case Yd:{let f=o;switch(u){case"bigint":a=kT,f=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([TT],o)}return i([a,f],o)}case Ka:{if(u){let p=o;return u==="DataView"?p=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(o)),i([u,[...p]],o)}const f=[],h=i([a,f],o);for(const p of o)f.push(s(p));return h}case Kc:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const f=[],h=i([a,f],o);for(const p of wL(o))(t||!Cu(xa(o[p])))&&f.push([s(p),s(o[p])]);return h}case sy:return i([a,o.toISOString()],o);case oy:{const{source:f,flags:h}=o;return i([a,{source:f,flags:h}],o)}case ay:{const f=[],h=i([a,f],o);for(const[p,g]of o)(t||!(Cu(xa(p))||Cu(xa(g))))&&f.push([s(p),s(g)]);return h}case ly:{const f=[],h=i([a,f],o);for(const p of o)(t||!Cu(xa(p)))&&f.push(s(p));return h}}const{message:c}=o;return i([a,{name:u,message:c}],o)};return s},Ew=(t,{json:e,lossy:n}={})=>{const r=[];return _L(!(e||n),!!e,new Map,r)(t),r},Qc=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?bw(Ew(t,e)):structuredClone(t):(t,e)=>bw(Ew(t,e));function bL(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function EL(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function IL(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||bL,r=t.options.footnoteBackLabel||EL,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&_.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,g);typeof x=="string"&&(x={type:"text",value:x}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,g),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const P=f[f.length-1];if(P&&P.type==="element"&&P.tagName==="p"){const x=P.children[P.children.length-1];x&&x.type==="text"?x.value+=" ":P.children.push({type:"text",value:" "}),P.children.push(..._)}else f.push(..._);const v={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(f,!0)};t.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Qc(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` +`}]}}const CT=function(t){if(t==null)return CL;if(typeof t=="function")return Xd(t);if(typeof t=="object")return Array.isArray(t)?TL(t):SL(t);if(typeof t=="string")return kL(t);throw new Error("Expected function, string, or object as test")};function TL(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let g=NT,_,S,P;if((!e||s(u,c,f[f.length-1]||void 0))&&(g=DL(n(u,f)),g[0]===Iw))return g;if("children"in u&&u.children){const v=u;if(v.children&&g[0]!==PL)for(S=(r?v.children.length:-1)+o,P=f.concat(v);S>-1&&S0&&n.push({type:"text",value:` +`}),n}function Tw(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Sw(t,e){const n=OL(t,e),r=n.one(t,void 0),i=IL(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` +`},i),s}function UL(t,e){return t&&"run"in t?async function(n,r){const i=Sw(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Sw(n,{file:r,...t||e})}}function kw(t){if(t)throw t}var Zu=Object.prototype.hasOwnProperty,PT=Object.prototype.toString,Cw=Object.defineProperty,Nw=Object.getOwnPropertyDescriptor,Aw=function(e){return typeof Array.isArray=="function"?Array.isArray(e):PT.call(e)==="[object Array]"},Pw=function(e){if(!e||PT.call(e)!=="[object Object]")return!1;var n=Zu.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Zu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||Zu.call(e,i)},Rw=function(e,n){Cw&&n.name==="__proto__"?Cw(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},Dw=function(e,n){if(n==="__proto__")if(Zu.call(e,n)){if(Nw)return Nw(e,n).value}else return;return e[n]},zL=function t(){var e,n,r,i,s,o,a=arguments[0],u=1,c=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=t.apply(this,o)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){n||(n=!0,e(o,...a))}function s(o){i(null,o)}}const vr={basename:HL,dirname:qL,extname:WL,join:GL,sep:"/"};function HL(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');$l(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=t.length),t.slice(n,r)}function qL(t){if($l(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function WL(t){$l(t);let e=t.length,n=-1,r=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){r=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function GL(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function QL(t,e){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=t.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,o):n=t.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function $l(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const YL={cwd:XL};function XL(){return"/"}function Wp(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function JL(t){if(typeof t=="string")t=new URL(t);else if(!Wp(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return ZL(t)}function ZL(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[g,..._]=f;const S=r[p][1];qp(S)&&qp(g)&&(g=tf(!0,S,g)),r[p]=[c,g,..._]}}}}const rM=new uy().freeze();function of(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function af(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function lf(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ow(t){if(!qp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Lw(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nu(t){return iM(t)?t:new RT(t)}function iM(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function sM(t){return typeof t=="string"||oM(t)}function oM(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const aM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Mw=[],Vw={allowDangerousHtml:!0},lM=/^(https?|ircs?|mailto|xmpp)$/i,uM=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cM(t){const e=dM(t),n=hM(t);return fM(e.runSync(e.parse(n),n),t)}function dM(t){const e=t.rehypePlugins||Mw,n=t.remarkPlugins||Mw,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Vw}:Vw;return rM().use(qO).use(n).use(UL,r).use(e)}function hM(t){const e=t.children||"",n=new RT;return typeof e=="string"&&(n.value=e),n}function fM(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,o=e.skipHtml,a=e.unwrapDisallowed,u=e.urlTransform||pM;for(const f of uM)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+aM+f.id,void 0);return AT(t,c),I5(t,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(f,h,p){if(f.type==="raw"&&p&&typeof h=="number")return o?p.children.splice(h,1):p.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let g;for(g in Jh)if(Object.hasOwn(Jh,g)&&Object.hasOwn(f.properties,g)){const _=f.properties[g],S=Jh[g];(S===null||S.includes(f.tagName))&&(f.properties[g]=u(String(_||""),g,f))}}if(f.type==="element"){let g=n?!n.includes(f.tagName):s?s.includes(f.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(f,h,p)),g&&p&&typeof h=="number")return a&&f.children?p.children.splice(h,1,...f.children):p.children.splice(h,1),h}}}function pM(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||lM.test(t.slice(0,e))?t:""}function mM({onBack:t,isAdmin:e}){const[n,r]=F.useState(""),[i,s]=F.useState(!1),[o,a]=F.useState(""),[u,c]=F.useState(!0);F.useEffect(()=>{const p=k3(g=>{g&&r(g.content),c(!1)});return()=>p()},[]);const f=async()=>{try{await S3(o),s(!1)}catch(p){console.error("Error saving info:",p),alert("Error al guardar la información.")}},h=()=>{a(n),s(!0)};return d.jsx("div",{className:"min-h-screen bg-[#0a0a0a] text-white p-4 sm:p-6 md:p-12 animate-in fade-in slide-in-from-bottom-4 duration-300",children:d.jsxs("div",{className:"max-w-4xl mx-auto",children:[d.jsxs("button",{onClick:t,className:"flex items-center gap-2 text-gray-400 hover:text-white transition-colors mb-8 group",children:[d.jsx(No,{className:"w-5 h-5 group-hover:-translate-x-1 transition-transform"}),d.jsx("span",{className:"font-medium",children:"Volver al inicio"})]}),d.jsxs("div",{className:"bg-[#1a1a1a] rounded-2xl border border-gray-800 p-8 sm:p-12 shadow-2xl relative",children:[e&&!i&&d.jsx("button",{onClick:h,className:"absolute top-8 right-8 p-2 rounded-lg bg-gray-800 text-gray-400 hover:text-[#bb86fc] hover:bg-[#bb86fc]/10 transition-colors",title:"Editar información",children:d.jsx(ob,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex items-center gap-4 mb-8 border-b border-gray-800 pb-8",children:[d.jsx("div",{className:"p-3 bg-gradient-to-br from-[#bb86fc] to-[#9966dd] rounded-xl shadow-lg shadow-[#bb86fc]/20",children:d.jsx(rb,{className:"w-8 h-8 text-white"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-white to-gray-400 bg-clip-text text-transparent",children:"Información"}),d.jsx("p",{className:"text-gray-400 mt-1",children:"Sobre Twisted Brody MangaFlow"})]})]}),i?d.jsxs("div",{className:"space-y-4",children:[d.jsx("textarea",{value:o,onChange:p=>a(p.target.value),className:"w-full h-[500px] bg-black/50 border border-[#bb86fc]/50 rounded-lg p-4 text-sm text-white focus:outline-none focus:border-[#bb86fc] font-mono",placeholder:"Escribe el contenido en Markdown..."}),d.jsxs("div",{className:"flex gap-3 justify-end",children:[d.jsxs("button",{onClick:()=>s(!1),className:"px-4 py-2 rounded-lg font-semibold text-gray-400 hover:text-white hover:bg-white/10 transition-colors flex items-center gap-2",children:[d.jsx(Vn,{className:"w-4 h-4"}),"Cancelar"]}),d.jsxs("button",{onClick:f,className:"px-4 py-2 rounded-lg font-semibold bg-[#bb86fc] hover:bg-[#9966dd] text-white transition-colors shadow-lg shadow-[#bb86fc]/20 flex items-center gap-2",children:[d.jsx(zm,{className:"w-4 h-4"}),"Guardar Cambios"]})]})]}):d.jsx("div",{className:"prose prose-invert prose-p:text-gray-300 prose-headings:text-white prose-a:no-underline max-w-none",children:d.jsx(cM,{components:{h1:({node:p,...g})=>d.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-[#bb86fc] to-[#7744cc] bg-clip-text text-transparent mb-6 pb-2 border-b border-gray-800",...g}),h2:({node:p,...g})=>d.jsx("h2",{className:"text-xl font-semibold text-white mt-8 mb-4 flex items-center gap-2",...g}),p:({node:p,...g})=>d.jsx("p",{className:"text-gray-300 leading-relaxed mb-4",...g}),ul:({node:p,...g})=>d.jsx("ul",{className:"space-y-2 mb-6",...g}),li:({node:p,...g})=>d.jsx("li",{className:"flex items-start gap-2 text-gray-300",...g}),a:({node:p,href:g,children:_,...S})=>{const P=g==null?void 0:g.startsWith("http");if((g==null?void 0:g.includes("t.me"))||(g==null?void 0:g.includes("patreon.com"))||(g==null?void 0:g.includes("x.com"))){let x="bg-[#1a1a1a] border border-gray-700 hover:border-gray-500",E="text-gray-300 hover:text-white";return g!=null&&g.includes("patreon")&&(x="bg-[#1a1a1a] border border-gray-700 hover:border-[#FF424D] hover:text-[#FF424D]"),g!=null&&g.includes("t.me")&&(x="bg-[#1a1a1a] border border-gray-700 hover:border-[#24A1DE] hover:text-[#24A1DE]"),g!=null&&g.includes("x.com")&&(x="bg-[#1a1a1a] border border-gray-700 hover:border-white hover:text-white"),d.jsx("a",{href:g,target:P?"_blank":void 0,rel:P?"noopener noreferrer":void 0,className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all transform hover:scale-105 shadow-sm my-1 mr-2 no-underline text-xs sm:text-sm font-medium ${x} ${E}`,...S,children:_})}return d.jsx("a",{href:g,className:"text-[#bb86fc] hover:underline",target:P?"_blank":void 0,rel:P?"noopener noreferrer":void 0,...S,children:_})},blockquote:({node:p,...g})=>d.jsx("blockquote",{className:"border-l-4 border-[#bb86fc] pl-4 py-2 bg-[#bb86fc]/10 rounded-r-lg italic text-gray-400 my-6",...g}),hr:({node:p,...g})=>d.jsx("hr",{className:"border-gray-800 my-8",...g}),img:()=>null},children:n})}),!i&&d.jsxs("div",{className:"pt-8 border-t border-gray-800 text-center text-sm text-gray-500 mt-8",children:["© ",new Date().getFullYear()," Twisted Brody. Todos los derechos reservados."]})]})]})})}function gM({isOpen:t,onClose:e,selectedMangaIds:n,onSaveComplete:r}){const[i,s]=F.useState([]),[o,a]=F.useState([]),[u,c]=F.useState(!1),[f,h]=F.useState(!1);F.useEffect(()=>{t&&(p(),a([]))},[t]);const p=async()=>{try{h(!0);const x=await zI();s(x)}catch(x){console.error("Error loading categories:",x)}finally{h(!1)}},g=async(x,E)=>{if(x.trim()){if(E==="tag"){const O=x.split(" ").map(L=>L.trim()).filter(L=>L.length>0);for(const L of O)await _(L,E);return}await _(x,E)}},_=async(x,E)=>{try{const O=i.find(L=>L.name.toLowerCase()===x.trim().toLowerCase()&&L.type===E);if(O)a(L=>L.includes(O.id)?L:[...L,O.id]);else{const L=await BI(x.trim(),E);s(D=>D.find(b=>b.id===L.id)?D:[...D,L]),a(D=>D.includes(L.id)?D:[...D,L.id])}}catch(O){console.error("Error creating category:",O)}},S=x=>{a(E=>E.filter(O=>O!==x))},P=async x=>{try{await $I(x),s(E=>E.filter(O=>O.id!==x)),a(E=>E.filter(O=>O!==x))}catch(E){console.error("Error deleting category:",E),Ct.error("Error al eliminar la categoría")}},v=async()=>{if(o.length===0){Ct.error("Selecciona al menos una categoría para aplicar.");return}c(!0);try{const x=n.map(async E=>{var O;try{const L=await UI(E);if(!L)return;const D=((O=L.categories)==null?void 0:O.map(w=>w.id))||[],b=Array.from(new Set([...D,...o]));await HI(E,{title:L.title,author:L.author,categoryIds:b})}catch(L){console.error(`Error updating manga ${E}`,L)}});await Promise.all(x),Ct.success("Categorías aplicadas correctamente."),r(),e()}catch(x){console.error("Error bulk updating mangas:",x),Ct.error("Error al aplicar cambios.")}finally{c(!1)}};return t?d.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-2xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10",children:[d.jsxs("h2",{className:"text-xl font-bold text-white",children:["Aplicar Categorías a ",n.length," Mangas"]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg",children:d.jsx(Vn,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar flex-1",children:f?d.jsx("div",{className:"flex justify-center p-8",children:d.jsx(bs,{size:32})}):d.jsxs("div",{className:"space-y-6",children:[d.jsx(ki,{label:"Personajes",type:"character",categories:i,selectedIds:o,onSelect:x=>{o.includes(x)||a(E=>[...E,x])},onRemove:S,onCreate:x=>g(x,"character"),onDeleteCategory:P,colorClass:"text-blue-400",placeholder:"Añadir personaje..."}),d.jsx(ki,{label:"Series",type:"series",categories:i,selectedIds:o,onSelect:x=>{o.includes(x)||a(E=>[...E,x])},onRemove:S,onCreate:x=>g(x,"series"),onDeleteCategory:P,colorClass:"text-green-400",placeholder:"Añadir serie..."}),d.jsx(ki,{label:"Géneros",type:"genre",categories:i,selectedIds:o,onSelect:x=>{o.includes(x)||a(E=>[...E,x])},onRemove:S,onCreate:x=>g(x,"genre"),onDeleteCategory:P,colorClass:"text-purple-400",placeholder:"Añadir género..."}),d.jsx(ki,{label:"Etiquetas",type:"tag",categories:i,selectedIds:o,onSelect:x=>{o.includes(x)||a(E=>[...E,x])},onRemove:S,onCreate:x=>g(x,"tag"),onDeleteCategory:P,colorClass:"text-pink-400",placeholder:"Añadir etiqueta..."})]})}),d.jsxs("div",{className:"p-6 border-t border-gray-800 flex justify-end gap-3 bg-[#1a1a1a]",children:[d.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg text-sm font-semibold text-gray-300 hover:text-white transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:v,disabled:u||o.length===0,className:"bg-[#bb86fc] hover:bg-[#9966dd] text-white px-6 py-2 rounded-lg font-semibold text-sm transition-all shadow-lg shadow-[#bb86fc]/20 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:u?d.jsxs(d.Fragment,{children:[d.jsx(bs,{size:16}),"Guardando..."]}):d.jsxs(d.Fragment,{children:[d.jsx(zm,{className:"w-4 h-4"}),"Aplicar Cambios"]})})]})]})}):null}const Fw=["series","character","genre","tag","other"],yM={series:"Series",character:"Personajes",genre:"Géneros",tag:"Etiquetas",other:"Otros"};function vM({isOpen:t,onClose:e,categories:n,selectedCategories:r,onToggleCategory:i,onClearFilters:s}){const[o,a]=F.useState(""),u=F.useMemo(()=>{const c=n.filter(h=>h.name.toLowerCase().includes(o.toLowerCase())),f={};return Fw.forEach(h=>{f[h]=[]}),f.other=[],c.forEach(h=>{const p=h.type||"other";f[p]||(f[p]=[]),f[p].push(h)}),f},[n,o]);return t?d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:d.jsxs("div",{className:"bg-[#1a1a1a] w-full max-w-4xl max-h-[85vh] rounded-2xl border border-gray-800 shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-200",onClick:c=>c.stopPropagation(),children:[d.jsxs("div",{className:"p-4 sm:p-6 border-b border-gray-800 flex items-center justify-between bg-[#1a1a1a]",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"bg-purple-500/20 p-2 rounded-lg",children:d.jsx(nb,{className:"w-5 h-5 text-purple-400"})}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Filtrar por Categorías"}),d.jsx("p",{className:"text-sm text-gray-400",children:"Selecciona múltiples opciones para refinar tu búsqueda"})]})]}),d.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white hover:bg-gray-800 p-2 rounded-lg transition-all",children:d.jsx(Vn,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"p-4 border-b border-gray-800 bg-[#151515]",children:d.jsxs("div",{className:"relative",children:[d.jsx(Tc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),d.jsx("input",{type:"text",placeholder:"Buscar categorías...",value:o,onChange:c=>a(c.target.value),className:"w-full bg-[#0f0f0f] border border-gray-700/50 rounded-lg pl-10 pr-4 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-purple-500/50 focus:ring-1 focus:ring-purple-500/50 transition-all"})]})}),d.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-8 custom-scrollbar",children:Fw.map(c=>{const f=u[c];return!f||f.length===0?null:d.jsxs("div",{className:"animate-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("h3",{className:"text-sm font-bold text-purple-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[d.jsx("span",{className:"w-1 h-4 bg-purple-500 rounded-full"}),yM[c]||c]}),d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2",children:f.sort((h,p)=>h.name.localeCompare(p.name)).map(h=>{const p=r.includes(h.name);return d.jsxs("button",{onClick:()=>i(h.name),className:` + relative group flex items-center justify-between px-3 py-2 rounded-lg text-sm text-left transition-all duration-200 border + ${p?"bg-purple-500/20 border-purple-500/50 text-purple-100 shadow-[0_0_15px_-3px_rgba(168,85,247,0.3)]":"bg-[#252525] border-transparent text-gray-300 hover:bg-[#2a2a2a] hover:border-gray-700"} + `,children:[d.jsx("span",{className:"truncate mr-2 font-medium",children:h.name}),p&&d.jsx("div",{className:"bg-purple-500 rounded-full p-0.5 animate-in zoom-in duration-200",children:d.jsx(fd,{className:"w-3 h-3 text-white"})})]},h.id)})})]},c)})}),d.jsxs("div",{className:"p-4 border-t border-gray-800 bg-[#1a1a1a] flex items-center justify-between",children:[d.jsxs("div",{className:"text-sm text-gray-400",children:[r.length," seleccionada",r.length!==1?"s":""]}),d.jsxs("div",{className:"flex items-center gap-3",children:[r.length>0&&d.jsx("button",{onClick:s,className:"px-4 py-2 text-sm text-gray-400 hover:text-white transition-colors",children:"Limpiar todo"}),d.jsx("button",{onClick:e,className:"px-6 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg text-sm font-semibold shadow-lg shadow-purple-900/20 transition-all hover:scale-105 active:scale-95",children:"Listo"})]})]})]})}):null}const xM={random:"Aleatorio",name:"Nombre",date:"Fecha de creación",modified:"Última modificación",pages:"Páginas",views:"Vistas"};function wM({value:t,onChange:e,placeholder:n="Buscar manga...",sortType:r="random",onSortTypeChange:i,sortDirection:s="asc",onSortDirectionChange:o,onOpenFilter:a}){const[u,c]=F.useState(!1),f=()=>{e("")},h=()=>{const _=["modified","name","date","pages","views","random"],P=(_.indexOf(r)+1)%_.length;i==null||i(_[P])},p=()=>{const _=s==="asc"?"desc":"asc";o==null||o(_)},g=()=>r==="views"?s==="asc"?"Menos vistos":"Más vistos":s==="asc"?"ASC":"DESC";return d.jsxs("div",{className:"w-full flex gap-2 items-center",children:[d.jsxs("div",{className:"relative flex-1",children:[d.jsx(Tc,{className:`absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 pointer-events-none ${u?"text-purple-400":"text-gray-400"}`}),d.jsx("input",{type:"text",placeholder:n,value:t,onChange:_=>e(_.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),className:"w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-10 py-2.5 text-sm placeholder-gray-400 border border-gray-700/50 focus:border-purple-500 focus:outline-none"}),t&&d.jsx("button",{onClick:f,className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-purple-400 transition-all p-1 hover:scale-125 hover:rotate-90 duration-300",title:"Limpiar búsqueda",children:d.jsx(Vn,{className:"w-4 h-4"})})]}),d.jsx("button",{onClick:a,className:"bg-gray-800 hover:bg-gray-700 border border-gray-700 hover:border-purple-500/50 text-white p-2.5 rounded-lg transition-all duration-300 hover:shadow-lg hover:shadow-purple-500/10 group",title:"Filtrar por categorías",children:d.jsx(nb,{className:"w-4 h-4 text-gray-400 group-hover:text-purple-400 transition-colors"})}),d.jsxs("button",{onClick:h,className:"bg-gradient-to-r from-gray-700/40 to-gray-600/40 hover:from-gray-700/60 hover:to-gray-600/60 border border-gray-600/50 hover:border-purple-500/50 text-white px-2.5 py-2.5 rounded-lg flex items-center justify-center gap-1.5 font-medium text-xs transition-all duration-300 active:scale-95 whitespace-nowrap hover:scale-110 hover:shadow-lg hover:shadow-purple-500/20 hover:border-purple-500",title:"Cambiar tipo de ordenamiento",children:[d.jsx(S2,{className:"w-3.5 h-3.5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:xM[r]})]}),d.jsxs("button",{onClick:p,className:"bg-gradient-to-r from-gray-700/40 to-gray-600/40 hover:from-gray-700/60 hover:to-gray-600/60 border border-gray-600/50 hover:border-purple-500/50 text-white px-2.5 py-2.5 rounded-lg flex items-center justify-center gap-1.5 font-medium text-xs transition-all duration-300 active:scale-95 whitespace-nowrap hover:scale-110 hover:shadow-lg hover:shadow-purple-500/20 hover:border-purple-500",title:s==="asc"?"Cambiar a descendente":"Cambiar a ascendente",children:[d.jsx(I2,{className:`w-3.5 h-3.5 transition-all duration-500 ${s==="desc"?"rotate-180":""} hover:scale-125`}),d.jsx("span",{className:"hidden sm:inline text-[10px]",children:g()})]})]})}function _M(){return d.jsxs("div",{className:"flex flex-col w-full max-w-xs",children:[d.jsx("div",{className:"relative bg-black rounded-lg shadow-lg overflow-hidden aspect-[2/3] mb-2",children:d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsx("div",{className:"rounded-full animate-spin",style:{width:"30px",height:"30px",borderWidth:"2px",borderStyle:"solid",borderColor:"rgba(187, 134, 252, 0.2)",borderTopColor:"#bb86fc",animation:"spin 0.6s linear infinite"}})})}),d.jsxs("div",{className:"flex flex-col gap-2 items-center animate-pulse",children:[d.jsx("div",{className:"h-4 bg-gray-800 rounded w-3/4"}),d.jsx("div",{className:"h-3 bg-gray-800 rounded w-1/2"})]})]})}const uf=24;function bM({items:t,searchTerm:e,isSearching:n,onSelectComic:r,onEditManga:i,onDeleteManga:s,isLoading:o=!1,isCategoryPlusEnabled:a=!1,selectedMangaIds:u=[],onToggleSelectManga:c}){const[f,h]=F.useState(()=>{const v=new URLSearchParams(window.location.search).get("page");return v?Math.max(1,Number(v)):1});F.useEffect(()=>{const P=()=>{const x=new URLSearchParams(window.location.search).get("page");h(x?Math.max(1,Number(x)):1)};return window.addEventListener("popstate",P),()=>window.removeEventListener("popstate",P)},[]);const p=Math.ceil(t.length/uf);F.useEffect(()=>{if(p>0&&f>p){h(p);const P=new URL(window.location.href);P.searchParams.set("page",String(p)),window.history.replaceState({},"",P)}},[p,f]),F.useEffect(()=>{if(e){h(1);const P=new URL(window.location.href);P.searchParams.delete("page"),window.history.replaceState({},"",P)}},[e]);const g=t.slice((f-1)*uf,f*uf),_=P=>{h(P);const v=new URL(window.location.href);v.searchParams.set("page",String(P)),window.history.pushState({},"",v),window.scrollTo({top:0,behavior:"smooth"})},S=()=>{if(p<=1)return null;const P=[],v=5;let x=Math.max(1,f-Math.floor(v/2)),E=Math.min(p,x+v-1);E-x+1_(1),disabled:f===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Primera página",children:d.jsx(eb,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>_(f-1),disabled:f===1,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Anterior",children:d.jsx(pd,{className:"w-4 h-4"})}),x>1&&d.jsx("span",{className:"text-gray-500 px-1",children:"..."}),P.map(O=>d.jsx("button",{onClick:()=>_(O),className:`w-8 h-8 rounded-lg text-sm font-medium transition-colors ${f===O?"bg-[#bb86fc] text-white":"bg-[#1a1a1a] text-gray-400 hover:bg-[#333] hover:text-white"}`,children:O},O)),E_(f+1),disabled:f===p,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Siguiente",children:d.jsx(md,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>_(p),disabled:f===p,className:"p-2 rounded-lg bg-[#1a1a1a] text-white hover:bg-[#bb86fc] disabled:opacity-50 disabled:hover:bg-[#1a1a1a] transition-colors",title:"Última página",children:d.jsx(tb,{className:"w-4 h-4"})})]})};return n&&e?d.jsx("div",{className:"flex flex-col items-center justify-center py-16 animate-in fade-in duration-300",children:d.jsxs("div",{className:"text-gray-400 text-sm animate-pulse",children:['Buscando "',e,'"...']})}):o?d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 justify-center items-start animate-in fade-in duration-300",children:Array.from({length:12}).map((P,v)=>d.jsx(_M,{},v))}):e&&t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 animate-in fade-in duration-300",children:[d.jsx(hl,{className:"w-16 h-16 text-gray-600 mb-4 animate-bounce"}),d.jsx("p",{className:"text-gray-400 text-lg mb-2",children:"No se encontraron resultados"}),d.jsx("p",{className:"text-gray-500 text-sm",children:"Intenta con otros términos de búsqueda"})]}):!e&&t.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-20 animate-in fade-in duration-300",children:[d.jsx(hl,{className:"w-16 h-16 text-gray-600 mb-4 animate-bounce"}),d.jsx("p",{className:"text-gray-400 text-lg mb-2",children:"No hay mangas disponibles"}),d.jsx("p",{className:"text-gray-500 text-sm",children:'Crea tu primer manga usando el botón "Nuevo"'})]}):d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-1.5 sm:gap-2 md:gap-3 justify-center items-start",children:g.map(P=>d.jsx("div",{children:d.jsx(KI,{id:P.id,title:P.title,author:P.author,pageCount:P.pageCount,thumbnail:P.thumbnail,manga:P.manga,onSelect:()=>r(P.id),onEdit:i,onDelete:s?()=>s(P.id):void 0,isCategoryPlusEnabled:a,isSelected:u.includes(P.id),onToggleSelect:c?()=>c(P.id):void 0})},P.id))}),S()]})}function lo(t){return t.toLowerCase().trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function cf(t,e){const n=lo(t),r=lo(e);if(n===r)return 1;if(n.length<2||r.length<2)return n.includes(r)?.8:0;const i=n.length>r.length?n:r,s=n.length>r.length?r:n,o=EM(s,i);return(i.length-o)/i.length}function EM(t,e){const n=[];for(let r=0;r<=t.length;r++){let i=r;for(let s=0;s<=e.length;s++)if(r===0)n[s]=s;else if(s>0){let o=n[s-1];t.charAt(r-1)!==e.charAt(s-1)&&(o=Math.min(Math.min(o,i),n[s])+1),n[s-1]=i,i=o}r>0&&(n[e.length]=i)}return n[e.length]}function IM(t,e,n={}){const{minChars:r=1,fuzzyMatch:i=!0}=n;if(!e.trim()||e.length{let u=0;const c=cf(a.title,e),f=cf(a.author,e),h=lo(a.title).includes(s)?.3:0,p=lo(a.author).includes(s)?.2:0;let g=0,_=0;if(a.categories&&a.categories.length>0){const S=a.categories.map(v=>cf(v,e));g=Math.max(...S),_=a.categories.some(v=>lo(v).includes(s))?.3:0}return u=Math.max(c*.6+h,f*.4+p,g*.5+_),{item:a,score:u}}).filter(a=>i?a.score>.3:a.score>.7).sort((a,u)=>u.score-a.score).map(a=>a.item);return{items:o,query:e,resultCount:o.length}}function TM(){const[t,e]=F.useState(!1),[n,r]=F.useState(!1),[i,s]=F.useState(!1),[o,a]=F.useState(()=>localStorage.getItem("isAdmin")==="true"),[u,c]=F.useState(null),[f,h]=F.useState(!1),[p,g]=F.useState([]),[_,S]=F.useState(!1),[P,v]=F.useState(null),[x,E]=F.useState([]),[O,L]=F.useState(null),[D,b]=F.useState([]),[w,T]=F.useState(!1),[A,N]=F.useState(!1),[j,C]=F.useState(!0),[se,he]=F.useState(""),[le,me]=F.useState([]),[q,oe]=F.useState(()=>localStorage.getItem("sortType")||"modified"),[k,ge]=F.useState(()=>localStorage.getItem("sortDirection")||"desc");F.useEffect(()=>{localStorage.setItem("isAdmin",String(o))},[o]),F.useEffect(()=>{localStorage.setItem("sortType",q)},[q]),F.useEffect(()=>{localStorage.setItem("sortDirection",k)},[k]),F.useEffect(()=>{var Ae;(Ae=window.Telegram)!=null&&Ae.WebApp&&window.Telegram.WebApp.ready(),ye();const te=window.location.hash.slice(1);if(te&&te.startsWith("manga/"))if(te.endsWith("/hd")){const Le=te.replace("manga/","").replace("/hd","");v(Le),T(!0)}else{const Le=te.replace("manga/","");v(Le),T(!1)}else te==="info"&&N(!0);const ve=()=>{const Le=window.location.hash.slice(1);if(!Le)v(null),L(null),N(!1),T(!1);else if(Le.startsWith("manga/")){if(Le.endsWith("/hd")){const we=Le.replace("manga/","").replace("/hd","");v(we),T(!0)}else{const we=Le.replace("manga/","");v(we),T(!1)}L(null),N(!1)}else Le==="info"&&(N(!0),v(null),L(null))};return window.addEventListener("hashchange",ve),()=>window.removeEventListener("hashchange",ve)},[]);async function ye(){try{C(!0);const te=await qd();b(te)}catch(te){console.error("Error loading mangas:",te)}finally{C(!1)}}const R=F.useMemo(()=>{const te=new Map;return D.forEach(ve=>{var Ae;(Ae=ve.categories)==null||Ae.forEach(Le=>{te.has(Le.id)||te.set(Le.id,Le)})}),Array.from(te.values())},[D]),$=F.useMemo(()=>se.trim()?IM(D.map(te=>({id:te.id,title:te.title,author:te.author,categories:te.categories?te.categories.map(ve=>ve.name):[]})),se,{fuzzyMatch:!0,minChars:1}):{items:D,query:"",resultCount:D.length},[D,se]),Z=F.useMemo(()=>{let te=$.items.length>0?$.items.map(Ae=>D.find(Le=>Le.id===Ae.id)).filter(Boolean):[];le.length>0&&(te=te.filter(Ae=>le.some(Le=>{var we;return(we=Ae.categories)==null?void 0:we.some(Qe=>Qe.name===Le)})));const ve=[...te];return q==="random"?ve.sort(()=>Math.random()-.5):(ve.sort((Ae,Le)=>{var Qe,Ht;let we=0;if(q==="name")we=Ae.title.localeCompare(Le.title);else if(q==="date"){const Xe=new Date(Ae.created_at||0).getTime(),ht=new Date(Le.created_at||0).getTime();we=Xe-ht}else if(q==="modified"){const Xe=new Date(Ae.updated_at||Ae.created_at||0).getTime(),ht=new Date(Le.updated_at||Le.created_at||0).getTime();we=Xe-ht}else if(q==="pages"){const Xe=((Qe=Ae.chapters)==null?void 0:Qe.reduce((tn,qt)=>{var z;return tn+(((z=qt.pages)==null?void 0:z.length)||0)},0))||0,ht=((Ht=Le.chapters)==null?void 0:Ht.reduce((tn,qt)=>{var z;return tn+(((z=qt.pages)==null?void 0:z.length)||0)},0))||0;we=Xe-ht}else q==="views"&&(we=(Ae.views||0)-(Le.views||0));return k==="asc"?we:-we}),ve)},[D,se,$.items,q,k,le]),ie=te=>{c(te),e(!0)},Te=async te=>{try{await Mj(te),await ye()}catch(ve){console.error("Error deleting manga:",ve),alert("Error al eliminar el manga. Por favor intenta de nuevo.")}},fe=te=>{g(ve=>ve.includes(te)?ve.filter(Ae=>Ae!==te):[...ve,te])},Fe=te=>{if(f){fe(te);return}window.location.hash=`manga/${te}`,v(te),T(!1)},ee=()=>{window.location.hash="",v(null),N(!1)},Ce=te=>{P&&E([...x,P]),window.location.hash=`manga / ${te} `,v(te)},tt=te=>{me(ve=>ve.includes(te)?ve.filter(Ae=>Ae!==te):[...ve,te]),ee()},Dt=te=>{me(ve=>ve.filter(Ae=>Ae!==te))},jt=F.useMemo(()=>Z.map(te=>{var Le,we;const ve=((Le=te.chapters)==null?void 0:Le.length)||0,Ae=((we=te.chapters)==null?void 0:we.reduce((Qe,Ht)=>{var Xe;return Qe+(((Xe=Ht.pages)==null?void 0:Xe.length)||0)},0))||0;return{id:te.id,title:te.title,author:te.author,chapterCount:ve,pageCount:Ae,thumbnail:te.cover_url||te.thumbnail_url||void 0,manga:te}}),[Z]);if(O)return d.jsx(I3,{manga:O.manga,chapter:O.chapter,onBack:()=>L(null)});if(A)return d.jsx(mM,{onBack:ee,isAdmin:o});if(P!==null){let te=D.find(ve=>ve.id===P);return w&&te?d.jsx(V2,{manga:te,onBack:()=>{window.history.back()}}):d.jsx(E3,{id:P,onBack:()=>{if(x.length>0){const ve=x[x.length-1];E(x.slice(0,-1)),window.location.hash=`manga / ${ve} `,v(ve)}else ee()},onReadChapter:ve=>{te&&L({manga:te,chapter:ve})},onMangaLoaded:ve=>{te||(te=ve)},onNavigateToManga:Ce,onSelectCategory:tt,isAdmin:o})}return d.jsxs("div",{className:"min-h-screen bg-[#121212] text-white flex flex-col",children:[d.jsx("header",{className:"border-b border-gray-800/50 px-3 sm:px-6 md:px-12 py-4 sm:py-6 flex-shrink-0 transition-all duration-300",children:d.jsxs("div",{className:"max-w-[1800px] mx-auto flex items-center justify-between gap-2 sm:gap-0",children:[d.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 group cursor-pointer",children:[d.jsx("img",{src:"/icons/icones.png",alt:"Twisted Brody Logo",className:"w-10 h-10 sm:w-14 sm:h-14 object-contain transition-all duration-300 group-hover:rotate-12 group-hover:scale-110"}),d.jsx("h1",{className:"text-lg sm:text-2xl font-bold text-white transition-colors duration-300 group-hover:text-[#bb86fc]",children:"Twisted Brody MangaFlow"})]}),d.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-3",children:[f&&d.jsxs("div",{className:"hidden sm:flex items-center gap-2 mr-2 px-3 py-1.5 bg-purple-500/10 rounded-lg border border-purple-500/20",children:[d.jsx(ib,{className:"w-4 h-4 text-purple-400"}),d.jsx("span",{className:"text-xs font-semibold text-purple-300",children:"Modo Plus Activo"}),d.jsx("span",{className:"text-xs bg-purple-500/20 px-2 py-0.5 rounded text-purple-200",children:p.length})]}),d.jsxs("button",{onClick:()=>r(!0),className:"bg-gray-800 hover:bg-gray-700 active:scale-95 text-white px-2 py-2 sm:px-4 sm:py-2.5 rounded-lg flex items-center gap-1.5 sm:gap-2 font-semibold transition-all duration-300 border border-gray-700/50 hover:border-gray-600 text-xs sm:text-sm hover:scale-110 hover:shadow-lg hover:shadow-700/50",title:"Ajustes y Admin",children:[d.jsx(lb,{className:"w-4 h-4 sm:w-5 sm:h-5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:"Ajustes"})]}),d.jsxs("button",{onClick:()=>e(!0),className:"bg-purple-600 hover:bg-purple-700 active:scale-95 text-white px-2 py-2 sm:px-4 sm:py-2.5 rounded-lg flex items-center gap-1.5 sm:gap-2 font-semibold transition-all duration-300 shadow-lg shadow-purple-600/30 hover:shadow-purple-600/50 text-xs sm:text-sm hover:scale-110",children:[d.jsx(fl,{className:"w-4 h-4 sm:w-5 sm:h-5 transition-transform duration-300 hover:rotate-180"}),d.jsx("span",{className:"hidden sm:inline",children:"Nuevo Manga"})]})]})]})}),d.jsxs("main",{className:"flex-1 px-4 sm:px-6 md:px-12 py-8",children:[d.jsx(w3,{isAdmin:o}),d.jsxs("div",{className:"max-w-[1800px] mx-auto mb-8 flex-shrink-0",children:[d.jsx(wM,{value:se,onChange:he,placeholder:"Buscar por título, autor...",sortType:q,onSortTypeChange:oe,sortDirection:k,onSortDirectionChange:ge,onOpenFilter:()=>s(!0)}),se&&d.jsxs("div",{className:"mt-2 text-sm text-gray-400",children:[$.resultCount," resultado",$.resultCount!==1?"s":""," encontrado",$.resultCount!==1?"s":""]}),le.length>0&&d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2 animate-in fade-in slide-in-from-top-2 duration-300",children:[d.jsx("span",{className:"text-sm text-gray-400",children:"Filtrado por:"}),le.map(te=>d.jsxs("button",{onClick:()=>Dt(te),className:"bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 px-3 py-1 rounded-full text-sm font-medium flex items-center gap-2 border border-purple-500/30 hover:border-purple-500/50 transition-all group",children:[te,d.jsx("div",{className:"bg-purple-500/20 rounded-full p-0.5 group-hover:bg-purple-500/40 transition-colors",children:d.jsx(fl,{className:"w-3 h-3 transform rotate-45"})})]},te)),le.length>1&&d.jsx("button",{onClick:()=>me([]),className:"text-xs text-gray-400 hover:text-white underline decoration-gray-600 hover:decoration-white transition-colors ml-2",children:"Limpiar todo"})]})]}),d.jsx("div",{className:"max-w-[1800px] mx-auto",children:d.jsxs(d.Fragment,{children:[d.jsx("link",{rel:"preconnect",href:"https://i.ibb.co"}),d.jsx(bM,{items:jt,searchTerm:se,isSearching:!1,isLoading:j,onSelectComic:Fe,onEditManga:o?ie:void 0,onDeleteManga:o?Te:void 0,isCategoryPlusEnabled:f,selectedMangaIds:p,onToggleSelectManga:fe})]})})]}),f&&p.length>0&&d.jsx("div",{className:"fixed bottom-6 left-1/2 transform -translate-x-1/2 z-40 animate-in slide-in-from-bottom-4 duration-200",children:d.jsxs("div",{className:"bg-[#1a1a1a] border border-gray-700/50 shadow-2xl rounded-xl px-6 py-3 flex items-center gap-4",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsxs("span",{className:"text-sm font-bold text-white",children:[p.length," seleccionados"]}),d.jsx("span",{className:"text-xs text-gray-400",children:"Listos para editar"})]}),d.jsx("div",{className:"h-8 w-px bg-gray-700"}),d.jsx("button",{onClick:()=>g([]),className:"text-gray-400 hover:text-white text-sm font-semibold transition-colors",children:"Cancelar"}),d.jsx("button",{onClick:()=>S(!0),className:"bg-[#bb86fc] hover:bg-[#9966dd] text-white px-4 py-2 rounded-lg text-sm font-bold shadow-lg shadow-purple-500/20 transition-all transform hover:scale-105 active:scale-95",children:"Aplicar Categorías"})]})}),d.jsx(gd,{}),d.jsx(p3,{isOpen:t,onClose:()=>{e(!1),c(null)},editingManga:u,onMangaCreated:te=>{ye(),c(null),te&&!u&&setTimeout(()=>{Fe(te)},500)},onDelete:o?Te:void 0}),d.jsx(gM,{isOpen:_,onClose:()=>S(!1),selectedMangaIds:p,onSaveComplete:()=>{ye(),g([])}}),d.jsx(x3,{isOpen:n,onClose:()=>r(!1),isAdmin:o,onAdminChange:a,isCategoryPlusEnabled:f,onCategoryPlusChange:h}),d.jsx(vM,{isOpen:i,onClose:()=>s(!1),categories:R,selectedCategories:le,onToggleCategory:tt,onClearFilters:()=>me([])}),d.jsx(f3,{position:"top-center",richColors:!0,theme:"dark"})]})}Z1(document.getElementById("root")).render(d.jsx(F.StrictMode,{children:d.jsx(TM,{})})); diff --git a/dist/icons/1.png b/dist/icons/1.png new file mode 100644 index 0000000000000000000000000000000000000000..df4bceda02851d735aa317699159f032aeca8807 --- /dev/null +++ b/dist/icons/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85d7e3678cda8a4496d66ee777d1fc4893b53452c84ec7b7bb1560ff7cf1a6db +size 1526625 diff --git a/dist/icons/2.png b/dist/icons/2.png new file mode 100644 index 0000000000000000000000000000000000000000..61728560bc2c4eeda7947a12b900ed2ad561e1c0 --- /dev/null +++ b/dist/icons/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1aaefd4770be8859c42931b6850277c4b04f22eaadb0d4d54d731ba96351b99 +size 1649544 diff --git a/dist/icons/3.png b/dist/icons/3.png new file mode 100644 index 0000000000000000000000000000000000000000..e1d9bc71dc46129ccee14bbaff0274d8fa885f6f --- /dev/null +++ b/dist/icons/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e46ad7e338ebc55e1e4e0b4158da6b84987c14f17cc327e299d36680b948a780 +size 1442924 diff --git a/dist/icons/4.png b/dist/icons/4.png new file mode 100644 index 0000000000000000000000000000000000000000..6a6f888029605804f6f58475e1b79509d90e0faf --- /dev/null +++ b/dist/icons/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78c74dafcebd872cfdc50174d4b54b85fedc590c6fc9892761c702b1934b753d +size 1343452 diff --git a/dist/icons/@twistedbrody dowload.png b/dist/icons/@twistedbrody dowload.png new file mode 100644 index 0000000000000000000000000000000000000000..99b34dd64d42fd7dacd1054b2d2caa7fb8740a96 --- /dev/null +++ b/dist/icons/@twistedbrody dowload.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66fc41948d1e7218f432c928873f3ca345f6f4ab020992188b1042f9d3cc0b07 +size 289754 diff --git a/dist/icons/@twistedbrody.png b/dist/icons/@twistedbrody.png new file mode 100644 index 0000000000000000000000000000000000000000..2c97c4d25c14ea33756636c08ae20f1e26fd2dec --- /dev/null +++ b/dist/icons/@twistedbrody.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e05f5e183d8d8aa7642fa54913ddcd08dffd9763568611be04c253bd09fc7c7 +size 101247 diff --git a/dist/icons/icones.png b/dist/icons/icones.png new file mode 100644 index 0000000000000000000000000000000000000000..00225e67c4e9013359ebb45b4845d7043c1f3d8e --- /dev/null +++ b/dist/icons/icones.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b906ab62cb436a7eeb3afbc4f2a266157ae30a7bcf9581ce0aeeca2033cf049 +size 1329654 diff --git a/dist/icons/logo pagina.png b/dist/icons/logo pagina.png new file mode 100644 index 0000000000000000000000000000000000000000..3aca924bba66aa57a743347154ee175754e27d30 Binary files /dev/null and b/dist/icons/logo pagina.png differ diff --git a/dist/icons/logo.png b/dist/icons/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..79b82f660b067177eb50ba1bfcf8c1fc110abf22 --- /dev/null +++ b/dist/icons/logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbf84689628529b5b8ce923188e84f42d663b6455332681aae32d94d92603f33 +size 1063322 diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b4ec9d5a95c6695f6f20ea53ac0c9b0722072b88 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,18 @@ + + + + + + + + + Twisted brody + + + + + +
+ + + \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..71a2a23dfa8b611bdf03aa131a55b6623a3f97d7 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,28 @@ +import js from '@eslint/js'; +import globals from 'globals'; +import reactHooks from 'eslint-plugin-react-hooks'; +import reactRefresh from 'eslint-plugin-react-refresh'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { ignores: ['dist'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, + } +); diff --git a/index.css b/index.css new file mode 100644 index 0000000000000000000000000000000000000000..e7fc085a0f74333c42c7bb0e8297f82ef6cdd2c1 --- /dev/null +++ b/index.css @@ -0,0 +1,215 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +.animate-spin { + animation: spin 1s linear infinite; +} + +@keyframes fadeIn { + from { + opacity: 0; + transform: scale(0.95); + } + to { + opacity: 1; + transform: scale(1); + } +} + +@keyframes fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes quickFadeIn { + from { + opacity: 0; + transform: scale(0.98); + } + to { + opacity: 1; + transform: scale(1); + } +} + +.animate-quick-fade-in { + animation: quickFadeIn 0.15s ease-out forwards; +} + +@keyframes smoothFadeIn { + 0% { + opacity: 0; + transform: scale(0.98); + } + 50% { + opacity: 0.5; + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +.animate-smooth-fade-in { + animation: smoothFadeIn 1.2s ease-out forwards; +} + +.masonry-container { + column-count: 2; + column-gap: 4px; +} + +@media (min-width: 640px) { + .masonry-container { + column-count: 3; + } +} + +@media (min-width: 768px) { + .masonry-container { + column-count: 4; + } +} + +@media (min-width: 1024px) { + .masonry-container { + column-count: 5; + } +} + +@media (min-width: 1280px) { + .masonry-container { + column-count: 6; + } +} + +@keyframes shimmer { + 0% { + background-position: -1000px 0; + } + 100% { + background-position: 1000px 0; + } +} + +.animate-shimmer { + animation: shimmer 2.5s infinite; +} + +.masonry-item { + break-inside: avoid; + margin-bottom: 4px; + display: inline-block; + width: 100%; +} + +@keyframes slideInUp { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes slideInDown { + from { + opacity: 0; + transform: translateY(-20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes slideInLeft { + from { + opacity: 0; + transform: translateX(-20px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + +@keyframes slideInRight { + from { + opacity: 0; + transform: translateX(20px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + +@keyframes glow { + 0%, 100% { + box-shadow: 0 0 5px rgba(139, 92, 246, 0.1); + } + 50% { + box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); + } +} + +@keyframes pulse-color { + 0%, 100% { + color: currentColor; + } + 50% { + color: rgba(139, 92, 246, 0.6); + } +} + +.animate-slide-in-up { + animation: slideInUp 0.5s ease-out forwards; +} + +.animate-slide-in-down { + animation: slideInDown 0.5s ease-out forwards; +} + +.animate-slide-in-left { + animation: slideInLeft 0.5s ease-out forwards; +} + +.animate-slide-in-right { + animation: slideInRight 0.5s ease-out forwards; +} + +.animate-glow { + animation: glow 2s ease-in-out infinite; +} + +.animate-pulse-color { + animation: pulse-color 2s ease-in-out infinite; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000000000000000000000000000000000000..4853c72ddbd5253f0bbf0743bd5e7824bc9f72c8 --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + + + + + Twisted brody + + + +
+ + + + \ No newline at end of file diff --git a/main.tsx b/main.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a53427345bb27e18113acc274f715e3b642b4920 --- /dev/null +++ b/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; +import App from './App.tsx'; +import './index.css'; + +createRoot(document.getElementById('root')!).render( + + + +); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..ce81ae389ca48e9acae711ef1289095fb8c2852f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,10334 @@ +{ + "name": "vite-react-typescript-starter", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vite-react-typescript-starter", + "version": "0.0.0", + "dependencies": { + "archiver": "^7.0.1", + "axios": "^1.13.2", + "cors": "^2.8.5", + "express": "^5.2.1", + "firebase": "^12.11.0", + "jspdf": "^3.0.3", + "jszip": "^3.10.1", + "lucide-react": "^0.344.0", + "pdfkit": "^0.17.2", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-markdown": "^10.1.0", + "sharp": "^0.34.5", + "sonner": "^2.0.7", + "swiper": "^12.1.3" + }, + "devDependencies": { + "@eslint/js": "^9.9.1", + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "autoprefixer": "^10.4.18", + "dotenv": "^17.3.1", + "eslint": "^9.9.1", + "eslint-plugin-react-hooks": "^5.1.0-rc.0", + "eslint-plugin-react-refresh": "^0.4.11", + "firebase-admin": "^13.7.0", + "globals": "^15.9.0", + "postcss": "^8.4.35", + "tailwindcss": "^3.4.1", + "typescript": "^5.5.3", + "typescript-eslint": "^8.3.0", + "vite": "^5.4.2" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz", + "integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.0.tgz", + "integrity": "sha512-m9FVDXU3GT2ITSe0UaMA5rU3QkfC/UXtCU8y0gSN/GugTqtVldOBWIB5V6V3sbmenVZUIpU6f+mPEO2+m5iTaA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@firebase/ai": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@firebase/ai/-/ai-2.10.0.tgz", + "integrity": "sha512-1lI6HomyoO/8RSJb6ItyHLpHnB2z27m5F4aX/Vpi1nhwWoxdNjkq+6UQOykHyCE0KairojOE5qQ20i1tnF0nNA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x", + "@firebase/app-types": "0.x" + } + }, + "node_modules/@firebase/analytics": { + "version": "0.10.21", + "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.21.tgz", + "integrity": "sha512-j2y2q65BlgLGB5Pwjhv/Jopw2X/TBTzvAtI5z/DSp56U4wBj7LfhBfzbdCtFPges+Wz0g55GdoawXibOH5jGng==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/installations": "0.6.21", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/analytics-compat": { + "version": "0.2.27", + "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.27.tgz", + "integrity": "sha512-ZObpYpAxL6JfgH7GnvlDD0sbzGZ0o4nijV8skatV9ZX49hJtCYbFqaEcPYptT94rgX1KUoKEderC7/fa7hybtw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/analytics": "0.10.21", + "@firebase/analytics-types": "0.8.3", + "@firebase/component": "0.7.2", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/analytics-types": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.3.tgz", + "integrity": "sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app": { + "version": "0.14.10", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.14.10.tgz", + "integrity": "sha512-PlPhdtjgWUra+LImQTnXOUqUa/jcufZhizdR93ZjlQSS3ahCtDTG6pJw7j0OwFal18DQjICXfeVNsUUrcNisfA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "idb": "7.1.1", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/app-check": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.11.2.tgz", + "integrity": "sha512-jcXQVMHAQ5AEKzVD5C7s5fmAYeFOuN6lAJeNTgZK2B9aLnofWaJt8u1A8Idm8gpsBBYSaY3cVyeH5SWMOVPBLQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/app-check-compat": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.4.2.tgz", + "integrity": "sha512-M91NhxqbSkI0ChkJWy69blC+rPr6HEgaeRllddSaU1pQ/7IiegeCQM9pPDIgvWnwnBSzKhUHpe6ro/jhJ+cvzw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check": "0.11.2", + "@firebase/app-check-types": "0.5.3", + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/app-check-interop-types": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz", + "integrity": "sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-check-types": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.3.tgz", + "integrity": "sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-compat": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.5.10.tgz", + "integrity": "sha512-tFmBuZL0/v1h6eyKRgWI58ucft6dEJmAi9nhPUXoAW4ZbPSTlnsh31AuEwUoRTz+wwRk9gmgss9GZV05ZM9Kug==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@firebase/app": "0.14.10", + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/app-types": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz", + "integrity": "sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/@firebase/auth-compat": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.6.4.tgz", + "integrity": "sha512-2pj8m/hnqXvMLfC0Mk+fORVTM5DQPkS6l8JpMgtoAWGVgCmYnoWdFMaNWtKbmCxBEyvMA3FlnCJyzrUSMWTfuA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/auth": "1.12.2", + "@firebase/auth-types": "0.13.0", + "@firebase/component": "0.7.2", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/auth-compat/node_modules/@firebase/auth": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.12.2.tgz", + "integrity": "sha512-CZJL8V10Vzibs+pDTXdQF+hot1IigIoqF4a4lA/qr5Deo1srcefiyIfgg28B67Lk7IxZhwfJMuI+1bu2xBmV0A==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x", + "@react-native-async-storage/async-storage": "^2.2.0" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, + "node_modules/@firebase/auth-interop-types": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz", + "integrity": "sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/auth-types": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.13.0.tgz", + "integrity": "sha512-S/PuIjni0AQRLF+l9ck0YpsMOdE8GO2KU6ubmBB7P+7TJUCQDa3R1dlgYm9UzGbbePMZsp0xzB93f2b/CgxMOg==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x", + "@firebase/util": "1.x" + } + }, + "node_modules/@firebase/component": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.7.2.tgz", + "integrity": "sha512-iyVDGc6Vjx7Rm0cAdccLH/NG6fADsgJak/XW9IA2lPf8AjIlsemOpFGKczYyPHxm4rnKdR8z6sK4+KEC7NwmEg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/data-connect": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.5.0.tgz", + "integrity": "sha512-G3GYHpWNJJ95502RQLApzw0jaG3pScHl+J/2MdxIuB51xtHnkRL6KvIAP3fFF1drUewWJHOnDA1U+q4Evf3KSw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/auth-interop-types": "0.2.4", + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/database": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.1.2.tgz", + "integrity": "sha512-lP96CMjMPy/+d1d9qaaHjHHdzdwvEOuyyLq9ehX89e2XMKwS1jHNzYBO+42bdSumuj5ukPbmnFtViZu8YOMT+w==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/auth-interop-types": "0.2.4", + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "faye-websocket": "0.11.4", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/database-compat": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.1.2.tgz", + "integrity": "sha512-j4A6IhVZbgxAzT6gJJC2PfOxYCK9SrDrUO7nTM4EscTYtKkAkzsbKoCnDdjFapQfnsncvPWjqVTr/0PffUwg3g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/database": "1.1.2", + "@firebase/database-types": "1.0.18", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/database-types": { + "version": "1.0.18", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.18.tgz", + "integrity": "sha512-yOY8IC2go9lfbVDMiy2ATun4EB2AFwocPaQADwMN/RHRUAZSM4rlAV7PGbWPSG/YhkJ2A9xQAiAENgSua9G5Fg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-types": "0.9.3", + "@firebase/util": "1.15.0" + } + }, + "node_modules/@firebase/firestore": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.13.0.tgz", + "integrity": "sha512-7i4cVNJXTMim7/P7UsNim0DwyLPk4QQ3y1oSNzv4l0ykJOKYCiFMOuEeUxUYvrReXDJxWHrT/4XMeVQm+13rRw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "@firebase/webchannel-wrapper": "1.0.5", + "@grpc/grpc-js": "~1.9.0", + "@grpc/proto-loader": "^0.7.8", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/firestore-compat": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.4.7.tgz", + "integrity": "sha512-Et4XxtGnjp0Q9tmaEMETnY5GHJ8gQ9+RN6sSTT4ETWKmym2d6gIjarw0rCQcx+7BrWVYLEIOAXSXysl0b3xnUA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/firestore": "4.13.0", + "@firebase/firestore-types": "3.0.3", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/firestore-types": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.3.tgz", + "integrity": "sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x", + "@firebase/util": "1.x" + } + }, + "node_modules/@firebase/functions": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.13.3.tgz", + "integrity": "sha512-csO7ckK3SSs+NUZW1nms9EK7ckHe/1QOjiP8uAkCYa7ND18s44vjE9g3KxEeIUpyEPqZaX1EhJuFyZjHigAcYw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/auth-interop-types": "0.2.4", + "@firebase/component": "0.7.2", + "@firebase/messaging-interop-types": "0.2.3", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/functions-compat": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.4.3.tgz", + "integrity": "sha512-BxkEwWgx1of0tKaao/r2VR6WBLk/RAiyztatiONPrPE8gkitFkOnOCxf8i9cUyA5hX5RGt5H30uNn25Q6QNEmQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/functions": "0.13.3", + "@firebase/functions-types": "0.6.3", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/functions-types": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.3.tgz", + "integrity": "sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/installations": { + "version": "0.6.21", + "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.21.tgz", + "integrity": "sha512-xGFGTeICJZ5vhrmmDukeczIcFULFXybojML2+QSDFoKj5A7zbGN7KzFGSKNhDkIxpjzsYG9IleJyUebuAcmqWA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/util": "1.15.0", + "idb": "7.1.1", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/installations-compat": { + "version": "0.2.21", + "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.21.tgz", + "integrity": "sha512-zahIUkaVKbR8zmTeBHkdfaVl6JGWlhVoSjF7CVH33nFqD3SlPEpEEegn2GNT5iAfsVdtlCyJJ9GW4YKjq+RJKQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/installations": "0.6.21", + "@firebase/installations-types": "0.5.3", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/installations-types": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.3.tgz", + "integrity": "sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x" + } + }, + "node_modules/@firebase/logger": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.5.0.tgz", + "integrity": "sha512-cGskaAvkrnh42b3BA3doDWeBmuHFO/Mx5A83rbRDYakPjO9bJtRL3dX7javzc2Rr/JHZf4HlterTW2lUkfeN4g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/messaging": { + "version": "0.12.25", + "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.25.tgz", + "integrity": "sha512-7RhDwoDHlOK1/ou0/LeubxmjcngsTjDdrY/ssg2vwAVpUuVAhQzQvuCAOYxcX5wNC1zCgQ54AP1vdngBwbCmOQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/installations": "0.6.21", + "@firebase/messaging-interop-types": "0.2.3", + "@firebase/util": "1.15.0", + "idb": "7.1.1", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/messaging-compat": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.25.tgz", + "integrity": "sha512-eoOQqGLtRlseTdiemTN44LlHZpltK5gnhq8XVUuLgtIOG+odtDzrz2UoTpcJWSzaJQVxNLb/x9f39tHdDM4N4w==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/messaging": "0.12.25", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/messaging-interop-types": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz", + "integrity": "sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/performance": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.7.11.tgz", + "integrity": "sha512-V3uAhrz7IYJuji+OgT3qYTGKxpek/TViXti9OSsUJ4AexZ3jQjYH5Yrn7JvBxk8MGiSLsC872hh+BxQiPZsm7g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/installations": "0.6.21", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0", + "web-vitals": "^4.2.4" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/performance-compat": { + "version": "0.2.24", + "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.24.tgz", + "integrity": "sha512-YRlejH8wLt7ThWao+HXoKUHUrZKGYq+otxkPS+8nuE5PeN1cBXX7NAJl9ueuUkBwMIrnKdnDqL/voHXxDAAt3g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/performance": "0.7.11", + "@firebase/performance-types": "0.2.3", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/performance-types": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.3.tgz", + "integrity": "sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/remote-config": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.8.2.tgz", + "integrity": "sha512-5EXqOThV4upjK9D38d/qOSVwOqRhemlaOFk9vCkMNNALeIlwr+4pLjtLNo4qoY8etQmU/1q4aIATE9N8PFqg0g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/installations": "0.6.21", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/remote-config-compat": { + "version": "0.2.23", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.23.tgz", + "integrity": "sha512-4+KqRRHEUUmKT6tFmnpWATOsaFfmSuBs1jXH8JzVtMLEYqq/WS9IDM92OdefFDSrAA2xGd0WN004z8mKeIIscw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/remote-config": "0.8.2", + "@firebase/remote-config-types": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/remote-config-types": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.5.0.tgz", + "integrity": "sha512-vI3bqLoF14L/GchtgayMiFpZJF+Ao3uR8WCde0XpYNkSokDpAKca2DxvcfeZv7lZUqkUwQPL2wD83d3vQ4vvrg==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/storage": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.14.2.tgz", + "integrity": "sha512-o/culaTeJ8GRpKXRJov21rux/n9dRaSOWLebyatFP2sqEdCxQPjVA1H9Z2fzYwQxMIU0JVmC7SPPmU11v7L6vQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/storage-compat": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.4.2.tgz", + "integrity": "sha512-R+aB38wxCH5zjIO/xu9KznI7fgiPuZAG98uVm1NcidHyyupGgIDLKigGmRGBZMnxibe/m2oxNKoZpfEbUX2aQQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/storage": "0.14.2", + "@firebase/storage-types": "0.8.3", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/storage-types": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.3.tgz", + "integrity": "sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x", + "@firebase/util": "1.x" + } + }, + "node_modules/@firebase/util": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.15.0.tgz", + "integrity": "sha512-AmWf3cHAOMbrCPG4xdPKQaj5iHnyYfyLKZxwz+Xf55bqKbpAmcYifB4jQinT2W9XhDRHISOoPyBOariJpCG6FA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/webchannel-wrapper": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.5.tgz", + "integrity": "sha512-+uGNN7rkfn41HLO0vekTFhTxk61eKa8mTpRGLO0QSqlQdKvIoGAvLp3ppdVIWbTGYJWM6Kp0iN+PjMIOcnVqTw==", + "license": "Apache-2.0" + }, + "node_modules/@google-cloud/firestore": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.11.6.tgz", + "integrity": "sha512-EW/O8ktzwLfyWBOsNuhRoMi8lrC3clHM5LVFhGvO1HCsLozCOOXRAlHrYBoE6HL42Sc8yYMuCb2XqcnJ4OOEpw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@opentelemetry/api": "^1.3.0", + "fast-deep-equal": "^3.1.1", + "functional-red-black-tree": "^1.0.1", + "google-gax": "^4.3.3", + "protobufjs": "^7.2.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz", + "integrity": "sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", + "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.19.0.tgz", + "integrity": "sha512-n2FjE7NAOYyshogdc7KQOl/VZb4sneqPjWouSyia9CMDdMhRX5+RIbqalNmC7LOLzuLAN89VlF2HvG8na9G+zQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "<4.1.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "duplexify": "^4.1.3", + "fast-xml-parser": "^5.3.4", + "gaxios": "^6.0.2", + "google-auth-library": "^9.6.3", + "html-entities": "^2.5.2", + "mime": "^3.0.0", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/gcp-metadata": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", + "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "gaxios": "^6.1.1", + "google-logging-utils": "^0.0.2", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/google-auth-library": { + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", + "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/google-logging-utils": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", + "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.9.15", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", + "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.15", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.15.tgz", + "integrity": "sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==", + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "dev": true, + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", + "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", + "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", + "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", + "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", + "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", + "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", + "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.3.tgz", + "integrity": "sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", + "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.3.tgz", + "integrity": "sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.3.tgz", + "integrity": "sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.3.tgz", + "integrity": "sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.3.tgz", + "integrity": "sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.3.tgz", + "integrity": "sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.3.tgz", + "integrity": "sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", + "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.3.tgz", + "integrity": "sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.3.tgz", + "integrity": "sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.3.tgz", + "integrity": "sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.3.tgz", + "integrity": "sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.3.tgz", + "integrity": "sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", + "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@swc/helpers": { + "version": "0.5.18", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.18.tgz", + "integrity": "sha512-TXTnIcNJQEKwThMMqBXsZ4VGAza6bvN4pa41Rkqoio6QBKMvo+5lexeTMScGCIxtzgQJzElcvIltani+adC5PQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", + "integrity": "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/ms": "*", + "@types/node": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.0.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.0.tgz", + "integrity": "sha512-rl78HwuZlaDIUSeUKkmogkhebA+8K1Hy7tddZuJ3D0xV8pZSfsYGTsliGUol1JPzu9EKnTxPC4L1fiWouStRew==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/pako": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz", + "integrity": "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==", + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "license": "MIT" + }, + "node_modules/@types/raf": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", + "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/react": { + "version": "18.3.27", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.27.tgz", + "integrity": "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@types/request": { + "version": "2.48.13", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz", + "integrity": "sha512-FGJ6udDNUCjd19pp0Q3iTiDkwhYup7J8hpMW9c4k53NrccQFFWKRho6hvtPPEhnXWKvukfwAlB6DbDz4yhH5Gg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.5" + } + }, + "node_modules/@types/request/node_modules/form-data": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", + "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.35", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/@types/request/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@types/request/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@types/request/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.49.0.tgz", + "integrity": "sha512-JXij0vzIaTtCwu6SxTh8qBc66kmf1xs7pI4UOiMDFVct6q86G0Zs7KRcEoJgY3Cav3x5Tq0MF5jwgpgLqgKG3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/type-utils": "8.49.0", + "@typescript-eslint/utils": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.49.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.49.0.tgz", + "integrity": "sha512-N9lBGA9o9aqb1hVMc9hzySbhKibHmB+N3IpoShyV6HyQYRGIhlrO5rQgttypi+yEeKsKI4idxC8Jw6gXKD4THA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.49.0.tgz", + "integrity": "sha512-/wJN0/DKkmRUMXjZUXYZpD1NEQzQAAn9QWfGwo+Ai8gnzqH7tvqS7oNVdTjKqOcPyVIdZdyCMoqN66Ia789e7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.49.0", + "@typescript-eslint/types": "^8.49.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.49.0.tgz", + "integrity": "sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.49.0.tgz", + "integrity": "sha512-8prixNi1/6nawsRYxet4YOhnbW+W9FK/bQPxsGB1D3ZrDzbJ5FXw5XmzxZv82X3B+ZccuSxo/X8q9nQ+mFecWA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.49.0.tgz", + "integrity": "sha512-KTExJfQ+svY8I10P4HdxKzWsvtVnsuCifU5MvXrRwoP2KOlNZ9ADNEWWsQTJgMxLzS5VLQKDjkCT/YzgsnqmZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0", + "@typescript-eslint/utils": "8.49.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", + "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.49.0.tgz", + "integrity": "sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.49.0", + "@typescript-eslint/tsconfig-utils": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", + "debug": "^4.3.4", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.49.0.tgz", + "integrity": "sha512-N3W7rJw7Rw+z1tRsHZbK395TWSYvufBXumYtEGzypgMUthlg0/hmCImeA8hgO2d2G4pd7ftpxxul2J8OdtdaFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.49.0.tgz", + "integrity": "sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.49.0", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "license": "ISC" + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/archiver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", + "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==", + "license": "MIT", + "dependencies": { + "archiver-utils": "^5.0.2", + "async": "^3.2.4", + "buffer-crc32": "^1.0.0", + "readable-stream": "^4.0.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^6.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/archiver-utils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz", + "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==", + "license": "MIT", + "dependencies": { + "glob": "^10.0.0", + "graceful-fs": "^4.2.0", + "is-stream": "^2.0.1", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/archiver-utils/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/archiver-utils/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/archiver-utils/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/archiver/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/archiver/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/archiver/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.4.22", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.22.tgz", + "integrity": "sha512-ARe0v/t9gO28Bznv6GgqARmVqcWOV3mfgUPn9becPHMiD3o9BwlRgaeccZnwTpZ7Zwqrm+c1sUSsMxIzQzc8Xg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.27.0", + "caniuse-lite": "^1.0.30001754", + "fraction.js": "^5.3.4", + "normalize-range": "^0.1.2", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/axios": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/bare-events": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz", + "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==", + "license": "Apache-2.0", + "peerDependencies": { + "bare-abort-controller": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + } + } + }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.6.tgz", + "integrity": "sha512-v9BVVpOTLB59C9E7aSnmIF8h7qRsFpx+A2nugVMTszEOMcfjlZMsXRm4LF23I3Z9AJxc8ANpIvzbzONoX9VJlg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz", + "integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brotli": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", + "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.1.2" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-crc32": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001760.tgz", + "integrity": "sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/canvg": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz", + "integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@babel/runtime": "^7.12.5", + "@types/raf": "^3.4.0", + "core-js": "^3.8.3", + "raf": "^3.4.1", + "regenerator-runtime": "^0.13.7", + "rgbcolor": "^1.0.1", + "stackblur-canvas": "^2.0.0", + "svg-pathdata": "^6.0.3" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/compress-commons": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", + "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==", + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^6.0.0", + "is-stream": "^2.0.1", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/compress-commons/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/compress-commons/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/compress-commons/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/core-js": { + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.47.0.tgz", + "integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz", + "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==", + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/crc32-stream/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/crc32-stream/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/crc32-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", + "license": "MIT" + }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "license": "MIT", + "optional": true, + "dependencies": { + "utrie": "^1.0.2" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz", + "integrity": "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dfa": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz", + "integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==", + "license": "MIT" + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/dompurify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz", + "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optional": true, + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/dotenv": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz", + "integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.267", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", + "integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz", + "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.39.1", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", + "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.24.tgz", + "integrity": "sha512-nLHIW7TEq3aLrEYWpVaJ1dRgFR+wLDPN8e8FpYAql/bMV2oBEfC37K0gLEGgv9fy66juNShSMV8OkTqzltcG/w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=8.40" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/events-universal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz", + "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.7.0" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/farmhash-modern": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/farmhash-modern/-/farmhash-modern-1.1.0.tgz", + "integrity": "sha512-6ypT4XfgqJk/F3Yuv4SX26I3doUjt0GTG4a+JgWxXQpxXzTBq8fPUeGHfcYMMDPHJHm3yPOSjaeBwBGAHWXCdA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-png": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/fast-png/-/fast-png-6.4.0.tgz", + "integrity": "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==", + "license": "MIT", + "dependencies": { + "@types/pako": "^2.0.3", + "iobuffer": "^5.3.2", + "pako": "^2.1.0" + } + }, + "node_modules/fast-xml-builder": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.3.tgz", + "integrity": "sha512-1o60KoFw2+LWKQu3IdcfcFlGTW4dpqEWmjhYec6H82AYZU2TVBXep6tMl8Z1Y+wM+ZrzCwe3BZ9Vyd9N2rIvmg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "path-expression-matcher": "^1.1.3" + } + }, + "node_modules/fast-xml-parser": { + "version": "5.5.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.5.tgz", + "integrity": "sha512-NLY+V5NNbdmiEszx9n14mZBseJTC50bRq1VHsaxOmR72JDuZt+5J1Co+dC/4JPnyq+WrIHNM69r0sqf7BMb3Mg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "fast-xml-builder": "^1.1.3", + "path-expression-matcher": "^1.1.3", + "strnum": "^2.1.2" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "license": "Apache-2.0", + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/firebase": { + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-12.11.0.tgz", + "integrity": "sha512-W9f3Y+cgQYgF9gvCGxt0upec8zwAtiQVcHuU8MfzUIgVU/9fRQWtu48Geiv1lsigtBz9QHML++Km9xAKO5GB5Q==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/ai": "2.10.0", + "@firebase/analytics": "0.10.21", + "@firebase/analytics-compat": "0.2.27", + "@firebase/app": "0.14.10", + "@firebase/app-check": "0.11.2", + "@firebase/app-check-compat": "0.4.2", + "@firebase/app-compat": "0.5.10", + "@firebase/app-types": "0.9.3", + "@firebase/auth": "1.12.2", + "@firebase/auth-compat": "0.6.4", + "@firebase/data-connect": "0.5.0", + "@firebase/database": "1.1.2", + "@firebase/database-compat": "2.1.2", + "@firebase/firestore": "4.13.0", + "@firebase/firestore-compat": "0.4.7", + "@firebase/functions": "0.13.3", + "@firebase/functions-compat": "0.4.3", + "@firebase/installations": "0.6.21", + "@firebase/installations-compat": "0.2.21", + "@firebase/messaging": "0.12.25", + "@firebase/messaging-compat": "0.2.25", + "@firebase/performance": "0.7.11", + "@firebase/performance-compat": "0.2.24", + "@firebase/remote-config": "0.8.2", + "@firebase/remote-config-compat": "0.2.23", + "@firebase/storage": "0.14.2", + "@firebase/storage-compat": "0.4.2", + "@firebase/util": "1.15.0" + } + }, + "node_modules/firebase-admin": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-13.7.0.tgz", + "integrity": "sha512-o3qS8zCJbApe7aKzkO2Pa380t9cHISqeSd3blqYTtOuUUUua3qZTLwNWgGUOss3td6wbzrZhiHIj3c8+fC046Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@fastify/busboy": "^3.0.0", + "@firebase/database-compat": "^2.0.0", + "@firebase/database-types": "^1.0.6", + "farmhash-modern": "^1.1.0", + "fast-deep-equal": "^3.1.1", + "google-auth-library": "^10.6.1", + "jsonwebtoken": "^9.0.0", + "jwks-rsa": "^3.1.0", + "node-forge": "^1.3.1", + "uuid": "^11.0.2" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@google-cloud/firestore": "^7.11.0", + "@google-cloud/storage": "^7.19.0" + } + }, + "node_modules/firebase/node_modules/@firebase/auth": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.12.2.tgz", + "integrity": "sha512-CZJL8V10Vzibs+pDTXdQF+hot1IigIoqF4a4lA/qr5Deo1srcefiyIfgg28B67Lk7IxZhwfJMuI+1bu2xBmV0A==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.2", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.15.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x", + "@react-native-async-storage/async-storage": "^2.2.0" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/fontkit": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fontkit/-/fontkit-2.0.4.tgz", + "integrity": "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==", + "license": "MIT", + "dependencies": { + "@swc/helpers": "^0.5.12", + "brotli": "^1.3.2", + "clone": "^2.1.2", + "dfa": "^1.2.0", + "fast-deep-equal": "^3.1.3", + "restructure": "^3.0.0", + "tiny-inflate": "^1.0.3", + "unicode-properties": "^1.4.0", + "unicode-trie": "^2.0.0" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/gaxios": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gaxios/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/gcp-metadata": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz", + "integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^7.0.0", + "google-logging-utils": "^1.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/gcp-metadata/node_modules/gaxios": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.4.tgz", + "integrity": "sha512-bTIgTsM2bWn3XklZISBTQX7ZSddGW+IO3bMdGaemHZ3tbqExMENHLx6kKZ/KlejgrMtj8q7wBItt51yegqalrA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "node-fetch": "^3.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/gcp-metadata/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/google-auth-library": { + "version": "10.6.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.6.1.tgz", + "integrity": "sha512-5awwuLrzNol+pFDmKJd0dKtZ0fPLAtoA5p7YO4ODsDu6ONJUVqbYwvv8y2ZBO5MBNp9TJXigB19710kYpBPdtA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "7.1.3", + "gcp-metadata": "8.1.2", + "google-logging-utils": "1.1.3", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/google-auth-library/node_modules/gaxios": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.3.tgz", + "integrity": "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "node-fetch": "^3.3.2", + "rimraf": "^5.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/google-auth-library/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/google-gax": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.6.1.tgz", + "integrity": "sha512-V6eky/xz2mcKfAd1Ioxyd6nmA61gao3n01C+YeuIwu3vzM9EDR6wcVzMSIbLMDXWeoi9SHYctXuKYC5uJUT3eQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/grpc-js": "^1.10.9", + "@grpc/proto-loader": "^0.7.13", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "google-auth-library": "^9.3.0", + "node-fetch": "^2.7.0", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^2.0.2", + "protobufjs": "^7.3.2", + "retry-request": "^7.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/@grpc/grpc-js": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.3.tgz", + "integrity": "sha512-Iq8QQQ/7X3Sac15oB6p0FmUg/klxQvXLeileoqrTRGJYLV+/9tubbr9ipz0GKHjmXVsgFPo/+W+2cA8eNcR+XA==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/google-gax/node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz", + "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.3", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/google-gax/node_modules/gcp-metadata": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", + "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "gaxios": "^6.1.1", + "google-logging-utils": "^0.0.2", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/google-auth-library": { + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", + "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/google-logging-utils": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", + "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/google-logging-utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz", + "integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/html-entities": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", + "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "license": "MIT", + "optional": true, + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-parser-js": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.10.tgz", + "integrity": "sha512-Pysuw9XpUq5dVc/2SMHpuTY01RFl8fttgcyunjL7eEMhGM3cI4eOmiCycJDVCo/7O7ClfQD3SaI6ftDzqOXYMA==", + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.1.tgz", + "integrity": "sha512-2Tth85cXwGFHfvRgZWszZSvdo+0Xsqmw8k8ZwxScfcBneNUraK+dxRxRm24nszx80Y0TVio8kKLt5sLE7ZCLlw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/idb": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==", + "license": "ISC" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "license": "MIT" + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/iobuffer": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/iobuffer/-/iobuffer-5.4.0.tgz", + "integrity": "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==", + "license": "MIT" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/jose": { + "version": "4.15.9", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/jpeg-exif": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/jpeg-exif/-/jpeg-exif-1.1.4.tgz", + "integrity": "sha512-a+bKEcCjtuW5WTdgeXFzswSrdqi0jk4XlEtZlx5A94wCoBpFjfFTbo/Tra5SpNCl/YFZPvcV1dJc+TAYeg6ROQ==", + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jws": "^4.0.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jspdf": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-3.0.4.tgz", + "integrity": "sha512-dc6oQ8y37rRcHn316s4ngz/nOjayLF/FFxBF4V9zamQKRqXxyiH1zagkCdktdWhtoQId5K20xt1lB90XzkB+hQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.28.4", + "fast-png": "^6.2.0", + "fflate": "^0.8.1" + }, + "optionalDependencies": { + "canvg": "^3.0.11", + "core-js": "^3.6.0", + "dompurify": "^3.2.4", + "html2canvas": "^1.0.0-rc.5" + } + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, + "node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwks-rsa": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.2.2.tgz", + "integrity": "sha512-BqTyEDV+lS8F2trk3A+qJnxV5Q9EqKCBJOPti3W97r7qTympCZjb7h2X6f2kc+0K3rsSTY1/6YG2eaXKoj497w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/jsonwebtoken": "^9.0.4", + "debug": "^4.3.4", + "jose": "^4.15.4", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==", + "dev": true + }, + "node_modules/linebreak": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/linebreak/-/linebreak-1.1.0.tgz", + "integrity": "sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ==", + "license": "MIT", + "dependencies": { + "base64-js": "0.0.8", + "unicode-trie": "^2.0.0" + } + }, + "node_modules/linebreak/node_modules/base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "dev": true, + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lru-memoizer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", + "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "6.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lru-memoizer/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/lucide-react": { + "version": "0.344.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.344.0.tgz", + "integrity": "sha512-6YyBnn91GB45VuVT96bYCOKElbJzUHqp65vX8cDcu55MQL9T969v4dhGClpljamuI/+KMO9P6w9Acq1CVQGvIQ==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", + "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-forge": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz", + "integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==", + "dev": true, + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", + "license": "(MIT AND Zlib)" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-expression-matcher": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.1.3.tgz", + "integrity": "sha512-qdVgY8KXmVdJZRSS1JdEPOKPdTiEK/pi0RkcT2sw1RhXxohdujUlJFPuS1TSkevZ9vzd3ZlL7ULl1MHGTApKzQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pdfkit": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/pdfkit/-/pdfkit-0.17.2.tgz", + "integrity": "sha512-UnwF5fXy08f0dnp4jchFYAROKMNTaPqb/xgR8GtCzIcqoTnbOqtp3bwKvO4688oHI6vzEEs8Q6vqqEnC5IUELw==", + "license": "MIT", + "dependencies": { + "crypto-js": "^4.2.0", + "fontkit": "^2.0.4", + "jpeg-exif": "^1.1.4", + "linebreak": "^1.1.0", + "png-js": "^1.0.0" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT", + "optional": true + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/png-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/png-js/-/png-js-1.0.0.tgz", + "integrity": "sha512-k+YsbhpA9e+EFfKjTCH3VW6aoKlyNYI6NYdTfDL4CIvFnvsuO84ttonmZE7rc+v23SLTH8XX+5w/Ak9v0xGY4g==" + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/property-information": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", + "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/proto3-json-serializer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz", + "integrity": "sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/protobufjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "license": "MIT", + "optional": true, + "dependencies": { + "performance-now": "^2.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-markdown": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz", + "integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "html-url-attributes": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "unified": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=18", + "react": ">=18" + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdir-glob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "license": "MIT", + "optional": true + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/restructure": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/restructure/-/restructure-3.0.2.tgz", + "integrity": "sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==", + "license": "MIT" + }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", + "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rgbcolor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", + "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==", + "license": "MIT OR SEE LICENSE IN FEEL-FREE.md", + "optional": true, + "engines": { + "node": ">= 0.8.15" + } + }, + "node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.3.tgz", + "integrity": "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.53.3", + "@rollup/rollup-android-arm64": "4.53.3", + "@rollup/rollup-darwin-arm64": "4.53.3", + "@rollup/rollup-darwin-x64": "4.53.3", + "@rollup/rollup-freebsd-arm64": "4.53.3", + "@rollup/rollup-freebsd-x64": "4.53.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", + "@rollup/rollup-linux-arm-musleabihf": "4.53.3", + "@rollup/rollup-linux-arm64-gnu": "4.53.3", + "@rollup/rollup-linux-arm64-musl": "4.53.3", + "@rollup/rollup-linux-loong64-gnu": "4.53.3", + "@rollup/rollup-linux-ppc64-gnu": "4.53.3", + "@rollup/rollup-linux-riscv64-gnu": "4.53.3", + "@rollup/rollup-linux-riscv64-musl": "4.53.3", + "@rollup/rollup-linux-s390x-gnu": "4.53.3", + "@rollup/rollup-linux-x64-gnu": "4.53.3", + "@rollup/rollup-linux-x64-musl": "4.53.3", + "@rollup/rollup-openharmony-arm64": "4.53.3", + "@rollup/rollup-win32-arm64-msvc": "4.53.3", + "@rollup/rollup-win32-ia32-msvc": "4.53.3", + "@rollup/rollup-win32-x64-gnu": "4.53.3", + "@rollup/rollup-win32-x64-msvc": "4.53.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sonner": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz", + "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==", + "license": "MIT", + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", + "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stackblur-canvas": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", + "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.14" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/streamx": { + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz", + "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==", + "license": "MIT", + "dependencies": { + "events-universal": "^1.0.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strnum": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.0.tgz", + "integrity": "sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svg-pathdata": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz", + "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/swiper": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/swiper/-/swiper-12.1.3.tgz", + "integrity": "sha512-XcWlVmkHFICI4fuoJKgbp8PscDcS4i7pBH8nwJRBi3dpQvhCySwsWRYm4bOf/BzKVWkHOYaFw7qz9uBSrY3oug==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/swiperjs" + }, + { + "type": "open_collective", + "url": "http://opencollective.com/swiper" + } + ], + "license": "MIT", + "engines": { + "node": ">= 4.7.0" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/tar-stream/node_modules/b4a": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz", + "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==", + "license": "Apache-2.0", + "peerDependencies": { + "react-native-b4a": "*" + }, + "peerDependenciesMeta": { + "react-native-b4a": { + "optional": true + } + } + }, + "node_modules/teeny-request": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", + "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/text-decoder/node_modules/b4a": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz", + "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==", + "license": "Apache-2.0", + "peerDependencies": { + "react-native-b4a": "*" + }, + "peerDependenciesMeta": { + "react-native-b4a": { + "optional": true + } + } + }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "license": "MIT", + "optional": true, + "dependencies": { + "utrie": "^1.0.2" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.49.0.tgz", + "integrity": "sha512-zRSVH1WXD0uXczCXw+nsdjGPUdx4dfrs5VQoHnUWmv1U3oNlAKv4FUNdLDhVUg+gYn+a5hUESqch//Rv5wVhrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.49.0", + "@typescript-eslint/parser": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0", + "@typescript-eslint/utils": "8.49.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/unicode-properties": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", + "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.0", + "unicode-trie": "^2.0.0" + } + }, + "node_modules/unicode-trie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", + "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", + "license": "MIT", + "dependencies": { + "pako": "^0.2.5", + "tiny-inflate": "^1.0.0" + } + }, + "node_modules/unicode-trie/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "license": "MIT" + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz", + "integrity": "sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "license": "MIT", + "optional": true, + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, + "node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/web-vitals": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz", + "integrity": "sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==", + "license": "Apache-2.0" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zip-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz", + "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==", + "license": "MIT", + "dependencies": { + "archiver-utils": "^5.0.0", + "compress-commons": "^6.0.2", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/zip-stream/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/zip-stream/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/zip-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3ce786a0825b99098e29cd0e378bda40a2d8c4c7 --- /dev/null +++ b/package.json @@ -0,0 +1,50 @@ +{ + "name": "vite-react-typescript-starter", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "start": "node server.js", + "server": "node server.js", + "dev": "vite", + "build": "vite build", + "lint": "eslint .", + "preview": "vite preview", + "typecheck": "tsc --noEmit -p tsconfig.app.json" + }, + "dependencies": { + "archiver": "^7.0.1", + "axios": "^1.13.2", + "cors": "^2.8.5", + "express": "^5.2.1", + "firebase": "^12.11.0", + "jspdf": "^3.0.3", + "jszip": "^3.10.1", + "lucide-react": "^0.344.0", + "pdfkit": "^0.17.2", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-markdown": "^10.1.0", + "sharp": "^0.34.5", + "sonner": "^2.0.7", + "swiper": "^12.1.3" + }, + "devDependencies": { + "@eslint/js": "^9.9.1", + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "autoprefixer": "^10.4.18", + "dotenv": "^17.3.1", + "eslint": "^9.9.1", + "eslint-plugin-react-hooks": "^5.1.0-rc.0", + "eslint-plugin-react-refresh": "^0.4.11", + "firebase-admin": "^13.7.0", + "globals": "^15.9.0", + "postcss": "^8.4.35", + "tailwindcss": "^3.4.1", + "typescript": "^5.5.3", + "typescript-eslint": "^8.3.0", + "vite": "^5.4.2" + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000000000000000000000000000000000000..daedffd2bf4950df77bf2c9d6920181331f4c48a --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/public/icons/1.png b/public/icons/1.png new file mode 100644 index 0000000000000000000000000000000000000000..df4bceda02851d735aa317699159f032aeca8807 --- /dev/null +++ b/public/icons/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85d7e3678cda8a4496d66ee777d1fc4893b53452c84ec7b7bb1560ff7cf1a6db +size 1526625 diff --git a/public/icons/2.png b/public/icons/2.png new file mode 100644 index 0000000000000000000000000000000000000000..61728560bc2c4eeda7947a12b900ed2ad561e1c0 --- /dev/null +++ b/public/icons/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1aaefd4770be8859c42931b6850277c4b04f22eaadb0d4d54d731ba96351b99 +size 1649544 diff --git a/public/icons/3.png b/public/icons/3.png new file mode 100644 index 0000000000000000000000000000000000000000..e1d9bc71dc46129ccee14bbaff0274d8fa885f6f --- /dev/null +++ b/public/icons/3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e46ad7e338ebc55e1e4e0b4158da6b84987c14f17cc327e299d36680b948a780 +size 1442924 diff --git a/public/icons/4.png b/public/icons/4.png new file mode 100644 index 0000000000000000000000000000000000000000..6a6f888029605804f6f58475e1b79509d90e0faf --- /dev/null +++ b/public/icons/4.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78c74dafcebd872cfdc50174d4b54b85fedc590c6fc9892761c702b1934b753d +size 1343452 diff --git a/public/icons/@twistedbrody dowload.png b/public/icons/@twistedbrody dowload.png new file mode 100644 index 0000000000000000000000000000000000000000..99b34dd64d42fd7dacd1054b2d2caa7fb8740a96 --- /dev/null +++ b/public/icons/@twistedbrody dowload.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66fc41948d1e7218f432c928873f3ca345f6f4ab020992188b1042f9d3cc0b07 +size 289754 diff --git a/public/icons/@twistedbrody.png b/public/icons/@twistedbrody.png new file mode 100644 index 0000000000000000000000000000000000000000..2c97c4d25c14ea33756636c08ae20f1e26fd2dec --- /dev/null +++ b/public/icons/@twistedbrody.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e05f5e183d8d8aa7642fa54913ddcd08dffd9763568611be04c253bd09fc7c7 +size 101247 diff --git a/public/icons/icones.png b/public/icons/icones.png new file mode 100644 index 0000000000000000000000000000000000000000..00225e67c4e9013359ebb45b4845d7043c1f3d8e --- /dev/null +++ b/public/icons/icones.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b906ab62cb436a7eeb3afbc4f2a266157ae30a7bcf9581ce0aeeca2033cf049 +size 1329654 diff --git a/public/icons/logo pagina.png b/public/icons/logo pagina.png new file mode 100644 index 0000000000000000000000000000000000000000..3aca924bba66aa57a743347154ee175754e27d30 Binary files /dev/null and b/public/icons/logo pagina.png differ diff --git a/public/icons/logo.png b/public/icons/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..79b82f660b067177eb50ba1bfcf8c1fc110abf22 --- /dev/null +++ b/public/icons/logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbf84689628529b5b8ce923188e84f42d663b6455332681aae32d94d92603f33 +size 1063322 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..506ae835bd1133db51fea279a0410f89ff0b7fc3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +img2pdf +requests diff --git a/run_local.bat b/run_local.bat new file mode 100644 index 0000000000000000000000000000000000000000..e49c0e67b3e683d950d508f5665b43d2ba4e4854 --- /dev/null +++ b/run_local.bat @@ -0,0 +1,9 @@ +@echo off +echo Iniciando sistema de descargas locales (Modo Una Ventana)... + +:: Usamos npx para no obligar a instalar dependencias globales +:: -k mata ambos procesos si uno falla o se cierra +:: --names nos da etiquetas bonitas [BACK] [FRONT] +call npx -y concurrently -k -n "BACK,FRONT" -c "blue,magenta" "npm run server" "npm run dev" + +pause diff --git a/server.js b/server.js new file mode 100644 index 0000000000000000000000000000000000000000..908620e76ca4a4e7e7c0f14e91a59a138f93289c --- /dev/null +++ b/server.js @@ -0,0 +1,597 @@ +import express from 'express'; +import cors from 'cors'; +import fs from 'fs'; +import path from 'path'; +import axios from 'axios'; +import archiver from 'archiver'; +import PDFDocument from 'pdfkit'; +import { spawn } from 'child_process'; +import { fileURLToPath } from 'url'; +import { initializeApp } from 'firebase/app'; +import sharp from 'sharp'; +import { getFirestore, collection, query, where, getDocs, orderBy } from 'firebase/firestore'; + +sharp.cache(false); // Disable cache to prevent memory growth during batch processing + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const app = express(); +const PORT = process.env.PORT || 7860; + +app.use(cors()); +app.use(express.json({ limit: '50mb' })); + +// Serve static files from the dist directory +app.use(express.static(path.join(__dirname, 'dist'))); + +// --- Firebase Config --- +const firebaseConfig = { + apiKey: "AIzaSyAH3jvbe0_QLzIuuv5kTMK8246HNvohvfE", + authDomain: "twistedbrody-9d163.firebaseapp.com", + projectId: "twistedbrody-9d163", + storageBucket: "twistedbrody-9d163.firebasestorage.app", + messagingSenderId: "733213514129", + appId: "1:733213514129:web:e9694684f5c3994ed06230", + measurementId: "G-N8TQ7MY42W" +}; + +const firebaseApp = initializeApp(firebaseConfig); +const db = getFirestore(firebaseApp); + +// --- 1. Almacén global de progreso --- +const progresoDescargas = {}; + +// --- Helpers --- +const downloadsDir = path.join(__dirname, 'downloads'); +if (!fs.existsSync(downloadsDir)) { + fs.mkdirSync(downloadsDir); +} + +// --- Cleanup on Startup --- +function cleanDownloadsFolder() { + console.log(`[INIT] Limpiando carpeta de descargas: ${downloadsDir}`); + try { + const files = fs.readdirSync(downloadsDir); + for (const file of files) { + if (file === '.gitkeep') continue; // Optional preservation + fs.unlinkSync(path.join(downloadsDir, file)); + } + if (files.length > 0) { + console.log(`[INIT] 🧹 Se eliminaron ${files.length} archivos temporales antiguos.`); + } else { + console.log(`[INIT] ✨ Carpeta de descargas limpia.`); + } + } catch (err) { + console.error(`[INIT] ❌ Error limpiando descargas: ${err.message}`); + } +} +cleanDownloadsFolder(); + +function sanitizeFilename(name) { + return name.replace(/[^a-z0-9]/gi, '_'); +} + +async function downloadImage(url) { + try { + const response = await axios({ + url, + method: 'GET', + responseType: 'arraybuffer', + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', + 'Referer': 'https://google.com' + } + }); + + if (response.status !== 200) throw new Error(`Status ${response.status}`); + return response.data; + } catch (error) { + console.error(`[DEBUG] Download failed: ${error.message} (${url})`); + throw error; + } +} + +// --- 2. Ruta para que el Frontend escuche el progreso (SSE) --- +app.get('/api/download/progress/:jobId', (req, res) => { + res.setHeader('Content-Type', 'text/event-stream'); + res.setHeader('Cache-Control', 'no-cache'); + res.setHeader('Connection', 'keep-alive'); + + const { jobId } = req.params; + + // Enviamos un latido cada 500ms + const interval = setInterval(() => { + const p = progresoDescargas[jobId] || 0; + res.write(`data: ${JSON.stringify({ progress: p })}\n\n`); + if (p >= 100 || p === 'error') { + clearInterval(interval); + if (p >= 100) delete progresoDescargas[jobId]; // Limpiar memoria + } + }, 500); + + req.on('close', () => clearInterval(interval)); +}); + +// --- Firebase Fetch Helper --- +async function getAllChapters(mangaId) { + console.log(`[FIREBASE] Buscando capítulos para manga_id: ${mangaId} (Estrategia Bypass de Índice)`); + + // HACKER FIX: Consultamos solo por 'where' para evitar el error de "Index Required". + // Ordenamos los datos nosotros mismos en la memoria RAM del servidor. + const q = query( + collection(db, "chapters"), + where("manga_id", "==", mangaId) + ); + + const querySnapshot = await getDocs(q); + + if (querySnapshot.empty) { + // Fallback: Try with 'mangaId' just in case the field name varies + console.log("[FIREBASE] Intento secundario con campo 'mangaId'..."); + const q2 = query(collection(db, "chapters"), where("mangaId", "==", mangaId)); + const snapshot2 = await getDocs(q2); + + if (snapshot2.empty) { + throw new Error('No se encontraron capítulos para este mangaId (ni por manga_id ni mangaId).'); + } + return processSnapshot(snapshot2); + } + + return processSnapshot(querySnapshot); +} + +function processSnapshot(snapshot) { + console.log(`[FIREBASE] Encontrados ${snapshot.size} capítulos. Procesando y ordenando en memoria...`); + + const chapters = snapshot.docs.map(doc => { + const data = doc.data(); + return { + id: doc.id, + number: Number(data.number) || 0, // Ensure number for sorting + original_pages: data.original_pages || [], + pages: data.pages || [] + }; + }); + + // Ordenamiento manual (Bypass del índice compuesto) + return chapters.sort((a, b) => a.number - b.number); +} + + + +// --- Image Proxy & Optimization --- +app.get('/api/image-proxy', async (req, res) => { + const { url, width, height, quality, format } = req.query; + + if (!url) { + return res.status(400).send('URL is required'); + } + + try { + // 1. Fetch the original image + const response = await axios({ + url: url, + method: 'GET', + responseType: 'arraybuffer', + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', + 'Referer': 'https://google.com' + } + }); + + let imageBuffer = response.data; + + // 2. Set aggressive cache headers (1 day) + res.setHeader('Cache-Control', 'public, max-age=86400, mutable'); + + // 3. Resize if requested (Sharp) + if (width || height || (format && format !== 'original')) { + const pipeline = sharp(imageBuffer); + + if (width || height) { + pipeline.resize( + width ? parseInt(width) : null, + height ? parseInt(height) : null, + { + fit: 'inside', + withoutEnlargement: true + } + ); + } + + // Format conversion (default to webp for performance check) + const outFormat = format || 'webp'; + const outQuality = quality ? parseInt(quality) : 85; + + if (outFormat === 'webp') { + pipeline.webp({ quality: outQuality }); + res.setHeader('Content-Type', 'image/webp'); + } else if (outFormat === 'jpeg' || outFormat === 'jpg') { + pipeline.jpeg({ quality: outQuality }); + res.setHeader('Content-Type', 'image/jpeg'); + } else if (outFormat === 'png') { + pipeline.png({ quality: outQuality }); + res.setHeader('Content-Type', 'image/png'); + } + + imageBuffer = await pipeline.toBuffer(); + } else { + // Pass-through original content type if not converting + res.setHeader('Content-Type', response.headers['content-type']); + } + + res.send(imageBuffer); + + } catch (error) { + console.error(`[PROXY ERROR] ${url}: ${error.message}`); + // Fallback: Redirect to original URL if proxy fails + res.redirect(url); + } +}); + +// --- Routes --- + +app.get('/api/progress/:jobId', (req, res) => { + const { jobId } = req.params; + res.writeHead(200, { + 'Content-Type': 'text/event-stream', + 'Cache-Control': 'no-cache', + 'Connection': 'keep-alive' + }); + jobs[jobId] = { res, progress: 0 }; + console.log(`[SERVIDOR] Cliente conectado (Job: ${jobId})`); + req.on('close', () => { + if (jobs[jobId]) delete jobs[jobId]; + }); +}); + +app.post('/api/download/zip', async (req, res) => { + console.log("[DEBUG] Body recibido ZIP:", JSON.stringify(req.body).substring(0, 500)); + const { mangaTitle, format } = req.body; // format: 'png', 'jpg', 'webp', 'original' + const mangaId = req.body.mangaId || req.body.manga_id; + + if (!mangaId || mangaId === 'undefined') { + console.error("[SERVIDOR] ❌ Error: MangaId indefinido"); + return res.status(400).json({ error: "ID requerido" }); + } + + console.log(`🚀 [SERVIDOR] Iniciando Stream ZIP para: ${mangaTitle} (${mangaId}) - Formato: ${format}`); + + try { + const chapters = await getAllChapters(mangaId); + + // Set headers for download + res.setHeader('Content-Type', 'application/zip'); + res.setHeader('Content-Disposition', `attachment; filename="${sanitizeFilename(mangaTitle)}.zip"`); + + // OPTIMIZATION: Use level 1 (Fastest) instead of 9 (Best) to avoid CPU bottleneck + const archive = archiver('zip', { zlib: { level: 1 } }); + + archive.on('error', (err) => { + console.error('[SERVIDOR] ❌ Error ZIP:', err); + if (!res.headersSent) res.status(500).send({ error: err.message }); + }); + + archive.pipe(res); + + // Collect all pages + let totalPagesToDownload = 0; + const chaptersToProcess = []; + for (const chap of chapters) { + let pages = []; + if (format === 'original') { + pages = (chap.original_pages && chap.original_pages.length > 0) ? chap.original_pages : chap.pages; + } else { + pages = (chap.pages && chap.pages.length > 0) ? chap.pages : chap.original_pages; + } + + if (pages && pages.length > 0) { + chaptersToProcess.push({ number: chap.number, pages }); + totalPagesToDownload += pages.length; + } + } + + // Process chapters in parallel (limit parallelism to avoid memory exploded with sharp) + let processedTotal = 0; + + // Helper for sequential processing within chapters to manage concurrency better + for (const chap of chaptersToProcess) { + console.log(`[STREAM] Procesando Cap ${chap.number}`); + + // OPTIMIZATION: Increased batch size from 20 to 50 for faster downloads + const chunkSize = 50; + for (let i = 0; i < chap.pages.length; i += chunkSize) { + const batch = chap.pages.slice(i, i + chunkSize); + + await Promise.all(batch.map(async (pageUrl, batchIndex) => { + const pageIndex = i + batchIndex; + try { + let buffer = await downloadImage(pageUrl); + + // --- CONVERSION LOGIC --- + let ext = 'jpg'; + let finalBuffer = buffer; + + // Usar sharp para leer de los headers del buffer el formato real + try { + const metadata = await sharp(buffer).metadata(); + if (metadata.format) { + ext = metadata.format === 'jpeg' ? 'jpg' : metadata.format; + } + } catch (err) { + // Fallback si no es imagen o falla leer metadata + if (pageUrl.toLowerCase().includes('.png') || pageUrl.toLowerCase().includes('.png?')) ext = 'png'; + else if (pageUrl.toLowerCase().includes('.webp') || pageUrl.toLowerCase().includes('.webp?')) ext = 'webp'; + } + + // IF format is NOT original, we convert (except GIFs to preserve animation) + if (ext === 'gif') { + // Si es un GIF, omitimos la conversión para no perder la animación + } else if (format && format !== 'original') { + try { + // Format mappings for sharp + let sharpFormat = format; + if (format === 'jpg') sharpFormat = 'jpeg'; + + // Perform conversion + finalBuffer = await sharp(buffer) + .toFormat(sharpFormat, { quality: 90 }) + .toBuffer(); + + ext = format; // Update extension to requested format + } catch (sharpErr) { + console.warn(`[WARN] Falló conversión a ${format}, usanda original.`, sharpErr.message); + } + } + + const cleanChapterNum = String(chap.number).padStart(2, '0'); + const archivePath = `Capitulo_${cleanChapterNum}/pagina_${String(pageIndex + 1).padStart(3, '0')}.${ext}`; + + archive.append(finalBuffer, { name: archivePath }); + + // --- UPDATE PROGRESS --- + processedTotal++; + const porcentaje = Math.round((processedTotal / totalPagesToDownload) * 100); + progresoDescargas[mangaId] = porcentaje; + + } catch (e) { + console.error(`[!] Error Cap ${chap.number} pág ${pageIndex}: ${e.message}`); + } + })); + } + } + + // Force 100% on complete + progresoDescargas[mangaId] = 100; + await archive.finalize(); + + } catch (error) { + console.error(`[SERVIDOR] ❌ Error Global: ${error.message}`); + fs.writeFileSync(path.join(__dirname, 'server_error.log'), `[${new Date().toISOString()}] Error ZIP: ${error.stack}\n`, { flag: 'a' }); + progresoDescargas[mangaId] = 'error'; + if (!res.headersSent) res.status(500).json({ error: error.message }); + } +}); + +// const { spawn } = require('child_process'); // Removed: using import at top + +app.post('/api/download/pdf', async (req, res) => { + console.log("[DEBUG] Body recibido PDF:", JSON.stringify(req.body).substring(0, 500)); + const { mangaTitle, format, jobId } = req.body; + const mangaId = req.body.mangaId || req.body.manga_id; + + if (!mangaId || mangaId === 'undefined') { + console.error("[SERVIDOR] ❌ Error: Se recibió un mangaId indefinido para PDF"); + return res.status(400).json({ error: "El ID del manga es obligatorio" }); + } + + console.log(`\n[SERVIDOR] Solicitud PDF (Python Bridge) para: ${mangaTitle} (ID: ${mangaId})`); + + // Notify client PDF is starting (optional, but good if we kept SSE) + // sendProgress(jobId, 10, 'starting'); // We might not be able to track detailed progress easily w/o advanced python ipc + + try { + // 1. Fetch URLs using existing helper + const chapters = await getAllChapters(mangaId); + let allUrls = []; + + // Sort chapters just to be safe, though getAllChapters does it + chapters.sort((a, b) => a.number - b.number); + + for (const chap of chapters) { + let pages = []; + if (format === 'original') pages = (chap.original_pages && chap.original_pages.length > 0) ? chap.original_pages : chap.pages; + else pages = (chap.pages && chap.pages.length > 0) ? chap.pages : chap.original_pages; + + if (pages && pages.length > 0) { + allUrls = allUrls.concat(pages); + } + } + + if (allUrls.length === 0) { + throw new Error("No extracted pages found to convert."); + } + + console.log(`[PYTHON] Delegando ${allUrls.length} páginas al script converter.py...`); + + const safeTitle = sanitizeFilename(mangaTitle); + const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); + const pdfName = `${safeTitle}_HackerMode_${timestamp}.pdf`; + const pdfPath = path.join(downloadsDir, pdfName); // Use full path + + // 2. Call Python Script in Unbuffered mode + // HACKER FIX: En Docker/Linux a menudo es 'python3', en Windows 'python' + const pythonCmd = process.env.PYTHON_CMD || (process.platform === 'win32' ? 'python' : 'python3'); + console.log(`[SERVIDOR] Usando comando Python: ${pythonCmd}`); + + const scriptPath = path.join(__dirname, 'converter.py'); + const pythonProcess = spawn(pythonCmd, ['-u', scriptPath]); + + // Send data to Python via STDIN + pythonProcess.stdin.write(JSON.stringify({ + urls: allUrls, + output: pdfPath + })); + pythonProcess.stdin.end(); + + // 🚩 Logic to sync progress with SSE + let imagenesTerminadas = 0; + const totalPaginasTarget = allUrls.length; + + pythonProcess.stdout.on('data', (data) => { + const lineas = data.toString().split('\n'); + + lineas.forEach(line => { + const mensaje = line.trim(); + if (mensaje.includes("PROGRESS:IMAGE_DONE")) { + imagenesTerminadas++; + const porcentaje = Math.round((imagenesTerminadas / totalPaginasTarget) * 100); + + // Update global store for SSE + progresoDescargas[mangaId] = porcentaje; + process.stdout.write(`\r[PYTHON] ⚡ Descarga Paralela: ${imagenesTerminadas}/${totalPaginasTarget} (${porcentaje}%)`); + + } else if (mensaje === "STATUS:SUCCESS") { + console.log("\n[PYTHON] ✅ PDF Creado con éxito."); + progresoDescargas[mangaId] = 100; // Ensure 100% + } else if (mensaje.startsWith("DEBUG:")) { + // console.log(`\n[PYTHON] ${mensaje}`); + } + }); + }); + + pythonProcess.stderr.on('data', (data) => { + console.error(`[PYTHON STDERR]: ${data}`); + }); + + pythonProcess.on('close', (code) => { + if (code === 0) { + console.log(`[SERVIDOR] ✅ PDF creado por Python: ${pdfPath}`); + // 3. Send file to client + res.download(pdfPath, (err) => { + if (err) { + console.error("Error sending file:", err); + if (!res.headersSent) res.status(500).send("Error downloading file"); + } + // Cleanup temp file after sending + if (fs.existsSync(pdfPath)) { + // small timeout to ensure stream closed + setTimeout(() => fs.unlinkSync(pdfPath), 1000); + } + }); + } else { + console.error(`[SERVIDOR] ❌ Python exited with code ${code}`); + if (!res.headersSent) res.status(500).send("Error en la conversión a PDF (Python Code " + code + ")"); + } + }); + + } catch (error) { + console.error(`[SERVIDOR] ❌ Error Global PDF: ${error.message}`); + if (!res.headersSent) res.status(500).send({ error: error.message }); + } +}); + +// --- Image Processing Endpoint --- +app.post('/api/process-image', async (req, res) => { + const startTime = Date.now(); + const { name, index, total } = req.body; // Extraemos metadatos + + try { + const { image } = req.body; + if (!image) { + return res.status(400).json({ error: 'Image data is required' }); + } + + // Log inicial del lote (solo si es la primera imagen y viene la info) + if (index === 1 && total) { + console.log(`\n[PROCESAMIENTO] � Iniciando lote: procesando ${total} imagenes`); + } + + // Extract base64 + const base64Data = image.replace(/^data:image\/\w+;base64,/, ""); + const buffer = Buffer.from(base64Data, 'base64'); + + // Procesamiento en Paralelo + const [webpBuffer, thumbnailBuffer] = await Promise.all([ + sharp(buffer) + .resize(1200, null, { fit: 'inside', withoutEnlargement: true }) + .webp({ quality: 90 }) + .toBuffer(), + sharp(buffer) + .resize(400, null, { fit: 'inside', withoutEnlargement: true }) + .jpeg({ quality: 80, leaflet: true }) + .toBuffer() + ]); + + // Log de finalización estilo solicitado + if (index && total) { + console.log(`finalizado ${index} paginas`); // "finalizado 1 paginas", "finalizado 2 paginas"... + if (index === total) { + console.log(`\n[PROCESAMIENTO] ✅ Lote de ${total} imágenes completado.`); + } + } else { + // Fallback para subidas individuales (portada, etc) + const duration = Date.now() - startTime; + console.log(`[PROCESAMIENTO] 🟢 Completado: ${name} (${duration}ms)`); + } + + res.json({ + success: true, + data: { + webp: `data:image/webp;base64,${webpBuffer.toString('base64')}`, + thumbnail: `data:image/jpeg;base64,${thumbnailBuffer.toString('base64')}` + } + }); + + } catch (error) { + console.error(`[PROCESAMIENTO] 🔴 Error con ${name}:`, error.message); + res.status(500).json({ error: 'Failed to process image', details: error.message }); + } +}); + +// --- Health Check --- +app.get('/health', (req, res) => { + res.status(200).send('OK'); +}); + +// --- Catch-all to serve index.html for client-side routing (Express 5 fix) --- +app.get(/.*/, (req, res) => { + if (req.path.startsWith('/api')) { + return res.status(404).json({ error: 'Not Found' }); + } + + const indexPath = path.join(__dirname, 'dist', 'index.html'); + + if (fs.existsSync(indexPath)) { + res.sendFile(indexPath); + } else { + // Fallback si no existe el build del frontend + res.status(200).send(` + + Server Running + +

✅ Server Status: ONLINE (Hacker Mode)

+

El servidor Backend está funcionando correctamente.

+
+

⚠️ Frontend no encontrado: No se encontró el archivo dist/index.html.

+

Posibles causas:

+
    +
  • El proceso de build (npm run build) falló o no se ejecutó en el Dockerfile.
  • +
  • La carpeta dist está en .dockerignore pero no se generó dentro de la imagen.
  • +
+

Revisa los logs de "Build" en Hugging Face.

+ + + `); + } +}); + +app.listen(PORT, '0.0.0.0', () => { + console.log(`\n[SERVIDOR] 🚀 Listo en http://0.0.0.0:${PORT} - Integración Firebase HACKER MODE Activa`); + console.log(`[INIT] ⚡ Sharp Concurrency: ${sharp.concurrency()} hilos activos para procesamiento de imágenes.`); + console.log(`\n--- ENLACES DE ACCESO ---`); + console.log(`👀 Visor (Solo Lectura): http://localhost:3000/`); + console.log(`🔑 Admin (Control Total): http://localhost:3000/?admin=true`); + console.log(`-------------------------\n`); +}); diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000000000000000000000000000000000000..b32aca40f9dee4cbb759c0e717537051f29bf0ef --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,848 @@ +import { Plus, Settings, Layers, User, Copy, Edit3, Tag, BookOpen, Folder, ArrowLeft } from 'lucide-react'; +import { useState, useEffect, useMemo } from 'react'; +import { HDComicViewer } from './components/HDComicViewer'; +import { NewMangaModal } from './components/NewMangaModal'; +import { SettingsModal } from './components/SettingsModal'; +import { AnnouncementBanner } from './components/AnnouncementBanner'; +import { ComicDetail } from './components/ComicDetail'; +import { ChapterReader } from './components/ChapterReader'; +import { InfoPage } from './components/InfoPage'; +import { BulkCategoryModal } from './components/BulkCategoryModal'; +import { BulkRemoveCategoryModal } from './components/BulkRemoveCategoryModal'; +import { CategoryFilterModal } from './components/CategoryFilterModal'; +import { TitleManagerModal } from './components/TitleManagerModal'; +import { BulkEditTitleModal } from './components/BulkEditTitleModal'; +import { EtiquetadoraModal } from './components/EtiquetadoraModal'; +import { CreateFolderModal } from './components/CreateFolderModal'; +import { MoveToFolderModal } from './components/MoveToFolderModal'; +import { Category } from './types/manga'; + +import { SearchBar } from './components/SearchBar'; +import { SearchResults } from './components/SearchResults'; +import { Toaster, toast } from 'sonner'; +import { deleteManga, getAllMangas } from './services/manga'; +import { Manga, Chapter } from './types/manga'; +import { searchItems } from './utils/searchUtils'; +import { GlobalFooter } from './components/GlobalFooter'; + +type SortType = 'random' | 'name' | 'date' | 'pages' | 'modified' | 'views'; +type SortDirection = 'asc' | 'desc'; + +function App() { + const [showModal, setShowModal] = useState(false); + const [showSettingsModal, setShowSettingsModal] = useState(false); + const [showFilterModal, setShowFilterModal] = useState(false); + const [isAdmin, setIsAdmin] = useState(false); + const [editingManga, setEditingManga] = useState(null); + const [isCategoryPlusEnabled, setIsCategoryPlusEnabled] = useState(false); + const [isCopyIdsEnabled, setIsCopyIdsEnabled] = useState(false); + const [isDeletePlusEnabled, setIsDeletePlusEnabled] = useState(false); + const [selectedMangaIds, setSelectedMangaIds] = useState([]); + const [showBulkModal, setShowBulkModal] = useState(false); + const [showBulkRemoveModal, setShowBulkRemoveModal] = useState(false); + const [showBulkEditTitleModal, setShowBulkEditTitleModal] = useState(false); + const [showEtiquetadoraModal, setShowEtiquetadoraModal] = useState(false); + const [showTitleManagerModal, setShowTitleManagerModal] = useState(false); + const [isCategoryMinusEnabled, setIsCategoryMinusEnabled] = useState(false); + const [isEditTitlePlusEnabled, setIsEditTitlePlusEnabled] = useState(false); + const [isEtiquetadoraEnabled, setIsEtiquetadoraEnabled] = useState(false); + const [isFolderPlusEnabled, setIsFolderPlusEnabled] = useState(false); + const [currentFolderId, setCurrentFolderId] = useState(null); + const [showCreateFolderModal, setShowCreateFolderModal] = useState(false); + const [showMoveToFolderModal, setShowMoveToFolderModal] = useState(false); + const [selectedComicId, setSelectedComicId] = useState(null); + const [navigationHistory, setNavigationHistory] = useState([]); + const [selectedChapter, setSelectedChapter] = useState<{ manga: Manga; chapter: Chapter } | null>(null); + const [mangas, setMangas] = useState([]); + const [showHD, setShowHD] = useState(false); + const [showInfo, setShowInfo] = useState(false); + const [loading, setLoading] = useState(true); + const [searchTerm, setSearchTerm] = useState(''); + const [viewFilter, setViewFilter] = useState<'all' | 'mangas' | 'folders'>('all'); + const [selectedCategories, setSelectedCategories] = useState([]); + const [selectedAuthors, setSelectedAuthors] = useState([]); + const [sortType, setSortType] = useState(() => + (localStorage.getItem('sortType') as SortType) || 'modified' + ); + const [sortDirection, setSortDirection] = useState(() => + (localStorage.getItem('sortDirection') as SortDirection) || 'desc' + ); + + useEffect(() => { + // Check for admin mode via URL query parameter + const searchParams = new URLSearchParams(window.location.search); + const isAdminMode = searchParams.get('admin') === 'true'; + setIsAdmin(isAdminMode); + }, []); + + useEffect(() => { + localStorage.setItem('sortType', sortType); + }, [sortType]); + + useEffect(() => { + localStorage.setItem('sortDirection', sortDirection); + }, [sortDirection]); + + useEffect(() => { + // Initialize Telegram Web App + // @ts-expect-error Window interface is extended in vite-env.d.ts + if (window.Telegram?.WebApp) { + // @ts-expect-error Window interface is extended in vite-env.d.ts + window.Telegram.WebApp.ready(); + } + loadMangas(); + + const hash = window.location.hash.slice(1); + if (hash && hash.startsWith('manga/')) { + if (hash.endsWith('/hd')) { + const mangaId = hash.replace('manga/', '').replace('/hd', ''); + setSelectedComicId(mangaId); + setShowHD(true); + } else { + const mangaId = hash.replace('manga/', ''); + setSelectedComicId(mangaId); + setShowHD(false); + } + } else if (hash && hash.startsWith('folder/')) { + const folderId = hash.replace('folder/', ''); + setCurrentFolderId(folderId); + } else if (hash === 'info') { + setShowInfo(true); + } + + const handleHashChange = () => { + const hash = window.location.hash.slice(1); + if (!hash) { + setSelectedComicId(null); + setSelectedChapter(null); + setShowInfo(false); + setShowHD(false); + setCurrentFolderId(null); + } else if (hash.startsWith('manga/')) { + if (hash.endsWith('/hd')) { + const mangaId = hash.replace('manga/', '').replace('/hd', ''); + setSelectedComicId(mangaId); + setShowHD(true); + } else { + const mangaId = hash.replace('manga/', ''); + setSelectedComicId(mangaId); + setShowHD(false); + } + setSelectedChapter(null); + setShowInfo(false); + setCurrentFolderId(null); + } else if (hash.startsWith('folder/')) { + setCurrentFolderId(hash.replace('folder/', '')); + setSelectedComicId(null); + setSelectedChapter(null); + setShowInfo(false); + setShowHD(false); + } else if (hash === 'info') { + setShowInfo(true); + setSelectedComicId(null); + setSelectedChapter(null); + setCurrentFolderId(null); + } + }; + + window.addEventListener('hashchange', handleHashChange); + return () => window.removeEventListener('hashchange', handleHashChange); + }, []); + + useEffect(() => { + if (!isCategoryPlusEnabled && !isCopyIdsEnabled && !isDeletePlusEnabled && !isCategoryMinusEnabled && !isEditTitlePlusEnabled && !isEtiquetadoraEnabled && !isFolderPlusEnabled) { + setSelectedMangaIds([]); + } + }, [isCategoryPlusEnabled, isCopyIdsEnabled, isDeletePlusEnabled, isCategoryMinusEnabled, isEditTitlePlusEnabled, isEtiquetadoraEnabled, isFolderPlusEnabled]); + + async function loadMangas() { + try { + setLoading(true); + const data = await getAllMangas(); + setMangas(data); + } catch (error) { + console.error('Error loading mangas:', error); + } finally { + setLoading(false); + } + } + + const allCategories = useMemo(() => { + const categoriesMap = new Map(); + mangas.forEach(manga => { + manga.categories?.forEach(cat => { + if (!categoriesMap.has(cat.id)) { + categoriesMap.set(cat.id, cat); + } + }); + }); + return Array.from(categoriesMap.values()); + }, [mangas]); + + const searchResult = useMemo(() => { + if (!searchTerm.trim()) { + return { items: mangas, query: '', resultCount: mangas.length }; + } + return searchItems( + mangas.map(m => ({ + id: m.id, + title: m.title, + author: m.author, + categories: m.categories ? m.categories.map(c => c.name) : [] + })), + searchTerm, + { fuzzyMatch: true, minChars: 1 } + ); + }, [mangas, searchTerm]); + + const filteredMangas = useMemo(() => { + let items = searchResult.items.length > 0 + ? searchResult.items.map(item => mangas.find(m => m.id === item.id)).filter(Boolean) as Manga[] + : []; + + if (selectedCategories.length > 0) { + items = items.filter(m => + selectedCategories.some(selCat => m.categories?.some(c => c.name === selCat)) + ); + } + + if (selectedAuthors.length > 0) { + items = items.filter(m => + selectedAuthors.includes(m.author) + ); + } + + const sorted = [...items]; + + const filteredByFolder = sorted.filter(m => (m.folder_id || null) === (currentFolderId || null)); + + let filteredByView = filteredByFolder; + if (viewFilter === 'mangas') { + filteredByView = filteredByView.filter(m => !m.is_folder); + } else if (viewFilter === 'folders') { + filteredByView = filteredByView.filter(m => m.is_folder); + } + + if (sortType === 'random') { + return filteredByView.sort(() => Math.random() - 0.5); + } + + filteredByView.sort((a, b) => { + let compareValue = 0; + + if (sortType === 'name') { + compareValue = a.title.localeCompare(b.title); + } else if (sortType === 'date') { + const dateA = new Date(a.created_at || 0).getTime(); + const dateB = new Date(b.created_at || 0).getTime(); + compareValue = dateA - dateB; + } else if (sortType === 'modified') { + const dateA = new Date(a.updated_at || a.created_at || 0).getTime(); + const dateB = new Date(b.updated_at || b.created_at || 0).getTime(); + compareValue = dateA - dateB; + } else if (sortType === 'pages') { + const pagesA = a.chapters?.reduce((sum: number, ch: any) => sum + (ch.pages?.length || 0), 0) || 0; + const pagesB = b.chapters?.reduce((sum: number, ch: any) => sum + (ch.pages?.length || 0), 0) || 0; + compareValue = pagesA - pagesB; + } else if (sortType === 'views') { + compareValue = (a.views || 0) - (b.views || 0); + } + + return sortDirection === 'asc' ? compareValue : -compareValue; + }); + + return filteredByView; + }, [mangas, searchTerm, searchResult.items, sortType, sortDirection, selectedCategories, selectedAuthors, currentFolderId, viewFilter]); + + const handleEditManga = (manga: Manga) => { + setEditingManga(manga); + setShowModal(true); + }; + + const handleDeleteManga = async (mangaId: string) => { + try { + await deleteManga(mangaId); + await loadMangas(); + } catch (error) { + console.error('Error deleting manga:', error); + alert('Error al eliminar el manga. Por favor intenta de nuevo.'); + } + }; + + const toggleSelectManga = (id: string) => { + setSelectedMangaIds(prev => { + if (prev.includes(id)) { + return prev.filter(mId => mId !== id); + } else { + return [...prev, id]; + } + }); + }; + + const handleSelectComic = (mangaId: string) => { + if (isCategoryPlusEnabled || isCopyIdsEnabled || isDeletePlusEnabled || isCategoryMinusEnabled || isEditTitlePlusEnabled || isEtiquetadoraEnabled || isFolderPlusEnabled) { + toggleSelectManga(mangaId); + return; + } + const manga = mangas.find(m => m.id === mangaId); + if (manga?.is_folder) { + window.location.hash = `folder/${mangaId}`; + return; + } + window.location.hash = `manga/${mangaId}`; + setSelectedComicId(mangaId); + setShowHD(false); + }; + + const handleBackToHome = () => { + window.location.hash = ''; + setSelectedComicId(null); + setShowInfo(false); + }; + + const handleNavigateToManga = (newMangaId: string) => { + if (selectedComicId) { + setNavigationHistory([...navigationHistory, selectedComicId]); + } + window.location.hash = `manga/${newMangaId}`; + setSelectedComicId(newMangaId); + }; + + const handleSelectCategory = (category: string) => { + setSelectedCategories(prev => { + if (prev.includes(category)) { + return prev.filter(c => c !== category); + } + return [...prev, category]; + }); + handleBackToHome(); + }; + + const handleRemoveCategory = (category: string) => { + setSelectedCategories(prev => prev.filter(c => c !== category)); + }; + + const handleSelectAuthor = (author: string) => { + setSelectedAuthors(prev => { + if (prev.includes(author)) { + return prev.filter(c => c !== author); + } + return [...prev, author]; + }); + handleBackToHome(); + }; + + const handleRemoveAuthor = (author: string) => { + setSelectedAuthors(prev => prev.filter(c => c !== author)); + }; + + const mangaItems = useMemo(() => filteredMangas.map(manga => { + const chapterCount = manga.chapters?.length || 0; + const totalPages = manga.chapters?.reduce((sum: number, ch: any) => sum + (ch.pages?.length || 0), 0) || 0; + return { + id: manga.id, + title: manga.title, + author: manga.author, + chapterCount, + pageCount: totalPages, + thumbnail: manga.cover_url || manga.thumbnail_url || undefined, + manga, + }; + }), [filteredMangas]); + + if (selectedChapter) { + return ( + setSelectedChapter(null)} + /> + ); + } + + if (showInfo) { + return ; + } + + if (selectedComicId !== null) { + let currentManga = mangas.find(m => m.id === selectedComicId); + + if (showHD && currentManga) { + return ( + { + // Guarantee reliable back navigation to the exact manga detail page. + if (currentManga) { + window.location.hash = `manga/${currentManga.id}`; + } + setShowHD(false); + }} + /> + ); + } + + return ( + { + if (navigationHistory.length > 0) { + const previousId = navigationHistory[navigationHistory.length - 1]; + setNavigationHistory(navigationHistory.slice(0, -1)); + window.location.hash = `manga/${previousId}`; + setSelectedComicId(previousId); + } else if (currentManga?.folder_id) { + window.location.hash = `folder/${currentManga.folder_id}`; + setCurrentFolderId(currentManga.folder_id); + setSelectedComicId(null); + } else { + handleBackToHome(); + } + }} + onReadChapter={(chapter) => { + if (currentManga) { + setSelectedChapter({ manga: currentManga, chapter }); + } + }} + onMangaLoaded={(loadedManga) => { + if (!currentManga) { + currentManga = loadedManga; + } + }} + onNavigateToManga={handleNavigateToManga} + onSelectCategory={handleSelectCategory} + onSelectAuthor={handleSelectAuthor} + isAdmin={isAdmin} + /> + ); + } + + return ( +
+
+
+
+ Twisted Brody Logo +
+

+ Twisted Brody MangaFlow +

+
+ + | + +
+
+
+
+ {(isCategoryPlusEnabled || isCopyIdsEnabled || isDeletePlusEnabled || isCategoryMinusEnabled || isEditTitlePlusEnabled || isEtiquetadoraEnabled) && ( +
+ + + {isEtiquetadoraEnabled ? 'Modo Etiquetar Activo' : isEditTitlePlusEnabled ? 'Modo Nombres Activo' : isCopyIdsEnabled ? 'Modo Copiar Activo' : isDeletePlusEnabled ? 'Modo Eliminar Activo' : isCategoryMinusEnabled ? 'Modo Minus Activo' : 'Modo Plus Activo'} + + + {selectedMangaIds.length} + +
+ )} + {isAdmin && ( + <> + + + + )} +
+
+
+ +
+ + +
+ setShowFilterModal(true)} + /> + {searchTerm && ( +
+ {searchResult.resultCount} resultado{searchResult.resultCount !== 1 ? 's' : ''} encontrado{searchResult.resultCount !== 1 ? 's' : ''} +
+ )} + + {(selectedCategories.length > 0 || selectedAuthors.length > 0) && ( +
+ Filtrado por: + {selectedCategories.map(cat => ( + + ))} + {selectedAuthors.map(auth => ( + + ))} + {(selectedCategories.length > 0 || selectedAuthors.length > 0) && ( + + )} +
+ )} +
+ +
+ {currentFolderId && (() => { + const folder = mangas.find(m => m.id === currentFolderId); + if (!folder) return null; + return ( +
+ +
+ +
+
+

{folder.title}

+

Carpeta • {mangas.filter(m => m.folder_id === folder.id).length} elementos

+
+
+ ); + })()} + {false ? ( +
+ ) : ( + <> + + + + )} +
+
+ + {/* Bulk Action Bar */} + {(isCategoryPlusEnabled || isCopyIdsEnabled || isDeletePlusEnabled || isCategoryMinusEnabled || isEditTitlePlusEnabled || isEtiquetadoraEnabled || isFolderPlusEnabled) && ( +
+
+
+ {selectedMangaIds.length} seleccionados + Listos para acción +
+
+ + {mangaItems.length > 0 && selectedMangaIds.length !== mangaItems.length && ( + + )} + + {selectedMangaIds.length > 0 && ( + + )} + + {selectedMangaIds.length > 0 && ( +
+ {isFolderPlusEnabled && ( + <> + + + + )} + {isCategoryPlusEnabled && ( + + )} + {isEtiquetadoraEnabled && ( + + )} + {isCategoryMinusEnabled && ( + + )} + {isEditTitlePlusEnabled && ( + + )} + {isCopyIdsEnabled && ( + + )} + {isDeletePlusEnabled && ( + + )} +
+ )} +
+
+ )} + + + + { + setShowModal(false); + setEditingManga(null); + }} + editingManga={editingManga} + onMangaCreated={(mangaId) => { + loadMangas(); + setEditingManga(null); + if (mangaId && !editingManga) { + setTimeout(() => { + handleSelectComic(mangaId); + }, 500); + } + }} + onDelete={isAdmin ? handleDeleteManga : undefined} + /> + + setShowBulkModal(false)} + selectedMangaIds={selectedMangaIds} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + + setShowBulkRemoveModal(false)} + selectedMangaIds={selectedMangaIds} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + + setShowBulkEditTitleModal(false)} + mangas={mangas} + selectedMangaIds={selectedMangaIds} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + + setShowEtiquetadoraModal(false)} + selectedMangaIds={selectedMangaIds} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + setShowCreateFolderModal(false)} + selectedMangaIds={selectedMangaIds} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + setShowMoveToFolderModal(false)} + selectedMangaIds={selectedMangaIds} + mangas={mangas} + onSaveComplete={() => { + loadMangas(); + setSelectedMangaIds([]); + }} + /> + + setShowSettingsModal(false)} + isAdmin={isAdmin} + onAdminChange={setIsAdmin} + isCategoryPlusEnabled={isCategoryPlusEnabled} + onCategoryPlusChange={setIsCategoryPlusEnabled} + isCopyIdsEnabled={isCopyIdsEnabled} + onCopyIdsChange={setIsCopyIdsEnabled} + isDeletePlusEnabled={isDeletePlusEnabled} + onDeletePlusChange={setIsDeletePlusEnabled} + isCategoryMinusEnabled={isCategoryMinusEnabled} + onCategoryMinusChange={setIsCategoryMinusEnabled} + isEditTitlePlusEnabled={isEditTitlePlusEnabled} + onEditTitlePlusChange={setIsEditTitlePlusEnabled} + isEtiquetadoraEnabled={isEtiquetadoraEnabled} + onEtiquetadoraChange={setIsEtiquetadoraEnabled} + isFolderPlusEnabled={isFolderPlusEnabled} + onFolderPlusChange={setIsFolderPlusEnabled} + onOpenTitleManager={() => setShowTitleManagerModal(true)} + /> + + setShowTitleManagerModal(false)} + mangas={mangas} + onSaveComplete={() => loadMangas()} + /> + + setShowFilterModal(false)} + categories={allCategories} + selectedCategories={selectedCategories} + onToggleCategory={handleSelectCategory} + onClearFilters={() => setSelectedCategories([])} + /> + +
+ ); +} + +export default App; + diff --git a/src/components/AnnouncementBanner.tsx b/src/components/AnnouncementBanner.tsx new file mode 100644 index 0000000000000000000000000000000000000000..16b7866311c67a3b727cf5cc2087ecaddb062cf8 --- /dev/null +++ b/src/components/AnnouncementBanner.tsx @@ -0,0 +1,91 @@ +import { useState, useEffect } from 'react'; +import { Megaphone, Timer } from 'lucide-react'; +import { subscribeToAnnouncement } from '../services/announcement'; + +interface AnnouncementBannerProps { + isAdmin?: boolean; +} + +export function AnnouncementBanner({ isAdmin }: AnnouncementBannerProps) { + const [announcement, setAnnouncement] = useState(''); + const [expiresAt, setExpiresAt] = useState(null); + const [timeLeft, setTimeLeft] = useState(''); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + const unsubscribe = subscribeToAnnouncement((data) => { + if (data) { + setAnnouncement(data.text); + setExpiresAt(data.expiresAt); + } else { + setAnnouncement(''); + setExpiresAt(null); + } + setIsLoading(false); + }); + + return () => unsubscribe(); + }, []); + + useEffect(() => { + if (!expiresAt) { + setTimeLeft(''); + return; + } + + const interval = setInterval(() => { + const now = new Date().getTime(); + const expiration = new Date(expiresAt).getTime(); + const difference = expiration - now; + + if (difference <= 0) { + setAnnouncement(''); + setExpiresAt(null); + clearInterval(interval); + } else { + const days = Math.floor(difference / (1000 * 60 * 60 * 24)); + const hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = Math.floor((difference % (1000 * 60)) / 1000); + + let timeString = ''; + if (days > 0) timeString += `${days}d `; + timeString += `${hours.toString().padStart(2, '0')}h ${minutes.toString().padStart(2, '0')}m ${seconds.toString().padStart(2, '0')}s`; + setTimeLeft(timeString); + } + }, 1000); + + return () => clearInterval(interval); + }, [expiresAt]); + + if (!announcement && !isLoading) return null; + if (!announcement) return null; + + return ( +
+
+ +
+
+ +
+

+ Información Importante + +

+
+ +
+ {announcement} +
+ + {timeLeft && ( +
+ + Expira en: {timeLeft} +
+ )} +
+
+ ); +} diff --git a/src/components/AuthorSelector.tsx b/src/components/AuthorSelector.tsx new file mode 100644 index 0000000000000000000000000000000000000000..22b1d0276d0361fd79281656af9854e23b5410df --- /dev/null +++ b/src/components/AuthorSelector.tsx @@ -0,0 +1,191 @@ +import { useState, useRef, useEffect, useMemo } from 'react'; +import { X, Check, User, Trash2, Plus } from 'lucide-react'; + +interface AuthorSelectorProps { + label: string; + authors: string[]; + value: string[]; + onChange: (authors: string[]) => void; + onDelete?: (author: string) => void; + placeholder?: string; + colorClass?: string; +} + +export function AuthorSelector({ + label, + authors, + value, + onChange, + onDelete, + placeholder = 'Añadir autor...', + colorClass = 'text-gray-400' +}: AuthorSelectorProps) { + const [inputValue, setInputValue] = useState(''); + const [isOpen, setIsOpen] = useState(false); + const containerRef = useRef(null); + + // Filter suggestions based on input + const suggestions = useMemo(() => { + if (!inputValue.trim()) return authors; + return authors.filter(author => + author.toLowerCase().includes(inputValue.toLowerCase()) + ); + }, [authors, inputValue]); + + // Handle click outside to close dropdown + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if (containerRef.current && !containerRef.current.contains(event.target as Node)) { + setIsOpen(false); + } + }; + + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, []); + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + e.preventDefault(); + handleAction(); + } + }; + + const handleAction = () => { + const _val = inputValue.trim(); + if (!_val) return; + + if (!value.includes(_val)) { + onChange([...value, _val]); + } + + setInputValue(''); + setIsOpen(false); + }; + + const handleSelect = (authorName: string) => { + const trimmed = authorName.trim(); + if (trimmed && !value.includes(trimmed)) { + onChange([...value, trimmed]); + } + setInputValue(''); + setIsOpen(false); + }; + + const handleRemove = (authorName: string) => { + onChange(value.filter(a => a !== authorName)); + }; + + const handleDeleteClick = (e: React.MouseEvent, author: string) => { + e.stopPropagation(); + e.preventDefault(); + if (onDelete) { + onDelete(author); + } + }; + + return ( +
+ + +
+
+
+
+ +
+ { + setInputValue(e.target.value); + setIsOpen(true); + }} + onFocus={() => setIsOpen(true)} + onKeyDown={handleKeyDown} + placeholder={placeholder} + className="w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg pl-10 pr-10 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all" + /> + {inputValue && ( + + )} +
+ +
+ + {/* Dropdown Suggestions */} + {isOpen && (suggestions.length > 0 || inputValue) && ( +
+ {suggestions.length > 0 ? ( + suggestions.map((author, index) => { + const isSelected = value.includes(author); + return ( +
{ + e.preventDefault(); + handleSelect(author); + }} + > + + {author} + +
+ {isSelected && } + {onDelete && ( + + )} +
+
+ ); + }) + ) : ( +
+

No encontrado.

+ +
+ )} +
+ )} +
+ + {/* Selected Tags */} +
+ {value.map((author, idx) => ( + + {author} + + + ))} +
+ + {/* Helper text */} +

+ {value.length > 0 ? `Autores seleccionados: ${value.join(', ')}` : 'Deja en blanco para no modificar el autor.'} +

+
+ ); +} diff --git a/src/components/BulkCategoryModal.tsx b/src/components/BulkCategoryModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f86fe6a901888a398dfbf06a9ce274664bec4d1b --- /dev/null +++ b/src/components/BulkCategoryModal.tsx @@ -0,0 +1,409 @@ +import { X, Save } from 'lucide-react'; +import { toast } from 'sonner'; +import { useState, useEffect } from 'react'; +import { Category } from '../types/manga'; +import { createCategory, getAllCategories, updateManga, getMangaById, deleteCategory, getAllAuthors, deleteAuthorByName } from '../services/manga'; +import { LoadingSpinner } from './LoadingSpinner'; +import { CategorySelector } from './CategorySelector'; +import { AuthorSelector } from './AuthorSelector'; + +interface BulkCategoryModalProps { + isOpen: boolean; + onClose: () => void; + selectedMangaIds: string[]; + onSaveComplete: () => void; +} + +export function BulkCategoryModal({ isOpen, onClose, selectedMangaIds, onSaveComplete }: BulkCategoryModalProps) { + const [categories, setCategories] = useState([]); + const [selectedCategories, setSelectedCategories] = useState([]); + + // Author state + const [authors, setAuthors] = useState([]); + const [selectedAuthors, setSelectedAuthors] = useState([]); + + const [applyDecensored, setApplyDecensored] = useState(false); + const [applyBn, setApplyBn] = useState(false); + const [applyColor, setApplyColor] = useState(false); + + const [isSaving, setIsSaving] = useState(false); + const [isLoading, setIsLoading] = useState(false); + + useEffect(() => { + if (isOpen) { + loadCategories(); + setSelectedCategories([]); // Reset selection on open + setSelectedAuthors([]); // Reset author on open + setApplyDecensored(false); + setApplyBn(false); + setApplyColor(false); + } + }, [isOpen]); + + const loadCategories = async () => { + try { + setIsLoading(true); + const data = await getAllCategories(); + setCategories(data); + + // Load authors - Optimized call + const uniqueAuthors = await getAllAuthors(); + setAuthors(uniqueAuthors); + } catch (error) { + console.error('Error loading categories:', error); + } finally { + setIsLoading(false); + } + }; + + const handleCreateCategory = async (name: string, type: 'character' | 'series' | 'genre' | 'tag') => { + if (!name.trim()) return; + + // Special handling for tags: split by space + if (type === 'tag') { + const tagNames = name.split(' ').map(t => t.trim()).filter(t => t.length > 0); + + // Allow multiple creations in parallel or sequential. + for (const tagName of tagNames) { + await processSingleCategory(tagName, type); + } + return; + } + + await processSingleCategory(name, type); + }; + + const processSingleCategory = async (name: string, type: 'character' | 'series' | 'genre' | 'tag') => { + try { + const existingCategory = categories.find( + cat => cat.name.toLowerCase() === name.trim().toLowerCase() && cat.type === type + ); + + if (existingCategory) { + setSelectedCategories(prev => { + if (!prev.includes(existingCategory.id)) return [...prev, existingCategory.id]; + return prev; + }); + } else { + const newCategory = await createCategory(name.trim(), type); + setCategories(prev => { + if (prev.find(c => c.id === newCategory.id)) return prev; + return [...prev, newCategory]; + }); + setSelectedCategories(prev => { + if (!prev.includes(newCategory.id)) return [...prev, newCategory.id]; + return prev; + }); + } + } catch (error) { + console.error('Error creating category:', error); + } + }; + + const handleRemoveCategory = (categoryId: string) => { + setSelectedCategories(prev => prev.filter(id => id !== categoryId)); + }; + + const handleDeleteCategory = async (id: string) => { + try { + await deleteCategory(id); + setCategories(prev => prev.filter(c => c.id !== id)); + // Also remove from selection if selected + setSelectedCategories(prev => prev.filter(catId => catId !== id)); + } catch (error) { + console.error('Error deleting category:', error); + toast.error('Error al eliminar la categoría'); + } + }; + + const handleDeleteAuthor = (authorName: string) => { + toast(`¿Eliminar al autor "${authorName}" permanentemente?`, { + description: 'Se eliminará este autor de TODOS los mangas. Esta acción no se puede deshacer.', + action: { + label: 'Eliminar', + onClick: async () => { + try { + setIsLoading(true); // Show loading state + await deleteAuthorByName(authorName); + toast.success(`Autor "${authorName}" eliminado correctamente.`); + + // Refresh authors list + setAuthors(prev => prev.filter(a => a !== authorName)); + if (selectedAuthors.includes(authorName)) { + setSelectedAuthors(prev => prev.filter(a => a !== authorName)); + } + + } catch (error) { + console.error('Error deleting author:', error); + toast.error('Error al eliminar el autor.'); + } finally { + setIsLoading(false); + } + }, + }, + cancel: { + label: 'Cancelar', + onClick: () => { }, + }, + duration: 5000, + }); + }; + + const handleSave = async () => { + if (selectedCategories.length === 0 && selectedAuthors.length === 0 && !applyDecensored && !applyBn && !applyColor) { + toast.error('Selecciona al menos una categoría, autor o clasificación para aplicar.'); + return; + } + + setIsSaving(true); + try { + // Process all mangas + // Strategy: Fetch current manga data (to get existing categories), append new ones unique, update. + // This ensures we don't overwrite existing categories that are NOT in the selection. + + const updatePromises = selectedMangaIds.map(async (mangaId) => { + try { + const manga = await getMangaById(mangaId); + if (!manga) return; + + const existingIds = manga.categories?.map(c => c.id) || []; + // Merge existing with selected, avoid duplicates + const mergedIds = Array.from(new Set([...existingIds, ...selectedCategories])); + + const updateData: any = { + title: manga.title, + author: manga.author, + categoryIds: mergedIds + }; + + // Update author if selected + if (selectedAuthors.length > 0) { + updateData.author = selectedAuthors.join(', '); + } + + if (applyDecensored) updateData.is_decensored = true; + if (applyBn) { + updateData.is_bn = true; + updateData.is_color = false; + } + if (applyColor) { + updateData.is_color = true; + updateData.is_bn = false; + } + + await updateManga(mangaId, updateData); + } catch (err) { + console.error(`Error updating manga ${mangaId}`, err); + } + }); + + await Promise.all(updatePromises); + toast.success('Categorías aplicadas correctamente.'); + onSaveComplete(); + onClose(); + + } catch (error) { + console.error('Error bulk updating mangas:', error); + toast.error('Error al aplicar cambios.'); + } finally { + setIsSaving(false); + } + }; + + if (!isOpen) return null; + + return ( +
+
+ + {/* Header */} +
+

+ Aplicar Categorías a {selectedMangaIds.length} Mangas +

+ +
+ +
+ {isLoading ? ( +
+ +
+ ) : ( +
+ {/* Autores */} +
+ +
+ + {/* Clasificaciones */} +
+
+
+

Sin censura

+

Marcar todos como sin censura

+
+ +
+ +
+
+

B/N

+

Marcar todos como Blanco y Negro

+
+ +
+ +
+
+

a color

+

Marcar todos como a color

+
+ +
+
+ + {/* Personajes */} + { + if (!selectedCategories.includes(id)) { + setSelectedCategories(prev => [...prev, id]); + } + }} + onRemove={handleRemoveCategory} + onCreate={(name) => handleCreateCategory(name, 'character')} + onDeleteCategory={handleDeleteCategory} + colorClass="text-blue-400" + placeholder="Añadir personaje..." + /> + + {/* Series */} + { + if (!selectedCategories.includes(id)) { + setSelectedCategories(prev => [...prev, id]); + } + }} + onRemove={handleRemoveCategory} + onCreate={(name) => handleCreateCategory(name, 'series')} + onDeleteCategory={handleDeleteCategory} + colorClass="text-green-400" + placeholder="Añadir serie..." + /> + + {/* Géneros */} + { + if (!selectedCategories.includes(id)) { + setSelectedCategories(prev => [...prev, id]); + } + }} + onRemove={handleRemoveCategory} + onCreate={(name) => handleCreateCategory(name, 'genre')} + onDeleteCategory={handleDeleteCategory} + colorClass="text-purple-400" + placeholder="Añadir género..." + /> + + {/* Etiquetas */} + { + if (!selectedCategories.includes(id)) { + setSelectedCategories(prev => [...prev, id]); + } + }} + onRemove={handleRemoveCategory} + onCreate={(name) => handleCreateCategory(name, 'tag')} + onDeleteCategory={handleDeleteCategory} + colorClass="text-pink-400" + placeholder="Añadir etiqueta..." + /> +
+ )} +
+ +
+ + +
+ +
+
+ ); +} diff --git a/src/components/BulkEditTitleModal.tsx b/src/components/BulkEditTitleModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..8543cd39816062c563d6592068dc2446b0db0476 --- /dev/null +++ b/src/components/BulkEditTitleModal.tsx @@ -0,0 +1,204 @@ +import { useState, useMemo, useEffect } from 'react'; +import { X, Search, Save, Edit3 } from 'lucide-react'; +import { Manga } from '../types/manga'; +import { toast } from 'sonner'; +import { updateMangaTitles } from '../services/manga'; +import { getThumbnailUrl } from '../utils/imageUtils'; + +interface BulkEditTitleModalProps { + isOpen: boolean; + onClose: () => void; + mangas: Manga[]; + selectedMangaIds: string[]; + onSaveComplete: () => void; +} + +export function BulkEditTitleModal({ isOpen, onClose, mangas, selectedMangaIds, onSaveComplete }: BulkEditTitleModalProps) { + const [searchTerm, setSearchTerm] = useState(''); + const [bulkName, setBulkName] = useState(''); + const [edits, setEdits] = useState>({}); + const [isSaving, setIsSaving] = useState(false); + + useEffect(() => { + if (isOpen) { + setSearchTerm(''); + setBulkName(''); + setEdits({}); + } + }, [isOpen]); + + const handleApplyBulkName = () => { + if (!bulkName.trim()) return; + const newEdits = { ...edits }; + mangas.filter(m => selectedMangaIds.includes(m.id)).forEach(m => { + newEdits[m.id] = bulkName; + }); + setEdits(newEdits); + toast.success(`Nombre aplicado a ${selectedMangaIds.length} mangas localmente`); + }; + + const sortedAndFilteredMangas = useMemo(() => { + let result = mangas.filter(m => selectedMangaIds.includes(m.id)); + if (searchTerm) { + const lowerQuery = searchTerm.toLowerCase(); + result = result.filter(m => m.title.toLowerCase().includes(lowerQuery)); + } + return result.sort((a, b) => a.title.localeCompare(b.title)); + }, [mangas, selectedMangaIds, searchTerm]); + + const handleTitleChange = (id: string, newTitle: string) => { + setEdits(prev => ({ + ...prev, + [id]: newTitle + })); + }; + + const handleSave = async () => { + const modifications = Object.entries(edits).filter(([id, newTitle]) => { + const originalManga = mangas.find(m => m.id === id); + return originalManga && originalManga.title !== newTitle.trim() && newTitle.trim() !== ''; + }); + + if (modifications.length === 0) { + toast.info('No hay cambios para guardar'); + return; + } + + try { + setIsSaving(true); + const updates = modifications.map(([id, title]) => ({ id, title: title.trim() })); + await updateMangaTitles(updates); + toast.success(`Se actualizaron ${updates.length} nombres correctamente`); + onSaveComplete(); + onClose(); + } catch (error) { + console.error('Error saving titles:', error); + toast.error('Error al guardar los cambios'); + } finally { + setIsSaving(false); + } + }; + + if (!isOpen) return null; + + return ( +
+
+
+
+
+ +
+
+

Editar Nombres

+

Edita los títulos de los {selectedMangaIds.length} mangas seleccionados

+
+
+ +
+ +
+
+ + setSearchTerm(e.target.value)} + placeholder="Filtrar manga por título..." + className="w-full bg-[#1a1a1a] border border-gray-700 rounded-xl pl-10 pr-4 py-3 text-sm text-white focus:outline-none focus:border-pink-500 transition-colors" + /> +
+
+ setBulkName(e.target.value)} + placeholder="Pon un nombre para aplicar a todos los seleccionados (Opcional)" + className="flex-1 bg-[#1a1a1a] border border-gray-700 rounded-xl px-4 py-3 text-sm text-white focus:outline-none focus:border-pink-500 transition-colors" + /> + +
+
+ +
+ {sortedAndFilteredMangas.map((manga) => { + const originalSrc = manga.cover_url || manga.thumbnail_url; + const optimizedSrc = originalSrc ? getThumbnailUrl(originalSrc) : undefined; + return ( +
+ {optimizedSrc ? ( + + ) : ( +
+ Sin img +
+ )} +
+ handleTitleChange(manga.id, e.target.value)} + className={`w-full bg-transparent border-b pl-2 py-1 text-sm focus:outline-none transition-colors ${ + edits[manga.id] !== undefined && edits[manga.id].trim() !== manga.title + ? 'border-pink-500 text-pink-300' + : 'border-transparent hover:border-gray-700 text-white focus:border-gray-600' + }`} + placeholder="Título del manga" + /> +
+
+ ); + })} + {sortedAndFilteredMangas.length === 0 && ( +
+ No se encontraron mangas con ese nombre en la selección +
+ )} +
+ +
+ + {Object.keys(edits).filter(id => edits[id].trim() !== mangas.find(m => m.id === id)?.title).length} cambios pendientes + +
+ + +
+
+
+
+ ); +} diff --git a/src/components/BulkRemoveCategoryModal.tsx b/src/components/BulkRemoveCategoryModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..7cd6e84fb5aa372200f76f85d99b52cf2083f872 --- /dev/null +++ b/src/components/BulkRemoveCategoryModal.tsx @@ -0,0 +1,265 @@ +import { X, Save, Trash2 } from 'lucide-react'; +import { toast } from 'sonner'; +import { useState, useEffect } from 'react'; +import { Category, Manga } from '../types/manga'; +import { updateManga, getMangaById } from '../services/manga'; +import { LoadingSpinner } from './LoadingSpinner'; + +interface BulkRemoveCategoryModalProps { + isOpen: boolean; + onClose: () => void; + selectedMangaIds: string[]; + onSaveComplete: () => void; +} + +export function BulkRemoveCategoryModal({ isOpen, onClose, selectedMangaIds, onSaveComplete }: BulkRemoveCategoryModalProps) { + const [availableCategories, setAvailableCategories] = useState([]); + const [availableAuthors, setAvailableAuthors] = useState([]); + + // The items the user selects TO REMOVE + const [selectedCategoryIdsToRemove, setSelectedCategoryIdsToRemove] = useState([]); + const [selectedAuthorsToRemove, setSelectedAuthorsToRemove] = useState([]); + + const [isSaving, setIsSaving] = useState(false); + const [isLoading, setIsLoading] = useState(false); + + useEffect(() => { + if (isOpen) { + loadMangasData(); + setSelectedCategoryIdsToRemove([]); + setSelectedAuthorsToRemove([]); + } + }, [isOpen]); + + const loadMangasData = async () => { + try { + setIsLoading(true); + const mangasData: (Manga | null)[] = await Promise.all( + selectedMangaIds.map(id => getMangaById(id).catch(() => null)) + ); + + const validMangas = mangasData.filter(Boolean) as Manga[]; + + const catMap = new Map(); + const authorSet = new Set(); + + validMangas.forEach(manga => { + if (manga.author) authorSet.add(manga.author); + if (manga.categories) { + manga.categories.forEach(cat => catMap.set(cat.id, cat)); + } + }); + + setAvailableCategories(Array.from(catMap.values())); + setAvailableAuthors(Array.from(authorSet)); + + } catch (error) { + console.error('Error loading mangas data:', error); + toast.error('Error al cargar datos de los mangas'); + } finally { + setIsLoading(false); + } + }; + + const toggleCategoryRemove = (id: string) => { + setSelectedCategoryIdsToRemove(prev => + prev.includes(id) ? prev.filter(c => c !== id) : [...prev, id] + ); + }; + + const toggleAuthorRemove = (author: string) => { + setSelectedAuthorsToRemove(prev => + prev.includes(author) ? prev.filter(a => a !== author) : [...prev, author] + ); + }; + + const handleSave = async () => { + if (selectedCategoryIdsToRemove.length === 0 && selectedAuthorsToRemove.length === 0) { + toast.error('Selecciona al menos una categoría o autor para eliminar.'); + return; + } + + setIsSaving(true); + try { + const updatePromises = selectedMangaIds.map(async (mangaId) => { + try { + const manga = await getMangaById(mangaId); + if (!manga) return; + + let needsUpdate = false; + const updateData: any = { + title: manga.title, + author: manga.author + }; + + if (selectedAuthorsToRemove.includes(manga.author)) { + updateData.author = 'Desconocido'; + needsUpdate = true; + } + + if (manga.categories && manga.categories.length > 0) { + const existingIds = manga.categories.map(c => c.id); + const newIds = existingIds.filter(id => !selectedCategoryIdsToRemove.includes(id)); + + if (newIds.length !== existingIds.length) { + updateData.categoryIds = newIds; + needsUpdate = true; + } else { + updateData.categoryIds = existingIds; + } + } else { + updateData.categoryIds = []; + } + + if (needsUpdate) { + await updateManga(mangaId, updateData); + } + } catch (err) { + console.error(`Error updating manga ${mangaId}`, err); + } + }); + + await Promise.all(updatePromises); + toast.success('Categorías eliminadas de los mangas correctamente.'); + onSaveComplete(); + onClose(); + + } catch (error) { + console.error('Error bulk updating mangas:', error); + toast.error('Error al aplicar cambios.'); + } finally { + setIsSaving(false); + } + }; + + if (!isOpen) return null; + + const renderCategorySection = (type: 'character' | 'series' | 'genre' | 'tag', title: string, colorClass: string) => { + const typeCategories = availableCategories.filter(c => c.type === type); + if (typeCategories.length === 0) return null; + + return ( +
+ {title} +
+ {typeCategories.map(cat => { + const isSelected = selectedCategoryIdsToRemove.includes(cat.id); + return ( + + ); + })} +
+
+ ); + }; + + return ( +
+
+ + {/* Header */} +
+

+ + Remover Categorías en {selectedMangaIds.length} Mangas +

+ +
+ +
+ {isLoading ? ( +
+ +

Escaneando mangas seleccionados...

+
+ ) : availableCategories.length === 0 && availableAuthors.length === 0 ? ( +
+ +

Sin categorías

+

Los mangas seleccionados no tienen autores ni categorías para remover.

+
+ ) : ( +
+

+ Selecciona los autores y categorías que deseas eliminar de los mangas seleccionados. +

+ + {/* Autores */} + {availableAuthors.length > 0 && ( +
+ Autor +
+ {availableAuthors.map(author => { + const isSelected = selectedAuthorsToRemove.includes(author); + return ( + + ); + })} +
+

* Remover al autor lo dejará como "Desconocido".

+
+ )} + + {/* Categorías */} + {renderCategorySection('character', 'Personajes', 'text-blue-400')} + {renderCategorySection('series', 'Series', 'text-green-400')} + {renderCategorySection('genre', 'Géneros', 'text-purple-400')} + {renderCategorySection('tag', 'Etiquetas', 'text-pink-400')} +
+ )} +
+ +
+ + +
+ +
+
+ ); +} diff --git a/src/components/CategoryFilterModal.tsx b/src/components/CategoryFilterModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..80954adfd0f4872210df5386ece3ff4c684788e2 --- /dev/null +++ b/src/components/CategoryFilterModal.tsx @@ -0,0 +1,167 @@ +import { X, Search, Check, Filter } from 'lucide-react'; +import { useState, useMemo } from 'react'; +import { Category } from '../types/manga'; + +interface CategoryFilterModalProps { + isOpen: boolean; + onClose: () => void; + categories: Category[]; + selectedCategories: string[]; + onToggleCategory: (categoryName: string) => void; + onClearFilters: () => void; +} + +const CATEGORY_TYPE_ORDER = ['series', 'character', 'genre', 'tag', 'other']; +const TYPE_LABELS: Record = { + series: 'Series', + character: 'Personajes', + genre: 'Géneros', + tag: 'Etiquetas', + other: 'Otros', +}; + +export function CategoryFilterModal({ + isOpen, + onClose, + categories, + selectedCategories, + onToggleCategory, + onClearFilters, +}: CategoryFilterModalProps) { + const [searchTerm, setSearchTerm] = useState(''); + + const groupedCategories = useMemo(() => { + const filtered = categories.filter(c => + c.name.toLowerCase().includes(searchTerm.toLowerCase()) + ); + + const groups: Record = {}; + + // Initialize groups + CATEGORY_TYPE_ORDER.forEach(type => { + groups[type] = []; + }); + groups['other'] = []; // Ensure 'other' exists + + filtered.forEach(cat => { + const type = cat.type || 'other'; + if (!groups[type]) { + groups[type] = []; + } + groups[type].push(cat); + }); + + return groups; + }, [categories, searchTerm]); + + if (!isOpen) return null; + + return ( +
+
e.stopPropagation()} + > + {/* Header */} +
+
+
+ +
+
+

Filtrar por Categorías

+

Selecciona múltiples opciones para refinar tu búsqueda

+
+
+ +
+ + {/* Search Bar */} +
+
+ + setSearchTerm(e.target.value)} + className="w-full bg-[#0f0f0f] border border-gray-700/50 rounded-lg pl-10 pr-4 py-2.5 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-purple-500/50 focus:ring-1 focus:ring-purple-500/50 transition-all" + /> +
+
+ + {/* Categories Content */} +
+ {CATEGORY_TYPE_ORDER.map((type) => { + const groupCategories = groupedCategories[type]; + if (!groupCategories || groupCategories.length === 0) return null; + + return ( +
+

+ + {TYPE_LABELS[type] || type} +

+
+ {groupCategories.sort((a, b) => a.name.localeCompare(b.name)).map((category) => { + const isSelected = selectedCategories.includes(category.name); + return ( + + ); + })} +
+
+ ); + })} + + {/* Show message if no results logic could be added here if needed */} +
+ + {/* Footer */} +
+
+ {selectedCategories.length} seleccionada{selectedCategories.length !== 1 ? 's' : ''} +
+
+ {selectedCategories.length > 0 && ( + + )} + +
+
+
+
+ ); +} diff --git a/src/components/CategorySelector.tsx b/src/components/CategorySelector.tsx new file mode 100644 index 0000000000000000000000000000000000000000..573ef34cefd9d40242693d68d5f97f83a6ca4ae0 --- /dev/null +++ b/src/components/CategorySelector.tsx @@ -0,0 +1,216 @@ +import { useState, useRef, useEffect, useMemo } from 'react'; +import { toast } from 'sonner'; +import { X, Plus, Trash2, Check } from 'lucide-react'; +import { Category } from '../types/manga'; + +interface CategorySelectorProps { + label: string; + type: 'character' | 'series' | 'genre' | 'tag'; + categories: Category[]; + selectedIds: string[]; + onSelect: (id: string) => void; + onRemove: (id: string) => void; + onCreate: (name: string) => void; + onDeleteCategory: (id: string) => void; + colorClass: string; // e.g., 'text-blue-400', 'bg-blue-500' + placeholder?: string; +} + +export function CategorySelector({ + label, + type, + categories, + selectedIds, + onSelect, + onRemove, + onCreate, + onDeleteCategory, + colorClass, + placeholder = 'Añadir...' +}: CategorySelectorProps) { + const [inputValue, setInputValue] = useState(''); + const [isOpen, setIsOpen] = useState(false); + const containerRef = useRef(null); + + // Filter categories by type + const typeCategories = useMemo(() => + categories.filter(c => c.type === type || (!c.type && type === 'genre')), + [categories, type]); + + // Filter suggestions based on input + const suggestions = useMemo(() => { + if (!inputValue.trim()) return typeCategories; + return typeCategories.filter(c => + c.name.toLowerCase().includes(inputValue.toLowerCase()) + ); + }, [typeCategories, inputValue]); + + // Handle click outside to close dropdown + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if (containerRef.current && !containerRef.current.contains(event.target as Node)) { + setIsOpen(false); + } + }; + + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, []); + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + e.preventDefault(); + handleAction(); + } + }; + + const handleAction = () => { + if (!inputValue.trim()) return; + + // Check for exact match (case insensitive) + const existing = typeCategories.find( + c => c.name.toLowerCase() === inputValue.trim().toLowerCase() + ); + + if (existing) { + if (!selectedIds.includes(existing.id)) { + onSelect(existing.id); + } + } else { + onCreate(inputValue.trim()); + } + setInputValue(''); + setIsOpen(false); + }; + + const handleDeleteClick = (e: React.MouseEvent, catId: string) => { + e.stopPropagation(); + toast('¿Eliminar esta categoría permanentemente?', { + description: 'Esta acción no se puede deshacer.', + action: { + label: 'Eliminar', + onClick: () => onDeleteCategory(catId), + }, + cancel: { + label: 'Cancelar', + onClick: () => { }, + }, + duration: 5000, + }); + }; + + // Get color classes + const getColors = () => { + if (colorClass.includes('blue')) return { bg: 'bg-blue-500/20', text: 'text-blue-300', border: 'border-blue-500/30' }; + if (colorClass.includes('green')) return { bg: 'bg-green-500/20', text: 'text-green-300', border: 'border-green-500/30' }; + if (colorClass.includes('purple')) return { bg: 'bg-purple-500/20', text: 'text-purple-300', border: 'border-purple-500/30' }; + if (colorClass.includes('pink')) return { bg: 'bg-pink-500/20', text: 'text-pink-300', border: 'border-pink-500/30' }; + return { bg: 'bg-gray-500/20', text: 'text-gray-300', border: 'border-gray-500/30' }; + }; + + const colors = getColors(); + + return ( +
+ + +
+
+
+ { + setInputValue(e.target.value); + setIsOpen(true); + }} + onFocus={() => setIsOpen(true)} + onKeyDown={handleKeyDown} + placeholder={placeholder} + className="w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] transition-all" + /> + {inputValue && ( + + )} +
+ +
+ + {/* Dropdown Suggestions */} + {isOpen && (suggestions.length > 0 || inputValue) && ( +
+ {suggestions.length > 0 ? ( + suggestions.map(cat => { + const isSelected = selectedIds.includes(cat.id); + return ( +
{ + if (!isSelected) { + onSelect(cat.id); + setInputValue(''); + setIsOpen(false); + } + }} + > + + {cat.name} + +
+ {isSelected && } + +
+
+ ); + }) + ) : ( +
+

No encontrado.

+ +
+ )} +
+ )} +
+ + {/* Selected Tags */} +
+ {selectedIds.map(catId => { + const category = categories.find(c => c.id === catId); + // Only show if it matches the current selector type + if (!category || (category.type !== type && !(type === 'genre' && !category.type))) return null; + + return ( + + {category.name} + + + ); + })} +
+
+ ); +} diff --git a/src/components/ChapterReader.tsx b/src/components/ChapterReader.tsx new file mode 100644 index 0000000000000000000000000000000000000000..70c1712887f5ff2b85c938f0c3a3270a6a5fa493 --- /dev/null +++ b/src/components/ChapterReader.tsx @@ -0,0 +1,129 @@ +import { ArrowLeft, ChevronLeft, ChevronRight } from 'lucide-react'; +import { useState } from 'react'; +import { Chapter, Manga } from '../types/manga'; +import { ImageLoader } from './ImageLoader'; +import { GlobalFooter } from './GlobalFooter'; + +import { getReaderUrl } from '../utils/imageUtils'; + +interface ChapterReaderProps { + manga: Manga; + chapter: Chapter; + onBack: () => void; +} + +export function ChapterReader({ manga, chapter, onBack }: ChapterReaderProps) { + const [currentPageIndex, setCurrentPageIndex] = useState(0); + + if (!chapter.pages || chapter.pages.length === 0) { + return ( +
+ +
No hay páginas disponibles
+
+ ); + } + + const handlePrevPage = () => { + if (currentPageIndex > 0) setCurrentPageIndex(currentPageIndex - 1); + }; + + const handleNextPage = () => { + if (currentPageIndex < chapter.pages.length - 1) setCurrentPageIndex(currentPageIndex + 1); + }; + + + return ( +
+
+
+
+ +
+

{manga.title}

+

{chapter.title}

+
+
+
+ {currentPageIndex + 1} / {chapter.pages.length} +
+
+
+ +
+
+ {chapter.pages.map((page, index) => { + // Smart Loading Strategy: + // - Eager load the first 2 pages so they appear instantly. + // - Lazy load the rest so we don't choke the network. + const isPriority = index < 2; + const optimizedSrc = getReaderUrl(page); + + return ( +
+ 0} + /> +
+ ); + })} +
+ +
+
+
+ +
+
+ + +
+ setCurrentPageIndex(parseInt(e.target.value))} + className="w-64 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-[#bb86fc]" + /> + + {currentPageIndex + 1}/{chapter.pages.length} + +
+ + +
+
+
+ ); +} diff --git a/src/components/ComicDetail.tsx b/src/components/ComicDetail.tsx new file mode 100644 index 0000000000000000000000000000000000000000..154fadb7ff146c93dcff6151b553e34ee138db01 --- /dev/null +++ b/src/components/ComicDetail.tsx @@ -0,0 +1,1056 @@ +import { ArrowLeft, BookMarked, User, Download, Link as LinkIcon, X, Plus, Rows, Grid2X2, Grid3X3, FileText, Search, Send, Check, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, Eye, ZoomIn, ZoomOut, RotateCcw } from 'lucide-react'; +import { GlobalFooter } from './GlobalFooter'; + +import { useState, useEffect } from 'react'; +import { getMangaById, incrementMangaViews, addExternalLink, removeExternalLink, getRecommendations, getAllMangas, subscribeToManga } from '../services/manga'; +import { Manga } from '../types/manga'; +import { detectImageOrientation } from '../utils/imageOptimization'; +import { LoadingSpinner } from './LoadingSpinner'; +import { ImageLightbox } from './ImageLightbox'; +import { ImageLoader } from './ImageLoader'; +import { MangaCard } from './MangaCard'; +import { LazyImageWrapper } from './LazyImageWrapper'; + +interface ComicDetailProps { + id: string; + onBack: () => void; + onReadChapter?: (chapter: any) => void; + onMangaLoaded?: (manga: Manga) => void; + onNavigateToManga?: (mangaId: string) => void; + onSelectCategory?: (category: string) => void; + onSelectAuthor?: (author: string) => void; + isAdmin?: boolean; +} + +export function ComicDetail({ id, onBack, onNavigateToManga, onMangaLoaded, onSelectCategory, onSelectAuthor, isAdmin = false }: ComicDetailProps) { + const [manga, setManga] = useState(null); + const [loading, setLoading] = useState(true); + const [downloading, setDownloading] = useState(false); + const [downloadProgress, setDownloadProgress] = useState(0); + const [showDownloadMenu, setShowDownloadMenu] = useState(false); + const [showPdfMenu, setShowPdfMenu] = useState(false); + const [downloadingPdf, setDownloadingPdf] = useState(false); + const [pdfProgress, setPdfProgress] = useState(0); + const [showExternalLinkModal, setShowExternalLinkModal] = useState(false); + const [externalLinkForm, setExternalLinkForm] = useState({ name: '', url: '' }); + const [externalLinks, setExternalLinks] = useState>([]); + const [coverOrientation, setCoverOrientation] = useState<'portrait' | 'landscape' | 'square'>('portrait'); + const [viewMode, setViewMode] = useState<'vertical' | 'gallery' | 'grid'>('vertical'); + const [lightboxOpen, setLightboxOpen] = useState(false); + const [lightboxIndex, setLightboxIndex] = useState(0); + // const [loadedImages, setLoadedImages] = useState>(new Set()); + const [recommendations, setRecommendations] = useState([]); + const [loadingRecommendations, setLoadingRecommendations] = useState(false); + const [searchTerm, setSearchTerm] = useState(''); + const [allMangas, setAllMangas] = useState([]); + const [loadingAllMangas, setLoadingAllMangas] = useState(false); + const [copiedId, setCopiedId] = useState(false); + const [recPage, setRecPage] = useState(1); + const [zoomLevel, setZoomLevel] = useState(1); + const REC_ITEMS_PER_PAGE = 6; + + const handleZoomIn = () => setZoomLevel(prev => Math.min(prev + 0.25, 3)); + const handleZoomOut = () => setZoomLevel(prev => Math.max(prev - 0.25, 0.5)); + const handleResetZoom = () => setZoomLevel(1); + + useEffect(() => { + // Initial fetch for loading state and increment logic + loadMangaAndInit(); + + // Subscribe for real-time updates (views, etc) + const unsubscribe = subscribeToManga(id, (updatedManga) => { + if (updatedManga) { + setManga(() => { + // Determine if we need to update orientation or other heavy stuff? + // For now, just update the data. + // Keep existing derived state if needed? No, just full replacement is safer for data consistency. + return updatedManga; + }); + // If it was the first load, we might need to trigger recommendations if we haven't + // But loadMangaAndInit handles that. + setLoading(false); + } + }); + + loadAllMangasForSearch(); + setSearchTerm(''); + const savedViewMode = localStorage.getItem('manga-view-mode'); + if (savedViewMode === 'vertical' || savedViewMode === 'gallery' || savedViewMode === 'grid') { + setViewMode(savedViewMode); + } + + return () => unsubscribe(); + }, [id]); + + async function loadAllMangasForSearch() { + try { + setLoadingAllMangas(true); + const mangas = await getAllMangas(); + setAllMangas(mangas); + } catch (error) { + console.error('Error loading all mangas:', error); + } finally { + setLoadingAllMangas(false); + } + } + + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + const target = event.target as HTMLElement; + if (showDownloadMenu && !target.closest('.download-menu-container')) { + setShowDownloadMenu(false); + } + if (showPdfMenu && !target.closest('.pdf-menu-container')) { + setShowPdfMenu(false); + } + } + + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, [showDownloadMenu, showPdfMenu]); + + const handleAddExternalLink = async () => { + if (externalLinkForm.name.trim() && externalLinkForm.url.trim() && manga) { + try { + await addExternalLink(manga.id, externalLinkForm); + setExternalLinks([...externalLinks, externalLinkForm]); + setExternalLinkForm({ name: '', url: '' }); + setShowExternalLinkModal(false); + } catch (error) { + console.error('Error al guardar el enlace:', error); + alert('Error al guardar el enlace'); + } + } + }; + + const handleRemoveExternalLink = async (index: number) => { + if (manga) { + try { + await removeExternalLink(manga.id, index); + setExternalLinks(externalLinks.filter((_, i) => i !== index)); + } catch (error) { + console.error('Error al eliminar el enlace:', error); + alert('Error al eliminar el enlace'); + } + } + }; + + const handleViewModeChange = (mode: 'vertical' | 'gallery' | 'grid') => { + setViewMode(mode); + localStorage.setItem('manga-view-mode', mode); + }; + + async function loadMangaAndInit() { + try { + setLoading(true); + + // We still fetch initially... + const data = await getMangaById(id); + if (data) { + setManga(data); + setExternalLinks(data.external_links || []); + + if (data.cover_url) { + try { + const orientation = await detectImageOrientation(data.cover_url); + setCoverOrientation(orientation); + } catch (error) { + console.warn('Failed to detect image orientation:', error); + setCoverOrientation('portrait'); + } + } + + loadRecommendations(data); + } + } catch (error) { + console.error('Error loading manga:', error); + } finally { + // setLoading(false); + } + } + + async function loadRecommendations(currentManga: Manga) { + try { + setLoadingRecommendations(true); + const categoryIds = currentManga.categories?.map(cat => cat.id) || []; + const recs = await getRecommendations(currentManga.id, categoryIds, currentManga.title); + setRecommendations(recs); + setRecPage(1); + } catch (error) { + console.error('Error loading recommendations:', error); + } finally { + setLoadingRecommendations(false); + } + } + + async function handleDownload(format: 'png' | 'jpg' | 'webp' | 'original') { + const targetId = manga?.id || id; + + if (!targetId) { + alert('Error: ID no encontrado.'); + return; + } + + const jobId = targetId; // Usamos el ID como identificador de la tarea + + // 1. Abrimos el canal de progreso (SSE) + console.log(`🚀 [CLIENTE] Suscribiendo a progreso: ${jobId}`); + const eventSource = new EventSource(`/api/download/progress/${jobId}`); + + eventSource.onmessage = (event) => { + const data = JSON.parse(event.data); + // console.log("⚡ [PROGRESO]:", data.progress); + setDownloadProgress(data.progress); + + if (data.progress >= 100) { + eventSource.close(); + } + }; + + try { + console.log("🚀 [CLIENTE] Iniciando descarga para ID:", targetId); + setDownloading(true); + setShowDownloadMenu(false); + setDownloadProgress(0); + + const response = await fetch('/api/download/zip', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + mangaId: targetId, + mangaTitle: manga?.title || 'Descarga', + format: format, + jobId: jobId // Though server uses mangaId mostly now, consistent + }), + }); + + if (!response.ok) throw new Error("Error en el servidor"); + + const blob = await response.blob(); + const urlDownload = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = urlDownload; + a.download = `${manga?.title || 'manga'}.zip`; + document.body.appendChild(a); + a.click(); + a.remove(); + window.URL.revokeObjectURL(urlDownload); + + console.log("✅ [CLIENTE] Descarga disparada con éxito"); + + } catch (error) { + console.error("❌ Error en la descarga:", error); + alert("Hubo un fallo en la matriz de descarga."); + } finally { + setDownloading(false); + eventSource.close(); + } + } + + async function handleDownloadPdf(format: 'png' | 'jpg' | 'webp' | 'original') { + const targetId = manga?.id || id; + if (!targetId) { + alert('Error: ID no encontrado.'); + return; + } + + const jobId = targetId; + + console.log(`🚀 [CLIENTE] Suscribiendo a progreso PDF: ${jobId}`); + const eventSource = new EventSource(`/api/download/progress/${jobId}`); + + eventSource.onmessage = (event) => { + const data = JSON.parse(event.data); + if (data.progress) { + setPdfProgress(data.progress); + } + if (data.progress >= 100) { + eventSource.close(); + } + }; + + try { + console.log("🚀 [CLIENTE] Iniciando PDF para ID:", targetId); + setDownloadingPdf(true); + setPdfProgress(0); + setShowPdfMenu(false); + + const response = await fetch('/api/download/pdf', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + mangaId: targetId, + mangaTitle: manga?.title || 'Descarga', + format: format, + jobId: jobId + }), + }); + + if (!response.ok) throw new Error("Error en el servidor al generar PDF"); + + const blob = await response.blob(); + const urlDownload = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = urlDownload; + a.download = `${manga?.title || 'manga'}.pdf`; + document.body.appendChild(a); + a.click(); + a.remove(); + window.URL.revokeObjectURL(urlDownload); + + console.log("✅ [CLIENTE] PDF descargado con éxito"); + + } catch (error) { + console.error('Error initiating PDF generation:', error); + alert('Error al generar PDF (puede que el archivo sea muy grande o Python falló).'); + } finally { + setDownloadingPdf(false); + eventSource.close(); + } + } + + + if (loading) { + return ( +
+ +
Cargando...
+
+ ); + } + + if (!manga) { + return ( +
+
Manga no encontrado
+
+ ); + } + + const filteredMangas = searchTerm.trim() + ? allMangas.filter(m => { + if (!m.id || !m.title || m.id === manga.id) return false; + const searchLower = searchTerm.toLowerCase(); + const titleMatch = m.title.toLowerCase().includes(searchLower); + const authorMatch = m.author ? m.author.toLowerCase().includes(searchLower) : false; + const categoryMatch = m.categories?.some(cat => cat?.name?.toLowerCase().includes(searchLower)) || false; + return titleMatch || authorMatch || categoryMatch; + }) + : []; + + return ( +
+
+
+ +

{manga.title}

+
+
+ + setSearchTerm(e.target.value)} + className="w-full bg-[#1a1a1a] text-white rounded-lg pl-10 pr-3 py-2 text-sm placeholder-gray-400 focus:ring-2 focus:ring-[#bb86fc] focus:outline-none transition-all border border-gray-700/50 focus:border-[#bb86fc]" + /> +
+
+
+
+ +
+
+ {!searchTerm.trim() && ( +
+
+
+
+ {manga.cover_url ? ( + <> + +
+ + ) : ( +
+ +
+ )} +
+
+
+ +
+

{manga.title}

+ +
+
+ {manga.author && manga.author.toLowerCase() !== 'anónimo' && manga.author.toLowerCase() !== 'anonimo' && ( + <> + + +
+ + )} + + {manga.views?.toLocaleString() || 0} vistas +
+
+ +
+

Categorías

+
+ {manga.categories?.sort((a, b) => { + const order = { series: 1, character: 2, genre: 3, tag: 4, other: 5 }; + const typeA = a.type || 'genre'; // Default to genre if undefined + const typeB = b.type || 'genre'; + return (order[typeA as keyof typeof order] || 5) - (order[typeB as keyof typeof order] || 5); + }).map((cat) => { + // Map colors based on type + let colorClass = "bg-[#bb86fc]/20 text-[#bb86fc] border-[#bb86fc]/40"; // Default (Genre/Purple) + if (cat.type === 'character') colorClass = "bg-blue-500/20 text-blue-300 border-blue-500/30"; + else if (cat.type === 'series') colorClass = "bg-green-500/20 text-green-300 border-green-500/30"; + else if (cat.type === 'tag') colorClass = "bg-pink-500/20 text-pink-300 border-pink-500/30"; + + return ( + + ); + })} +
+
+ + {manga.description && manga.description.trim() !== '' && ( +
+

Sinopsis

+

+ {manga.description} +

+
+ )} + +
+ {manga.chapters && manga.chapters.length > 0 && manga.chapters[0].pages && manga.chapters[0].pages.length > 0 && ( + <> + {downloading && ( +
+
+ Descargando ZIP + {downloadProgress}% +
+
+
+
+
+ )} + {downloadingPdf && ( +
+
+ Generando PDF + {pdfProgress}% +
+
+
+
+
+ )} +
+
+ + + {showDownloadMenu && !downloading && ( +
+ + + + +
+ )} +
+ +
+ + + {showPdfMenu && !downloadingPdf && ( +
+ + + + +
+ )} +
+ + + + + + {externalLinks.map((link, index) => ( + + + {link.name} + {isAdmin && ( + + )} + + ))} + + {isAdmin && ( + + )} +
+ + )} +
+
+
+ )} + + {searchTerm.trim() ? ( +
+

+ Resultados de búsqueda + {filteredMangas.length > 0 && ( + + ({filteredMangas.length} {filteredMangas.length === 1 ? 'resultado' : 'resultados'}) + + )} +

+ {loadingAllMangas ? ( +
+ +
+ ) : filteredMangas.length === 0 ? ( +
+ +

No se encontraron comics que coincidan con "{searchTerm}"

+
+ ) : ( +
+ {filteredMangas.map((m) => { + if (!m.id || !m.title) return null; + const chapterCount = m.chapters?.length || 0; + const totalPages = m.chapters?.reduce((sum, ch) => sum + (ch.pages?.length || 0), 0) || 0; + return ( + { + if (onNavigateToManga) { + window.scrollTo({ top: 0, behavior: 'smooth' }); + onNavigateToManga(mangaId); + } + }} + /> + ); + })} +
+ )} +
+ ) : manga.chapters && manga.chapters.length > 0 && manga.chapters[0].pages && manga.chapters[0].pages.length > 0 && ( +
+
+

+ Páginas +

+
+ + + + + {/* Zoom Controls (Only for Vertical) */} + {viewMode === 'vertical' && ( +
+ + {Math.round(zoomLevel * 100)}% + + +
+ )} +
+
+ +
+ {viewMode === 'gallery' ? ( + manga.chapters[0].pages + .map((pageUrl, index) => ({ pageUrl, index })) + .map(({ pageUrl, index }) => ( +
{ + setLightboxIndex(index); + setLightboxOpen(true); + }} + > + 2 ? "lazy" : "eager"} + className="rounded-lg" + imgClassName="group-hover:scale-110" + /> +
+ )) + ) : ( + manga.chapters[0].pages + .map((pageUrl, index) => ({ pageUrl, index })) + .map(({ pageUrl, index }) => ( +
1 ? 'none' : undefined } : undefined} + onClick={() => { + if (viewMode === 'grid') { + setLightboxIndex(index); + setLightboxOpen(true); + } + }} + > + {viewMode === 'vertical' ? ( + + {() => ( + + )} + + ) : ( + 2 ? "lazy" : "eager"} + className="rounded-lg" + imgClassName="group-hover:scale-110" + /> + )} +
+ )) + )} +
+
+ )} + + {!searchTerm.trim() && recommendations.length > 0 && ( +
+

Recomendaciones

+ {loadingRecommendations ? ( +
+ {Array.from({ length: 6 }).map((_, index) => ( +
+
+
+
+
+ ))} +
+ ) : ( + <> +
+ {recommendations.slice((recPage - 1) * REC_ITEMS_PER_PAGE, recPage * REC_ITEMS_PER_PAGE).map((rec, index) => ( +
+
{ + window.scrollTo({ top: 0, behavior: 'smooth' }); + if (onNavigateToManga) { + onNavigateToManga(rec.id); + } + }} + className="group cursor-pointer flex flex-col" + > +
+ {rec.cover_url || rec.thumbnail_url ? ( + <> + +
+ + ) : ( +
+ +
+ )} + +
+
+ {rec.chapters?.reduce((sum, ch) => sum + (ch.pages?.length || 0), 0) || 0} paginas +
+ {rec.is_decensored && ( +
+ Sin censura +
+ )} + {rec.is_bn && ( +
+ B/N +
+ )} + {rec.is_color && ( +
+ a color +
+ )} +
+
+ +
+

+ {rec.title} +

+ {rec.categories && rec.categories.length > 0 && ( +

+ {(rec.categories.find(c => c.type === 'series') || rec.categories[0]).name} +

+ )} +
+
+
+ ))} +
+ + {recommendations.length > REC_ITEMS_PER_PAGE && ( +
+ + + + + Página {recPage} de {Math.ceil(recommendations.length / REC_ITEMS_PER_PAGE)} + + + + +
+ )} + + )} +
+ )} +
+ +
+ + {lightboxOpen && manga.chapters?.[0]?.pages && ( + setLightboxOpen(false)} + /> + )} + + {showExternalLinkModal && ( +
+
+
+

Añadir Enlace Externo

+ +
+ +
+
+ + setExternalLinkForm({ ...externalLinkForm, name: e.target.value })} + className="w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all" + /> +
+ +
+ + setExternalLinkForm({ ...externalLinkForm, url: e.target.value })} + className="w-full bg-[#1a1a1a] border border-gray-600/50 rounded-lg px-4 py-3 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-[#bb86fc] focus:ring-2 focus:ring-[#bb86fc]/30 transition-all" + /> +
+ +
+ + +
+
+
+
+ )} +
+ ); +} diff --git a/src/components/ConfirmModal.tsx b/src/components/ConfirmModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..426a862a2c4ef76900c3bfc9482ea11c4ea0dbe3 --- /dev/null +++ b/src/components/ConfirmModal.tsx @@ -0,0 +1,82 @@ +import { AlertTriangle, X } from 'lucide-react'; + +interface ConfirmModalProps { + isOpen: boolean; + onClose: () => void; + onConfirm: () => void; + title: string; + message: string; + confirmText?: string; + cancelText?: string; + variant?: 'danger' | 'warning' | 'info'; +} + +export function ConfirmModal({ + isOpen, + onClose, + onConfirm, + title, + message, + confirmText = 'Confirmar', + cancelText = 'Cancelar', + variant = 'warning', +}: ConfirmModalProps) { + if (!isOpen) return null; + + const colorClasses = { + danger: 'from-red-500 to-red-600 shadow-red-500/20', + warning: 'from-[#bb86fc] to-[#9966dd] shadow-[#bb86fc]/30', + info: 'from-blue-500 to-blue-600 shadow-blue-500/20', + }; + + const iconClasses = { + danger: 'bg-red-500/10 text-red-500', + warning: 'bg-[#bb86fc]/10 text-[#bb86fc]', + info: 'bg-blue-500/10 text-blue-500', + }; + + return ( +
+
+
+
+
+ +
+

{title}

+
+ +
+ +
+

+ {message} +

+ +
+ + +
+
+
+
+ ); +} diff --git a/src/components/CreateFolderModal.tsx b/src/components/CreateFolderModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..5903ead06118e14b41ea43543a83111f0e6e36ed --- /dev/null +++ b/src/components/CreateFolderModal.tsx @@ -0,0 +1,88 @@ +import { useState } from 'react'; +import { X, FolderPlus } from 'lucide-react'; +import { toast } from 'sonner'; +import { createFolderAndMove } from '../services/manga'; + +interface CreateFolderModalProps { + isOpen: boolean; + onClose: () => void; + selectedMangaIds: string[]; + onSaveComplete: () => void; +} + +export function CreateFolderModal({ isOpen, onClose, selectedMangaIds, onSaveComplete }: CreateFolderModalProps) { + const [folderName, setFolderName] = useState(''); + const [isSaving, setIsSaving] = useState(false); + + const handleSave = async () => { + if (!folderName.trim()) { + toast.error('Gamba: Escribe un nombre para la carpeta'); + return; + } + + try { + setIsSaving(true); + await createFolderAndMove(folderName.trim(), selectedMangaIds); + toast.success(`Carpeta "${folderName}" creada exitosamente.`); + onSaveComplete(); + onClose(); + setFolderName(''); + } catch (error) { + console.error('Error creating folder:', error); + toast.error('Error al crear la carpeta'); + } finally { + setIsSaving(false); + } + }; + + if (!isOpen) return null; + + return ( +
+
+
+
+
+ +
+
+

Crear Carpeta

+

{selectedMangaIds.length} elementos seleccionados

+
+
+ +
+ +
+ setFolderName(e.target.value)} + placeholder="Nombre de la nueva carpeta" + className="w-full bg-[#1a1a1a] border border-gray-700 rounded-xl px-4 py-3 text-sm text-white focus:outline-none focus:border-purple-500 transition-colors" + autoFocus + /> +
+ +
+ + +
+
+
+ ); +} diff --git a/src/components/EtiquetadoraModal.tsx b/src/components/EtiquetadoraModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..3cf6f922d3e12add0b57904173598e06cd3fc4ad --- /dev/null +++ b/src/components/EtiquetadoraModal.tsx @@ -0,0 +1,312 @@ +import { X, Save, Tag } from 'lucide-react'; +import { toast } from 'sonner'; +import { useState, useEffect } from 'react'; +import { getMangaById, updateManga } from '../services/manga'; +import { LoadingSpinner } from './LoadingSpinner'; + +interface MangaToggles { + id: string; + title: string; + is_decensored: boolean; + is_bn: boolean; + is_color: boolean; + hasChanged: boolean; +} + +interface EtiquetadoraModalProps { + isOpen: boolean; + onClose: () => void; + selectedMangaIds: string[]; + onSaveComplete: () => void; +} + +export function EtiquetadoraModal({ isOpen, onClose, selectedMangaIds, onSaveComplete }: EtiquetadoraModalProps) { + const [mangas, setMangas] = useState([]); + const [isLoading, setIsLoading] = useState(false); + const [isSaving, setIsSaving] = useState(false); + + // Global toggle states + const [globalDecensored, setGlobalDecensored] = useState(false); + const [globalBn, setGlobalBn] = useState(false); + const [globalColor, setGlobalColor] = useState(false); + + useEffect(() => { + if (isOpen) { + loadMangas(); + setGlobalDecensored(false); + setGlobalBn(false); + setGlobalColor(false); + } + }, [isOpen, selectedMangaIds]); + + const loadMangas = async () => { + setIsLoading(true); + try { + const loaded = await Promise.all( + selectedMangaIds.map(async (id) => { + const manga = await getMangaById(id); + if (!manga) return null; + return { + id: manga.id, + title: manga.title, + is_decensored: !!manga.is_decensored, + is_bn: !!manga.is_bn, + is_color: !!manga.is_color, + hasChanged: false, + } as MangaToggles; + }) + ); + setMangas(loaded.filter(m => m !== null) as MangaToggles[]); + } catch (error) { + console.error('Error loading mangas:', error); + toast.error('Error al cargar la información de los mangas'); + } finally { + setIsLoading(false); + } + }; + + const handleGlobalDecensored = (checked: boolean) => { + setGlobalDecensored(checked); + setMangas(prev => prev.map(m => ({ ...m, is_decensored: checked, hasChanged: true }))); + }; + + const handleGlobalBn = (checked: boolean) => { + setGlobalBn(checked); + if (checked) setGlobalColor(false); + setMangas(prev => prev.map(m => ({ + ...m, + is_bn: checked, + is_color: checked ? false : m.is_color, + hasChanged: true + }))); + }; + + const handleGlobalColor = (checked: boolean) => { + setGlobalColor(checked); + if (checked) setGlobalBn(false); + setMangas(prev => prev.map(m => ({ + ...m, + is_color: checked, + is_bn: checked ? false : m.is_bn, + hasChanged: true + }))); + }; + + const handleIndividualToggle = (id: string, field: 'is_decensored' | 'is_bn' | 'is_color', value: boolean) => { + setMangas(prev => prev.map(m => { + if (m.id !== id) return m; + + const newM = { ...m, [field]: value, hasChanged: true }; + + if (field === 'is_bn' && value) newM.is_color = false; + if (field === 'is_color' && value) newM.is_bn = false; + + return newM; + })); + }; + + const handleSave = async () => { + const changedMangas = mangas.filter(m => m.hasChanged); + + if (changedMangas.length === 0) { + toast.info('No hay cambios para guardar'); + onClose(); + return; + } + + setIsSaving(true); + try { + const promises = changedMangas.map(manga => + updateManga(manga.id, { + is_decensored: manga.is_decensored, + is_bn: manga.is_bn, + is_color: manga.is_color + }) + ); + + await Promise.all(promises); + toast.success(`Se actualizaron las etiquetas de ${changedMangas.length} mangas`); + onSaveComplete(); + onClose(); + } catch (error) { + console.error('Error updating mangas:', error); + toast.error('Ocurrió un error al guardar los cambios'); + } finally { + setIsSaving(false); + } + }; + + if (!isOpen) return null; + + return ( +
+
+ {/* Header */} +
+
+
+ +
+

+ Etiquetadora ({selectedMangaIds.length} mangas) +

+
+ +
+ +
+ {isLoading ? ( +
+ +
+ ) : ( + <> + {/* Global Toggles */} +
+

+ Opciones Generales +

+
+
+ +
+ Sin censura (Todos) +
+
+ +
+ +
+ B/N (Todos) +
+
+ +
+ +
+ a color (Todos) +
+
+
+
+ + {/* Individual Manga List */} +
+

+ Mangas Individuales ({mangas.length}) +

+
+ {mangas.map((manga) => ( +
+
+

+ {manga.title} +

+ {manga.hasChanged && ( + Modificado + )} +
+ +
+
+ + Sin censura +
+ +
+ + B/N +
+ +
+ + a color +
+
+
+ ))} +
+
+ + )} +
+ +
+ + +
+
+
+ ); +} diff --git a/src/components/GlobalFooter.tsx b/src/components/GlobalFooter.tsx new file mode 100644 index 0000000000000000000000000000000000000000..b49ad6a37b0db39bbc22d2b66922bd7433b87396 --- /dev/null +++ b/src/components/GlobalFooter.tsx @@ -0,0 +1,76 @@ +import { Info } from 'lucide-react'; + + + + +export function GlobalFooter() { + return ( +
+ + {/* Left: Live Counter */} + + + {/* Center: Social Links */} +
+ + + + + Twisted Brody + + + + + + Canal Hub + + + + + + X + + + + + + Patreon + + +
+ + {/* Right: Copyright (visible only on md screens and up, or pushed down on mobile) */} +
+ Twisted Brody MangaFlow © {new Date().getFullYear()} +
+
+ ); +} diff --git a/src/components/HDComicViewer.tsx b/src/components/HDComicViewer.tsx new file mode 100644 index 0000000000000000000000000000000000000000..51203d132e527b5494a2992da5cf319d39b3dce7 --- /dev/null +++ b/src/components/HDComicViewer.tsx @@ -0,0 +1,207 @@ + +import { ArrowLeft, Rows, Grid2X2, Grid3X3, ZoomIn, ZoomOut, RotateCcw } from 'lucide-react'; +import { useState } from 'react'; +import { Manga } from '../types/manga'; +import { ImageLoader } from './ImageLoader'; +import { ImageLightbox } from './ImageLightbox'; +import { GlobalFooter } from './GlobalFooter'; +import { LazyImageWrapper } from './LazyImageWrapper'; + + +interface HDComicViewerProps { + manga: Manga; + onBack: () => void; +} + +export function HDComicViewer({ manga, onBack }: HDComicViewerProps) { + // Assuming the first chapter contains the full comic pages for "Graphic Novels" / "Doujins" style + // If there are multiple chapters, we might default to the first one or need a selector. + // Given the context of "Ver HD" implies seeing the "book" in full quality. + const chapter = manga.chapters && manga.chapters.length > 0 ? manga.chapters[0] : null; + const pages = chapter ? (chapter.original_pages && chapter.original_pages.length > 0 ? chapter.original_pages : chapter.pages) : []; + + const [viewMode, setViewMode] = useState<'vertical' | 'gallery' | 'grid'>('vertical'); + const [zoomLevel, setZoomLevel] = useState(1); // 1 = 100% + const [lightboxOpen, setLightboxOpen] = useState(false); + const [lightboxIndex, setLightboxIndex] = useState(0); + + if (!pages || pages.length === 0) { + return ( +
+ +
No hay páginas disponibles
+
+ ); + } + + const handleZoomIn = () => setZoomLevel(prev => Math.min(prev + 0.25, 3)); + const handleZoomOut = () => setZoomLevel(prev => Math.max(prev - 0.25, 0.5)); + const handleResetZoom = () => setZoomLevel(1); + + return ( +
+ {/* Sticky Header */} +
+
+ +
+ +
+

+ {manga.title} HD +

+
+ +
+ {/* View Modes */} +
+ + + +
+ + {/* Zoom Controls (Only for Vertical) */} + {viewMode === 'vertical' && ( +
+ + {Math.round(zoomLevel * 100)}% + + +
+ )} +
+
+ + {/* Mobile View Mode Selector (if screen is small) */} +
+
+ + + +
+
+ +
+
+ {pages.map((pageUrl, index) => { + // Use the direct URL to avoid proxy issues, matching ComicDetail behavior. + const src = pageUrl; + + if (viewMode === 'vertical') { + // Calculate width style based on zoom + // Default max-w-5xl is roughly 64rem (1024px). + // We can apply transform or width. Width is safer for layout flow. + // Let's use inline style for width percentage relative to "normal" max-width, or just set max-width. + // Actually, simpler: Wrapper width. + // Better approach: Control the wrapper width directly. + return ( +
1 ? 'none' : '80rem' }}> +
+ + {() => ( + + )} + +
+
+ ); + } + + // Gallery / Grid + return ( +
{ + setLightboxIndex(index); + setLightboxOpen(true); + }} + > + +
+ ); + })} +
+
+ + + + {lightboxOpen && ( + setLightboxOpen(false)} + /> + )} +
+ ); +} diff --git a/src/components/ImageLightbox.tsx b/src/components/ImageLightbox.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e86cb702e0b011785a551949bdbb416c676a0bd3 --- /dev/null +++ b/src/components/ImageLightbox.tsx @@ -0,0 +1,356 @@ +import { ChevronLeft, ChevronRight, X, ZoomIn, ZoomOut, BookOpen, Book } from 'lucide-react'; +import { useState, useEffect, useRef } from 'react'; +import { ImageLoader } from './ImageLoader'; + +interface ImageLightboxProps { + images: string[]; + initialIndex: number; + onClose: () => void; +} + +export function ImageLightbox({ images, initialIndex, onClose }: ImageLightboxProps) { + const [currentIndex, setCurrentIndex] = useState(initialIndex); + const [isBookMode, setIsBookMode] = useState(false); + + // -- Carousel State -- + const [dragOffset, setDragOffset] = useState(0); // Pixels + + + // -- Zoom & Pan -- + const [scale, setScale] = useState(1); + const [position, setPosition] = useState({ x: 0, y: 0 }); + + // -- Interaction State -- + const [isDragging, setIsDragging] = useState(false); + const [dragStart, setDragStart] = useState({ x: 0, y: 0 }); + const [startPinchDist, setStartPinchDist] = useState(null); + const [startScale, setStartScale] = useState(1); + + const containerRef = useRef(null); + + useEffect(() => { + document.body.style.overflow = 'hidden'; + return () => { document.body.style.overflow = 'unset'; }; + }, []); + + // -- Helpers -- + const getWrappedIndex = (index: number) => { + const len = images.length; + return ((index % len) + len) % len; + }; + + const getDistance = (touches: React.TouchList) => { + return Math.hypot( + touches[0].clientX - touches[1].clientX, + touches[0].clientY - touches[1].clientY + ); + }; + + const clampPosition = (pos: { x: number, y: number }, s: number) => { + const width = window.innerWidth; + const height = window.innerHeight; + + // Bounds: (Dimension * Scale - Dimension) / 2 + // If scale < 1, limits are 0 (or negative, but we clamp to 0) + const maxX = (width * s - width) / 2; + const maxY = (height * s - height) / 2; + + return { + x: Math.min(Math.max(pos.x, -maxX), maxX), + y: Math.min(Math.max(pos.y, -maxY), maxY) + }; + }; + + // -- Navigation -- + const stride = isBookMode ? 2 : 1; + + const handlePrevious = () => { + // if (scale > 1) return; // Allow navigation even if zoomed, just reset. + setCurrentIndex(prev => getWrappedIndex(prev - stride)); + setDragOffset(0); + setScale(1); // Reset zoom + setPosition({ x: 0, y: 0 }); // Reset position + }; + + const handleNext = () => { + // if (scale > 1) return; // Allow navigation even if zoomed, just reset. + setCurrentIndex(prev => getWrappedIndex(prev + stride)); + setDragOffset(0); + setScale(1); // Reset zoom + setPosition({ x: 0, y: 0 }); // Reset position + }; + + // -- Interaction Handlers -- + const handleStart = (clientX: number, clientY: number) => { + // if (isAnimating) return; // Removed + setIsDragging(true); + setDragStart({ x: clientX, y: clientY }); + }; + + const handleMove = (clientX: number, clientY: number) => { + if (!isDragging) return; + + if (scale > 1) { + const deltaX = clientX - dragStart.x; + const deltaY = clientY - dragStart.y; + setPosition(prev => ({ x: prev.x + deltaX, y: prev.y + deltaY })); + setDragStart({ x: clientX, y: clientY }); + } else { + const deltaX = clientX - dragStart.x; + setDragOffset(deltaX); + } + }; + + const handleEnd = () => { + setIsDragging(false); + setStartPinchDist(null); + + if (scale > 1) return; + + const width = containerRef.current?.clientWidth || window.innerWidth; + const threshold = width * 0.25; + + if (Math.abs(dragOffset) > threshold) { + if (dragOffset > 0) handlePrevious(); + else handleNext(); + } else { + setDragOffset(0); + } + }; + + // -- Event Listeners -- + const onMouseDown = (e: React.MouseEvent) => { e.preventDefault(); handleStart(e.clientX, e.clientY); }; + const onMouseMove = (e: React.MouseEvent) => { e.preventDefault(); handleMove(e.clientX, e.clientY); }; + const onMouseUp = () => handleEnd(); + + const onTouchStart = (e: React.TouchEvent) => { + if (e.touches.length === 2) { + const dist = getDistance(e.touches); + setStartPinchDist(dist); + setStartScale(scale); + setIsDragging(false); + } else if (e.touches.length === 1) { + handleStart(e.touches[0].clientX, e.touches[0].clientY); + } + }; + + const onTouchMove = (e: React.TouchEvent) => { + if (e.touches.length === 2 && startPinchDist !== null) { + const dist = getDistance(e.touches); + const zoomFactor = dist / startPinchDist; + const newScale = Math.min(Math.max(startScale * zoomFactor, 1), 4); + + setScale(newScale); + setPosition(prev => clampPosition(prev, newScale)); + + } else if (e.touches.length === 1) { + handleMove(e.touches[0].clientX, e.touches[0].clientY); + } + }; + + const onTouchEnd = (e: React.TouchEvent) => { + if (startPinchDist !== null && e.touches.length < 2) { + setStartPinchDist(null); + return; + } + handleEnd(); + }; + + // -- Keyboard -- + useEffect(() => { + function handleKeyDown(e: KeyboardEvent) { + if (e.key === 'Escape') onClose(); + else if (e.key === 'ArrowLeft') handlePrevious(); + else if (e.key === 'ArrowRight') handleNext(); + else if (e.key === '+' || e.key === '=') setScale(p => { const newS = Math.min(p + 0.5, 4); setPosition(prev => clampPosition(prev, newS)); return newS; }); + else if (e.key === '-') setScale(p => { const newS = Math.max(p - 0.5, 1); setPosition(prev => clampPosition(prev, newS)); return newS; }); + } + window.addEventListener('keydown', handleKeyDown); + return () => window.removeEventListener('keydown', handleKeyDown); + }, [scale, isBookMode]); // Removed isAnimating dependency + + // -- Render -- + let transform = `translateX(calc(-33.333333% + ${dragOffset}px))`; + let transition = isDragging ? 'none' : 'transform 0.1s ease-out'; + // If not dragging, we want a tiny snap transition for the dragOffset reset, but NOT for page change. + // Since handlePrevious reset dragOffset to 0 instantly and change index, we might not need transition at all for page change. + // But if we just released a drag and it didn't change page, we want it to snap back. + // Actually, simplest is no transition if we want INSTANT page change. + // But for "snap back" (cancel drag), a small transition is nice. + // Given user wants "no slide on change", we prioritize that. + // Let's set transition only if dragOffset is being animated back to 0 without index change? + // For simplicity and robustness of "no animation", let's use 'none' whenever dragOffset is 0. + + if (dragOffset === 0) { + transition = 'none'; + } + + // Pre-calculate indices for slots + // Slot 1 (Prev): currentIndex - stride + // Slot 2 (Current): currentIndex + // Slot 3 (Next): currentIndex + stride + + const renderSlot = (baseIndex: number) => { + // If Book Mode: render baseIndex and baseIndex+1 + // If Single Mode: render baseIndex + + const img1Index = getWrappedIndex(baseIndex); + + if (!isBookMode) { + return ( + + ); + } else { + const img2Index = getWrappedIndex(baseIndex + 1); + return ( +
+ {/* Page 1 (Left) */} +
+ +
+ {/* Page 2 (Right) */} +
+ +
+
+ ); + } + }; + + return ( +
{ + e.stopPropagation(); + const delta = e.deltaY < 0 ? 0.5 : -0.5; + setScale(p => { + const newS = Math.min(Math.max(p + delta, 1), 4); + setPosition(prev => clampPosition(prev, newS)); + return newS; + }); + }} + onMouseDown={onMouseDown} + onMouseMove={onMouseMove} + onMouseUp={onMouseUp} + onMouseLeave={() => { setIsDragging(false); if (scale === 1) setDragOffset(0); }} + onTouchStart={onTouchStart} + onTouchMove={onTouchMove} + onTouchEnd={onTouchEnd} + > + {/* Controls */} +
+
+ {/* Book Mode Toggle */} + +
+ + + {Math.round(scale * 100)}% + +
+ +
+ + {/* TRACK */} +
+ {/* PREV Slot */} +
+ {renderSlot(currentIndex - stride)} +
+ + {/* CURRENT Slot (Zoomable Container) */} +
+
1 ? (isDragging ? 'grabbing' : 'grab') : 'default', + }} + onDoubleClick={(e) => { e.stopPropagation(); setScale(p => p > 1 ? 1 : 2.5); setPosition({ x: 0, y: 0 }); }} + > + {renderSlot(currentIndex)} +
+
+ + {/* NEXT Slot */} +
+ {renderSlot(currentIndex + stride)} +
+
+ + {/* Navigation Arrows */} + {scale === 1 && ( + <> + + + + )} + +
+ {isBookMode + ? `${currentIndex + 1}-${Math.min(currentIndex + 2, images.length)} / ${images.length}` + : `${currentIndex + 1} / ${images.length}` + } +
+
+ ); +} diff --git a/src/components/ImageLoader.tsx b/src/components/ImageLoader.tsx new file mode 100644 index 0000000000000000000000000000000000000000..8cef1f005aac0d6058a9a5fd08f934e44c08e743 --- /dev/null +++ b/src/components/ImageLoader.tsx @@ -0,0 +1,144 @@ +import { useState, useEffect } from 'react'; +import { RotateCcw, AlertCircle } from 'lucide-react'; + +// Caché global en memoria para recordar qué URLs absolutas ya se cargaron exitosamente +// durante esta sesión del navegador. +const loadedImagesCache = new Set(); + +interface ImageLoaderProps { + src: string; + alt: string; + className?: string; + imgClassName?: string; + objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'; + aspectRatio?: string; + loading?: 'lazy' | 'eager'; + showPlaceholder?: boolean; + draggable?: boolean; + showControls?: boolean; +} + +export function ImageLoader({ + src, + alt, + className = '', + imgClassName = '', + objectFit = 'contain', + aspectRatio, + loading, + draggable, + showControls = false +}: ImageLoaderProps) { + // Si la imagen ya está en caché, inicializamos isLoaded en true instantáneamente + const isAlreadyLoaded = loadedImagesCache.has(src); + + // 1. Estados para controlar qué mostrar + const [isLoaded, setIsLoaded] = useState(isAlreadyLoaded); + const [hasError, setHasError] = useState(false); + const [retryCount, setRetryCount] = useState(0); + + // Reiniciar estados si cambia la fuente (por ejemplo, al cambiar de capítulo) + useEffect(() => { + if (loadedImagesCache.has(src)) { + setIsLoaded(true); + setHasError(false); + } else { + setIsLoaded(false); + setHasError(false); + } + setRetryCount(0); + }, [src]); + + const handleRetry = () => { + setHasError(false); + setIsLoaded(false); + setRetryCount(prev => prev + 1); + }; + + const handleLoadSuccess = () => { + setIsLoaded(true); + setHasError(false); + // Añadimos a la caché global + loadedImagesCache.add(src); + }; + + // Añadimos un timestamp o contador falso a la query string para esquivar el caché del navegador + // si es que ya hay reintentos. + const currentSrc = retryCount > 0 + ? `${src}${src.includes('?') ? '&' : '?'}retry=${retryCount}` + : src; + + const isVideo = currentSrc.includes('format=mp4') || currentSrc.toLowerCase().endsWith('.mp4') || currentSrc.toLowerCase().endsWith('.webm'); + + + return ( +
+ + {/* 2. EL SPINNER (Círculo de carga) o ESTADO DE ERROR + Se muestra solo si NO ha terminado de cargar (!isLoaded). + Cuando carga, se vuelve invisible (opacity-0). + */} +
+ {hasError ? ( +
+
+ +
+

La imagen no cargó. El servidor podría tener problemas.

+ +
+ ) : ( +
+ )} +
+ + {/* 3. LA IMAGEN REAL + Empieza invisible (opacity-0). + Cuando se dispara onLoad, pasa a 'opacity-100' creando la animación de aparición. + */} + {!hasError && ( + isVideo ? ( +
+ ); +} diff --git a/src/components/InfoPage.tsx b/src/components/InfoPage.tsx new file mode 100644 index 0000000000000000000000000000000000000000..cbdc2d72dd4ed9a3cfa54b10a6f890c824ffd942 --- /dev/null +++ b/src/components/InfoPage.tsx @@ -0,0 +1,183 @@ +import { ArrowLeft, Info, Edit2, Save, X } from 'lucide-react'; +import { useState, useEffect } from 'react'; +import { subscribeToInfo, saveInfo } from '../services/info'; +import ReactMarkdown from 'react-markdown'; + +interface InfoPageProps { + onBack: () => void; + isAdmin: boolean; +} + +export function InfoPage({ onBack, isAdmin }: InfoPageProps) { + const [content, setContent] = useState(''); + const [isEditing, setIsEditing] = useState(false); + const [editContent, setEditContent] = useState(''); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + const unsubscribe = subscribeToInfo((data) => { + if (data) { + setContent(data.content); + } + setIsLoading(false); + }); + return () => unsubscribe(); + }, []); + + const handleSave = async () => { + try { + await saveInfo(editContent); + setIsEditing(false); + } catch (error) { + console.error('Error saving info:', error); + alert('Error al guardar la información.'); + } + }; + + const startEditing = () => { + setEditContent(content); + setIsEditing(true); + }; + + return ( +
+
+ + +
+ + {isAdmin && !isEditing && ( + + )} + +
+
+ +
+
+

+ Información +

+

+ Sobre Twisted Brody MangaFlow +

+
+
+ + {isEditing ? ( +
+