diff --git a/.gitignore b/.gitignore index 940fe6c355..ace0d60370 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,9 @@ licenses.txt *.pkl *.mar *.torchscript +*.db +*.sqlite +*.sqlite3 **/.ipynb_checkpoints **/dist/ **/checkpoints/ diff --git a/examples/README.md b/examples/README.md index f1a1212ed9..da8f5547ae 100644 --- a/examples/README.md +++ b/examples/README.md @@ -62,6 +62,7 @@ All necessary details are provided in the comments at the top of each script. | [Upload Chat Interface](/examples/chat/upload_chat.py) | [ragbits-chat](/packages/ragbits-chat) | Example of how to use the `ChatInterface` with file upload support via `upload_handler`. | | [File Explorer Agent](/examples/chat/file_explorer_agent.py) | [ragbits-chat](/packages/ragbits-chat) | Secure file management agent with path validation and confirmation for all file operations within a restricted directory. | | [Code Planner](/examples/chat/code_planner.py) | [ragbits-chat](/packages/ragbits-chat) | Example of how to use the `ChatInterface` with planning tools for code architecture tasks. | +| [Shared Chat Interface](/examples/chat/shared_chat.py) | [ragbits-chat](/packages/ragbits-chat) | Example of how to use the `ChatInterface` with conversation sharing via `SQLSharePersistence` and `SQLHistoryPersistence`. | ### Agents (`examples/agents/`) diff --git a/examples/chat/shared_chat.py b/examples/chat/shared_chat.py new file mode 100644 index 0000000000..ab8b681cf7 --- /dev/null +++ b/examples/chat/shared_chat.py @@ -0,0 +1,124 @@ +r""" +Ragbits Chat Example: Conversation Sharing + +This example demonstrates how to enable conversation sharing between authenticated +users by wiring `SQLSharePersistence` into `RagbitsAPI` alongside +`SQLHistoryPersistence`. + +By default it uses SQLite for both stores so the example runs with no external +dependencies. Set ``USE_POSTGRES=1`` (and the optional ``PG_*`` env vars) to +point share persistence at a Postgres instance instead, e.g.: + + ```bash + docker run --rm -d --name ragbits-pg \ + -e POSTGRES_USER=ragbits -e POSTGRES_PASSWORD=ragbits \ + -e POSTGRES_DB=ragbits -p 5432:5432 postgres:16 + USE_POSTGRES=1 uv run examples/chat/shared_chat.py + ``` + +To run the script, execute the following command: + + ```bash + uv run examples/chat/shared_chat.py + ``` + +Log in as `alice` / `alice123` and `bob` / `bob123` in two browser windows to try it. +""" + +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "ragbits-chat[sql]", +# "ragbits-core[sqlite,postgres]", +# ] +# /// + +import os +import tempfile +from collections.abc import AsyncGenerator +from pathlib import Path + +from sqlalchemy.ext.asyncio import create_async_engine + +from ragbits.chat.api import RagbitsAPI +from ragbits.chat.auth.backends import ListAuthenticationBackend +from ragbits.chat.auth.session_store import InMemorySessionStore +from ragbits.chat.interface import ChatInterface +from ragbits.chat.interface.types import ChatContext, ChatResponse +from ragbits.chat.persistence.share import SQLSharePersistence +from ragbits.chat.persistence.sql import SQLHistoryPersistence +from ragbits.core.llms import LiteLLM +from ragbits.core.prompt import ChatFormat +from ragbits.core.storage.connections import PostgresConnection, SQLiteConnection + +DB_FILE = Path(tempfile.gettempdir()) / "ragbits_shared_chat.db" +SHARES_DB_FILE = Path(tempfile.gettempdir()) / "ragbits_shared_chat_shares.db" + + +class SharedChat(ChatInterface): + """An example ChatInterface with SQLite history so conversations can be shared.""" + + conversation_history = True + + def __init__(self) -> None: + self.llm = LiteLLM(model_name="gpt-4o-mini") + self.history_persistence = SQLHistoryPersistence(create_async_engine(f"sqlite+aiosqlite:///{DB_FILE}")) + + async def chat( + self, + message: str, + history: ChatFormat, + context: ChatContext, + ) -> AsyncGenerator[ChatResponse, None]: + """Stream a reply from the LLM; persisted history is owned by `context.user`.""" + async for chunk in self.llm.generate_streaming([*history, {"role": "user", "content": message}]): + yield self.create_text_response(chunk) + + +def get_auth_backend() -> ListAuthenticationBackend: + """Factory for a simple username/password backend with two demo users.""" + users = [ + { + "user_id": "alice", + "username": "alice", + "password": "alice123", + "email": "alice@example.com", + "full_name": "Alice", + "roles": ["user"], + }, + { + "user_id": "bob", + "username": "bob", + "password": "bob123", + "email": "bob@example.com", + "full_name": "Bob", + "roles": ["user"], + }, + ] + return ListAuthenticationBackend(users=users, session_store=InMemorySessionStore()) + + +def get_share_persistence() -> SQLSharePersistence: + """Factory for `SQLSharePersistence` backed by `ragbits.core.storage`. + + Defaults to a local SQLite file. Set ``USE_POSTGRES=1`` (with optional + ``PG_*`` overrides) to use a PostgreSQL connection instead. + """ + if os.environ.get("USE_POSTGRES"): + connection = PostgresConnection( + host=os.environ.get("PG_HOST", "localhost"), + port=int(os.environ.get("PG_PORT", "5432")), + database=os.environ.get("PG_DB", "ragbits"), + user=os.environ.get("PG_USER", "ragbits"), + password=os.environ.get("PG_PASS", "ragbits"), + ) + return SQLSharePersistence(connection) + return SQLSharePersistence(SQLiteConnection(SHARES_DB_FILE)) + + +if __name__ == "__main__": + RagbitsAPI( + SharedChat, + auth_backend=get_auth_backend(), + share_persistence=get_share_persistence(), + ).run() diff --git a/package-lock.json b/package-lock.json index 876cec5da0..20164467af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14152,7 +14152,7 @@ } }, "typescript/@ragbits/api-client": { - "version": "1.7.0-dev.202604020305", + "version": "1.7.0-dev.202604280307", "license": "MIT", "devDependencies": { "@eslint/js": "^9.17.0", @@ -14171,7 +14171,7 @@ } }, "typescript/@ragbits/api-client-react": { - "version": "1.7.0-dev.202604020305", + "version": "1.7.0-dev.202604280307", "license": "MIT", "dependencies": { "@ragbits/api-client": "*" diff --git a/packages/ragbits-chat/CHANGELOG.md b/packages/ragbits-chat/CHANGELOG.md index 6ff581d382..29be8cc983 100644 --- a/packages/ragbits-chat/CHANGELOG.md +++ b/packages/ragbits-chat/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +### Added + +- Add conversation sharing: new `SQLSharePersistence` SQL-backed store (`ragbits.chat.persistence.SQLSharePersistence`) and `share_persistence` parameter on `RagbitsAPI` that together expose REST endpoints for listing/sharing/unsharing/dismissing conversations and wire the `ShareButton`, shared-conversation sidebar entries and read-only conversation guard in the default UI. +- Extend `SQLHistoryPersistence` with `user_id` and `summary` columns on the `Conversation` model and `list_conversations`, `get_conversation_summaries`, `delete_conversation` and `get_conversation_owner` helpers used by the sharing endpoints. The `summary` column is updated automatically on every `save_interaction` that includes a `ConversationSummaryResponse`. +- Add `sharing` flag on `ConfigResponse` plus `ShareConversationRequest`, `ConversationShareResponse`, `ConversationMeta` and `ConversationDetail` schemas for the new sharing API. +- Add `examples/chat/shared_chat.py` demonstrating an end-to-end conversation sharing setup with `ListAuthenticationBackend`, `SQLHistoryPersistence` and a Postgres-backed `SQLSharePersistence`. + ## 1.6.2 (2026-03-26) - ragbits-agents updated to version v1.6.2 @@ -44,6 +51,7 @@ - Fix a UI build that had a hardcoded `127.0.0.1:8000` address ## 1.4.1 (2026-02-08) + ### Changed - ragbits-core updated to version v1.4.1 @@ -51,6 +59,7 @@ - Fix FastAPI installation by adding `standard` extras to ensure all required dependencies are included ## 1.4.0 (2026-02-04) + ### Changed - ragbits-core updated to version v1.4.0 diff --git a/packages/ragbits-chat/src/ragbits/chat/api.py b/packages/ragbits-chat/src/ragbits/chat/api.py index e018538976..d0f0802e43 100644 --- a/packages/ragbits-chat/src/ragbits/chat/api.py +++ b/packages/ragbits-chat/src/ragbits/chat/api.py @@ -14,10 +14,17 @@ from fastapi import FastAPI, HTTPException, Request, UploadFile, status from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware -from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse, RedirectResponse, StreamingResponse +from fastapi.responses import ( + HTMLResponse, + JSONResponse, + PlainTextResponse, + RedirectResponse, + StreamingResponse, +) from fastapi.staticfiles import StaticFiles from pydantic import BaseModel +from ragbits.chat.api_routes import build_conversations_router from ragbits.chat.auth import AuthenticationBackend, User from ragbits.chat.auth.backends import MultiAuthenticationBackend, OAuth2AuthenticationBackend from ragbits.chat.auth.provider_config import get_provider_visual_config @@ -39,6 +46,7 @@ ImageResponse, OAuth2ProviderConfig, ) +from ragbits.chat.persistence.base import HistoryPersistenceStrategy, SharePersistenceStrategy from ragbits.core.audit.metrics import record_metric from ragbits.core.audit.metrics.base import MetricType from ragbits.core.audit.traces import trace @@ -48,6 +56,16 @@ logger = logging.getLogger(__name__) +def _supports_conversation_listing(history_persistence: HistoryPersistenceStrategy) -> bool: + """Return True if the strategy overrides ``list_conversations`` from the base class. + + Used to decide whether conversation-sharing routes can be registered. + """ + impl = type(history_persistence).list_conversations + base = HistoryPersistenceStrategy.list_conversations + return impl is not base + + class RagbitsAPI: """ RagbitsAPI class for running API with Demo UI for testing purposes @@ -61,6 +79,7 @@ def __init__( debug_mode: bool = False, auth_backend: AuthenticationBackend | type[AuthenticationBackend] | str | None = None, theme_path: str | None = None, + share_persistence: SharePersistenceStrategy | None = None, ) -> None: """ Initialize the RagbitsAPI. @@ -73,6 +92,9 @@ def __init__( debug_mode: Flag enabling debug tools in the default UI auth_backend: Authentication backend for user authentication. If None, no authentication required. theme_path: Path to a JSON file containing HeroUI theme configuration from heroui.com/themes + share_persistence: Optional share persistence for conversation sharing. Requires auth_backend + and a HistoryPersistenceStrategy that supports ownership tracking (see + :meth:`HistoryPersistenceStrategy.get_conversation_owner`). """ self.chat_interface: ChatInterface = self._load_chat_interface(chat_interface) self.dist_dir = Path(ui_build_dir) if ui_build_dir else Path(__file__).parent / "ui-build" @@ -80,6 +102,7 @@ def __init__( self.debug_mode = debug_mode self.auth_backend = self._load_auth_backend(auth_backend) self.theme_path = Path(theme_path) if theme_path else None + self.share_persistence = share_persistence self.frontend_base_url = BASE_URL @@ -269,6 +292,7 @@ async def config() -> JSONResponse: oauth2_providers=oauth2_providers, ), supports_upload=self.chat_interface.upload_handler is not None, + sharing=self.share_persistence is not None, ) return JSONResponse(content=config_response.model_dump()) @@ -301,12 +325,50 @@ async def theme() -> PlainTextResponse: logger.error(f"Error serving theme: {e}") raise HTTPException(status_code=500, detail="Error loading theme") from e + if self.auth_backend: + self._setup_conversation_routes() + @self.app.get("/{full_path:path}", response_class=HTMLResponse) async def root() -> HTMLResponse: index_file = self.dist_dir / "index.html" with open(str(index_file)) as file: return HTMLResponse(content=file.read()) + def _setup_conversation_routes(self) -> None: + """Register routes for authenticated conversation management. + + Requires ``auth_backend`` and a ``history_persistence`` that supports + ownership tracking (i.e. overrides + :meth:`HistoryPersistenceStrategy.list_conversations` to return the + user's conversations). When ``share_persistence`` is configured, sharing + endpoints are enabled as part of the same router. + """ + history_persistence = self.chat_interface.history_persistence + if history_persistence is None: + logger.warning("Conversation routes require a history_persistence strategy; routes disabled.") + return + + if not _supports_conversation_listing(history_persistence): + logger.warning( + "history_persistence does not support conversation listing; conversation routes disabled. " + "Override HistoryPersistenceStrategy.list_conversations to enable conversation routes." + ) + return + + async def require_user(request: Request) -> User: + user = await self.require_authenticated_user(request) + if user is None: + raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Authentication required") + return user + + self.app.include_router( + build_conversations_router( + history_persistence=history_persistence, + require_user=require_user, + share_persistence=self.share_persistence, + ) + ) + @staticmethod def _prepare_chat_context( request: ChatMessageRequest, diff --git a/packages/ragbits-chat/src/ragbits/chat/api_routes/__init__.py b/packages/ragbits-chat/src/ragbits/chat/api_routes/__init__.py new file mode 100644 index 0000000000..be30d7e811 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/api_routes/__init__.py @@ -0,0 +1,10 @@ +"""FastAPI routers that `RagbitsAPI` composes. + +Extracting routes into routers keeps the main ``RagbitsAPI`` class focused on +wiring (middleware, dependencies, lifespan) and makes individual feature +groups importable and unit-testable on their own. +""" + +from ragbits.chat.api_routes.conversations import build_conversations_router, build_share_router + +__all__ = ["build_conversations_router", "build_share_router"] diff --git a/packages/ragbits-chat/src/ragbits/chat/api_routes/conversations.py b/packages/ragbits-chat/src/ragbits/chat/api_routes/conversations.py new file mode 100644 index 0000000000..6414667ce8 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/api_routes/conversations.py @@ -0,0 +1,186 @@ +"""FastAPI router that implements conversation endpoints. + +The router always exposes authenticated conversation history endpoints and can +optionally expose sharing endpoints when ``share_persistence`` is configured. +""" + +from collections.abc import Awaitable, Callable +from typing import Any + +from fastapi import APIRouter, Depends, HTTPException, Request, Response, status + +from ragbits.chat.api_routes.share_access import recipient_identifiers +from ragbits.chat.auth import User +from ragbits.chat.interface.types import ( + ConversationDetail, + ConversationInteractionData, + ConversationMeta, + ConversationShareResponse, + ShareConversationRequest, +) +from ragbits.chat.persistence.base import HistoryPersistenceStrategy, SharePersistenceStrategy + +RequireUser = Callable[[Request], Awaitable[User]] + + +def build_conversations_router( # noqa: PLR0915 + history_persistence: HistoryPersistenceStrategy, + require_user: RequireUser, + share_persistence: SharePersistenceStrategy | None = None, +) -> APIRouter: + """Create an :class:`APIRouter` exposing conversation endpoints. + + Args: + history_persistence: History persistence with ownership/listing support. + require_user: Dependency that returns the authenticated user or raises + ``HTTPException(401)``. + share_persistence: Optional share persistence strategy. When provided, + share-management and shared-conversation access endpoints are enabled. + """ + router = APIRouter() + authed_user: Any = Depends(require_user) + + async def require_owner(conversation_id: str, user: User) -> None: + owner = await history_persistence.get_conversation_owner(conversation_id) + if owner is None or owner != user.user_id: + raise HTTPException(status_code=404, detail="Conversation not found.") + + @router.get("/api/conversations", response_model=list[ConversationMeta]) + async def list_conversations(user: User = authed_user) -> list[ConversationMeta]: + owned = await history_persistence.list_conversations(user.user_id) + owned_ids = {c["id"] for c in owned} + shared_rows: list[dict[str, Any]] = [] + if share_persistence is not None: + shared_rows = await share_persistence.list_shared_with_me(recipient_identifiers(user)) + shared_rows = [r for r in shared_rows if r["conversation_id"] not in owned_ids] + + all_ids = [c["id"] for c in owned] + [r["conversation_id"] for r in shared_rows] + summaries = await history_persistence.get_conversation_summaries(all_ids) + + owned_metas = [ + ConversationMeta( + conversation_id=c["id"], + created_at=str(c["created_at"]) if c.get("created_at") else "", + summary=summaries.get(c["id"]), + ) + for c in owned + ] + shared_metas = [ + ConversationMeta( + conversation_id=r["conversation_id"], + created_at=str(r["shared_at"]) if r.get("shared_at") else "", + summary=summaries.get(r["conversation_id"]), + is_shared=True, + shared_by=r["owner_id"], + ) + for r in shared_rows + ] + return owned_metas + shared_metas + + @router.get("/api/conversations/{conversation_id}", response_model=ConversationDetail) + async def get_conversation(conversation_id: str, user: User = authed_user) -> ConversationDetail: + owner = await history_persistence.get_conversation_owner(conversation_id) + is_shared = False + shared_by: str | None = None + is_owner = owner is not None and owner == user.user_id + if not is_owner: + if share_persistence is None: + raise HTTPException(status_code=404, detail="Conversation not found.") + if not await share_persistence.can_access(conversation_id, recipient_identifiers(user)): + raise HTTPException(status_code=404, detail="Conversation not found.") + is_shared = True + shared_by = owner + + interactions = await history_persistence.get_conversation_interactions(conversation_id) + messages = [ + ConversationInteractionData( + message_id=interaction.get("message_id"), + message=str(interaction.get("message", "")), + response=str(interaction.get("response", "")), + ) + for interaction in interactions + ] + shares: list[ConversationShareResponse] | None = None + if is_owner and share_persistence is not None: + raw_shares = await share_persistence.get_shares(conversation_id, user.user_id) + shares = [ + ConversationShareResponse( + recipient=s["recipient"], + shared_at=str(s["shared_at"]) if s.get("shared_at") else "", + ) + for s in raw_shares + ] + return ConversationDetail( + conversation_id=conversation_id, + messages=messages, + is_shared=is_shared, + shared_by=shared_by, + shares=shares, + ) + + @router.delete("/api/conversations/{conversation_id}", status_code=status.HTTP_204_NO_CONTENT) + async def delete_conversation(conversation_id: str, user: User = authed_user) -> Response: + await require_owner(conversation_id, user) + await history_persistence.delete_conversation(conversation_id) + return Response(status_code=status.HTTP_204_NO_CONTENT) + + if share_persistence is not None: + + @router.put("/api/conversations/{conversation_id}/shares", response_model=list[ConversationShareResponse]) + async def update_shares( + conversation_id: str, + body: ShareConversationRequest, + user: User = authed_user, + ) -> list[ConversationShareResponse]: + await require_owner(conversation_id, user) + new_recipients = set(body.recipients) + existing = await share_persistence.get_shares(conversation_id, user.user_id) + existing_recipients = {s["recipient"] for s in existing} + to_add = list(new_recipients - existing_recipients) + to_remove = list(existing_recipients - new_recipients) + if to_remove: + await share_persistence.remove_shares(conversation_id, user.user_id, to_remove) + if to_add: + await share_persistence.set_shares(conversation_id, user.user_id, to_add) + updated = await share_persistence.get_shares(conversation_id, user.user_id) + return [ + ConversationShareResponse( + recipient=s["recipient"], + shared_at=str(s["shared_at"]) if s.get("shared_at") else "", + ) + for s in updated + ] + + @router.delete( + "/api/conversations/{conversation_id}/shares/{recipient}", + status_code=status.HTTP_204_NO_CONTENT, + ) + async def revoke_share( + conversation_id: str, + recipient: str, + user: User = authed_user, + ) -> Response: + await require_owner(conversation_id, user) + await share_persistence.remove_shares(conversation_id, user.user_id, [recipient]) + return Response(status_code=status.HTTP_204_NO_CONTENT) + + @router.delete("/api/shared/{conversation_id}", status_code=status.HTTP_204_NO_CONTENT) + async def dismiss_share(conversation_id: str, user: User = authed_user) -> Response: + if not await share_persistence.hide_share(conversation_id, recipient_identifiers(user)): + raise HTTPException(status_code=404, detail="Shared conversation not found.") + return Response(status_code=status.HTTP_204_NO_CONTENT) + + return router + + +def build_share_router( + history_persistence: HistoryPersistenceStrategy, + share_persistence: SharePersistenceStrategy, + require_user: RequireUser, +) -> APIRouter: + """Backward-compatible wrapper for existing share-router imports.""" + return build_conversations_router( + history_persistence=history_persistence, + require_user=require_user, + share_persistence=share_persistence, + ) diff --git a/packages/ragbits-chat/src/ragbits/chat/api_routes/share_access.py b/packages/ragbits-chat/src/ragbits/chat/api_routes/share_access.py new file mode 100644 index 0000000000..5b607d1355 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/api_routes/share_access.py @@ -0,0 +1,37 @@ +"""Helpers used by the conversation-sharing API. + +Kept in its own module so it can be unit-tested without bringing up the whole +FastAPI application. +""" + +from __future__ import annotations + +from ragbits.chat.auth import User + + +def normalize_identifier(identifier: str | None) -> str | None: + """Return the canonical (lowercased, trimmed) form of ``identifier``. + + Returns ``None`` when the input is empty after trimming. + """ + if identifier is None: + return None + normalized = identifier.strip().lower() + return normalized or None + + +def recipient_identifiers(user: User) -> list[str]: + """Return all identifiers a user can be addressed by when sharing. + + A user may be addressed by user_id, username, or email. The persistence + layer stores recipients lowercased, so we mirror that here. Duplicates + are removed while preserving order. + """ + ids: list[str] = [] + seen: set[str] = set() + for raw in (user.user_id, user.username, user.email): + normalized = normalize_identifier(raw) + if normalized and normalized not in seen: + seen.add(normalized) + ids.append(normalized) + return ids diff --git a/packages/ragbits-chat/src/ragbits/chat/interface/_interface.py b/packages/ragbits-chat/src/ragbits/chat/interface/_interface.py index 40c3a83c71..767c4d66e9 100644 --- a/packages/ragbits-chat/src/ragbits/chat/interface/_interface.py +++ b/packages/ragbits-chat/src/ragbits/chat/interface/_interface.py @@ -92,6 +92,10 @@ async def wrapper( # noqa: PLR0915 context.message_id = str(uuid.uuid4()) yield MessageIdResponse(content=MessageIdContent(message_id=context.message_id)) + responses: list[ChatResponseUnion] = [] + main_response = "" + extra_responses: list[ChatResponseUnion] = [] + # Generate conversation_id if this is the first message is_new_conversation = False if not context.conversation_id: @@ -111,11 +115,12 @@ async def wrapper( # noqa: PLR0915 try: summary = await self.generate_conversation_summary(message, history, context) if summary: - yield ConversationSummaryResponse(content=ConversationSummaryContent(summary=summary)) + summary_response = ConversationSummaryResponse(content=ConversationSummaryContent(summary=summary)) + extra_responses.append(summary_response) + yield summary_response except Exception: logger.exception("Failed to generate conversation title") - responses, main_response, extra_responses = [], "", [] timestamp = time.time() response_token_count, first_token_time = 0.0, None diff --git a/packages/ragbits-chat/src/ragbits/chat/interface/types.py b/packages/ragbits-chat/src/ragbits/chat/interface/types.py index a7f73b9d50..2c091b7231 100644 --- a/packages/ragbits-chat/src/ragbits/chat/interface/types.py +++ b/packages/ragbits-chat/src/ragbits/chat/interface/types.py @@ -907,3 +907,45 @@ class ConfigResponse(BaseModel): conversation_history: bool = Field(default=False, description="Flag to enable conversation history") show_usage: bool = Field(default=False, description="Flag to enable usage statistics") authentication: AuthenticationConfig = Field(..., description="Authentication configuration") + sharing: bool = Field(default=False, description="Flag to enable conversation sharing") + + +class ShareConversationRequest(BaseModel): + """Validated input for sharing a conversation.""" + + recipients: list[str] = Field(min_length=1, description="List of recipient identifiers (user IDs or emails)") + + +class ConversationShareResponse(BaseModel): + """API response model for a single share recipient.""" + + recipient: str + shared_at: str + + +class ConversationMeta(BaseModel): + """Conversation metadata returned in list endpoints.""" + + conversation_id: str + created_at: str + summary: str | None = None + is_shared: bool = False + shared_by: str | None = None + + +class ConversationInteractionData(BaseModel): + """A single user/assistant interaction belonging to a conversation.""" + + message_id: str | None = None + message: str + response: str + + +class ConversationDetail(BaseModel): + """Full conversation detail including messages.""" + + conversation_id: str + messages: list[ConversationInteractionData] + is_shared: bool = False + shared_by: str | None = None + shares: list[ConversationShareResponse] | None = None diff --git a/packages/ragbits-chat/src/ragbits/chat/persistence/__init__.py b/packages/ragbits-chat/src/ragbits/chat/persistence/__init__.py index 6a446ed93d..720f0d2e27 100644 --- a/packages/ragbits-chat/src/ragbits/chat/persistence/__init__.py +++ b/packages/ragbits-chat/src/ragbits/chat/persistence/__init__.py @@ -1,3 +1,11 @@ -from ragbits.chat.persistence.base import HistoryPersistenceStrategy +from ragbits.chat.persistence.base import ( + HistoryPersistenceStrategy, + SharePersistenceStrategy, +) +from ragbits.chat.persistence.share import SQLSharePersistence -__all__ = ["HistoryPersistenceStrategy"] +__all__ = [ + "HistoryPersistenceStrategy", + "SQLSharePersistence", + "SharePersistenceStrategy", +] diff --git a/packages/ragbits-chat/src/ragbits/chat/persistence/base.py b/packages/ragbits-chat/src/ragbits/chat/persistence/base.py index 7ebc47ec13..19a5623210 100644 --- a/packages/ragbits-chat/src/ragbits/chat/persistence/base.py +++ b/packages/ragbits-chat/src/ragbits/chat/persistence/base.py @@ -1,11 +1,18 @@ from abc import ABC, abstractmethod from collections.abc import Sequence +from typing import Any from ragbits.chat.interface.types import ChatContext, ChatResponse class HistoryPersistenceStrategy(ABC): - """Base class for history persistence strategies.""" + """Base class for history persistence strategies. + + Implementations are responsible for storing chat interactions. Strategies + that additionally know about conversation identity and ownership should + override the optional listing methods below so that higher-level features + (e.g. conversation sharing) can be built on top of them. + """ @abstractmethod async def save_interaction( @@ -26,4 +33,115 @@ async def save_interaction( context: Optional context dictionary containing metadata timestamp: Unix timestamp of when the interaction occurred """ - pass + + async def get_conversation_interactions(self, conversation_id: str) -> list[dict[str, Any]]: + """Return all interactions for a conversation, ordered chronologically. + + Implementations that support conversation retrieval must override this + method. The default implementation raises `NotImplementedError` so that + strategies without retrieval capability fail loudly. + """ + raise NotImplementedError(f"{type(self).__name__} does not support conversation retrieval") + + async def list_conversations(self, user_id: str, limit: int = 50, offset: int = 0) -> list[dict[str, Any]]: + """List conversations owned by a user, ordered by creation time descending. + + Implementations that know about conversation ownership must override + this method. Each returned dict should contain at least ``id`` and + ``created_at`` keys. + """ + raise NotImplementedError(f"{type(self).__name__} does not support listing conversations") + + async def get_conversation_summaries(self, conversation_ids: list[str]) -> dict[str, str]: # noqa: ARG002, PLR6301 + """Return a display summary for each requested conversation. + + Implementations that support conversation listing should return a dict + mapping conversation id to a short summary string. Summaries should + reflect the latest ``ConversationSummaryResponse`` yielded by the + ``ChatInterface`` during the conversation when one is available; for + conversations without one, a sensible fallback (such as a truncated + first user message) is acceptable. The default implementation returns + an empty dict so that summaries remain optional. + """ + return {} + + async def delete_conversation(self, conversation_id: str) -> bool: + """Delete a conversation and all its interactions. + + Returns True when a conversation was deleted. Implementations that do + not support deletion should override this and raise ``NotImplementedError``. + """ + raise NotImplementedError(f"{type(self).__name__} does not support conversation deletion") + + async def get_conversation_owner(self, conversation_id: str) -> str | None: # noqa: ARG002, PLR6301 + """Return the owner user_id for a conversation, or None when unknown. + + Implementations without ownership tracking should leave this default, + which returns None to signal that ownership cannot be established. + """ + return None + + +class SharePersistenceStrategy(ABC): + """Base class for conversation share persistence strategies. + + Implementations are responsible for storing share records that map a + conversation to a set of recipients (user identifiers). Recipients may be + represented by user_id, username, or email; normalisation is the + responsibility of the persistence layer. + """ + + @abstractmethod + async def set_shares( + self, + conversation_id: str, + owner_id: str, + recipients: list[str], + ) -> list[dict[str, Any]]: + """Create (or re-enable previously hidden) share records. + + Args: + conversation_id: The conversation to share. + owner_id: Identifier of the conversation owner. + recipients: Recipient identifiers to grant access to. + + Returns: + The resulting share rows for the requested recipients. + """ + + @abstractmethod + async def get_shares(self, conversation_id: str, owner_id: str) -> list[dict[str, Any]]: + """Return active (non-hidden) share rows owned by ``owner_id``.""" + + @abstractmethod + async def remove_shares( + self, + conversation_id: str, + owner_id: str, + recipients: list[str], + ) -> None: + """Delete share rows for the given recipients.""" + + @abstractmethod + async def list_shared_with_me( + self, + user_identifiers: Sequence[str], + limit: int = 50, + offset: int = 0, + ) -> list[dict[str, Any]]: + """Return conversations shared with the user, newest first. + + Args: + user_identifiers: All identifiers the user can be addressed by + (e.g. user_id, username, email). + limit: Maximum number of results. + offset: Number of results to skip. + """ + + @abstractmethod + async def can_access(self, conversation_id: str, user_identifiers: Sequence[str]) -> bool: + """Return True if any of ``user_identifiers`` has active access.""" + + @abstractmethod + async def hide_share(self, conversation_id: str, user_identifiers: Sequence[str]) -> bool: + """Soft-delete the share for the recipient. Returns True when a row was updated.""" diff --git a/packages/ragbits-chat/src/ragbits/chat/persistence/share.py b/packages/ragbits-chat/src/ragbits/chat/persistence/share.py new file mode 100644 index 0000000000..ac5f965abf --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/persistence/share.py @@ -0,0 +1,361 @@ +"""Persistence for conversation shares built on ``ragbits.core.storage``. + +Stores share records (owner → recipient) for conversations using a pluggable +:class:`~ragbits.core.storage.connections.DatabaseConnection`. Postgres and +SQLite are supported out of the box; new dialects only have to declare a +``placeholder_style`` and (optionally) override the schema DDL via subclassing. + +Recipient identifiers are normalised (lowercased, trimmed) before storage and +lookup so that sharing with a user by user_id, username, or email is symmetric +across casing. +""" + +from __future__ import annotations + +import asyncio +import time +import uuid +from collections.abc import Sequence +from typing import Any, ClassVar, TypeVar + +from typing_extensions import Self + +from ragbits.chat.persistence.base import SharePersistenceStrategy +from ragbits.core.options import Options +from ragbits.core.storage.connections import DatabaseConnection +from ragbits.core.utils.config_handling import ObjectConstructionConfig + + +def _normalize_identifier(identifier: str) -> str: + """Canonicalise an identifier for case-insensitive comparisons.""" + return identifier.strip().lower() + + +def _coerce_identifiers(user_id: str | Sequence[str]) -> list[str]: + """Normalize a single identifier or sequence into a deduplicated list. + + Empty strings are dropped and identifiers are lowercased so that owners, + recipients, and access checks all compare against the same canonical form. + """ + raw = [user_id] if isinstance(user_id, str) else list(user_id) + seen: set[str] = set() + result: list[str] = [] + for value in raw: + if not value: + continue + normalized = _normalize_identifier(value) + if normalized and normalized not in seen: + seen.add(normalized) + result.append(normalized) + return result + + +class SQLSharePersistenceOptions(Options): + """Configuration options for :class:`SQLSharePersistence`.""" + + shares_table: str = "ragbits_conversation_shares" + + +SQLSharePersistenceOptionsT = TypeVar("SQLSharePersistenceOptionsT", bound=SQLSharePersistenceOptions) + + +class SQLSharePersistence(SharePersistenceStrategy): + """A SQL-backed share persistence using :class:`DatabaseConnection`. + + The connection determines the dialect (placeholder style and DDL flavour), + so the same class works for PostgreSQL and SQLite. Multiple persistences + may share the same underlying ``DatabaseConnection``; the class never + closes the connection it was given — that lifecycle stays with the caller. + Unlike ``SQLHistoryPersistence`` (which uses SQLAlchemy ORM), this class + intentionally targets the lighter ``ragbits.core.storage`` abstraction so + callers can share one cross-database connection layer for non-ORM stores. + + Example: + ```python + from ragbits.core.storage.connections import SQLiteConnection + from ragbits.chat.persistence.share import SQLSharePersistence + + connection = SQLiteConnection(":memory:") + share = SQLSharePersistence(connection) + async with connection: + await share.set_shares("conv-1", "alice", ["bob"]) + ``` + """ + + configuration_key: ClassVar = "share_persistence" + + def __init__( + self, + connection: DatabaseConnection[Any], + options: SQLSharePersistenceOptions | None = None, + ) -> None: + """ + Args: + connection: Database connection. Must be a known dialect + (``placeholder_style`` of ``"qmark"`` or ``"numeric"``). + options: Configuration for table names and other settings. + + Raises: + TypeError: When ``connection`` is not a :class:`DatabaseConnection` + or has an unsupported ``placeholder_style``. + """ + if not isinstance(connection, DatabaseConnection): + raise TypeError(f"connection must be a DatabaseConnection, got {type(connection).__name__}") + if connection.placeholder_style not in ("qmark", "numeric"): + raise TypeError( + f"Unsupported placeholder_style: {connection.placeholder_style!r}. " + "Expected 'qmark' (SQLite) or 'numeric' (Postgres)." + ) + self._connection = connection + self.options = options or SQLSharePersistenceOptions() + self._schema_initialized = False + self._init_lock = asyncio.Lock() + + @property + def _table(self) -> str: + return self.options.shares_table + + @property + def _is_postgres(self) -> bool: + return self._connection.placeholder_style == "numeric" + + def _ph(self, index: int) -> str: + """Render a 1-based positional placeholder for the active dialect.""" + return self._connection.placeholder(index) + + def _placeholders(self, count: int, *, start: int = 1) -> str: + """Render ``count`` comma-separated placeholders starting at ``start``.""" + return ", ".join(self._ph(start + i) for i in range(count)) + + def _bool_literal(self, value: bool) -> str: + """Render a SQL boolean literal (some SQLite versions lack TRUE/FALSE).""" + if self._is_postgres: + return "TRUE" if value else "FALSE" + return "1" if value else "0" + + @staticmethod + def _normalize_row(row: dict[str, Any]) -> dict[str, Any]: + """Normalise a raw row so callers see consistent types across dialects.""" + result = dict(row) + if "hidden" in result: + result["hidden"] = bool(result["hidden"]) + return result + + async def _init_db(self) -> None: + """Create tables on first use. Safe to call repeatedly and concurrently.""" + if self._schema_initialized: + return + async with self._init_lock: + if self._schema_initialized: + return + await self._connection._ensure_connected() + if self._is_postgres: + ddl = f""" + CREATE TABLE IF NOT EXISTS {self._table} ( + id TEXT PRIMARY KEY, + conversation_id TEXT NOT NULL, + owner_id TEXT NOT NULL, + recipient TEXT NOT NULL, + shared_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + hidden BOOLEAN NOT NULL DEFAULT FALSE, + UNIQUE (conversation_id, recipient) + ) + """ # noqa: S608 + else: + ddl = f""" + CREATE TABLE IF NOT EXISTS {self._table} ( + id TEXT PRIMARY KEY, + conversation_id TEXT NOT NULL, + owner_id TEXT NOT NULL, + recipient TEXT NOT NULL, + shared_at REAL NOT NULL DEFAULT (strftime('%s','now')), + hidden INTEGER NOT NULL DEFAULT 0, + UNIQUE (conversation_id, recipient) + ) + """ # noqa: S608 + await self._connection.execute(ddl) + await self._connection.execute( + f"CREATE INDEX IF NOT EXISTS idx_{self._table}_conv " # noqa: S608 + f"ON {self._table} (conversation_id)" + ) + await self._connection.execute( + f"CREATE INDEX IF NOT EXISTS idx_{self._table}_recipient " # noqa: S608 + f"ON {self._table} (recipient)" + ) + self._schema_initialized = True + + async def set_shares( + self, + conversation_id: str, + owner_id: str, + recipients: list[str], + ) -> list[dict[str, Any]]: + """Create or refresh share rows for ``recipients`` under ``owner_id``. + + Uses an UPSERT so concurrent calls converge on the same final state + without raising on the ``UNIQUE (conversation_id, recipient)`` + constraint. Each row insert/update is performed inside a single + transaction so the call is atomic per request. + """ + normalized_owner = _normalize_identifier(owner_id) + normalized_recipients = _coerce_identifiers(recipients) + if not normalized_recipients: + return [] + + await self._init_db() + + rows: list[dict[str, Any]] = [] + async with self._connection.transaction(): + for recipient in normalized_recipients: + share_id = str(uuid.uuid4()) + if self._is_postgres: + sql = ( + f"INSERT INTO {self._table} " # noqa: S608 + "(id, conversation_id, owner_id, recipient, shared_at, hidden) " + f"VALUES ({self._ph(1)}, {self._ph(2)}, {self._ph(3)}, {self._ph(4)}, NOW(), FALSE) " + "ON CONFLICT (conversation_id, recipient) DO UPDATE SET " + "owner_id = EXCLUDED.owner_id, shared_at = NOW(), hidden = FALSE " + "RETURNING id, conversation_id, owner_id, recipient, shared_at, hidden" + ) + row = await self._connection.fetch_one(sql, share_id, conversation_id, normalized_owner, recipient) + else: + now_ts = time.time() + sql = ( + f"INSERT INTO {self._table} " # noqa: S608 + "(id, conversation_id, owner_id, recipient, shared_at, hidden) " + "VALUES (?, ?, ?, ?, ?, 0) " + "ON CONFLICT (conversation_id, recipient) DO UPDATE SET " + "owner_id = excluded.owner_id, shared_at = excluded.shared_at, hidden = 0" + ) + await self._connection.execute(sql, share_id, conversation_id, normalized_owner, recipient, now_ts) + row = await self._connection.fetch_one( + f"SELECT id, conversation_id, owner_id, recipient, shared_at, hidden " # noqa: S608 + f"FROM {self._table} WHERE conversation_id = ? AND recipient = ?", + conversation_id, + recipient, + ) + if row is not None: + rows.append(self._normalize_row(row)) + return rows + + async def get_shares(self, conversation_id: str, owner_id: str) -> list[dict[str, Any]]: + """Return the visible shares of ``conversation_id`` owned by ``owner_id``.""" + await self._init_db() + normalized_owner = _normalize_identifier(owner_id) + sql = ( + f"SELECT id, conversation_id, owner_id, recipient, shared_at, hidden " # noqa: S608 + f"FROM {self._table} " + f"WHERE conversation_id = {self._ph(1)} " + f"AND owner_id = {self._ph(2)} " + f"AND hidden = {self._bool_literal(False)} " + f"ORDER BY shared_at DESC" + ) + rows = await self._connection.fetch_all(sql, conversation_id, normalized_owner) + return [self._normalize_row(r) for r in rows] + + async def remove_shares( + self, + conversation_id: str, + owner_id: str, + recipients: list[str], + ) -> None: + """Delete share rows that match ``conversation_id``, ``owner_id`` and any of ``recipients``.""" + normalized_recipients = _coerce_identifiers(recipients) + if not normalized_recipients: + return + + await self._init_db() + normalized_owner = _normalize_identifier(owner_id) + + in_list = self._placeholders(len(normalized_recipients), start=3) + sql = ( + f"DELETE FROM {self._table} " # noqa: S608 + f"WHERE conversation_id = {self._ph(1)} " + f"AND owner_id = {self._ph(2)} " + f"AND recipient IN ({in_list})" + ) + await self._connection.execute(sql, conversation_id, normalized_owner, *normalized_recipients) + + async def list_shared_with_me( + self, + user_identifiers: Sequence[str], + limit: int = 50, + offset: int = 0, + ) -> list[dict[str, Any]]: + """List conversations shared with any of ``user_identifiers``, newest first.""" + identifiers = _coerce_identifiers(user_identifiers) + if not identifiers: + return [] + + await self._init_db() + + n = len(identifiers) + in_list = self._placeholders(n, start=1) + limit_ph = self._ph(n + 1) + offset_ph = self._ph(n + 2) + sql = ( + f"SELECT id, conversation_id, owner_id, recipient, shared_at, hidden " # noqa: S608 + f"FROM {self._table} " + f"WHERE recipient IN ({in_list}) " + f"AND hidden = {self._bool_literal(False)} " + f"ORDER BY shared_at DESC " + f"LIMIT {limit_ph} OFFSET {offset_ph}" + ) + rows = await self._connection.fetch_all(sql, *identifiers, limit, offset) + return [self._normalize_row(r) for r in rows] + + async def can_access(self, conversation_id: str, user_identifiers: Sequence[str]) -> bool: + """Return True when any of ``user_identifiers`` has a visible share for ``conversation_id``.""" + identifiers = _coerce_identifiers(user_identifiers) + if not identifiers: + return False + + await self._init_db() + + in_list = self._placeholders(len(identifiers), start=2) + sql = ( + f"SELECT 1 FROM {self._table} " # noqa: S608 + f"WHERE conversation_id = {self._ph(1)} " + f"AND recipient IN ({in_list}) " + f"AND hidden = {self._bool_literal(False)} " + f"LIMIT 1" + ) + row = await self._connection.fetch_one(sql, conversation_id, *identifiers) + return row is not None + + async def hide_share(self, conversation_id: str, user_identifiers: Sequence[str]) -> bool: + """Soft-delete visible shares for ``conversation_id`` that match ``user_identifiers``.""" + identifiers = _coerce_identifiers(user_identifiers) + if not identifiers: + return False + + await self._init_db() + + in_list = self._placeholders(len(identifiers), start=2) + sql = ( + f"UPDATE {self._table} SET hidden = {self._bool_literal(True)} " # noqa: S608 + f"WHERE conversation_id = {self._ph(1)} " + f"AND recipient IN ({in_list}) " + f"AND hidden = {self._bool_literal(False)}" + ) + rowcount = await self._connection.execute(sql, conversation_id, *identifiers) + return rowcount > 0 + + @classmethod + def from_config(cls, config: dict) -> Self: + """Construct the persistence from a plain config dict. + + The ``connection`` key is expected to be an + :class:`ObjectConstructionConfig` describing a + :class:`DatabaseConnection`, e.g.:: + + { + "connection": { + "type": "ragbits.core.storage.connections:SQLiteConnection", + "config": {"db_path": ":memory:"}, + } + } + """ + connection_options = ObjectConstructionConfig.model_validate(config["connection"]) + config["connection"] = DatabaseConnection.subclass_from_config(connection_options) + return cls(**config) diff --git a/packages/ragbits-chat/src/ragbits/chat/persistence/sql.py b/packages/ragbits-chat/src/ragbits/chat/persistence/sql.py index 4d749bb7b7..4500200ef4 100644 --- a/packages/ragbits-chat/src/ragbits/chat/persistence/sql.py +++ b/packages/ragbits-chat/src/ragbits/chat/persistence/sql.py @@ -1,3 +1,4 @@ +import asyncio import uuid from collections.abc import Sequence from typing import Any, Protocol, TypeVar @@ -8,7 +9,7 @@ from sqlalchemy.orm import DeclarativeBase from typing_extensions import Self -from ragbits.chat.interface.types import ChatContext, ChatResponse +from ragbits.chat.interface.types import ChatContext, ChatResponse, ConversationSummaryResponse from ragbits.chat.persistence.base import HistoryPersistenceStrategy from ragbits.core.options import Options from ragbits.core.utils.config_handling import ObjectConstructionConfig @@ -22,6 +23,8 @@ class ConversationProtocol(Protocol): """Protocol for Conversation model.""" id: str + user_id: str | None + summary: str | None created_at: Any @@ -57,6 +60,8 @@ class Conversation(base_class): # type: ignore[misc, valid-type] Attributes: id: The unique identifier for the conversation. + user_id: Identifier of the conversation owner, or ``None`` for anonymous. + summary: Latest summary yielded for this conversation, or ``None``. created_at: The timestamp when the conversation was created. Table: @@ -65,6 +70,8 @@ class Conversation(base_class): # type: ignore[misc, valid-type] __tablename__ = table_name id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) + user_id = Column(String, nullable=True, index=True) + summary = Column(Text, nullable=True) created_at = Column(TIMESTAMP, server_default=func.now()) return Conversation @@ -158,6 +165,7 @@ def __init__( self.sqlalchemy_engine = sqlalchemy_engine self.options = options or SQLHistoryPersistenceOptions() self._db_initialized = False + self._init_lock = asyncio.Lock() # Create a unique DeclarativeBase for this instance to avoid table conflicts class _Base(DeclarativeBase): @@ -179,7 +187,11 @@ async def _init_db(self) -> None: This method is called automatically on first usage. """ - if not self._db_initialized: + if self._db_initialized: + return + async with self._init_lock: + if self._db_initialized: + return async with self.sqlalchemy_engine.begin() as conn: await conn.run_sync(self._base.metadata.create_all) self._db_initialized = True @@ -205,9 +217,10 @@ async def save_interaction( await self._init_db() async with AsyncSession(self.sqlalchemy_engine) as session, session.begin(): - # Ensure conversation exists if conversation_id is provided + summary = self._latest_summary_from_responses(extra_responses) if context.conversation_id: - await self._ensure_conversation_exists(session, context.conversation_id) + user_id = context.user.user_id if context.user else None + await self._ensure_conversation_exists(session, context.conversation_id, user_id, summary) # Convert to JSON-serializable format with type information extra_responses_data = [ @@ -229,23 +242,43 @@ async def save_interaction( session.add(interaction) await session.commit() - async def _ensure_conversation_exists(self, session: AsyncSession, conversation_id: str) -> None: + @staticmethod + def _latest_summary_from_responses(extra_responses: Sequence[ChatResponse]) -> str | None: + """Return the most recent ``ConversationSummaryResponse`` summary, if any.""" + for response in reversed(extra_responses): + if isinstance(response, ConversationSummaryResponse): + summary = response.content.summary + if summary: + return summary + return None + + async def _ensure_conversation_exists( + self, + session: AsyncSession, + conversation_id: str, + user_id: str | None = None, + summary: str | None = None, + ) -> None: """ Ensures that a conversation with the given ID exists in the database. Args: session: The database session to use. conversation_id: The ID of the conversation to check/create. + user_id: The owner user ID to associate with a new conversation. + summary: Latest summary to persist, if available. Existing summaries + are only overwritten when a new non-empty value is provided. """ - # Check if conversation exists result = await session.execute(sqlalchemy.select(self.Conversation).filter_by(id=conversation_id).limit(1)) existing_conversation = result.scalar_one_or_none() - # Create conversation if it doesn't exist - if not existing_conversation: - conversation = self.Conversation(id=conversation_id) + if existing_conversation is None: + conversation = self.Conversation(id=conversation_id, user_id=user_id, summary=summary) session.add(conversation) await session.flush() + elif summary is not None and existing_conversation.summary != summary: + existing_conversation.summary = summary + await session.flush() async def get_conversation_interactions(self, conversation_id: str) -> list[dict[str, Any]]: """ @@ -282,6 +315,138 @@ async def get_conversation_interactions(self, conversation_id: str) -> list[dict for interaction in interactions ] + async def list_conversations(self, user_id: str, limit: int = 50, offset: int = 0) -> list[dict[str, Any]]: + """ + List conversations owned by a user, ordered by most recent activity. + + Args: + user_id: The owner's user ID. + limit: Maximum number of conversations to return. + offset: Number of conversations to skip. + + Returns: + A list of conversation dictionaries. + """ + await self._init_db() + + async with AsyncSession(self.sqlalchemy_engine) as session: + latest_interaction_subquery = ( + sqlalchemy.select( + self.ChatInteraction.conversation_id.label("conversation_id"), + sqlalchemy.func.max(self.ChatInteraction.timestamp).label("updated_at"), + ) + .group_by(self.ChatInteraction.conversation_id) + .subquery() + ) + result = await session.execute( + sqlalchemy.select(self.Conversation) + .join( + latest_interaction_subquery, + self.Conversation.id == latest_interaction_subquery.c.conversation_id, + isouter=True, + ) + .where(self.Conversation.user_id == user_id) + .order_by( + latest_interaction_subquery.c.updated_at.desc(), + self.Conversation.created_at.desc(), + ) + .limit(limit) + .offset(offset) + ) + conversations = result.scalars().all() + + return [ + { + "id": conv.id, + "user_id": conv.user_id, + "summary": conv.summary, + "created_at": conv.created_at, + } + for conv in conversations + ] + + async def get_conversation_summaries(self, conversation_ids: list[str]) -> dict[str, str]: + """ + Get a display summary for each conversation. + + Reads the persisted ``summary`` column populated by ``save_interaction`` + when a ``ConversationSummaryResponse`` is yielded. Falls back to a + truncated version of the first user message for conversations that have + no stored summary yet. + + Args: + conversation_ids: List of conversation IDs to fetch summaries for. + + Returns: + A dict mapping conversation_id → summary string. + """ + if not conversation_ids: + return {} + + await self._init_db() + + max_len = 80 + summaries: dict[str, str] = {} + async with AsyncSession(self.sqlalchemy_engine) as session: + stored = await session.execute( + sqlalchemy.select(self.Conversation.id, self.Conversation.summary).filter( + self.Conversation.id.in_(conversation_ids) + ) + ) + for conv_id, summary in stored.all(): + if summary: + summaries[conv_id] = summary + + for cid in conversation_ids: + if cid in summaries: + continue + result = await session.execute( + sqlalchemy.select(self.ChatInteraction.message) + .filter_by(conversation_id=cid) + .order_by(self.ChatInteraction.id.asc()) + .limit(1) + ) + first_msg = result.scalar_one_or_none() + if first_msg: + summaries[cid] = first_msg[:max_len] + ("…" if len(first_msg) > max_len else "") + return summaries + + async def delete_conversation(self, conversation_id: str) -> bool: + """ + Delete a conversation and all its interactions. + + Args: + conversation_id: The ID of the conversation to delete. + + Returns: + True if the conversation was deleted, False if it didn't exist. + """ + await self._init_db() + + async with AsyncSession(self.sqlalchemy_engine) as session: + await session.execute(sqlalchemy.delete(self.ChatInteraction).filter_by(conversation_id=conversation_id)) + result = await session.execute(sqlalchemy.delete(self.Conversation).filter_by(id=conversation_id)) + await session.commit() + return result.rowcount > 0 # type: ignore[union-attr] + + async def get_conversation_owner(self, conversation_id: str) -> str | None: + """ + Get the owner user_id for a conversation. + + Args: + conversation_id: The conversation ID. + + Returns: + The owner's user_id, or None if the conversation doesn't exist. + """ + await self._init_db() + + async with AsyncSession(self.sqlalchemy_engine) as session: + result = await session.execute( + sqlalchemy.select(self.Conversation.user_id).filter_by(id=conversation_id).limit(1) + ) + return result.scalar_one_or_none() + @classmethod def from_config(cls, config: dict) -> Self: """ diff --git a/packages/ragbits-chat/src/ragbits/chat/providers/model_provider.py b/packages/ragbits-chat/src/ragbits/chat/providers/model_provider.py index d2e49c3236..3a23469381 100644 --- a/packages/ragbits-chat/src/ragbits/chat/providers/model_provider.py +++ b/packages/ragbits-chat/src/ragbits/chat/providers/model_provider.py @@ -55,7 +55,11 @@ def get_models(self) -> dict[str, type[BaseModel | Enum]]: ChatMessageRequest, ChunkedContent, ConfigResponse, + ConversationDetail, ConversationIdContent, + ConversationInteractionData, + ConversationMeta, + ConversationShareResponse, ConversationSummaryContent, ErrorContent, FeedbackConfig, @@ -75,6 +79,7 @@ def get_models(self) -> dict[str, type[BaseModel | Enum]]: OAuth2ProviderConfig, PlanItemContent, Reference, + ShareConversationRequest, StateUpdate, TextContent, UsageContent, @@ -135,6 +140,12 @@ def get_models(self) -> dict[str, type[BaseModel | Enum]]: "LoginRequest": LoginRequest, "LoginResponse": LoginResponse, "User": User, + # Conversation sharing + "ShareConversationRequest": ShareConversationRequest, + "ConversationShareResponse": ConversationShareResponse, + "ConversationMeta": ConversationMeta, + "ConversationInteractionData": ConversationInteractionData, + "ConversationDetail": ConversationDetail, } return self._models_cache @@ -198,6 +209,10 @@ def get_categories(self) -> dict[str, list[str]]: "ConfigResponse", "LoginResponse", "OAuth2AuthorizeResponse", + "ConversationShareResponse", + "ConversationMeta", + "ConversationInteractionData", + "ConversationDetail", ], "requests": [ "ChatRequest", @@ -206,6 +221,7 @@ def get_categories(self) -> dict[str, list[str]]: "OAuth2Credentials", "LoginRequest", "LogoutRequest", + "ShareConversationRequest", ], } diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-CoMO0eC0.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-cDr3k6LK.js similarity index 79% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-CoMO0eC0.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-cDr3k6LK.js index 4d41336ab5..cb0d149cc0 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-CoMO0eC0.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-cDr3k6LK.js @@ -1 +1 @@ -import{r as h,j as e,aW as c,aw as p,c as S,bo as x,bp as l,bq as d,br as m,bs as b}from"./index-Be6O1iVd.js";import{a}from"./authStore-DX4sLJ2o.js";import{u as j}from"./useInitializeUserStore-BqNjwnPQ.js";const v=h.createContext(null);function y({children:t}){const[o]=h.useState(()=>a);return e.jsx(v.Provider,{value:o,children:t})}function U(){const{logout:t,login:o,setHydrated:u}=c(a,f=>f),i=j(),n=p(),s=S("/api/user"),g=x();return h.useEffect(()=>{(async()=>{try{const r=await s.call();r?(o(r),i?i(r.user_id):console.error("Failed to initialize store for user, initializeUserStore() is not defined. Check current HistoryStoreContextProvider implementation."),g.pathname==="/login"&&n("/")):t()}catch(r){console.error("Failed to check session:",r),t(),n("/login")}finally{u()}})()},[]),null}function P({children:t}){const o=x(),u=c(a,s=>s.isAuthenticated),i=c(a,s=>s.hasHydrated),n=c(a,s=>s.logout);return i?o.pathname==="/login"?e.jsx(l,{baseUrl:d,auth:{credentials:"include"},children:t}):u?e.jsx(y,{children:e.jsx(l,{baseUrl:d,auth:{onUnauthorized:n,credentials:"include"},children:t})}):e.jsx(b,{to:"/login",replace:!0}):e.jsxs(l,{baseUrl:d,auth:{credentials:"include"},children:[e.jsx(U,{}),e.jsx(m,{})]})}export{P as default}; +import{r as h,j as e,aX as c,aF as p,c as S,bo as x,bp as l,bq as d,br as m,bs as b}from"./index-DKQs0Q0w.js";import{a}from"./authStore-DVjFDcbE.js";import{u as j}from"./useInitializeUserStore-DHrBxa3t.js";const v=h.createContext(null);function y({children:t}){const[o]=h.useState(()=>a);return e.jsx(v.Provider,{value:o,children:t})}function U(){const{logout:t,login:o,setHydrated:u}=c(a,f=>f),i=j(),n=p(),s=S("/api/user"),g=x();return h.useEffect(()=>{(async()=>{try{const r=await s.call();r?(o(r),i?i(r.user_id):console.error("Failed to initialize store for user, initializeUserStore() is not defined. Check current HistoryStoreContextProvider implementation."),g.pathname==="/login"&&n("/")):t()}catch(r){console.error("Failed to check session:",r),t(),n("/login")}finally{u()}})()},[]),null}function P({children:t}){const o=x(),u=c(a,s=>s.isAuthenticated),i=c(a,s=>s.hasHydrated),n=c(a,s=>s.logout);return i?o.pathname==="/login"?e.jsx(l,{baseUrl:d,auth:{credentials:"include"},children:t}):u?e.jsx(y,{children:e.jsx(l,{baseUrl:d,auth:{onUnauthorized:n,credentials:"include"},children:t})}):e.jsx(b,{to:"/login",replace:!0}):e.jsxs(l,{baseUrl:d,auth:{credentials:"include"},children:[e.jsx(U,{}),e.jsx(m,{})]})}export{P as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-9XE9TJHw.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-9XE9TJHw.js new file mode 100644 index 0000000000..5d43182a91 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-9XE9TJHw.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-8wr_YRsr.js","assets/index-DKQs0Q0w.js","assets/index-CDmU1Tem.css"])))=>i.map(i=>d[i]); +import{r as m,t as ae,k as Xe,Z as W,ay as Me,$ as Ze,j as t,q as me,L as xe,n as ye,T as Pe,_ as Ye,s as et,v as H,V as tt,d as X,l as se,aq as Ie,o as ot,H as ke,a9 as rt,J as Ne,az as at,ac as pe,U as st,X as _e,af as he,aA as nt,aB as lt,ag as it,K as dt,O as be,Q as ct,W as ut,a0 as pt,ah as ft,a2 as B,a3 as Ae,ai as vt,R as ht,aC as bt,a8 as gt,aD as mt,aE as xt,a5 as yt,a as Pt,aF as Ct,aw as wt,i as Ce,aG as fe,D as we,I as J,aH as $t,aI as jt,aJ as $e}from"./index-DKQs0Q0w.js";import{u as St,b as Dt,c as je,d as Mt,e as It,m as kt,$ as Nt,a as _t}from"./useMenuTriggerState-DIuhWKKT.js";import{$ as At}from"./useSelectableItem-Svsj-E2p.js";import{i as Ft}from"./chunk-SSA7SXE4-O5iifkg7.js";var Ot=(e,o)=>{var n;let s=[];const r=(n=m.Children.map(e,l=>m.isValidElement(l)&&l.type===o?(s.push(l),null):l))==null?void 0:n.filter(Boolean),c=s.length>=0?s:void 0;return[r,c]},Et=ae({base:["w-full","p-1","min-w-[200px]"]});ae({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","outline-hidden","cursor-pointer","tap-highlight-transparent","data-[pressed=true]:opacity-70",...Xe,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center",title:"flex-1 text-small font-normal truncate",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100"},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{}}},defaultVariants:{variant:"solid",color:"default"},compoundVariants:[{variant:"solid",color:"default",class:{base:"data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"solid",color:"primary",class:{base:"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"solid",color:"warning",class:{base:"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"shadow",color:"default",class:{base:"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"shadow",color:"primary",class:{base:"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"shadow",color:"secondary",class:{base:"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"shadow",color:"success",class:{base:"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"shadow",color:"warning",class:{base:"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"shadow",color:"danger",class:{base:"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"bordered",color:"default",class:{base:"data-[hover=true]:border-default"}},{variant:"bordered",color:"primary",class:{base:"data-[hover=true]:border-primary data-[hover=true]:text-primary"}},{variant:"bordered",color:"secondary",class:{base:"data-[hover=true]:border-secondary data-[hover=true]:text-secondary"}},{variant:"bordered",color:"success",class:{base:"data-[hover=true]:border-success data-[hover=true]:text-success"}},{variant:"bordered",color:"warning",class:{base:"data-[hover=true]:border-warning data-[hover=true]:text-warning"}},{variant:"bordered",color:"danger",class:{base:"data-[hover=true]:border-danger data-[hover=true]:text-danger"}},{variant:"flat",color:"default",class:{base:"data-[hover=true]:bg-default/40 data-[hover=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{base:"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary"}},{variant:"flat",color:"secondary",class:{base:"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary"}},{variant:"flat",color:"success",class:{base:"data-[hover=true]:bg-success/20 data-[hover=true]:text-success "}},{variant:"flat",color:"warning",class:{base:"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning"}},{variant:"flat",color:"danger",class:{base:"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger"}},{variant:"faded",color:"default",class:{base:"data-[hover=true]:text-default-foreground"}},{variant:"faded",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"faded",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"faded",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"faded",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"faded",color:"danger",class:{base:"data-[hover=true]:text-danger"}},{variant:"light",color:"default",class:{base:"data-[hover=true]:text-default-500"}},{variant:"light",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"light",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"light",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"light",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"light",color:"danger",class:{base:"data-[hover=true]:text-danger"}}]});ae({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}});ae({base:"w-full flex flex-col gap-0.5 p-1"});var Tt=(e,o)=>{if(!e&&!o)return{};const n=new Set([...Object.keys(e||{}),...Object.keys(o||{})]);return Array.from(n).reduce((s,r)=>({...s,[r]:W(e?.[r],o?.[r])}),{})},[Rt,Fe]=Me({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),Se=()=>Ye(()=>import("./index-8wr_YRsr.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Oe=e=>{const{as:o,children:n,className:s,...r}=e,{Component:c,placement:l,backdrop:h,motionProps:p,disableAnimation:u,getPopoverProps:i,getDialogProps:S,getBackdropProps:b,getContentProps:P,isNonModal:k,onClose:j}=Fe(),f=m.useRef(null),{dialogProps:D,titleProps:M}=Ze({},f),x=S({ref:f,...D,...r}),I=o||c||"div",d=t.jsxs(t.Fragment,{children:[!k&&t.jsx(me,{onDismiss:j}),t.jsx(I,{...x,children:t.jsx("div",{...P({className:s}),children:typeof n=="function"?n(M):n})}),t.jsx(me,{onDismiss:j})]}),v=m.useMemo(()=>h==="transparent"?null:u?t.jsx("div",{...b()}):t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"exit",variants:Pe.fade,...b()})}),[h,u,b]),_=l?et(l==="center"?"top":l):void 0,C=t.jsx(t.Fragment,{children:u?d:t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"initial",style:_,variants:Pe.scaleSpringOpacity,...p,children:d})})});return t.jsxs("div",{...i(),children:[v,C]})};Oe.displayName="HeroUI.PopoverContent";var Ht=Oe,Ee=e=>{var o;const{triggerRef:n,getTriggerProps:s}=Fe(),{children:r,...c}=e,l=m.useMemo(()=>typeof r=="string"?t.jsx("p",{children:r}):m.Children.only(r),[r]),h=(o=l.props.ref)!=null?o:l.ref,{onPress:p,isDisabled:u,...i}=m.useMemo(()=>s(H(c,l.props),h),[s,l.props,c,h]),[,S]=Ot(r,X),{buttonProps:b}=tt({onPress:p,isDisabled:u},n),P=m.useMemo(()=>S?.[0]!==void 0,[S]);return P||delete i.preventFocusOnPress,m.cloneElement(l,H(i,P?{onPress:p,isDisabled:u}:b))};Ee.displayName="HeroUI.PopoverTrigger";var Ut=Ee,Te=se((e,o)=>{const{children:n,...s}=e,r=St({...s,ref:o}),[c,l]=m.Children.toArray(n),h=t.jsx(ot,{portalContainer:r.portalContainer,children:l});return t.jsxs(Rt,{value:r,children:[c,r.disableAnimation&&r.isOpen?h:t.jsx(Ie,{children:r.isOpen?h:null})]})});Te.displayName="HeroUI.Popover";var Kt=Te,[Bt,Re]=Me({name:"DropdownContext",errorMessage:"useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"});function Vt(e){const{isSelected:o,disableAnimation:n,...s}=e;return t.jsx("svg",{"aria-hidden":"true","data-selected":o,role:"presentation",viewBox:"0 0 17 18",...s,children:t.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:n?{}:{transition:"stroke-dashoffset 200ms ease"}})})}const He=new WeakMap;function Lt(e,o,n){let{shouldFocusWrap:s=!0,onKeyDown:r,onKeyUp:c,...l}=e;!e["aria-label"]&&e["aria-labelledby"];let h=ke(e,{labelable:!0}),{listProps:p}=rt({...l,ref:n,selectionManager:o.selectionManager,collection:o.collection,disabledKeys:o.disabledKeys,shouldFocusWrap:s,linkBehavior:"override"});return He.set(o,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:Ne(h,{onKeyDown:r,onKeyUp:c},{role:"menu",...p,onKeyDown:u=>{var i;(u.key!=="Escape"||e.shouldUseVirtualFocus)&&((i=p.onKeyDown)===null||i===void 0||i.call(p,u))}})}}function zt(e,o,n){let{id:s,key:r,closeOnSelect:c,isVirtualized:l,"aria-haspopup":h,onPressStart:p,onPressUp:u,onPress:i,onPressChange:S,onPressEnd:b,onHoverStart:P,onHoverChange:k,onHoverEnd:j,onKeyDown:f,onKeyUp:D,onFocus:M,onFocusChange:x,onBlur:I,selectionManager:d=o.selectionManager}=e,v=!!h,_=v&&e["aria-expanded"]==="true";var C;let A=(C=e.isDisabled)!==null&&C!==void 0?C:d.isDisabled(r);var a;let w=(a=e.isSelected)!==null&&a!==void 0?a:d.isSelected(r),F=He.get(o),y=o.collection.getItem(r),T=e.onClose||F.onClose,R=at(),$=g=>{var Q;if(!v){if(!(y==null||(Q=y.props)===null||Q===void 0)&&Q.onAction?y.props.onAction():e.onAction&&e.onAction(r),F.onAction){let ce=F.onAction;ce(r)}g.target instanceof HTMLAnchorElement&&y&&R.open(g.target,g,y.props.href,y.props.routerOptions)}},N="menuitem";v||(d.selectionMode==="single"?N="menuitemradio":d.selectionMode==="multiple"&&(N="menuitemcheckbox"));let O=pe(),U=pe(),q=pe(),V={id:s,"aria-disabled":A||void 0,role:N,"aria-label":e["aria-label"],"aria-labelledby":O,"aria-describedby":[U,q].filter(Boolean).join(" ")||void 0,"aria-controls":e["aria-controls"],"aria-haspopup":h,"aria-expanded":e["aria-expanded"]};d.selectionMode!=="none"&&!v&&(V["aria-checked"]=w),l&&(V["aria-posinset"]=y?.index,V["aria-setsize"]=Dt(o.collection));let G=g=>{g.pointerType==="keyboard"&&$(g),p?.(g)},Z=()=>{!v&&T&&(c??(d.selectionMode!=="multiple"||d.isLink(r)))&&T()},Y=g=>{g.pointerType==="mouse"&&($(g),Z()),u?.(g)},ne=g=>{g.pointerType!=="keyboard"&&g.pointerType!=="mouse"&&($(g),Z()),i?.(g)},{itemProps:L,isFocused:ee}=At({id:s,selectionManager:d,key:r,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:F.shouldUseVirtualFocus}),{pressProps:le,isPressed:te}=st({onPressStart:G,onPress:ne,onPressUp:Y,onPressChange:S,onPressEnd:b,isDisabled:A}),{hoverProps:ie}=_e({isDisabled:A,onHoverStart(g){!he()&&!(_&&h)&&(d.setFocused(!0),d.setFocusedKey(r)),P?.(g)},onHoverChange:k,onHoverEnd:j}),{keyboardProps:oe}=nt({onKeyDown:g=>{if(g.repeat){g.continuePropagation();return}switch(g.key){case" ":!A&&d.selectionMode==="none"&&!v&&c!==!1&&T&&T();break;case"Enter":!A&&c!==!1&&!v&&T&&T();break;default:v||g.continuePropagation(),f?.(g);break}},onKeyUp:D}),{focusProps:K}=lt({onBlur:I,onFocus:M,onFocusChange:x}),re=ke(y?.props);delete re.id;let de=it(y?.props);return{menuItemProps:{...V,...Ne(re,de,v?{onFocus:L.onFocus,"data-collection":L["data-collection"],"data-key":L["data-key"]}:L,le,ie,oe,K,F.shouldUseVirtualFocus||v?{onMouseDown:g=>g.preventDefault()}:void 0),tabIndex:L.tabIndex!=null&&_&&!F.shouldUseVirtualFocus?-1:L.tabIndex},labelProps:{id:O},descriptionProps:{id:U},keyboardShortcutProps:{id:q},isFocused:ee,isFocusVisible:ee&&d.isFocused&&he()&&!_,isSelected:w,isPressed:te,isDisabled:A}}function Wt(e){let{heading:o,"aria-label":n}=e,s=dt();return{itemProps:{role:"presentation"},headingProps:o?{id:s,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":o?s:void 0}}}function qt(e){var o,n;const s=be(),[r,c]=ct(e,je.variantKeys),{as:l,item:h,state:p,shortcut:u,description:i,startContent:S,endContent:b,isVirtualized:P,selectedIcon:k,className:j,classNames:f,onAction:D,autoFocus:M,onPress:x,onPressStart:I,onPressUp:d,onPressEnd:v,onPressChange:_,onHoverStart:C,onHoverChange:A,onHoverEnd:a,hideSelectedIcon:w=!1,isReadOnly:F=!1,closeOnSelect:y,onClose:T,onClick:R,...$}=r,N=(n=(o=e.disableAnimation)!=null?o:s?.disableAnimation)!=null?n:!1,O=m.useRef(null),U=l||($?.href?"a":"li"),q=typeof U=="string",{rendered:V,key:G}=h,Z=p.disabledKeys.has(G)||e.isDisabled,Y=p.selectionManager.selectionMode!=="none",ne=Mt(),{isFocusVisible:L,focusProps:ee}=ut({autoFocus:M}),le=m.useCallback(E=>{R?.(E),x?.(E)},[R,x]),{isPressed:te,isFocused:ie,isSelected:oe,isDisabled:K,menuItemProps:re,labelProps:de,descriptionProps:g,keyboardShortcutProps:Q}=zt({key:G,onClose:T,isDisabled:Z,onPress:le,onPressStart:I,onPressUp:d,onPressEnd:v,onPressChange:_,"aria-label":r["aria-label"],closeOnSelect:y,isVirtualized:P,onAction:D},p,O);let{hoverProps:ce,isHovered:ge}=_e({isDisabled:K,onHoverStart(E){he()||(p.selectionManager.setFocused(!0),p.selectionManager.setFocusedKey(G)),C?.(E)},onHoverChange:A,onHoverEnd:a}),ue=re;const z=m.useMemo(()=>je({...c,isDisabled:K,disableAnimation:N,hasTitleTextChild:typeof V=="string",hasDescriptionTextChild:typeof i=="string"}),[pt(c),K,N,V,i]),ze=W(f?.base,j);F&&(ue=ft(ue));const We=(E={})=>({ref:O,...H(F?{}:ee,Ae($,{enabled:q}),ue,ce,E),"data-focus":B(ie),"data-selectable":B(Y),"data-hover":B(ne?ge||te:ge),"data-disabled":B(K),"data-selected":B(oe),"data-pressed":B(te),"data-focus-visible":B(L),className:z.base({class:W(ze,E.className)})}),qe=(E={})=>({...H(de,E),className:z.title({class:f?.title})}),Je=(E={})=>({...H(g,E),className:z.description({class:f?.description})}),Ge=(E={})=>({...H(Q,E),className:z.shortcut({class:f?.shortcut})}),Qe=m.useCallback((E={})=>({"aria-hidden":B(!0),"data-disabled":B(K),className:z.selectedIcon({class:f?.selectedIcon}),...E}),[K,z,f]);return{Component:U,domRef:O,slots:z,classNames:f,isSelectable:Y,isSelected:oe,isDisabled:K,rendered:V,shortcut:u,description:i,startContent:S,endContent:b,selectedIcon:k,disableAnimation:N,getItemProps:We,getLabelProps:qe,hideSelectedIcon:w,getDescriptionProps:Je,getKeyboardShortcutProps:Ge,getSelectedIconProps:Qe}}var Ue=e=>{const{Component:o,slots:n,classNames:s,rendered:r,shortcut:c,description:l,isSelectable:h,isSelected:p,isDisabled:u,selectedIcon:i,startContent:S,endContent:b,disableAnimation:P,hideSelectedIcon:k,getItemProps:j,getLabelProps:f,getDescriptionProps:D,getKeyboardShortcutProps:M,getSelectedIconProps:x}=qt(e),I=m.useMemo(()=>{const d=t.jsx(Vt,{disableAnimation:P,isSelected:p});return typeof i=="function"?i({icon:d,isSelected:p,isDisabled:u}):i||d},[i,p,u,P]);return t.jsxs(o,{...j(),children:[S,l?t.jsxs("div",{className:n.wrapper({class:s?.wrapper}),children:[t.jsx("span",{...f(),children:r}),t.jsx("span",{...D(),children:l})]}):t.jsx("span",{...f(),children:r}),c&&t.jsx("kbd",{...M(),children:c}),h&&!k&&t.jsx("span",{...x(),children:I}),b]})};Ue.displayName="HeroUI.MenuItem";var Ke=Ue,Be=se(({item:e,state:o,as:n,variant:s,color:r,disableAnimation:c,onAction:l,closeOnSelect:h,className:p,classNames:u,showDivider:i=!1,hideSelectedIcon:S,dividerProps:b={},itemClasses:P,title:k,...j},f)=>{const D=n||"li",M=m.useMemo(()=>It(),[]),x=W(u?.base,p),I=W(u?.divider,b?.className),{itemProps:d,headingProps:v,groupProps:_}=Wt({heading:e.rendered,"aria-label":e["aria-label"]});return t.jsxs(D,{"data-slot":"base",...H(d,j),className:M.base({class:x}),children:[e.rendered&&t.jsx("span",{...v,className:M.heading({class:u?.heading}),"data-slot":"heading",children:e.rendered}),t.jsxs("ul",{..._,className:M.group({class:u?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(C=>{const{key:A,props:a}=C;let w=t.jsx(Ke,{classNames:P,closeOnSelect:h,color:r,disableAnimation:c,hideSelectedIcon:S,item:C,state:o,variant:s,onAction:l,...a},A);return C.wrapper&&(w=C.wrapper(w)),w}),i&&t.jsx(vt,{as:"li",className:M.divider({class:I}),...b})]})]})});Be.displayName="HeroUI.MenuSection";var Jt=Be;function Gt(e){var o;const n=be(),{as:s,ref:r,variant:c,color:l,children:h,disableAnimation:p=(o=n?.disableAnimation)!=null?o:!1,onAction:u,closeOnSelect:i,itemClasses:S,className:b,state:P,topContent:k,bottomContent:j,hideEmptyContent:f=!1,hideSelectedIcon:D=!1,emptyContent:M="No items.",menuProps:x,onClose:I,classNames:d,...v}=e,_=s||"ul",C=ht(r),A=typeof _=="string",a=bt({...v,...x,children:h}),w=P||a,{menuProps:F}=Lt({...v,...x,onAction:u},w,C),y=m.useMemo(()=>kt({className:b}),[b]),T=W(d?.base,b);return{Component:_,state:w,variant:c,color:l,disableAnimation:p,onClose:I,topContent:k,bottomContent:j,closeOnSelect:i,className:b,itemClasses:S,getBaseProps:(O={})=>({ref:C,"data-slot":"base",className:y.base({class:T}),...Ae(v,{enabled:A}),...O}),getListProps:(O={})=>({"data-slot":"list",className:y.list({class:d?.list}),...F,...O}),hideEmptyContent:f,hideSelectedIcon:D,getEmptyContentProps:(O={})=>({children:M,className:y.emptyContent({class:d?.emptyContent}),...O})}}var Qt=se(function(o,n){const{Component:s,state:r,closeOnSelect:c,color:l,disableAnimation:h,hideSelectedIcon:p,hideEmptyContent:u,variant:i,onClose:S,topContent:b,bottomContent:P,itemClasses:k,getBaseProps:j,getListProps:f,getEmptyContentProps:D}=Gt({...o,ref:n}),M=t.jsxs(s,{...f(),children:[!r.collection.size&&!u&&t.jsx("li",{children:t.jsx("div",{...D()})}),[...r.collection].map(x=>{const I={closeOnSelect:c,color:l,disableAnimation:h,item:x,state:r,variant:i,onClose:S,hideSelectedIcon:p,...x.props},d=Tt(k,I?.classNames);if(x.type==="section")return t.jsx(Jt,{...I,itemClasses:d},x.key);let v=t.jsx(Ke,{...I,classNames:d},x.key);return x.wrapper&&(v=x.wrapper(v)),v})]});return t.jsxs("div",{...j(),children:[b,M,P]})}),Xt=Qt,Zt=gt,ve=Zt,Yt=se(function(o,n){const{getMenuProps:s}=Re();return t.jsx(Ht,{children:t.jsx(mt,{contain:!0,restoreFocus:!0,children:t.jsx(Xt,{...s(o,n)})})})}),De=Yt,Ve=e=>{const{getMenuTriggerProps:o}=Re(),{children:n,...s}=e;return t.jsx(Ut,{...o(s),children:n})};Ve.displayName="HeroUI.DropdownTrigger";var eo=Ve,to=(e,o)=>{if(e){const n=Array.isArray(e.children)?e.children:[...e?.items||[]];if(n&&n.length)return n.find(r=>{if(r&&r.key===o)return r})||{}}return null},oo=(e,o,n)=>{const s=n||to(e,o);return s&&s.props&&"closeOnSelect"in s.props?s.props.closeOnSelect:e?.closeOnSelect};function ro(e){var o;const n=be(),{as:s,triggerRef:r,isOpen:c,defaultOpen:l,onOpenChange:h,isDisabled:p,type:u="menu",trigger:i="press",placement:S="bottom",closeOnSelect:b=!0,shouldBlockScroll:P=!0,classNames:k,disableAnimation:j=(o=n?.disableAnimation)!=null?o:!1,onClose:f,className:D,...M}=e,x=s||"div",I=m.useRef(null),d=r||I,v=m.useRef(null),_=m.useRef(null),C=Nt({trigger:i,isOpen:c,defaultOpen:l,onOpenChange:$=>{h?.($),$||f?.()}}),{menuTriggerProps:A,menuProps:a}=_t({type:u,trigger:i,isDisabled:p},C,d),w=m.useMemo(()=>Et({className:D}),[D]),F=$=>{$!==void 0&&!$||b&&C.close()},y=($={})=>{const N=H(M,$);return{state:C,placement:S,ref:_,disableAnimation:j,shouldBlockScroll:P,scrollRef:v,triggerRef:d,...N,classNames:{...k,...$.classNames,content:W(w,k?.content,$.className)}}},T=($={})=>{const{onPress:N,onPressStart:O,...U}=A;return H(U,{isDisabled:p},$)},R=($,N=null)=>({ref:xt(N,v),menuProps:a,closeOnSelect:b,...H($,{onAction:(O,U)=>{const q=oo($,O,U);F(q)},onClose:C.close})});return{Component:x,menuRef:v,menuProps:a,closeOnSelect:b,onClose:C.close,autoFocus:C.focusStrategy||!0,disableAnimation:j,getPopoverProps:y,getMenuProps:R,getMenuTriggerProps:T}}var Le=e=>{const{children:o,...n}=e,s=ro(n),[r,c]=yt.Children.toArray(o);return t.jsx(Bt,{value:s,children:t.jsxs(Kt,{...s.getPopoverProps(),children:[r,c]})})};Le.displayName="HeroUI.Dropdown";var ao=Le;function co(){const{selectConversation:e,deleteConversation:o,newConversation:n,setConversationProperties:s,loadServerConversations:r}=Pt(),c=Ct(),{client:l}=wt();m.useEffect(()=>{r(l)},[r,l]);const h=Ce(a=>a.conversations),p=m.useMemo(()=>Object.entries(h).reverse().map(([a,w])=>({id:a,summary:w.summary,isShared:w.isShared??!1})),[h]),u=Ce(a=>a.currentConversation),[i,S]=m.useState(!1),[b,P]=m.useState(null),[k,j]=m.useState(""),[f,D]=m.useState(!1),M=m.useRef(null),x=i?"Open sidebar":"Close sidebar",I=t.jsx(J,{icon:"heroicons:pencil-square"}),d=(a,w)=>{P(a),j(w??""),D(!0),setTimeout(()=>{M.current?.focus?.(),setTimeout(()=>D(!1),120)},0)},v=a=>{if(b!==a)return;const w=(k||"").trim();w&&s(a,{summary:w}),P(null),j(""),D(!1)},_=()=>{P(null),j(""),D(!1)},C=()=>{const a=n();c($e(a))},A=a=>{e(a),c($e(a))};return t.jsx(fe.div,{initial:!1,animate:{maxWidth:i?"4.5rem":"16rem"},className:"rounded-l-medium border-small border-divider ml-4 flex h-full w-full min-w-[4.5rem] flex-grow flex-col space-y-2 overflow-hidden border-r-0 p-4 py-3",children:t.jsxs(Ie,{children:[t.jsx(we,{content:x,placement:"bottom",children:t.jsx(X,{isIconOnly:!0,"aria-label":x,variant:"ghost",onPress:()=>S(a=>!a),"data-testid":"chat-history-collapse-button",className:"ml-auto",children:t.jsx(J,{icon:i?"heroicons:chevron-double-right":"heroicons:chevron-double-left"})})},"collapse-button"),!i&&t.jsx(fe.p,{initial:!1,animate:{opacity:1,width:"100%",height:"auto"},exit:{opacity:0,width:0,height:0,marginBottom:0},className:"text-small text-foreground truncate leading-5 font-semibold",children:"Conversations"},"conversations"),t.jsx(we,{content:"New conversation",placement:"right",children:t.jsx(X,{"aria-label":"New conversation",variant:"ghost",onPress:C,"data-testid":"chat-history-clear-chat-button",startContent:I,isIconOnly:i,children:!i&&"New conversation"})},"new-conversation-button"),!i&&t.jsx(fe.div,{className:"mt-2 flex flex-1 flex-col gap-2 overflow-auto overflow-x-hidden",initial:!1,animate:{opacity:1,width:"100%"},exit:{opacity:0,width:0},children:p.map(({id:a,summary:w,isShared:F})=>{if($t(a))return null;const y=a===u,T=a===b,R=y?"solid":"light",$=()=>{o(a,l)};return t.jsxs("div",{className:"flex w-full justify-between gap-2",children:[T&&!F?t.jsx(Ft,{ref:M,size:"sm",variant:"bordered",value:k,onChange:N=>j(N.target.value),onBlur:()=>{f||v(a)},onKeyDown:N=>{N.key==="Enter"&&v(a),N.key==="Escape"&&_()},className:"flex-1","data-testid":`input-conversation-${a}`}):t.jsx(X,{variant:R,"aria-label":`Select conversation ${a}`,"data-active":y,onPress:()=>A(a),title:w??a,"data-testid":`select-conversation-${a}`,className:"flex-1 justify-start",startContent:t.jsx(jt,{name:"chatHistory.itemDecorator",disableSkeleton:!0,props:{conversationId:a}}),children:t.jsx("div",{className:"text-small truncate",children:w??a})}),t.jsxs(ao,{children:[t.jsx(eo,{children:t.jsx(X,{isIconOnly:!0,variant:"light","aria-label":`Conversation actions for ${a}`,"data-testid":`dropdown-conversation-${a}`,children:t.jsx(J,{icon:"heroicons:ellipsis-vertical",className:"rotate-90"})})}),F?t.jsx(De,{"aria-label":"Shared conversation actions",children:t.jsx(ve,{className:"text-danger",color:"danger",startContent:t.jsx(J,{icon:"heroicons:x-mark"}),onPress:$,"data-testid":`dismiss-conversation-${a}`,children:"Dismiss"},"dismiss")}):t.jsxs(De,{"aria-label":"Conversation actions",children:[t.jsx(ve,{startContent:t.jsx(J,{icon:"heroicons:pencil-square",className:"mb-0.5"}),onPress:()=>d(a,w??a),"data-testid":`edit-conversation-${a}`,children:"Edit"},"edit"),t.jsx(ve,{className:"text-danger mb-0.5",color:"danger",startContent:t.jsx(J,{icon:"heroicons:trash"}),onPress:()=>o(a,l),"data-testid":`delete-conversation-${a}`,children:"Delete conversation"},"delete")]})]})]},`${a}-${R}`)})},"conversation-list")]})})}export{co as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-B32DGMwk.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-B32DGMwk.js deleted file mode 100644 index 98a3e4c9f9..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-B32DGMwk.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CQEJd7fb.js","assets/index-Be6O1iVd.js","assets/index-CwtSwCGi.css"])))=>i.map(i=>d[i]); -import{r as P,t as ae,k as Xe,Z as W,az as Me,$ as Ze,j as t,q as me,L as xe,n as ye,T as Pe,_ as Ye,s as et,v as R,V as tt,d as X,l as se,aq as Ie,o as ot,H as ke,a9 as rt,J as Ne,aA as at,ac as pe,U as st,X as _e,af as he,aB as nt,aC as lt,ag as it,K as dt,O as be,Q as ct,W as ut,a0 as pt,ah as ft,a2 as K,a3 as Ae,ai as vt,R as ht,aD as bt,a8 as gt,aE as mt,aF as xt,a5 as yt,a as Pt,aw as Ct,i as fe,aG as Ce,aH as ve,D as we,I as Q,as as wt,aI as $t,ay as $e}from"./index-Be6O1iVd.js";import{u as jt,b as St,c as je,d as Dt,e as Mt,m as It,$ as kt,a as Nt}from"./useMenuTriggerState-CF7Kywot.js";import{$ as _t}from"./useSelectableItem-DLYBSIKg.js";import{i as At}from"./chunk-SSA7SXE4-C3U6kJ4J.js";var Ot=(e,r)=>{var n;let s=[];const a=(n=P.Children.map(e,d=>P.isValidElement(d)&&d.type===r?(s.push(d),null):d))==null?void 0:n.filter(Boolean),u=s.length>=0?s:void 0;return[a,u]},Ft=ae({base:["w-full","p-1","min-w-[200px]"]});ae({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","outline-hidden","cursor-pointer","tap-highlight-transparent","data-[pressed=true]:opacity-70",...Xe,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center",title:"flex-1 text-small font-normal truncate",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100"},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{}}},defaultVariants:{variant:"solid",color:"default"},compoundVariants:[{variant:"solid",color:"default",class:{base:"data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"solid",color:"primary",class:{base:"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"solid",color:"warning",class:{base:"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"shadow",color:"default",class:{base:"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"shadow",color:"primary",class:{base:"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"shadow",color:"secondary",class:{base:"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"shadow",color:"success",class:{base:"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"shadow",color:"warning",class:{base:"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"shadow",color:"danger",class:{base:"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"bordered",color:"default",class:{base:"data-[hover=true]:border-default"}},{variant:"bordered",color:"primary",class:{base:"data-[hover=true]:border-primary data-[hover=true]:text-primary"}},{variant:"bordered",color:"secondary",class:{base:"data-[hover=true]:border-secondary data-[hover=true]:text-secondary"}},{variant:"bordered",color:"success",class:{base:"data-[hover=true]:border-success data-[hover=true]:text-success"}},{variant:"bordered",color:"warning",class:{base:"data-[hover=true]:border-warning data-[hover=true]:text-warning"}},{variant:"bordered",color:"danger",class:{base:"data-[hover=true]:border-danger data-[hover=true]:text-danger"}},{variant:"flat",color:"default",class:{base:"data-[hover=true]:bg-default/40 data-[hover=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{base:"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary"}},{variant:"flat",color:"secondary",class:{base:"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary"}},{variant:"flat",color:"success",class:{base:"data-[hover=true]:bg-success/20 data-[hover=true]:text-success "}},{variant:"flat",color:"warning",class:{base:"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning"}},{variant:"flat",color:"danger",class:{base:"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger"}},{variant:"faded",color:"default",class:{base:"data-[hover=true]:text-default-foreground"}},{variant:"faded",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"faded",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"faded",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"faded",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"faded",color:"danger",class:{base:"data-[hover=true]:text-danger"}},{variant:"light",color:"default",class:{base:"data-[hover=true]:text-default-500"}},{variant:"light",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"light",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"light",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"light",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"light",color:"danger",class:{base:"data-[hover=true]:text-danger"}}]});ae({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}});ae({base:"w-full flex flex-col gap-0.5 p-1"});var Et=(e,r)=>{if(!e&&!r)return{};const n=new Set([...Object.keys(e||{}),...Object.keys(r||{})]);return Array.from(n).reduce((s,a)=>({...s,[a]:W(e?.[a],r?.[a])}),{})},[Tt,Oe]=Me({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),Se=()=>Ye(()=>import("./index-CQEJd7fb.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Fe=e=>{const{as:r,children:n,className:s,...a}=e,{Component:u,placement:d,backdrop:h,motionProps:l,disableAnimation:c,getPopoverProps:p,getDialogProps:w,getBackdropProps:b,getContentProps:x,isNonModal:I,onClose:j}=Oe(),f=P.useRef(null),{dialogProps:M,titleProps:D}=Ze({},f),y=w({ref:f,...M,...a}),S=r||u||"div",i=t.jsxs(t.Fragment,{children:[!I&&t.jsx(me,{onDismiss:j}),t.jsx(S,{...y,children:t.jsx("div",{...x({className:s}),children:typeof n=="function"?n(D):n})}),t.jsx(me,{onDismiss:j})]}),v=P.useMemo(()=>h==="transparent"?null:c?t.jsx("div",{...b()}):t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"exit",variants:Pe.fade,...b()})}),[h,c,b]),k=d?et(d==="center"?"top":d):void 0,o=t.jsx(t.Fragment,{children:c?i:t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"initial",style:k,variants:Pe.scaleSpringOpacity,...l,children:i})})});return t.jsxs("div",{...p(),children:[v,o]})};Fe.displayName="HeroUI.PopoverContent";var Rt=Fe,Ee=e=>{var r;const{triggerRef:n,getTriggerProps:s}=Oe(),{children:a,...u}=e,d=P.useMemo(()=>typeof a=="string"?t.jsx("p",{children:a}):P.Children.only(a),[a]),h=(r=d.props.ref)!=null?r:d.ref,{onPress:l,isDisabled:c,...p}=P.useMemo(()=>s(R(u,d.props),h),[s,d.props,u,h]),[,w]=Ot(a,X),{buttonProps:b}=tt({onPress:l,isDisabled:c},n),x=P.useMemo(()=>w?.[0]!==void 0,[w]);return x||delete p.preventFocusOnPress,P.cloneElement(d,R(p,x?{onPress:l,isDisabled:c}:b))};Ee.displayName="HeroUI.PopoverTrigger";var Ht=Ee,Te=se((e,r)=>{const{children:n,...s}=e,a=jt({...s,ref:r}),[u,d]=P.Children.toArray(n),h=t.jsx(ot,{portalContainer:a.portalContainer,children:d});return t.jsxs(Tt,{value:a,children:[u,a.disableAnimation&&a.isOpen?h:t.jsx(Ie,{children:a.isOpen?h:null})]})});Te.displayName="HeroUI.Popover";var Ut=Te,[Kt,Re]=Me({name:"DropdownContext",errorMessage:"useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"});function Bt(e){const{isSelected:r,disableAnimation:n,...s}=e;return t.jsx("svg",{"aria-hidden":"true","data-selected":r,role:"presentation",viewBox:"0 0 17 18",...s,children:t.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:r?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:n?{}:{transition:"stroke-dashoffset 200ms ease"}})})}const He=new WeakMap;function Vt(e,r,n){let{shouldFocusWrap:s=!0,onKeyDown:a,onKeyUp:u,...d}=e;!e["aria-label"]&&e["aria-labelledby"];let h=ke(e,{labelable:!0}),{listProps:l}=rt({...d,ref:n,selectionManager:r.selectionManager,collection:r.collection,disabledKeys:r.disabledKeys,shouldFocusWrap:s,linkBehavior:"override"});return He.set(r,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:Ne(h,{onKeyDown:a,onKeyUp:u},{role:"menu",...l,onKeyDown:c=>{var p;(c.key!=="Escape"||e.shouldUseVirtualFocus)&&((p=l.onKeyDown)===null||p===void 0||p.call(l,c))}})}}function Lt(e,r,n){let{id:s,key:a,closeOnSelect:u,isVirtualized:d,"aria-haspopup":h,onPressStart:l,onPressUp:c,onPress:p,onPressChange:w,onPressEnd:b,onHoverStart:x,onHoverChange:I,onHoverEnd:j,onKeyDown:f,onKeyUp:M,onFocus:D,onFocusChange:y,onBlur:S,selectionManager:i=r.selectionManager}=e,v=!!h,k=v&&e["aria-expanded"]==="true";var o;let C=(o=e.isDisabled)!==null&&o!==void 0?o:i.isDisabled(a);var _;let A=(_=e.isSelected)!==null&&_!==void 0?_:i.isSelected(a),N=He.get(r),g=r.collection.getItem(a),T=e.onClose||N.onClose,B=at(),$=m=>{var J;if(!v){if(!(g==null||(J=g.props)===null||J===void 0)&&J.onAction?g.props.onAction():e.onAction&&e.onAction(a),N.onAction){let ce=N.onAction;ce(a)}m.target instanceof HTMLAnchorElement&&g&&B.open(m.target,m,g.props.href,g.props.routerOptions)}},E="menuitem";v||(i.selectionMode==="single"?E="menuitemradio":i.selectionMode==="multiple"&&(E="menuitemcheckbox"));let O=pe(),H=pe(),q=pe(),V={id:s,"aria-disabled":C||void 0,role:E,"aria-label":e["aria-label"],"aria-labelledby":O,"aria-describedby":[H,q].filter(Boolean).join(" ")||void 0,"aria-controls":e["aria-controls"],"aria-haspopup":h,"aria-expanded":e["aria-expanded"]};i.selectionMode!=="none"&&!v&&(V["aria-checked"]=A),d&&(V["aria-posinset"]=g?.index,V["aria-setsize"]=St(r.collection));let G=m=>{m.pointerType==="keyboard"&&$(m),l?.(m)},Z=()=>{!v&&T&&(u??(i.selectionMode!=="multiple"||i.isLink(a)))&&T()},Y=m=>{m.pointerType==="mouse"&&($(m),Z()),c?.(m)},ne=m=>{m.pointerType!=="keyboard"&&m.pointerType!=="mouse"&&($(m),Z()),p?.(m)},{itemProps:L,isFocused:ee}=_t({id:s,selectionManager:i,key:a,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:N.shouldUseVirtualFocus}),{pressProps:le,isPressed:te}=st({onPressStart:G,onPress:ne,onPressUp:Y,onPressChange:w,onPressEnd:b,isDisabled:C}),{hoverProps:ie}=_e({isDisabled:C,onHoverStart(m){!he()&&!(k&&h)&&(i.setFocused(!0),i.setFocusedKey(a)),x?.(m)},onHoverChange:I,onHoverEnd:j}),{keyboardProps:oe}=nt({onKeyDown:m=>{if(m.repeat){m.continuePropagation();return}switch(m.key){case" ":!C&&i.selectionMode==="none"&&!v&&u!==!1&&T&&T();break;case"Enter":!C&&u!==!1&&!v&&T&&T();break;default:v||m.continuePropagation(),f?.(m);break}},onKeyUp:M}),{focusProps:U}=lt({onBlur:S,onFocus:D,onFocusChange:y}),re=ke(g?.props);delete re.id;let de=it(g?.props);return{menuItemProps:{...V,...Ne(re,de,v?{onFocus:L.onFocus,"data-collection":L["data-collection"],"data-key":L["data-key"]}:L,le,ie,oe,U,N.shouldUseVirtualFocus||v?{onMouseDown:m=>m.preventDefault()}:void 0),tabIndex:L.tabIndex!=null&&k&&!N.shouldUseVirtualFocus?-1:L.tabIndex},labelProps:{id:O},descriptionProps:{id:H},keyboardShortcutProps:{id:q},isFocused:ee,isFocusVisible:ee&&i.isFocused&&he()&&!k,isSelected:A,isPressed:te,isDisabled:C}}function zt(e){let{heading:r,"aria-label":n}=e,s=dt();return{itemProps:{role:"presentation"},headingProps:r?{id:s,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":r?s:void 0}}}function Wt(e){var r,n;const s=be(),[a,u]=ct(e,je.variantKeys),{as:d,item:h,state:l,shortcut:c,description:p,startContent:w,endContent:b,isVirtualized:x,selectedIcon:I,className:j,classNames:f,onAction:M,autoFocus:D,onPress:y,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,onHoverStart:o,onHoverChange:C,onHoverEnd:_,hideSelectedIcon:A=!1,isReadOnly:N=!1,closeOnSelect:g,onClose:T,onClick:B,...$}=a,E=(n=(r=e.disableAnimation)!=null?r:s?.disableAnimation)!=null?n:!1,O=P.useRef(null),H=d||($?.href?"a":"li"),q=typeof H=="string",{rendered:V,key:G}=h,Z=l.disabledKeys.has(G)||e.isDisabled,Y=l.selectionManager.selectionMode!=="none",ne=Dt(),{isFocusVisible:L,focusProps:ee}=ut({autoFocus:D}),le=P.useCallback(F=>{B?.(F),y?.(F)},[B,y]),{isPressed:te,isFocused:ie,isSelected:oe,isDisabled:U,menuItemProps:re,labelProps:de,descriptionProps:m,keyboardShortcutProps:J}=Lt({key:G,onClose:T,isDisabled:Z,onPress:le,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,"aria-label":a["aria-label"],closeOnSelect:g,isVirtualized:x,onAction:M},l,O);let{hoverProps:ce,isHovered:ge}=_e({isDisabled:U,onHoverStart(F){he()||(l.selectionManager.setFocused(!0),l.selectionManager.setFocusedKey(G)),o?.(F)},onHoverChange:C,onHoverEnd:_}),ue=re;const z=P.useMemo(()=>je({...u,isDisabled:U,disableAnimation:E,hasTitleTextChild:typeof V=="string",hasDescriptionTextChild:typeof p=="string"}),[pt(u),U,E,V,p]),ze=W(f?.base,j);N&&(ue=ft(ue));const We=(F={})=>({ref:O,...R(N?{}:ee,Ae($,{enabled:q}),ue,ce,F),"data-focus":K(ie),"data-selectable":K(Y),"data-hover":K(ne?ge||te:ge),"data-disabled":K(U),"data-selected":K(oe),"data-pressed":K(te),"data-focus-visible":K(L),className:z.base({class:W(ze,F.className)})}),qe=(F={})=>({...R(de,F),className:z.title({class:f?.title})}),Ge=(F={})=>({...R(m,F),className:z.description({class:f?.description})}),Je=(F={})=>({...R(J,F),className:z.shortcut({class:f?.shortcut})}),Qe=P.useCallback((F={})=>({"aria-hidden":K(!0),"data-disabled":K(U),className:z.selectedIcon({class:f?.selectedIcon}),...F}),[U,z,f]);return{Component:H,domRef:O,slots:z,classNames:f,isSelectable:Y,isSelected:oe,isDisabled:U,rendered:V,shortcut:c,description:p,startContent:w,endContent:b,selectedIcon:I,disableAnimation:E,getItemProps:We,getLabelProps:qe,hideSelectedIcon:A,getDescriptionProps:Ge,getKeyboardShortcutProps:Je,getSelectedIconProps:Qe}}var Ue=e=>{const{Component:r,slots:n,classNames:s,rendered:a,shortcut:u,description:d,isSelectable:h,isSelected:l,isDisabled:c,selectedIcon:p,startContent:w,endContent:b,disableAnimation:x,hideSelectedIcon:I,getItemProps:j,getLabelProps:f,getDescriptionProps:M,getKeyboardShortcutProps:D,getSelectedIconProps:y}=Wt(e),S=P.useMemo(()=>{const i=t.jsx(Bt,{disableAnimation:x,isSelected:l});return typeof p=="function"?p({icon:i,isSelected:l,isDisabled:c}):p||i},[p,l,c,x]);return t.jsxs(r,{...j(),children:[w,d?t.jsxs("div",{className:n.wrapper({class:s?.wrapper}),children:[t.jsx("span",{...f(),children:a}),t.jsx("span",{...M(),children:d})]}):t.jsx("span",{...f(),children:a}),u&&t.jsx("kbd",{...D(),children:u}),h&&!I&&t.jsx("span",{...y(),children:S}),b]})};Ue.displayName="HeroUI.MenuItem";var Ke=Ue,Be=se(({item:e,state:r,as:n,variant:s,color:a,disableAnimation:u,onAction:d,closeOnSelect:h,className:l,classNames:c,showDivider:p=!1,hideSelectedIcon:w,dividerProps:b={},itemClasses:x,title:I,...j},f)=>{const M=n||"li",D=P.useMemo(()=>Mt(),[]),y=W(c?.base,l),S=W(c?.divider,b?.className),{itemProps:i,headingProps:v,groupProps:k}=zt({heading:e.rendered,"aria-label":e["aria-label"]});return t.jsxs(M,{"data-slot":"base",...R(i,j),className:D.base({class:y}),children:[e.rendered&&t.jsx("span",{...v,className:D.heading({class:c?.heading}),"data-slot":"heading",children:e.rendered}),t.jsxs("ul",{...k,className:D.group({class:c?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(o=>{const{key:C,props:_}=o;let A=t.jsx(Ke,{classNames:x,closeOnSelect:h,color:a,disableAnimation:u,hideSelectedIcon:w,item:o,state:r,variant:s,onAction:d,..._},C);return o.wrapper&&(A=o.wrapper(A)),A}),p&&t.jsx(vt,{as:"li",className:D.divider({class:S}),...b})]})]})});Be.displayName="HeroUI.MenuSection";var qt=Be;function Gt(e){var r;const n=be(),{as:s,ref:a,variant:u,color:d,children:h,disableAnimation:l=(r=n?.disableAnimation)!=null?r:!1,onAction:c,closeOnSelect:p,itemClasses:w,className:b,state:x,topContent:I,bottomContent:j,hideEmptyContent:f=!1,hideSelectedIcon:M=!1,emptyContent:D="No items.",menuProps:y,onClose:S,classNames:i,...v}=e,k=s||"ul",o=ht(a),C=typeof k=="string",_=bt({...v,...y,children:h}),A=x||_,{menuProps:N}=Vt({...v,...y,onAction:c},A,o),g=P.useMemo(()=>It({className:b}),[b]),T=W(i?.base,b);return{Component:k,state:A,variant:u,color:d,disableAnimation:l,onClose:S,topContent:I,bottomContent:j,closeOnSelect:p,className:b,itemClasses:w,getBaseProps:(O={})=>({ref:o,"data-slot":"base",className:g.base({class:T}),...Ae(v,{enabled:C}),...O}),getListProps:(O={})=>({"data-slot":"list",className:g.list({class:i?.list}),...N,...O}),hideEmptyContent:f,hideSelectedIcon:M,getEmptyContentProps:(O={})=>({children:D,className:g.emptyContent({class:i?.emptyContent}),...O})}}var Jt=se(function(r,n){const{Component:s,state:a,closeOnSelect:u,color:d,disableAnimation:h,hideSelectedIcon:l,hideEmptyContent:c,variant:p,onClose:w,topContent:b,bottomContent:x,itemClasses:I,getBaseProps:j,getListProps:f,getEmptyContentProps:M}=Gt({...r,ref:n}),D=t.jsxs(s,{...f(),children:[!a.collection.size&&!c&&t.jsx("li",{children:t.jsx("div",{...M()})}),[...a.collection].map(y=>{const S={closeOnSelect:u,color:d,disableAnimation:h,item:y,state:a,variant:p,onClose:w,hideSelectedIcon:l,...y.props},i=Et(I,S?.classNames);if(y.type==="section")return t.jsx(qt,{...S,itemClasses:i},y.key);let v=t.jsx(Ke,{...S,classNames:i},y.key);return y.wrapper&&(v=y.wrapper(v)),v})]});return t.jsxs("div",{...j(),children:[b,D,x]})}),Qt=Jt,Xt=gt,De=Xt,Zt=se(function(r,n){const{getMenuProps:s}=Re();return t.jsx(Rt,{children:t.jsx(mt,{contain:!0,restoreFocus:!0,children:t.jsx(Qt,{...s(r,n)})})})}),Yt=Zt,Ve=e=>{const{getMenuTriggerProps:r}=Re(),{children:n,...s}=e;return t.jsx(Ht,{...r(s),children:n})};Ve.displayName="HeroUI.DropdownTrigger";var eo=Ve,to=(e,r)=>{if(e){const n=Array.isArray(e.children)?e.children:[...e?.items||[]];if(n&&n.length)return n.find(a=>{if(a&&a.key===r)return a})||{}}return null},oo=(e,r,n)=>{const s=n||to(e,r);return s&&s.props&&"closeOnSelect"in s.props?s.props.closeOnSelect:e?.closeOnSelect};function ro(e){var r;const n=be(),{as:s,triggerRef:a,isOpen:u,defaultOpen:d,onOpenChange:h,isDisabled:l,type:c="menu",trigger:p="press",placement:w="bottom",closeOnSelect:b=!0,shouldBlockScroll:x=!0,classNames:I,disableAnimation:j=(r=n?.disableAnimation)!=null?r:!1,onClose:f,className:M,...D}=e,y=s||"div",S=P.useRef(null),i=a||S,v=P.useRef(null),k=P.useRef(null),o=kt({trigger:p,isOpen:u,defaultOpen:d,onOpenChange:$=>{h?.($),$||f?.()}}),{menuTriggerProps:C,menuProps:_}=Nt({type:c,trigger:p,isDisabled:l},o,i),A=P.useMemo(()=>Ft({className:M}),[M]),N=$=>{$!==void 0&&!$||b&&o.close()},g=($={})=>{const E=R(D,$);return{state:o,placement:w,ref:k,disableAnimation:j,shouldBlockScroll:x,scrollRef:v,triggerRef:i,...E,classNames:{...I,...$.classNames,content:W(A,I?.content,$.className)}}},T=($={})=>{const{onPress:E,onPressStart:O,...H}=C;return R(H,{isDisabled:l},$)},B=($,E=null)=>({ref:xt(E,v),menuProps:_,closeOnSelect:b,...R($,{onAction:(O,H)=>{const q=oo($,O,H);N(q)},onClose:o.close})});return{Component:y,menuRef:v,menuProps:_,closeOnSelect:b,onClose:o.close,autoFocus:o.focusStrategy||!0,disableAnimation:j,getPopoverProps:g,getMenuProps:B,getMenuTriggerProps:T}}var Le=e=>{const{children:r,...n}=e,s=ro(n),[a,u]=yt.Children.toArray(r);return t.jsx(Kt,{value:s,children:t.jsxs(Ut,{...s.getPopoverProps(),children:[a,u]})})};Le.displayName="HeroUI.Dropdown";var ao=Le;function co(){const{selectConversation:e,deleteConversation:r,newConversation:n,setConversationProperties:s}=Pt(),a=Ct(),u=fe(Ce(o=>Object.keys(o.conversations).reverse())),d=fe(Ce(o=>Object.values(o.conversations).reverse().map(C=>C.summary))),h=fe(o=>o.currentConversation),[l,c]=P.useState(!1),[p,w]=P.useState(null),[b,x]=P.useState(""),[I,j]=P.useState(!1),f=P.useRef(null),M=l?"Open sidebar":"Close sidebar",D=t.jsx(Q,{icon:"heroicons:pencil-square"}),y=(o,C)=>{w(o),x(C??""),j(!0),setTimeout(()=>{f.current?.focus?.(),setTimeout(()=>j(!1),120)},0)},S=o=>{if(p!==o)return;const C=(b||"").trim();C&&s(o,{summary:C}),w(null),x(""),j(!1)},i=()=>{w(null),x(""),j(!1)},v=()=>{const o=n();a($e(o))},k=o=>{e(o),a($e(o))};return t.jsx(ve.div,{initial:!1,animate:{maxWidth:l?"4.5rem":"16rem"},className:"rounded-l-medium border-small border-divider ml-4 flex h-full w-full min-w-[4.5rem] flex-grow flex-col space-y-2 overflow-hidden border-r-0 p-4 py-3",children:t.jsxs(Ie,{children:[t.jsx(we,{content:M,placement:"bottom",children:t.jsx(X,{isIconOnly:!0,"aria-label":M,variant:"ghost",onPress:()=>c(o=>!o),"data-testid":"chat-history-collapse-button",className:"ml-auto",children:t.jsx(Q,{icon:l?"heroicons:chevron-double-right":"heroicons:chevron-double-left"})})},"collapse-button"),!l&&t.jsx(ve.p,{initial:!1,animate:{opacity:1,width:"100%",height:"auto"},exit:{opacity:0,width:0,height:0,marginBottom:0},className:"text-small text-foreground truncate leading-5 font-semibold",children:"Conversations"},"conversations"),t.jsx(we,{content:"New conversation",placement:"right",children:t.jsx(X,{"aria-label":"New conversation",variant:"ghost",onPress:v,"data-testid":"chat-history-clear-chat-button",startContent:D,isIconOnly:l,children:!l&&"New conversation"})},"new-conversation-button"),!l&&t.jsx(ve.div,{className:"mt-2 flex flex-1 flex-col gap-2 overflow-auto overflow-x-hidden",initial:!1,animate:{opacity:1,width:"100%"},exit:{opacity:0,width:0},children:wt.zip(u,d).map(([o,C])=>{if(!o||$t(o))return null;const _=o===h,A=o===p,N=_?"solid":"light";return t.jsxs("div",{className:"flex w-full justify-between gap-2",children:[A?t.jsx(At,{ref:f,size:"sm",variant:"bordered",value:b,onChange:g=>x(g.target.value),onBlur:()=>{I||S(o)},onKeyDown:g=>{g.key==="Enter"&&S(o),g.key==="Escape"&&i()},className:"flex-1","data-testid":`input-conversation-${o}`}):t.jsx(X,{variant:N,"aria-label":`Select conversation ${o}`,"data-active":_,onPress:()=>k(o),title:C??o,"data-testid":`select-conversation-${o}`,className:"flex-1 justify-start",children:t.jsx("div",{className:"text-small truncate",children:C??o})}),t.jsxs(ao,{children:[t.jsx(eo,{children:t.jsx(X,{isIconOnly:!0,variant:"light","aria-label":`Conversation actions for ${o}`,"data-testid":`dropdown-conversation-${o}`,children:t.jsx(Q,{icon:"heroicons:ellipsis-vertical",className:"rotate-90"})})}),t.jsxs(Yt,{"aria-label":"Conversation actions",children:[t.jsx(De,{startContent:t.jsx(Q,{icon:"heroicons:pencil-square",className:"mb-0.5"}),onPress:()=>y(o,C??o),"data-testid":`edit-conversation-${o}`,children:"Edit"},"edit"),t.jsx(De,{className:"text-danger mb-0.5",color:"danger",startContent:t.jsx(Q,{icon:"heroicons:trash"}),onPress:()=>r(o),"data-testid":`delete-conversation-${o}`,children:"Delete conversation"},"delete")]})]})]},`${o}-${N}`)})},"conversation-list")]})})}export{co as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DBuZluwC.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DyuNcrHy.js similarity index 94% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DBuZluwC.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DyuNcrHy.js index 5c13b454a0..ef99b66dc6 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DBuZluwC.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DyuNcrHy.js @@ -1 +1 @@ -import{g as z,r as f,u as ie,h as ce,a as ue,i as le,b as fe,p as Y,C as Q,j as l,D as de,d as A,I as me,m as ge,e as he,f as pe}from"./index-Be6O1iVd.js";import{g as Z,v as W,F as ve,t as be}from"./index-BSfI8fMz.js";import{m as Se}from"./chunk-IGSAU2ZA-C95SHugN.js";import"./chunk-SSA7SXE4-C3U6kJ4J.js";import"./useMenuTriggerState-CF7Kywot.js";import"./useSelectableItem-DLYBSIKg.js";import"./index-DImPjBZJ.js";var B,V;function xe(){if(V)return B;V=1;var n="Expected a function",t=NaN,s="[object Symbol]",m=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,i=/^0o[0-7]+$/i,b=parseInt,S=typeof z=="object"&&z&&z.Object===Object&&z,y=typeof self=="object"&&self&&self.Object===Object&&self,C=S||y||Function("return this")(),d=Object.prototype,r=d.toString,c=Math.max,O=Math.min,E=function(){return C.Date.now()};function $(e,u,v){var T,L,P,I,p,j,R=0,G=!1,D=!1,k=!0;if(typeof e!="function")throw new TypeError(n);u=q(u)||0,_(v)&&(G=!!v.leading,D="maxWait"in v,P=D?c(q(v.maxWait)||0,u):P,k="trailing"in v?!!v.trailing:k);function H(o){var x=T,F=L;return T=L=void 0,R=o,I=e.apply(F,x),I}function re(o){return R=o,p=setTimeout(N,u),G?H(o):I}function oe(o){var x=o-j,F=o-R,X=u-x;return D?O(X,P-F):X}function U(o){var x=o-j,F=o-R;return j===void 0||x>=u||x<0||D&&F>=P}function N(){var o=E();if(U(o))return K(o);p=setTimeout(N,oe(o))}function K(o){return p=void 0,k&&T?H(o):(T=L=void 0,I)}function se(){p!==void 0&&clearTimeout(p),R=0,T=j=L=p=void 0}function ae(){return p===void 0?I:K(E())}function M(){var o=E(),x=U(o);if(T=arguments,L=this,j=o,x){if(p===void 0)return re(j);if(D)return p=setTimeout(N,u),H(j)}return p===void 0&&(p=setTimeout(N,u)),I}return M.cancel=se,M.flush=ae,M}function _(e){var u=typeof e;return!!e&&(u=="object"||u=="function")}function a(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||a(e)&&r.call(e)==s}function q(e){if(typeof e=="number")return e;if(w(e))return t;if(_(e)){var u=typeof e.valueOf=="function"?e.valueOf():e;e=_(u)?u+"":u}if(typeof e!="string")return e===0?e:+e;e=e.replace(m,"");var v=h.test(e);return v||i.test(e)?b(e.slice(2),v?2:8):g.test(e)?t:+e}return B=$,B}xe();var ne=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ee(n,t,s,m){const g=f.useRef(t);ne(()=>{g.current=t},[t]),f.useEffect(()=>{const h=window;if(!(h&&h.addEventListener))return;const i=b=>{g.current(b)};return h.addEventListener(n,i,m),()=>{h.removeEventListener(n,i,m)}},[n,s,m])}function te(n){const t=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return ne(()=>{t.current=n},[n]),f.useCallback((...s)=>{var m;return(m=t.current)==null?void 0:m.call(t,...s)},[t])}var J=typeof window>"u";function ye(n,t,s={}){const{initializeWithValue:m=!0}=s,g=f.useCallback(r=>s.serializer?s.serializer(r):JSON.stringify(r),[s]),h=f.useCallback(r=>{if(s.deserializer)return s.deserializer(r);if(r==="undefined")return;const c=t instanceof Function?t():t;let O;try{O=JSON.parse(r)}catch(E){return console.error("Error parsing JSON:",E),c}return O},[s,t]),i=f.useCallback(()=>{const r=t instanceof Function?t():t;if(J)return r;try{const c=window.localStorage.getItem(n);return c?h(c):r}catch(c){return console.warn(`Error reading localStorage key “${n}”:`,c),r}},[t,n,h]),[b,S]=f.useState(()=>m?i():t instanceof Function?t():t),y=te(r=>{J&&console.warn(`Tried setting localStorage key “${n}” even though environment is not a client`);try{const c=r instanceof Function?r(i()):r;window.localStorage.setItem(n,g(c)),S(c),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(c){console.warn(`Error setting localStorage key “${n}”:`,c)}}),C=te(()=>{J&&console.warn(`Tried removing localStorage key “${n}” even though environment is not a client`);const r=t instanceof Function?t():t;window.localStorage.removeItem(n),S(r),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))});f.useEffect(()=>{S(i())},[n]);const d=f.useCallback(r=>{r.key&&r.key!==n||S(i())},[n,i]);return ee("storage",d),ee("local-storage",d),[b,y,C]}const Ce="ragbits-no-history-chat-options";function Le(){const{isOpen:n,onOpen:t,onClose:s}=ie(),m=ce(a=>a.chatOptions),g=f.useRef(null),{setConversationProperties:h,initializeChatOptions:i}=ue(),b=le(a=>a.currentConversation),{config:{user_settings:S}}=fe(),[y,C]=ye(Ce,null),d=S?.form,r=a=>{Y.isPluginActivated(Q.name)||C(a)},c=()=>{t()},O=(a,w)=>{w.preventDefault(),g.current=a.formData,s()},E=()=>{if(!d)return;const a=Z(W,d);g.current=a,s()},$=()=>{s()},_=a=>{if(a!=="exit"||!g.current)return;const w=g.current;h(b,{chatOptions:w}),r(w),g.current=null};return f.useEffect(()=>{if(!d)return;const a=Z(W,d);Y.isPluginActivated(Q.name)?i(a):y!==null?i(y):(i(a),C(a))},[i,d,b,y,C]),d?l.jsxs(l.Fragment,{children:[l.jsx(de,{content:"Chat Options",placement:"bottom",children:l.jsx(A,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open chat options",onPress:c,"data-testid":"open-chat-options",children:l.jsx(me,{icon:"heroicons:cog-6-tooth"})})}),l.jsx(ge,{isOpen:n,onOpenChange:$,motionProps:{onAnimationComplete:_},children:l.jsxs(he,{children:[l.jsx(Se,{className:"text-default-900 flex flex-col gap-1",children:d.title||"Chat Options"}),l.jsx(pe,{children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsx(ve,{schema:d,validator:W,formData:m,onSubmit:O,transformErrors:be,liveValidate:!0,children:l.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[l.jsx(A,{className:"mr-auto",color:"primary",variant:"light",onPress:E,"aria-label":"Restore default user settings",children:"Restore defaults"}),l.jsx(A,{color:"danger",variant:"light",onPress:s,"aria-label":"Close chat options form",children:"Cancel"}),l.jsx(A,{color:"primary",type:"submit","aria-label":"Save chat options","data-testid":"chat-options-submit",children:"Save"})]})})})})]})})]}):null}export{Le as default}; +import{g as z,r as f,u as ie,h as ce,a as ue,i as le,b as fe,p as Y,C as Q,j as l,D as de,d as A,I as me,m as ge,e as he,f as pe}from"./index-DKQs0Q0w.js";import{g as Z,v as W,F as ve,t as be}from"./index-BLcaR0iU.js";import{m as Se}from"./chunk-IGSAU2ZA-B7iwVIJ3.js";import"./chunk-SSA7SXE4-O5iifkg7.js";import"./useMenuTriggerState-DIuhWKKT.js";import"./useSelectableItem-Svsj-E2p.js";import"./index-DgPm4MMk.js";var B,V;function xe(){if(V)return B;V=1;var n="Expected a function",t=NaN,s="[object Symbol]",m=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,i=/^0o[0-7]+$/i,b=parseInt,S=typeof z=="object"&&z&&z.Object===Object&&z,y=typeof self=="object"&&self&&self.Object===Object&&self,C=S||y||Function("return this")(),d=Object.prototype,r=d.toString,c=Math.max,O=Math.min,E=function(){return C.Date.now()};function $(e,u,v){var T,L,P,I,p,j,R=0,G=!1,D=!1,k=!0;if(typeof e!="function")throw new TypeError(n);u=q(u)||0,_(v)&&(G=!!v.leading,D="maxWait"in v,P=D?c(q(v.maxWait)||0,u):P,k="trailing"in v?!!v.trailing:k);function H(o){var x=T,F=L;return T=L=void 0,R=o,I=e.apply(F,x),I}function re(o){return R=o,p=setTimeout(N,u),G?H(o):I}function oe(o){var x=o-j,F=o-R,X=u-x;return D?O(X,P-F):X}function U(o){var x=o-j,F=o-R;return j===void 0||x>=u||x<0||D&&F>=P}function N(){var o=E();if(U(o))return K(o);p=setTimeout(N,oe(o))}function K(o){return p=void 0,k&&T?H(o):(T=L=void 0,I)}function se(){p!==void 0&&clearTimeout(p),R=0,T=j=L=p=void 0}function ae(){return p===void 0?I:K(E())}function M(){var o=E(),x=U(o);if(T=arguments,L=this,j=o,x){if(p===void 0)return re(j);if(D)return p=setTimeout(N,u),H(j)}return p===void 0&&(p=setTimeout(N,u)),I}return M.cancel=se,M.flush=ae,M}function _(e){var u=typeof e;return!!e&&(u=="object"||u=="function")}function a(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||a(e)&&r.call(e)==s}function q(e){if(typeof e=="number")return e;if(w(e))return t;if(_(e)){var u=typeof e.valueOf=="function"?e.valueOf():e;e=_(u)?u+"":u}if(typeof e!="string")return e===0?e:+e;e=e.replace(m,"");var v=h.test(e);return v||i.test(e)?b(e.slice(2),v?2:8):g.test(e)?t:+e}return B=$,B}xe();var ne=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ee(n,t,s,m){const g=f.useRef(t);ne(()=>{g.current=t},[t]),f.useEffect(()=>{const h=window;if(!(h&&h.addEventListener))return;const i=b=>{g.current(b)};return h.addEventListener(n,i,m),()=>{h.removeEventListener(n,i,m)}},[n,s,m])}function te(n){const t=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return ne(()=>{t.current=n},[n]),f.useCallback((...s)=>{var m;return(m=t.current)==null?void 0:m.call(t,...s)},[t])}var J=typeof window>"u";function ye(n,t,s={}){const{initializeWithValue:m=!0}=s,g=f.useCallback(r=>s.serializer?s.serializer(r):JSON.stringify(r),[s]),h=f.useCallback(r=>{if(s.deserializer)return s.deserializer(r);if(r==="undefined")return;const c=t instanceof Function?t():t;let O;try{O=JSON.parse(r)}catch(E){return console.error("Error parsing JSON:",E),c}return O},[s,t]),i=f.useCallback(()=>{const r=t instanceof Function?t():t;if(J)return r;try{const c=window.localStorage.getItem(n);return c?h(c):r}catch(c){return console.warn(`Error reading localStorage key “${n}”:`,c),r}},[t,n,h]),[b,S]=f.useState(()=>m?i():t instanceof Function?t():t),y=te(r=>{J&&console.warn(`Tried setting localStorage key “${n}” even though environment is not a client`);try{const c=r instanceof Function?r(i()):r;window.localStorage.setItem(n,g(c)),S(c),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(c){console.warn(`Error setting localStorage key “${n}”:`,c)}}),C=te(()=>{J&&console.warn(`Tried removing localStorage key “${n}” even though environment is not a client`);const r=t instanceof Function?t():t;window.localStorage.removeItem(n),S(r),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))});f.useEffect(()=>{S(i())},[n]);const d=f.useCallback(r=>{r.key&&r.key!==n||S(i())},[n,i]);return ee("storage",d),ee("local-storage",d),[b,y,C]}const Ce="ragbits-no-history-chat-options";function Le(){const{isOpen:n,onOpen:t,onClose:s}=ie(),m=ce(a=>a.chatOptions),g=f.useRef(null),{setConversationProperties:h,initializeChatOptions:i}=ue(),b=le(a=>a.currentConversation),{config:{user_settings:S}}=fe(),[y,C]=ye(Ce,null),d=S?.form,r=a=>{Y.isPluginActivated(Q.name)||C(a)},c=()=>{t()},O=(a,w)=>{w.preventDefault(),g.current=a.formData,s()},E=()=>{if(!d)return;const a=Z(W,d);g.current=a,s()},$=()=>{s()},_=a=>{if(a!=="exit"||!g.current)return;const w=g.current;h(b,{chatOptions:w}),r(w),g.current=null};return f.useEffect(()=>{if(!d)return;const a=Z(W,d);Y.isPluginActivated(Q.name)?i(a):y!==null?i(y):(i(a),C(a))},[i,d,b,y,C]),d?l.jsxs(l.Fragment,{children:[l.jsx(de,{content:"Chat Options",placement:"bottom",children:l.jsx(A,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open chat options",onPress:c,"data-testid":"open-chat-options",children:l.jsx(me,{icon:"heroicons:cog-6-tooth"})})}),l.jsx(ge,{isOpen:n,onOpenChange:$,motionProps:{onAnimationComplete:_},children:l.jsxs(he,{children:[l.jsx(Se,{className:"text-default-900 flex flex-col gap-1",children:d.title||"Chat Options"}),l.jsx(pe,{children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsx(ve,{schema:d,validator:W,formData:m,onSubmit:O,transformErrors:be,liveValidate:!0,children:l.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[l.jsx(A,{className:"mr-auto",color:"primary",variant:"light",onPress:E,"aria-label":"Restore default user settings",children:"Restore defaults"}),l.jsx(A,{color:"danger",variant:"light",onPress:s,"aria-label":"Close chat options form",children:"Cancel"}),l.jsx(A,{color:"primary",type:"submit","aria-label":"Save chat options","data-testid":"chat-options-submit",children:"Save"})]})})})})]})})]}):null}export{Le as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-DQf8u3KV.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-CPOIKZVK.js similarity index 85% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-DQf8u3KV.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-CPOIKZVK.js index 229812bfc1..d971f08f43 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-DQf8u3KV.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-CPOIKZVK.js @@ -1 +1 @@ -import{r as c,c as x,aW as w,aw as S,j as t,aq as b,aH as j,d as v,bm as C}from"./index-Be6O1iVd.js";import{a as P}from"./authStore-DX4sLJ2o.js";import{u as q}from"./useInitializeUserStore-BqNjwnPQ.js";import{i as m}from"./chunk-SSA7SXE4-C3U6kJ4J.js";function E(){const[s,p]=c.useState({username:"",password:""}),l=x("/api/auth/login",{headers:{"Content-Type":"application/json"},method:"POST"}),f=w(P,e=>e.login),g=S(),u=q(),[y,o]=c.useState(!1),h=async e=>{o(!1),e.preventDefault(),e.stopPropagation();const r=new FormData(e.currentTarget),n=r.get("username"),i=r.get("password");try{const a=await l.call({body:{username:n,password:i}});if(!a.success||!a.user){o(!0);return}f(a.user),u?u(a.user.user_id):console.error("Failed to initialize store for user, initializeUserStore() is not defined. Check current HistoryStoreContextProvider implementation."),g("/")}catch(a){console.error("Failed to login",a),o(!0)}},d=e=>r=>p(n=>C(n,i=>{i[e]=r.target.value}));return t.jsxs("form",{className:"flex w-full flex-col gap-4",onSubmit:h,children:[t.jsx(m,{label:"Username",name:"username",labelPlacement:"outside",placeholder:"Your username",required:!0,isRequired:!0,value:s.username,onChange:d("username")}),t.jsx(m,{label:"Password",labelPlacement:"outside",id:"password",name:"password",type:"password",placeholder:"••••••••",required:!0,isRequired:!0,value:s.password,onChange:d("password")}),t.jsx(b,{children:y&&!l.isLoading&&t.jsx(j.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:"We couldn't sign you in. Please verify your credentials and try again."})}),t.jsx(v,{type:"submit",color:s.password&&s.username?"primary":"default",children:"Sign in"})]})}export{E as default}; +import{r as c,c as x,aX as w,aF as S,j as t,aq as b,aG as j,d as v,bm as C}from"./index-DKQs0Q0w.js";import{a as P}from"./authStore-DVjFDcbE.js";import{u as q}from"./useInitializeUserStore-DHrBxa3t.js";import{i as m}from"./chunk-SSA7SXE4-O5iifkg7.js";function E(){const[s,p]=c.useState({username:"",password:""}),l=x("/api/auth/login",{headers:{"Content-Type":"application/json"},method:"POST"}),f=w(P,e=>e.login),g=S(),u=q(),[y,o]=c.useState(!1),h=async e=>{o(!1),e.preventDefault(),e.stopPropagation();const r=new FormData(e.currentTarget),n=r.get("username"),i=r.get("password");try{const a=await l.call({body:{username:n,password:i}});if(!a.success||!a.user){o(!0);return}f(a.user),u?u(a.user.user_id):console.error("Failed to initialize store for user, initializeUserStore() is not defined. Check current HistoryStoreContextProvider implementation."),g("/")}catch(a){console.error("Failed to login",a),o(!0)}},d=e=>r=>p(n=>C(n,i=>{i[e]=r.target.value}));return t.jsxs("form",{className:"flex w-full flex-col gap-4",onSubmit:h,children:[t.jsx(m,{label:"Username",name:"username",labelPlacement:"outside",placeholder:"Your username",required:!0,isRequired:!0,value:s.username,onChange:d("username")}),t.jsx(m,{label:"Password",labelPlacement:"outside",id:"password",name:"password",type:"password",placeholder:"••••••••",required:!0,isRequired:!0,value:s.password,onChange:d("password")}),t.jsx(b,{children:y&&!l.isLoading&&t.jsx(j.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:"We couldn't sign you in. Please verify your credentials and try again."})}),t.jsx(v,{type:"submit",color:s.password&&s.username?"primary":"default",children:"Sign in"})]})}export{E as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-4ocPbX4e.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DBI-2jGk.js similarity index 86% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-4ocPbX4e.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DBI-2jGk.js index 1be88240cc..952b858b19 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-4ocPbX4e.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DBI-2jGk.js @@ -1 +1 @@ -import{u as g,a as v,b as C,r as T,F as t,c as _,j as e,D as f,d as r,I as b,m as I,e as w,f as D}from"./index-Be6O1iVd.js";import{F as O,t as R,v as S}from"./index-BSfI8fMz.js";import{m as E}from"./chunk-IGSAU2ZA-C95SHugN.js";import"./chunk-SSA7SXE4-C3U6kJ4J.js";import"./useMenuTriggerState-CF7Kywot.js";import"./useSelectableItem-DLYBSIKg.js";import"./index-DImPjBZJ.js";function z({message:s}){const{isOpen:h,onOpen:p,onClose:l}=g(),{mergeExtensions:c}=v(),{config:{feedback:o}}=C(),n=T.useRef(t.Like),k=_("/api/feedback",{headers:{"Content-Type":"application/json"},method:"POST"});if(!s.serverId)return null;const i=o[n.current].form,x=()=>{l()},d=async(a,y)=>{if(!s.serverId)throw new Error('Feedback is only available for messages with "serverId" set');try{await k.call({body:{message_id:s.serverId,feedback:y??n.current,payload:a??{}}})}catch(F){console.error(F)}},j=a=>{c(s.id,{feedbackType:n.current}),d(a.formData),l()},m=async a=>{if(n.current=a,o[a].form===null){c(s.id,{feedbackType:a}),await d(null,a);return}p()},u=s.extensions?.feedbackType;return e.jsxs(e.Fragment,{children:[o.like.enabled&&e.jsx(f,{content:"Like",placement:"bottom",children:e.jsx(r,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as helpful",onPress:()=>m(t.Like),"data-testid":"feedback-like",children:e.jsx(b,{icon:u===t.Like?"heroicons:hand-thumb-up-solid":"heroicons:hand-thumb-up"})})}),o.dislike.enabled&&e.jsx(f,{content:"Dislike",placement:"bottom",children:e.jsx(r,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as unhelpful",onPress:()=>m(t.Dislike),"data-testid":"feedback-dislike",children:e.jsx(b,{icon:u===t.Dislike?"heroicons:hand-thumb-down-solid":"heroicons:hand-thumb-down"})})}),i&&e.jsx(I,{isOpen:h,onOpenChange:x,children:e.jsx(w,{children:a=>e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"text-default-900 flex flex-col gap-1",children:i.title}),e.jsx(D,{children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(O,{schema:i,validator:S,onSubmit:j,transformErrors:R,liveValidate:!0,children:e.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[e.jsx(r,{color:"danger",variant:"light",onPress:a,"aria-label":"Close feedback form",children:"Cancel"}),e.jsx(r,{color:"primary",type:"submit","aria-label":"Submit feedback","data-testid":"feedback-submit",children:"Submit"})]})})})})]})})})]})}export{z as default}; +import{u as g,a as v,b as C,r as T,F as t,c as _,j as e,D as f,d as r,I as b,m as I,e as w,f as D}from"./index-DKQs0Q0w.js";import{F as O,t as R,v as S}from"./index-BLcaR0iU.js";import{m as E}from"./chunk-IGSAU2ZA-B7iwVIJ3.js";import"./chunk-SSA7SXE4-O5iifkg7.js";import"./useMenuTriggerState-DIuhWKKT.js";import"./useSelectableItem-Svsj-E2p.js";import"./index-DgPm4MMk.js";function z({message:s}){const{isOpen:h,onOpen:p,onClose:l}=g(),{mergeExtensions:c}=v(),{config:{feedback:o}}=C(),n=T.useRef(t.Like),k=_("/api/feedback",{headers:{"Content-Type":"application/json"},method:"POST"});if(!s.serverId)return null;const i=o[n.current].form,x=()=>{l()},d=async(a,y)=>{if(!s.serverId)throw new Error('Feedback is only available for messages with "serverId" set');try{await k.call({body:{message_id:s.serverId,feedback:y??n.current,payload:a??{}}})}catch(F){console.error(F)}},j=a=>{c(s.id,{feedbackType:n.current}),d(a.formData),l()},m=async a=>{if(n.current=a,o[a].form===null){c(s.id,{feedbackType:a}),await d(null,a);return}p()},u=s.extensions?.feedbackType;return e.jsxs(e.Fragment,{children:[o.like.enabled&&e.jsx(f,{content:"Like",placement:"bottom",children:e.jsx(r,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as helpful",onPress:()=>m(t.Like),"data-testid":"feedback-like",children:e.jsx(b,{icon:u===t.Like?"heroicons:hand-thumb-up-solid":"heroicons:hand-thumb-up"})})}),o.dislike.enabled&&e.jsx(f,{content:"Dislike",placement:"bottom",children:e.jsx(r,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as unhelpful",onPress:()=>m(t.Dislike),"data-testid":"feedback-dislike",children:e.jsx(b,{icon:u===t.Dislike?"heroicons:hand-thumb-down-solid":"heroicons:hand-thumb-down"})})}),i&&e.jsx(I,{isOpen:h,onOpenChange:x,children:e.jsx(w,{children:a=>e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"text-default-900 flex flex-col gap-1",children:i.title}),e.jsx(D,{children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(O,{schema:i,validator:S,onSubmit:j,transformErrors:R,liveValidate:!0,children:e.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[e.jsx(r,{color:"danger",variant:"light",onPress:a,"aria-label":"Close feedback form",children:"Cancel"}),e.jsx(r,{color:"primary",type:"submit","aria-label":"Submit feedback","data-testid":"feedback-submit",children:"Submit"})]})})})})]})})})]})}export{z as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-DKYXCjKW.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-4ZDD6Yw-.js similarity index 89% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-DKYXCjKW.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-4ZDD6Yw-.js index 601ac9d79a..a6f204da18 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-DKYXCjKW.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-4ZDD6Yw-.js @@ -1 +1 @@ -import{r as s,j as e}from"./index-Be6O1iVd.js";function n({children:t}){return s.useEffect(()=>{document.title="Login"},[]),e.jsx("div",{className:"flex h-screen w-screen",children:e.jsxs("div",{className:"rounded-medium border-small border-divider m-auto flex w-full max-w-xs flex-col gap-4 p-4",children:[e.jsxs("div",{className:"text-small",children:[e.jsx("div",{className:"text-foreground truncate leading-5 font-semibold",children:"Sign in"}),e.jsx("div",{className:"text-default-500 truncate leading-5 font-normal",children:"Sign in to start chatting."})]}),t]})})}export{n as default}; +import{r as s,j as e}from"./index-DKQs0Q0w.js";function n({children:t}){return s.useEffect(()=>{document.title="Login"},[]),e.jsx("div",{className:"flex h-screen w-screen",children:e.jsxs("div",{className:"rounded-medium border-small border-divider m-auto flex w-full max-w-xs flex-col gap-4 p-4",children:[e.jsxs("div",{className:"text-small",children:[e.jsx("div",{className:"text-foreground truncate leading-5 font-semibold",children:"Sign in"}),e.jsx("div",{className:"text-default-500 truncate leading-5 font-normal",children:"Sign in to start chatting."})]}),t]})})}export{n as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-CLxY8Frn.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-DGc7NGn7.js similarity index 80% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-CLxY8Frn.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-DGc7NGn7.js index 0a1d29c340..6eb2576468 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-CLxY8Frn.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-DGc7NGn7.js @@ -1 +1 @@ -import{c,aW as a,aw as l,j as o,D as g,d,I as h}from"./index-Be6O1iVd.js";import{a as s}from"./authStore-DX4sLJ2o.js";function m(){const n=c("/api/auth/logout",{headers:{"Content-Type":"application/json"},method:"POST"}),r=a(s,t=>t.logout),u=a(s,t=>t.isAuthenticated),e=l(),i=async()=>{if(!u){e("/login");return}try{if(!(await n.call()).success)return;r(),e("/login")}catch(t){console.error("Failed to logout",t)}};return o.jsx(g,{content:"Logout",placement:"bottom",children:o.jsx(d,{isIconOnly:!0,"aria-label":"Logout",variant:"ghost",onPress:i,"data-testid":"logout-button",children:o.jsx(h,{icon:"heroicons:arrow-left-start-on-rectangle"})})})}export{m as default}; +import{c,aX as a,aF as l,j as o,D as g,d,I as h}from"./index-DKQs0Q0w.js";import{a as s}from"./authStore-DVjFDcbE.js";function m(){const n=c("/api/auth/logout",{headers:{"Content-Type":"application/json"},method:"POST"}),r=a(s,t=>t.logout),u=a(s,t=>t.isAuthenticated),e=l(),i=async()=>{if(!u){e("/login");return}try{if(!(await n.call()).success)return;r(),e("/login")}catch(t){console.error("Failed to logout",t)}};return o.jsx(g,{content:"Logout",placement:"bottom",children:o.jsx(d,{isIconOnly:!0,"aria-label":"Logout",variant:"ghost",onPress:i,"data-testid":"logout-button",children:o.jsx(h,{icon:"heroicons:arrow-left-start-on-rectangle"})})})}export{m as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-BaGretpd.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-CpVTPKIn.js similarity index 93% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-BaGretpd.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-CpVTPKIn.js index 6ed23ab0ec..207b639386 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-BaGretpd.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-CpVTPKIn.js @@ -1,2 +1,2 @@ -import{ar as An,r as K,c as Sn,j as le,aq as Rn,aH as yn,d as On}from"./index-Be6O1iVd.js";var $e,Ct;function Nt(){if(Ct)return $e;Ct=1;const{entries:Z,setPrototypeOf:M,isFrozen:w,getPrototypeOf:Oe,getOwnPropertyDescriptor:ce}=Object;let{freeze:T,seal:y,create:x}=Object,{apply:z,construct:G}=typeof Reflect<"u"&&Reflect;T||(T=function(o){return o}),y||(y=function(o){return o}),z||(z=function(o,l){for(var r=arguments.length,c=new Array(r>2?r-2:0),O=2;O1?l-1:0),c=1;c1?l-1:0),c=1;c2&&arguments[2]!==void 0?arguments[2]:me;M&&M(s,null);let r=o.length;for(;r--;){let c=o[r];if(typeof c=="string"){const O=l(c);O!==c&&(w(o)||(o[r]=O),c=O)}s[c]=!0}return s}function kt(s){for(let o=0;o/gm),Gt=y(/\$\{[\w\W]*/gm),Wt=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bt=y(/^aria-[\-\w]+$/),Qe=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yt=y(/^(?:\w+script|data):/i),jt=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),et=y(/^html$/i),Xt=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var tt=Object.freeze({__proto__:null,ARIA_ATTR:Bt,ATTR_WHITESPACE:jt,CUSTOM_ELEMENT:Xt,DATA_ATTR:Wt,DOCTYPE_NAME:et,ERB_EXPR:zt,IS_ALLOWED_URI:Qe,IS_SCRIPT_OR_DATA:Yt,MUSTACHE_EXPR:Ht,TMPLIT_EXPR:Gt});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},$t=function(){return typeof window>"u"?null:window},qt=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const c="data-tt-policy-suffix";l&&l.hasAttribute(c)&&(r=l.getAttribute(c));const O="dompurify"+(r?"#"+r:"");try{return o.createPolicy(O,{createHTML(B){return B},createScriptURL(B){return B}})}catch{return console.warn("TrustedTypes policy "+O+" could not be created."),null}},nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ot(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t();const o=i=>ot(i);if(o.version="3.3.3",o.removed=[],!s||!s.document||s.document.nodeType!==te.document||!s.Element)return o.isSupported=!1,o;let{document:l}=s;const r=l,c=r.currentScript,{DocumentFragment:O,HTMLTemplateElement:B,Node:Me,Element:it,NodeFilter:ne,NamedNodeMap:Kt=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:Zt,DOMParser:Jt,trustedTypes:de}=s,oe=it.prototype,Qt=ee(oe,"cloneNode"),en=ee(oe,"remove"),tn=ee(oe,"nextSibling"),nn=ee(oe,"childNodes"),Te=ee(oe,"parentNode");if(typeof B=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let S,ie="";const{implementation:we,createNodeIterator:on,createDocumentFragment:rn,getElementsByTagName:an}=l,{importNode:sn}=r;let R=nt();o.isSupported=typeof Z=="function"&&typeof Te=="function"&&we&&we.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:xe,ERB_EXPR:Pe,TMPLIT_EXPR:ve,DATA_ATTR:ln,ARIA_ATTR:cn,IS_SCRIPT_OR_DATA:un,ATTR_WHITESPACE:rt,CUSTOM_ELEMENT:fn}=tt;let{IS_ALLOWED_URI:at}=tt,d=null;const st=a({},[...Ve,...Le,...Ie,...Ce,...Ke]);let E=null;const lt=a({},[...Ze,...Ne,...Je,...pe]);let f=Object.seal(x(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,Ee=null;const F=Object.seal(x(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ct=!0,ke=!0,ut=!1,ft=!0,Y=!1,_e=!0,U=!1,Fe=!1,Ue=!1,j=!1,he=!1,ge=!1,mt=!0,pt=!1;const mn="user-content-";let He=!0,ae=!1,X={},C=null;const ze=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let dt=null;const Tt=a({},["audio","video","img","source","image","track"]);let Ge=null;const Et=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ae="http://www.w3.org/1998/Math/MathML",Se="http://www.w3.org/2000/svg",P="http://www.w3.org/1999/xhtml";let $=P,We=!1,Be=null;const pn=a({},[Ae,Se,P],De);let Re=a({},["mi","mo","mn","ms","mtext"]),ye=a({},["annotation-xml"]);const dn=a({},["title","style","font","a","script"]);let se=null;const Tn=["application/xhtml+xml","text/html"],En="text/html";let p=null,q=null;const _n=l.createElement("form"),_t=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(q&&q===e)){if((!e||typeof e!="object")&&(e={}),e=I(e),se=Tn.indexOf(e.PARSER_MEDIA_TYPE)===-1?En:e.PARSER_MEDIA_TYPE,p=se==="application/xhtml+xml"?De:me,d=L(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,p):st,E=L(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,p):lt,Be=L(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,De):pn,Ge=L(e,"ADD_URI_SAFE_ATTR")?a(I(Et),e.ADD_URI_SAFE_ATTR,p):Et,dt=L(e,"ADD_DATA_URI_TAGS")?a(I(Tt),e.ADD_DATA_URI_TAGS,p):Tt,C=L(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,p):ze,re=L(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,p):I({}),Ee=L(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,p):I({}),X=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,ct=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=e.SAFE_FOR_TEMPLATES||!1,_e=e.SAFE_FOR_XML!==!1,U=e.WHOLE_DOCUMENT||!1,j=e.RETURN_DOM||!1,he=e.RETURN_DOM_FRAGMENT||!1,ge=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,mt=e.SANITIZE_DOM!==!1,pt=e.SANITIZE_NAMED_PROPS||!1,He=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,at=e.ALLOWED_URI_REGEXP||Qe,$=e.NAMESPACE||P,Re=e.MATHML_TEXT_INTEGRATION_POINTS||Re,ye=e.HTML_INTEGRATION_POINTS||ye,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ke=!1),he&&(j=!0),X&&(d=a({},Ke),E=x(null),X.html===!0&&(a(d,Ve),a(E,Ze)),X.svg===!0&&(a(d,Le),a(E,Ne),a(E,pe)),X.svgFilters===!0&&(a(d,Ie),a(E,Ne),a(E,pe)),X.mathMl===!0&&(a(d,Ce),a(E,Je),a(E,pe))),L(e,"ADD_TAGS")||(F.tagCheck=null),L(e,"ADD_ATTR")||(F.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?F.tagCheck=e.ADD_TAGS:(d===st&&(d=I(d)),a(d,e.ADD_TAGS,p))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?F.attributeCheck=e.ADD_ATTR:(E===lt&&(E=I(E)),a(E,e.ADD_ATTR,p))),e.ADD_URI_SAFE_ATTR&&a(Ge,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(C===ze&&(C=I(C)),a(C,e.FORBID_CONTENTS,p)),e.ADD_FORBID_CONTENTS&&(C===ze&&(C=I(C)),a(C,e.ADD_FORBID_CONTENTS,p)),He&&(d["#text"]=!0),U&&a(d,["html","head","body"]),d.table&&(a(d,["tbody"]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=e.TRUSTED_TYPES_POLICY,ie=S.createHTML("")}else S===void 0&&(S=qt(de,c)),S!==null&&typeof ie=="string"&&(ie=S.createHTML(""));T&&T(e),q=e}},ht=a({},[...Le,...Ie,...Ft]),gt=a({},[...Ce,...Ut]),hn=function(e){let t=Te(e);(!t||!t.tagName)&&(t={namespaceURI:$,tagName:"template"});const n=me(e.tagName),u=me(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Se?t.namespaceURI===P?n==="svg":t.namespaceURI===Ae?n==="svg"&&(u==="annotation-xml"||Re[u]):!!ht[n]:e.namespaceURI===Ae?t.namespaceURI===P?n==="math":t.namespaceURI===Se?n==="math"&&ye[u]:!!gt[n]:e.namespaceURI===P?t.namespaceURI===Se&&!ye[u]||t.namespaceURI===Ae&&!Re[u]?!1:!gt[n]&&(dn[n]||!ht[n]):!!(se==="application/xhtml+xml"&&Be[e.namespaceURI]):!1},N=function(e){b(o.removed,{element:e});try{Te(e).removeChild(e)}catch{en(e)}},H=function(e,t){try{b(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{b(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(j||he)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},At=function(e){let t=null,n=null;if(Ue)e=""+e;else{const m=be(e,/^[\r\n\t ]+/);n=m&&m[0]}se==="application/xhtml+xml"&&$===P&&(e=''+e+"");const u=S?S.createHTML(e):e;if($===P)try{t=new Jt().parseFromString(u,se)}catch{}if(!t||!t.documentElement){t=we.createDocument($,"template",null);try{t.documentElement.innerHTML=We?ie:u}catch{}}const h=t.body||t.documentElement;return e&&n&&h.insertBefore(l.createTextNode(n),h.childNodes[0]||null),$===P?an.call(t,U?"html":"body")[0]:U?t.documentElement:h},St=function(e){return on.call(e.ownerDocument||e,e,ne.SHOW_ELEMENT|ne.SHOW_COMMENT|ne.SHOW_TEXT|ne.SHOW_PROCESSING_INSTRUCTION|ne.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof Zt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Kt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Rt=function(e){return typeof Me=="function"&&e instanceof Me};function v(i,e,t){W(i,n=>{n.call(o,e,t,q)})}const yt=function(e){let t=null;if(v(R.beforeSanitizeElements,e,null),je(e))return N(e),!0;const n=p(e.nodeName);if(v(R.uponSanitizeElement,e,{tagName:n,allowedTags:d}),_e&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&g(/<[/\w!]/g,e.innerHTML)&&g(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||_e&&e.nodeType===te.comment&&g(/<[/\w]/g,e.data))return N(e),!0;if(!(F.tagCheck instanceof Function&&F.tagCheck(n))&&(!d[n]||re[n])){if(!re[n]&&Dt(n)&&(f.tagNameCheck instanceof RegExp&&g(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(He&&!C[n]){const u=Te(e)||e.parentNode,h=nn(e)||e.childNodes;if(h&&u){const m=h.length;for(let D=m-1;D>=0;--D){const k=Qt(h[D],!0);k.__removalCount=(e.__removalCount||0)+1,u.insertBefore(k,tn(e))}}}return N(e),!0}return e instanceof it&&!hn(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&g(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(Y&&e.nodeType===te.text&&(t=e.textContent,W([xe,Pe,ve],u=>{t=J(t,u," ")}),e.textContent!==t&&(b(o.removed,{element:e.cloneNode()}),e.textContent=t)),v(R.afterSanitizeElements,e,null),!1)},Ot=function(e,t,n){if(Ee[t]||mt&&(t==="id"||t==="name")&&(n in l||n in _n))return!1;if(!(ke&&!Ee[t]&&g(ln,t))){if(!(ct&&g(cn,t))){if(!(F.attributeCheck instanceof Function&&F.attributeCheck(t,e))){if(!E[t]||Ee[t]){if(!(Dt(e)&&(f.tagNameCheck instanceof RegExp&&g(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&g(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t,e))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&g(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Ge[t]){if(!g(at,J(n,rt,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&xt(n,"data:")===0&&dt[e])){if(!(ut&&!g(un,J(n,rt,"")))){if(n)return!1}}}}}}}return!0},Dt=function(e){return e!=="annotation-xml"&&be(e,fn)},bt=function(e){v(R.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let u=t.length;for(;u--;){const h=t[u],{name:m,namespaceURI:D,value:k}=h,V=p(m),Xe=k;let _=m==="value"?Xe:Pt(Xe);if(n.attrName=V,n.attrValue=_,n.keepAttr=!0,n.forceKeepAttr=void 0,v(R.uponSanitizeAttribute,e,n),_=n.attrValue,pt&&(V==="id"||V==="name")&&(H(m,e),_=mn+_),_e&&g(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_)){H(m,e);continue}if(V==="attributename"&&be(_,"href")){H(m,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){H(m,e);continue}if(!ft&&g(/\/>/i,_)){H(m,e);continue}Y&&W([xe,Pe,ve],It=>{_=J(_,It," ")});const Lt=p(e.nodeName);if(!Ot(Lt,V,_)){H(m,e);continue}if(S&&typeof de=="object"&&typeof de.getAttributeType=="function"&&!D)switch(de.getAttributeType(Lt,V)){case"TrustedHTML":{_=S.createHTML(_);break}case"TrustedScriptURL":{_=S.createScriptURL(_);break}}if(_!==Xe)try{D?e.setAttributeNS(D,m,_):e.setAttribute(m,_),je(e)?N(e):fe(o.removed)}catch{H(m,e)}}v(R.afterSanitizeAttributes,e,null)},gn=function i(e){let t=null;const n=St(e);for(v(R.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)v(R.uponSanitizeShadowNode,t,null),yt(t),bt(t),t.content instanceof O&&i(t.content);v(R.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,u=null,h=null;if(We=!i,We&&(i=""),typeof i!="string"&&!Rt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!o.isSupported)return i;if(Fe||Ye(e),o.removed=[],typeof i=="string"&&(ae=!1),ae){if(i.nodeName){const k=p(i.nodeName);if(!d[k]||re[k])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof Me)t=At(""),n=t.ownerDocument.importNode(i,!0),n.nodeType===te.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!j&&!Y&&!U&&i.indexOf("<")===-1)return S&&ge?S.createHTML(i):i;if(t=At(i),!t)return j?null:ge?ie:""}t&&Ue&&N(t.firstChild);const m=St(ae?i:t);for(;u=m.nextNode();)yt(u),bt(u),u.content instanceof O&&gn(u.content);if(ae)return i;if(j){if(he)for(h=rn.call(t.ownerDocument);t.firstChild;)h.appendChild(t.firstChild);else h=t;return(E.shadowroot||E.shadowrootmode)&&(h=sn.call(r,h,!0)),h}let D=U?t.outerHTML:t.innerHTML;return U&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&g(et,t.ownerDocument.doctype.name)&&(D=" -`+D),Y&&W([xe,Pe,ve],k=>{D=J(D,k," ")}),S&&ge?S.createHTML(D):D},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye(i),Fe=!0},o.clearConfig=function(){q=null,Fe=!1},o.isValidAttribute=function(i,e,t){q||Ye({});const n=p(i),u=p(e);return Ot(n,u,t)},o.addHook=function(i,e){typeof e=="function"&&b(R[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=ue(R[i],e);return t===-1?void 0:wt(R[i],t,1)[0]}return fe(R[i])},o.removeHooks=function(i){R[i]=[]},o.removeAllHooks=function(){R=nt()},o}var Vt=ot();return $e=Vt,$e}var qe,Mt;function Dn(){return Mt||(Mt=1,qe=self.DOMPurify||(self.DOMPurify=Nt().default||Nt())),qe}var bn=Dn();const Ln=An(bn);function Cn({provider:Z,displayName:M,visualConfig:w}){const[Oe,ce]=K.useState(!1),[T,y]=K.useState(""),[x,z]=K.useState(!1),G=Sn("/api/auth/authorize/:provider"),W=K.useCallback(async()=>{ce(!1),z(!0);try{const b=await G.call({pathParams:{provider:Z}});if(!b.authorize_url)throw new Error(`Failed to get ${M} authorization URL`);window.location.href=b.authorize_url}catch(b){ce(!0),y(`Failed to initiate ${M} login: ${b}`),console.error(`Failed to start ${M} login`,b)}finally{z(!1)}},[G,M,Z]),ue=K.useMemo(()=>{if(w?.buttonColor)return{backgroundColor:w.buttonColor,color:w.textColor||"#FFFFFF"}},[w]),fe=K.useMemo(()=>{if(x||!w?.iconSvg)return null;const b=Ln.sanitize(w.iconSvg,{USE_PROFILES:{svg:!0}});return le.jsx("span",{className:"flex items-center justify-center",dangerouslySetInnerHTML:{__html:b}})},[x,w?.iconSvg]);return le.jsxs("div",{className:"flex flex-col gap-4",children:[le.jsx(Rn,{children:Oe&&le.jsx(yn.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:T||`Failed to sign in with ${M}`})}),le.jsx(On,{onPress:W,color:ue?void 0:"primary",style:ue,isLoading:x,startContent:fe,children:x?"Redirecting...":`Sign in with ${M}`})]})}export{Cn as default}; +import{ar as An,r as K,c as Sn,j as le,aq as Rn,aG as yn,d as On}from"./index-DKQs0Q0w.js";var $e,Ct;function Nt(){if(Ct)return $e;Ct=1;const{entries:Z,setPrototypeOf:M,isFrozen:w,getPrototypeOf:Oe,getOwnPropertyDescriptor:ce}=Object;let{freeze:T,seal:y,create:x}=Object,{apply:H,construct:G}=typeof Reflect<"u"&&Reflect;T||(T=function(o){return o}),y||(y=function(o){return o}),H||(H=function(o,l){for(var r=arguments.length,c=new Array(r>2?r-2:0),O=2;O1?l-1:0),c=1;c1?l-1:0),c=1;c2&&arguments[2]!==void 0?arguments[2]:me;M&&M(s,null);let r=o.length;for(;r--;){let c=o[r];if(typeof c=="string"){const O=l(c);O!==c&&(w(o)||(o[r]=O),c=O)}s[c]=!0}return s}function kt(s){for(let o=0;o/gm),Gt=y(/\$\{[\w\W]*/gm),Wt=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bt=y(/^aria-[\-\w]+$/),Qe=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yt=y(/^(?:\w+script|data):/i),jt=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),et=y(/^html$/i),Xt=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var tt=Object.freeze({__proto__:null,ARIA_ATTR:Bt,ATTR_WHITESPACE:jt,CUSTOM_ELEMENT:Xt,DATA_ATTR:Wt,DOCTYPE_NAME:et,ERB_EXPR:Ht,IS_ALLOWED_URI:Qe,IS_SCRIPT_OR_DATA:Yt,MUSTACHE_EXPR:zt,TMPLIT_EXPR:Gt});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},$t=function(){return typeof window>"u"?null:window},qt=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const c="data-tt-policy-suffix";l&&l.hasAttribute(c)&&(r=l.getAttribute(c));const O="dompurify"+(r?"#"+r:"");try{return o.createPolicy(O,{createHTML(B){return B},createScriptURL(B){return B}})}catch{return console.warn("TrustedTypes policy "+O+" could not be created."),null}},nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ot(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t();const o=i=>ot(i);if(o.version="3.3.3",o.removed=[],!s||!s.document||s.document.nodeType!==te.document||!s.Element)return o.isSupported=!1,o;let{document:l}=s;const r=l,c=r.currentScript,{DocumentFragment:O,HTMLTemplateElement:B,Node:Me,Element:it,NodeFilter:ne,NamedNodeMap:Kt=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:Zt,DOMParser:Jt,trustedTypes:de}=s,oe=it.prototype,Qt=ee(oe,"cloneNode"),en=ee(oe,"remove"),tn=ee(oe,"nextSibling"),nn=ee(oe,"childNodes"),Te=ee(oe,"parentNode");if(typeof B=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let S,ie="";const{implementation:we,createNodeIterator:on,createDocumentFragment:rn,getElementsByTagName:an}=l,{importNode:sn}=r;let R=nt();o.isSupported=typeof Z=="function"&&typeof Te=="function"&&we&&we.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:xe,ERB_EXPR:Pe,TMPLIT_EXPR:ve,DATA_ATTR:ln,ARIA_ATTR:cn,IS_SCRIPT_OR_DATA:un,ATTR_WHITESPACE:rt,CUSTOM_ELEMENT:fn}=tt;let{IS_ALLOWED_URI:at}=tt,d=null;const st=a({},[...Ve,...Le,...Ie,...Ce,...Ke]);let E=null;const lt=a({},[...Ze,...Ne,...Je,...pe]);let f=Object.seal(x(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,Ee=null;const F=Object.seal(x(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ct=!0,ke=!0,ut=!1,ft=!0,Y=!1,_e=!0,U=!1,Fe=!1,Ue=!1,j=!1,he=!1,ge=!1,mt=!0,pt=!1;const mn="user-content-";let ze=!0,ae=!1,X={},C=null;const He=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let dt=null;const Tt=a({},["audio","video","img","source","image","track"]);let Ge=null;const Et=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ae="http://www.w3.org/1998/Math/MathML",Se="http://www.w3.org/2000/svg",P="http://www.w3.org/1999/xhtml";let $=P,We=!1,Be=null;const pn=a({},[Ae,Se,P],De);let Re=a({},["mi","mo","mn","ms","mtext"]),ye=a({},["annotation-xml"]);const dn=a({},["title","style","font","a","script"]);let se=null;const Tn=["application/xhtml+xml","text/html"],En="text/html";let p=null,q=null;const _n=l.createElement("form"),_t=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(q&&q===e)){if((!e||typeof e!="object")&&(e={}),e=I(e),se=Tn.indexOf(e.PARSER_MEDIA_TYPE)===-1?En:e.PARSER_MEDIA_TYPE,p=se==="application/xhtml+xml"?De:me,d=L(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,p):st,E=L(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,p):lt,Be=L(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,De):pn,Ge=L(e,"ADD_URI_SAFE_ATTR")?a(I(Et),e.ADD_URI_SAFE_ATTR,p):Et,dt=L(e,"ADD_DATA_URI_TAGS")?a(I(Tt),e.ADD_DATA_URI_TAGS,p):Tt,C=L(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,p):He,re=L(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,p):I({}),Ee=L(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,p):I({}),X=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,ct=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=e.SAFE_FOR_TEMPLATES||!1,_e=e.SAFE_FOR_XML!==!1,U=e.WHOLE_DOCUMENT||!1,j=e.RETURN_DOM||!1,he=e.RETURN_DOM_FRAGMENT||!1,ge=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,mt=e.SANITIZE_DOM!==!1,pt=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,at=e.ALLOWED_URI_REGEXP||Qe,$=e.NAMESPACE||P,Re=e.MATHML_TEXT_INTEGRATION_POINTS||Re,ye=e.HTML_INTEGRATION_POINTS||ye,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ke=!1),he&&(j=!0),X&&(d=a({},Ke),E=x(null),X.html===!0&&(a(d,Ve),a(E,Ze)),X.svg===!0&&(a(d,Le),a(E,Ne),a(E,pe)),X.svgFilters===!0&&(a(d,Ie),a(E,Ne),a(E,pe)),X.mathMl===!0&&(a(d,Ce),a(E,Je),a(E,pe))),L(e,"ADD_TAGS")||(F.tagCheck=null),L(e,"ADD_ATTR")||(F.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?F.tagCheck=e.ADD_TAGS:(d===st&&(d=I(d)),a(d,e.ADD_TAGS,p))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?F.attributeCheck=e.ADD_ATTR:(E===lt&&(E=I(E)),a(E,e.ADD_ATTR,p))),e.ADD_URI_SAFE_ATTR&&a(Ge,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(C===He&&(C=I(C)),a(C,e.FORBID_CONTENTS,p)),e.ADD_FORBID_CONTENTS&&(C===He&&(C=I(C)),a(C,e.ADD_FORBID_CONTENTS,p)),ze&&(d["#text"]=!0),U&&a(d,["html","head","body"]),d.table&&(a(d,["tbody"]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=e.TRUSTED_TYPES_POLICY,ie=S.createHTML("")}else S===void 0&&(S=qt(de,c)),S!==null&&typeof ie=="string"&&(ie=S.createHTML(""));T&&T(e),q=e}},ht=a({},[...Le,...Ie,...Ft]),gt=a({},[...Ce,...Ut]),hn=function(e){let t=Te(e);(!t||!t.tagName)&&(t={namespaceURI:$,tagName:"template"});const n=me(e.tagName),u=me(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Se?t.namespaceURI===P?n==="svg":t.namespaceURI===Ae?n==="svg"&&(u==="annotation-xml"||Re[u]):!!ht[n]:e.namespaceURI===Ae?t.namespaceURI===P?n==="math":t.namespaceURI===Se?n==="math"&&ye[u]:!!gt[n]:e.namespaceURI===P?t.namespaceURI===Se&&!ye[u]||t.namespaceURI===Ae&&!Re[u]?!1:!gt[n]&&(dn[n]||!ht[n]):!!(se==="application/xhtml+xml"&&Be[e.namespaceURI]):!1},N=function(e){b(o.removed,{element:e});try{Te(e).removeChild(e)}catch{en(e)}},z=function(e,t){try{b(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{b(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(j||he)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},At=function(e){let t=null,n=null;if(Ue)e=""+e;else{const m=be(e,/^[\r\n\t ]+/);n=m&&m[0]}se==="application/xhtml+xml"&&$===P&&(e=''+e+"");const u=S?S.createHTML(e):e;if($===P)try{t=new Jt().parseFromString(u,se)}catch{}if(!t||!t.documentElement){t=we.createDocument($,"template",null);try{t.documentElement.innerHTML=We?ie:u}catch{}}const h=t.body||t.documentElement;return e&&n&&h.insertBefore(l.createTextNode(n),h.childNodes[0]||null),$===P?an.call(t,U?"html":"body")[0]:U?t.documentElement:h},St=function(e){return on.call(e.ownerDocument||e,e,ne.SHOW_ELEMENT|ne.SHOW_COMMENT|ne.SHOW_TEXT|ne.SHOW_PROCESSING_INSTRUCTION|ne.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof Zt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Kt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Rt=function(e){return typeof Me=="function"&&e instanceof Me};function v(i,e,t){W(i,n=>{n.call(o,e,t,q)})}const yt=function(e){let t=null;if(v(R.beforeSanitizeElements,e,null),je(e))return N(e),!0;const n=p(e.nodeName);if(v(R.uponSanitizeElement,e,{tagName:n,allowedTags:d}),_e&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&g(/<[/\w!]/g,e.innerHTML)&&g(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||_e&&e.nodeType===te.comment&&g(/<[/\w]/g,e.data))return N(e),!0;if(!(F.tagCheck instanceof Function&&F.tagCheck(n))&&(!d[n]||re[n])){if(!re[n]&&Dt(n)&&(f.tagNameCheck instanceof RegExp&&g(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(ze&&!C[n]){const u=Te(e)||e.parentNode,h=nn(e)||e.childNodes;if(h&&u){const m=h.length;for(let D=m-1;D>=0;--D){const k=Qt(h[D],!0);k.__removalCount=(e.__removalCount||0)+1,u.insertBefore(k,tn(e))}}}return N(e),!0}return e instanceof it&&!hn(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&g(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(Y&&e.nodeType===te.text&&(t=e.textContent,W([xe,Pe,ve],u=>{t=J(t,u," ")}),e.textContent!==t&&(b(o.removed,{element:e.cloneNode()}),e.textContent=t)),v(R.afterSanitizeElements,e,null),!1)},Ot=function(e,t,n){if(Ee[t]||mt&&(t==="id"||t==="name")&&(n in l||n in _n))return!1;if(!(ke&&!Ee[t]&&g(ln,t))){if(!(ct&&g(cn,t))){if(!(F.attributeCheck instanceof Function&&F.attributeCheck(t,e))){if(!E[t]||Ee[t]){if(!(Dt(e)&&(f.tagNameCheck instanceof RegExp&&g(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&g(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t,e))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&g(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Ge[t]){if(!g(at,J(n,rt,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&xt(n,"data:")===0&&dt[e])){if(!(ut&&!g(un,J(n,rt,"")))){if(n)return!1}}}}}}}return!0},Dt=function(e){return e!=="annotation-xml"&&be(e,fn)},bt=function(e){v(R.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let u=t.length;for(;u--;){const h=t[u],{name:m,namespaceURI:D,value:k}=h,V=p(m),Xe=k;let _=m==="value"?Xe:Pt(Xe);if(n.attrName=V,n.attrValue=_,n.keepAttr=!0,n.forceKeepAttr=void 0,v(R.uponSanitizeAttribute,e,n),_=n.attrValue,pt&&(V==="id"||V==="name")&&(z(m,e),_=mn+_),_e&&g(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_)){z(m,e);continue}if(V==="attributename"&&be(_,"href")){z(m,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){z(m,e);continue}if(!ft&&g(/\/>/i,_)){z(m,e);continue}Y&&W([xe,Pe,ve],It=>{_=J(_,It," ")});const Lt=p(e.nodeName);if(!Ot(Lt,V,_)){z(m,e);continue}if(S&&typeof de=="object"&&typeof de.getAttributeType=="function"&&!D)switch(de.getAttributeType(Lt,V)){case"TrustedHTML":{_=S.createHTML(_);break}case"TrustedScriptURL":{_=S.createScriptURL(_);break}}if(_!==Xe)try{D?e.setAttributeNS(D,m,_):e.setAttribute(m,_),je(e)?N(e):fe(o.removed)}catch{z(m,e)}}v(R.afterSanitizeAttributes,e,null)},gn=function i(e){let t=null;const n=St(e);for(v(R.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)v(R.uponSanitizeShadowNode,t,null),yt(t),bt(t),t.content instanceof O&&i(t.content);v(R.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,u=null,h=null;if(We=!i,We&&(i=""),typeof i!="string"&&!Rt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!o.isSupported)return i;if(Fe||Ye(e),o.removed=[],typeof i=="string"&&(ae=!1),ae){if(i.nodeName){const k=p(i.nodeName);if(!d[k]||re[k])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof Me)t=At(""),n=t.ownerDocument.importNode(i,!0),n.nodeType===te.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!j&&!Y&&!U&&i.indexOf("<")===-1)return S&&ge?S.createHTML(i):i;if(t=At(i),!t)return j?null:ge?ie:""}t&&Ue&&N(t.firstChild);const m=St(ae?i:t);for(;u=m.nextNode();)yt(u),bt(u),u.content instanceof O&&gn(u.content);if(ae)return i;if(j){if(he)for(h=rn.call(t.ownerDocument);t.firstChild;)h.appendChild(t.firstChild);else h=t;return(E.shadowroot||E.shadowrootmode)&&(h=sn.call(r,h,!0)),h}let D=U?t.outerHTML:t.innerHTML;return U&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&g(et,t.ownerDocument.doctype.name)&&(D=" +`+D),Y&&W([xe,Pe,ve],k=>{D=J(D,k," ")}),S&&ge?S.createHTML(D):D},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye(i),Fe=!0},o.clearConfig=function(){q=null,Fe=!1},o.isValidAttribute=function(i,e,t){q||Ye({});const n=p(i),u=p(e);return Ot(n,u,t)},o.addHook=function(i,e){typeof e=="function"&&b(R[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=ue(R[i],e);return t===-1?void 0:wt(R[i],t,1)[0]}return fe(R[i])},o.removeHooks=function(i){R[i]=[]},o.removeAllHooks=function(){R=nt()},o}var Vt=ot();return $e=Vt,$e}var qe,Mt;function Dn(){return Mt||(Mt=1,qe=self.DOMPurify||(self.DOMPurify=Nt().default||Nt())),qe}var bn=Dn();const Ln=An(bn);function Cn({provider:Z,displayName:M,visualConfig:w}){const[Oe,ce]=K.useState(!1),[T,y]=K.useState(""),[x,H]=K.useState(!1),G=Sn("/api/auth/authorize/:provider"),W=K.useCallback(async()=>{ce(!1),H(!0);try{const b=await G.call({pathParams:{provider:Z}});if(!b.authorize_url)throw new Error(`Failed to get ${M} authorization URL`);window.location.href=b.authorize_url}catch(b){ce(!0),y(`Failed to initiate ${M} login: ${b}`),console.error(`Failed to start ${M} login`,b)}finally{H(!1)}},[G,M,Z]),ue=K.useMemo(()=>{if(w?.buttonColor)return{backgroundColor:w.buttonColor,color:w.textColor||"#FFFFFF"}},[w]),fe=K.useMemo(()=>{if(x||!w?.iconSvg)return null;const b=Ln.sanitize(w.iconSvg,{USE_PROFILES:{svg:!0}});return le.jsx("span",{className:"flex items-center justify-center",dangerouslySetInnerHTML:{__html:b}})},[x,w?.iconSvg]);return le.jsxs("div",{className:"flex flex-col gap-4",children:[le.jsx(Rn,{children:Oe&&le.jsx(yn.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:T||`Failed to sign in with ${M}`})}),le.jsx(On,{onPress:W,color:ue?void 0:"primary",style:ue,isLoading:x,startContent:fe,children:x?"Redirecting...":`Sign in with ${M}`})]})}export{Cn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-BTRQ21je.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-BTRQ21je.js new file mode 100644 index 0000000000..c8e5b03b4e --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-BTRQ21je.js @@ -0,0 +1 @@ +import{l as $,av as U,R as A,j as s,Z as H,u as B,r,i as K,h as V,aw as q,c as I,D as N,d as f,I as g,m as G,e as Z,f as J,ax as Q,ai as W}from"./index-DKQs0Q0w.js";import{m as X}from"./chunk-IGSAU2ZA-B7iwVIJ3.js";import{i as Y}from"./chunk-SSA7SXE4-O5iifkg7.js";var _=$((h,x)=>{const{as:i,children:p,className:u,...n}=h,{slots:d,classNames:t}=U(),m=A(x),v=i||"footer";return s.jsx(v,{ref:m,className:d.footer({class:H(t?.footer,u)}),...n,children:p})});_.displayName="HeroUI.ModalFooter";var ee=_;const j="heroicons:share",se="heroicons:check";function oe(){const{isOpen:h,onOpen:x,onClose:i}=B(),[p,u]=r.useState(""),[n,d]=r.useState([]),[t,m]=r.useState([]),[v,y]=r.useState(!1),[S,l]=r.useState(null),[E,C]=r.useState(j),c=K(e=>e.currentConversation),P=V(e=>e.isShared),{client:w}=q(),b=I("/api/conversations/:conversationId/shares",{method:"PUT"}),k=I("/api/conversations/:conversationId/shares/:recipient",{method:"DELETE"}),D=r.useCallback(async()=>{if(c){y(!0);try{const e=await w.makeRequest("/api/conversations/:conversationId",{method:"GET",pathParams:{conversationId:c}});m(e?.shares??[])}catch(e){console.error("Failed to load shares",e),l("Failed to load shares")}finally{y(!1)}}},[c,w]);r.useEffect(()=>{h&&(D(),d([]),u(""),l(null))},[h]);const R=()=>{const e=p.trim();if(!e)return;if([...t.map(a=>a.recipient),...n].some(a=>a.toLowerCase()===e.toLowerCase())){l("Already added");return}d(a=>[...a,e]),u(""),l(null)},F=e=>{d(o=>o.filter(a=>a!==e))},L=async e=>{try{await k.call({pathParams:{conversationId:c,recipient:e}}),m(o=>o.filter(a=>a.recipient!==e))}catch(o){console.error("Failed to revoke share",o),l("Failed to remove recipient")}},O=async()=>{if(n.length===0&&t.length>0){i();return}try{const e=[...t.map(a=>a.recipient),...n];if(e.length===0){i();return}const o=await b.call({pathParams:{conversationId:c},body:{recipients:e}});m(o??[]),d([]),i()}catch(e){console.error("Failed to share conversation",e),l("Failed to share conversation")}},T=()=>{const e=`${window.location.origin}/conversation/${c}`;navigator.clipboard.writeText(e),C(se),setTimeout(()=>C(j),2e3)},z=e=>{(e.key==="Enter"||e.key===",")&&(e.preventDefault(),R())};if(P)return null;const M=b.isLoading;return s.jsxs(s.Fragment,{children:[s.jsx(N,{content:"Share conversation",placement:"bottom",children:s.jsx(f,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Share conversation",onPress:x,children:s.jsx(g,{icon:j})})}),s.jsx(G,{isOpen:h,onOpenChange:i,size:"lg",children:s.jsxs(Z,{children:[s.jsx(X,{className:"text-default-900 flex items-center gap-2",children:"Share conversation"}),s.jsx(J,{children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Y,{placeholder:"Add people by user ID or email",value:p,onChange:e=>{u(e.target.value),l(null)},onKeyDown:z,onBlur:()=>{p.trim()&&R()},isInvalid:!!S,errorMessage:S,size:"sm","aria-label":"Recipient identifier"}),n.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(e=>s.jsx(Q,{size:"sm",variant:"flat",color:"primary",onClose:()=>F(e),children:e},e))}),t.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-default-500 text-xs font-medium uppercase",children:"Shared with"}),t.map(e=>s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-default-700 text-sm",children:e.recipient}),s.jsx(f,{isIconOnly:!0,size:"sm",variant:"light",color:"danger","aria-label":`Remove ${e.recipient}`,onPress:()=>L(e.recipient),children:s.jsx(g,{icon:"heroicons:x-mark",width:16})})]},e.recipient))]})]}),v&&s.jsx("span",{className:"text-default-400 text-sm",children:"Loading..."})]})}),s.jsxs(ee,{className:"flex items-center justify-between",children:[s.jsx(N,{content:`${window.location.origin}/conversation/${c}`,placement:"top",children:s.jsx(f,{size:"sm",variant:"flat",startContent:s.jsx(g,{icon:E,width:16}),onPress:T,"aria-label":"Copy link",children:"Copy link"})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(f,{variant:"light",onPress:i,"aria-label":"Cancel",children:"Cancel"}),s.jsx(f,{color:"primary",onPress:O,isLoading:M,isDisabled:n.length===0&&t.length===0,"aria-label":"Share",children:"Share"})]})]})]})})]})}export{oe as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-DpNPT4em.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-DpNPT4em.js deleted file mode 100644 index 50a3d5bfcc..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-DpNPT4em.js +++ /dev/null @@ -1 +0,0 @@ -import{av as Hr,u as Jr,r as hr,aw as Wr,j as O,D as qr,d as gr,I as Yr,m as Kr,e as Lr,f as Qr,ax as Vr,ay as Xr}from"./index-Be6O1iVd.js";import{m as Zr}from"./chunk-IGSAU2ZA-C95SHugN.js";var j=Uint8Array,B=Uint16Array,jr=Int32Array,lr=new j([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sr=new j([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),br=new j([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dr=function(r,e){for(var a=new B(31),n=0;n<31;++n)a[n]=e+=1<>1|(p&21845)<<1;Q=(Q&52428)>>2|(Q&13107)<<2,Q=(Q&61680)>>4|(Q&3855)<<4,Cr[p]=((Q&65280)>>8|(Q&255)<<8)>>1}var q=(function(r,e,a){for(var n=r.length,t=0,o=new B(e);t>h]=u}else for(l=new B(n),t=0;t>15-r[t]);return l}),V=new j(288);for(var p=0;p<144;++p)V[p]=8;for(var p=144;p<256;++p)V[p]=9;for(var p=256;p<280;++p)V[p]=7;for(var p=280;p<288;++p)V[p]=8;var fr=new j(32);for(var p=0;p<32;++p)fr[p]=5;var ee=q(V,9,0),ae=q(V,9,1),ne=q(fr,5,0),te=q(fr,5,1),wr=function(r){for(var e=r[0],a=1;ae&&(e=r[a]);return e},J=function(r,e,a){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&a},xr=function(r,e){var a=e/8|0;return(r[a]|r[a+1]<<8|r[a+2]<<16)>>(e&7)},Ar=function(r){return(r+7)/8|0},cr=function(r,e,a){return(e==null||e<0)&&(e=0),(a==null||a>r.length)&&(a=r.length),new j(r.subarray(e,a))},oe=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],H=function(r,e,a){var n=new Error(e||oe[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,H),!a)throw n;return n},fe=function(r,e,a,n){var t=r.length,o=0;if(!t||e.f&&!e.l)return a||new j(0);var v=!a,l=v||e.i!=2,h=e.i;v&&(a=new j(t*3));var u=function(ar){var nr=a.length;if(ar>nr){var rr=new j(Math.max(nr*2,ar));rr.set(a),a=rr}},f=e.f||0,i=e.p||0,s=e.b||0,x=e.l,d=e.d,w=e.m,C=e.n,N=t*8;do{if(!x){f=J(r,i,1);var y=J(r,i+1,3);if(i+=3,y)if(y==1)x=ae,d=te,w=9,C=5;else if(y==2){var R=J(r,i,31)+257,A=J(r,i+10,15)+4,g=R+J(r,i+5,31)+1;i+=14;for(var c=new j(g),M=new j(19),T=0;T>4;if(m<16)c[T++]=m;else{var k=0,S=0;for(m==16?(S=3+J(r,i,3),i+=2,k=c[T-1]):m==17?(S=3+J(r,i,7),i+=3):m==18&&(S=11+J(r,i,127),i+=7);S--;)c[T++]=k}}var z=c.subarray(0,R),E=c.subarray(R);w=wr(z),C=wr(E),x=q(z,w,1),d=q(E,C,1)}else H(1);else{var m=Ar(i)+4,D=r[m-4]|r[m-3]<<8,F=m+D;if(F>t){h&&H(0);break}l&&u(s+D),a.set(r.subarray(m,F),s),e.b=s+=D,e.p=i=F*8,e.f=f;continue}if(i>N){h&&H(0);break}}l&&u(s+131072);for(var er=(1<>4;if(i+=k&15,i>N){h&&H(0);break}if(k||H(2),P<256)a[s++]=P;else if(P==256){Y=i,x=null;break}else{var $=P-254;if(P>264){var T=P-257,b=lr[T];$=J(r,i,(1<>4;W||H(3),i+=W&15;var E=re[X];if(X>3){var b=sr[X];E+=xr(r,i)&(1<N){h&&H(0);break}l&&u(s+131072);var Z=s+$;if(s>8},tr=function(r,e,a){a<<=e&7;var n=e/8|0;r[n]|=a,r[n+1]|=a>>8,r[n+2]|=a>>16},pr=function(r,e){for(var a=[],n=0;ns&&(s=o[n].s);var x=new B(s+1),d=mr(a[f-1],x,0);if(d>e){var n=0,w=0,C=d-e,N=1<e)w+=N-(1<>=C;w>0;){var m=o[n].s;x[m]=0&&w;--n){var D=o[n].s;x[D]==e&&(--x[D],++w)}d=e}return{t:new j(x),l:d}},mr=function(r,e,a){return r.s==-1?Math.max(mr(r.l,e,a+1),mr(r.r,e,a+1)):e[r.s]=a},kr=function(r){for(var e=r.length;e&&!r[--e];);for(var a=new B(++e),n=0,t=r[0],o=1,v=function(h){a[n++]=h},l=1;l<=e;++l)if(r[l]==t&&l!=e)++o;else{if(!t&&o>2){for(;o>138;o-=138)v(32754);o>2&&(v(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(v(t),--o;o>6;o-=6)v(8304);o>2&&(v(o-3<<5|8208),o=0)}for(;o--;)v(t);o=1,t=r[l]}return{c:a.subarray(0,n),n:e}},or=function(r,e){for(var a=0,n=0;n>8,r[t+2]=r[t]^255,r[t+3]=r[t+1]^255;for(var o=0;o4&&!M[br[I-1]];--I);var L=u+5<<3,U=or(t,V)+or(o,fr)+v,_=or(t,s)+or(o,w)+v+14+3*I+or(A,M)+2*A[16]+3*A[17]+7*A[18];if(h>=0&&L<=U&&L<=_)return Ur(e,f,r.subarray(h,h+u));var k,S,z,E;if(K(e,f,1+(_15&&(K(e,f,P[g]>>5&127),f+=P[g]>>12)}}else k=ee,S=V,z=ne,E=fr;for(var g=0;g255){var $=b>>18&31;tr(e,f,k[$+257]),f+=S[$+257],$>7&&(K(e,f,b>>23&31),f+=lr[$]);var W=b&31;tr(e,f,z[W]),f+=E[W],W>3&&(tr(e,f,b>>5&8191),f+=sr[W])}else tr(e,f,k[b]),f+=S[b]}return tr(e,f,k[256]),f+S[256]},ie=new jr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pr=new j(0),ve=function(r,e,a,n,t,o){var v=o.z||r.length,l=new j(n+v+5*(1+Math.ceil(v/7e3))+t),h=l.subarray(n,l.length-t),u=o.l,f=(o.r||0)&7;if(e){f&&(h[0]=o.r>>3);for(var i=ie[e-1],s=i>>13,x=i&8191,d=(1<7e3||M>24576)&&(k>423||!u)){f=Er(r,h,0,D,F,R,g,M,I,c-I,f),M=A=g=0,I=c;for(var S=0;S<286;++S)F[S]=0;for(var S=0;S<30;++S)R[S]=0}var z=2,E=0,er=x,G=U-_&32767;if(k>2&&L==m(c-G))for(var Y=Math.min(s,k)-1,P=Math.min(32767,c),$=Math.min(258,k);G<=P&&--er&&U!=_;){if(r[c+z]==r[c+z-G]){for(var b=0;b<$&&r[c+b]==r[c+b-G];++b);if(b>z){if(z=b,E=G,b>Y)break;for(var W=Math.min(G,b-2),X=0,S=0;SX&&(X=vr,_=Z)}}}U=_,_=w[U],G+=U-_&32767}if(E){D[M++]=268435456|dr[z]<<18|Mr[E];var ar=dr[z]&31,nr=Mr[E]&31;g+=lr[ar]+sr[nr],++F[257+ar],++R[nr],T=c+z,++A}else D[M++]=r[c],++F[r[c]]}}for(c=Math.max(c,T);c=v&&(h[f/8|0]=u,rr=v),f=Ur(h,f+1,r.subarray(c,rr))}o.i=v}return cr(l,0,n+Ar(f)+t)},$r=function(){var r=1,e=0;return{p:function(a){for(var n=r,t=e,o=a.length|0,v=0;v!=o;){for(var l=Math.min(v+2655,o);v>16),t=(t&65535)+15*(t>>16)}r=n,e=t},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},le=function(r,e,a,n,t){if(!t&&(t={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),v=new j(o.length+r.length);v.set(o),v.set(r,o.length),r=v,t.w=o.length}return ve(r,e.level==null?6:e.level,e.mem==null?t.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,a,n,t)},Br=function(r,e,a){for(;a;++e)r[e]=a,a>>>=8},se=function(r,e){var a=e.level,n=a==0?0:a<6?1:a==9?3:2;if(r[0]=120,r[1]=n<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var t=$r();t.p(e.dictionary),Br(r,2,t.d())}},ce=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&H(6,"invalid zlib data"),(r[1]>>5&1)==1&&H(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ue(r,e){e||(e={});var a=$r();a.p(r);var n=le(r,e,e.dictionary?6:2,4);return se(n,e),Br(n,n.length-4,a.d()),n}function he(r,e){return fe(r.subarray(ce(r),-4),{i:2},e,e)}var Fr=typeof TextEncoder<"u"&&new TextEncoder,Tr=typeof TextDecoder<"u"&&new TextDecoder,ge=0;try{Tr.decode(Pr,{stream:!0}),ge=1}catch{}var we=function(r){for(var e="",a=0;;){var n=r[a++],t=(n>127)+(n>223)+(n>239);if(a+t>r.length)return{s:e,r:cr(r,a-1)};t?t==3?(n=((n&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):t&1?e+=String.fromCharCode((n&31)<<6|r[a++]&63):e+=String.fromCharCode((n&15)<<12|(r[a++]&63)<<6|r[a++]&63):e+=String.fromCharCode(n)}};function Ir(r,e){if(e){for(var a=new j(r.length),n=0;n>1)),v=0,l=function(f){o[v++]=f},n=0;no.length){var h=new j(v+8+(t-n<<1));h.set(o),o=h}var u=r.charCodeAt(n);u<128||e?l(u):u<2048?(l(192|u>>6),l(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|r.charCodeAt(++n)&1023,l(240|u>>18),l(128|u>>12&63),l(128|u>>6&63),l(128|u&63)):(l(224|u>>12),l(128|u>>6&63),l(128|u&63))}return cr(o,0,v)}function Or(r,e){if(e){for(var a="",n=0;n`,Sr=``;function pe(r){if(typeof r!="object"||r===null)return!1;const e=r;return!(typeof e.history!="object"||"followupMessages"in e&&typeof e.followupMessages!="object"||"chatOptions"in e&&typeof e.chatOptions!="object"||"serverState"in e&&typeof e.serverState!="object"||"conversationId"in e&&typeof e.conversationId!="string"&&typeof e.conversationId!="object")}function be(){const{restore:r,getCurrentConversation:e}=Hr(),{isOpen:a,onOpen:n,onClose:t}=Jr(),[o,v]=hr.useState(Nr),l=hr.useRef(null),h=Wr(),u=()=>{const{chatOptions:i,history:s,serverState:x,conversationId:d,followupMessages:w}=e(),C=Vr({chatOptions:i,history:s,serverState:x,conversationId:d,followupMessages:w}),N=Ir(`${yr}${JSON.stringify(C)}${Sr}`),y=btoa(Or(ue(N,{level:9}),!0));navigator.clipboard.writeText(y),v(xe),t(),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{v(Nr)},2e3)},f=()=>{t()};return hr.useEffect(()=>{const i=s=>{if(!s.clipboardData){console.warn("[Share] Nothing to parse, skipping.");return}const x=s.clipboardData.types;if(!x.includes("text/plain")&&!x.includes("text")){console.warn("[Share] Invalid content type of pasted content, skipping.");return}const d=s.clipboardData.getData("text/plain")??s.clipboardData.getData("text");try{const w=atob(d);if(!w.startsWith("xÚ")){console.warn("[Share] Incorrect header, skipping.");return}const C=Or(he(Ir(w,!0)));if(!C.startsWith(yr)||!C.endsWith(Sr)){console.warn("[Share] Failed to parse as valid Ragbits state, skipping.");return}s.preventDefault(),s.stopPropagation();const N=C.slice(yr.length,-Sr.length),y=JSON.parse(N);if(!pe(y)){console.warn("[Share] Pasted state didn't pass validation, skipping.");return}const m=r(y.history,y.followupMessages,y.chatOptions,y.serverState,y.conversationId);h(Xr(m))}catch(w){console.error("[Share] Couldn't parse pasted string as valid Ragbits state",w)}};return window.addEventListener("paste",i),()=>{window.removeEventListener("paste",i)}}),O.jsxs(O.Fragment,{children:[O.jsx(qr,{content:"Share conversation",placement:"bottom",children:O.jsx(gr,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Share conversation",onPress:n,children:O.jsx(Yr,{icon:o})})}),O.jsx(Kr,{isOpen:a,onOpenChange:f,children:O.jsx(Lr,{children:i=>O.jsxs(O.Fragment,{children:[O.jsx(Zr,{className:"text-default-900 flex flex-col gap-1",children:"Share conversation"}),O.jsx(Qr,{children:O.jsxs("div",{className:"flex flex-col gap-4",children:[O.jsx("p",{className:"text-medium text-default-500",children:"You are about to copy a code that allows sharing and storing your current app state. Once copied, you can paste this code anywhere on the site to instantly return to this exact setup. It’s a quick way to save your progress or share it with others."}),O.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[O.jsx(gr,{color:"danger",variant:"light",onPress:i,"aria-label":"Close share modal",children:"Cancel"}),O.jsx(gr,{color:"primary",onPress:u,"aria-label":"Copy to clipboard to share the conversation",children:"Copy to clipboard"})]})]})})]})})})]})}export{be as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/SharedBanner-D0P0hcGV.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/SharedBanner-D0P0hcGV.js new file mode 100644 index 0000000000..b30d170d25 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/SharedBanner-D0P0hcGV.js @@ -0,0 +1 @@ +import{h as n,j as s,I as a}from"./index-DKQs0Q0w.js";function i(){const t=n(e=>e.isShared),r=n(e=>e.sharedBy);return!t||!r?null:s.jsxs("div",{className:"bg-default-100 text-default-600 mb-4 flex items-center gap-2 rounded-lg px-4 py-2 text-sm",children:[s.jsx(a,{icon:"heroicons:link",width:16}),s.jsxs("span",{children:["Shared by ",r]})]})}export{i as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/SharedItemIcon-DR9bhy9E.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/SharedItemIcon-DR9bhy9E.js new file mode 100644 index 0000000000..e4dbe3aa75 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/SharedItemIcon-DR9bhy9E.js @@ -0,0 +1 @@ +import{i as r,j as t,I as i}from"./index-DKQs0Q0w.js";function a({conversationId:s}){return r(e=>e.conversations[s]?.isShared??!1)?t.jsx(i,{icon:"heroicons:link",className:"text-default-400 shrink-0",width:14}):null}export{a as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UploadButton-BCp7z0Ib.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UploadButton-4-Iaq9dc.js similarity index 91% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UploadButton-BCp7z0Ib.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UploadButton-4-Iaq9dc.js index 7b8d6621aa..4f0b295da2 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UploadButton-BCp7z0Ib.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UploadButton-4-Iaq9dc.js @@ -1 +1 @@ -import{r as d,c as u,j as a,d as p,I as f}from"./index-Be6O1iVd.js";function m({isInputDisabled:n}){const e=d.useRef(null),{call:s,isLoading:i}=u("/api/upload"),o=()=>{e.current?.click()},r=async c=>{const l=c.target.files?.[0];if(l)try{const t=new FormData;t.append("file",l),await s({method:"POST",body:t})}catch(t){console.error("Upload failed",t)}finally{e.current&&(e.current.value="")}};return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"file",ref:e,className:"hidden",onChange:r}),a.jsx(p,{isIconOnly:!0,"aria-label":"Upload file",variant:"ghost",onPress:o,isLoading:i,isDisabled:n,className:"p-0","data-testid":"upload-file-button",children:a.jsx(f,{className:"text-default-500",icon:"heroicons:paper-clip",width:20})})]})}export{m as default}; +import{r as d,c as u,j as a,d as p,I as f}from"./index-DKQs0Q0w.js";function m({isInputDisabled:n}){const e=d.useRef(null),{call:s,isLoading:i}=u("/api/upload"),o=()=>{e.current?.click()},r=async c=>{const l=c.target.files?.[0];if(l)try{const t=new FormData;t.append("file",l),await s({method:"POST",body:t})}catch(t){console.error("Upload failed",t)}finally{e.current&&(e.current.value="")}};return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"file",ref:e,className:"hidden",onChange:r}),a.jsx(p,{isIconOnly:!0,"aria-label":"Upload file",variant:"ghost",onPress:o,isLoading:i,isDisabled:n,className:"p-0","data-testid":"upload-file-button",children:a.jsx(f,{className:"text-default-500",icon:"heroicons:paper-clip",width:20})})]})}export{m as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-DXMuUpgY.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-DWoyT-rb.js similarity index 99% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-DXMuUpgY.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-DWoyT-rb.js index 56b8c59c68..33acf2c0f8 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-DXMuUpgY.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-DWoyT-rb.js @@ -1 +1 @@ -import{r as k,aX as Ml,aY as ae,t as Ne,k as ie,aK as z,aZ as W,a_ as U,a$ as te,b0 as Tl,aT as _,b1 as Rl,b2 as Vl,A as ze,b3 as ue,b4 as Ol,K as pe,H as Hl,J,M as Ll,b5 as L,af as Ul,b6 as Y,b7 as Z,b8 as le,U as Wl,b9 as Gl,ba as Ce,bb as Yl,l as T,R as M,W as X,Z as K,j as h,ap as be,au as Fe,v as I,a3 as O,a2 as w,w as Zl,y as _l,x as ql,a5 as q,O as Jl,Q as Pe,a0 as Ke,X as Ie,u as Xl,as as De,D as Ql,d as eu,I as tu,m as lu,e as uu,f as nu,bc as ou}from"./index-Be6O1iVd.js";import{b as fe,$ as je}from"./useSelectableItem-DLYBSIKg.js";import{C as su,u as iu}from"./index-DImPjBZJ.js";import{m as ru}from"./chunk-IGSAU2ZA-C95SHugN.js";function Me(e,t){const l=k.useRef(!0),u=k.useRef(null);k.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]),k.useEffect(()=>{let o=u.current;l.current?l.current=!1:(!o||t.some((n,s)=>!Object.is(n,o[s])))&&e(),u.current=t},t)}function au(e,t){let l=t?.isDisabled,[u,o]=k.useState(!1);return Ml(()=>{if(e?.current&&!l){let n=()=>{if(e.current){let r=ae(e.current,{tabbable:!0});o(!!r.nextNode())}};n();let s=new MutationObserver(n);return s.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{s.disconnect()}}}),l?!1:u}var ke=Ne({base:"w-px h-px inline-block",variants:{isInline:{true:"inline-block",false:"block"}},defaultVariants:{isInline:!1}}),Be=Ne({slots:{base:"flex flex-col relative gap-4",wrapper:["p-4","z-0","flex","flex-col","relative","justify-between","gap-4","shadow-small","bg-content1","overflow-auto"],table:"min-w-full h-auto",thead:"[&>tr]:first:rounded-lg",tbody:"after:block",tr:["group/tr","outline-hidden",...ie],th:["group/th","px-3","h-10","text-start","align-middle","bg-default-100","whitespace-nowrap","text-foreground-500","text-tiny","font-semibold","first:rounded-s-lg","last:rounded-e-lg","outline-hidden","data-[sortable=true]:cursor-pointer","data-[hover=true]:text-foreground-400",...ie],td:["py-2","px-3","relative","align-middle","whitespace-normal","text-small","font-normal","outline-hidden","[&>*]:z-1","[&>*]:relative",...ie,"before:pointer-events-none","before:content-['']","before:absolute","before:z-0","before:inset-0","before:opacity-0","data-[selected=true]:before:opacity-100","group-data-[disabled=true]/tr:text-foreground-300","group-data-[disabled=true]/tr:cursor-not-allowed"],tfoot:"",sortIcon:["ms-2","mb-px","opacity-0","text-inherit","inline-block","transition-transform-opacity","data-[visible=true]:opacity-100","group-data-[hover=true]/th:opacity-100","data-[direction=ascending]:rotate-180"],emptyWrapper:"text-foreground-400 align-middle text-center h-40",loadingWrapper:"absolute inset-0 flex items-center justify-center"},variants:{color:{default:{td:"before:bg-default/60 data-[selected=true]:text-default-foreground"},primary:{td:"before:bg-primary/20 data-[selected=true]:text-primary"},secondary:{td:"before:bg-secondary/20 data-[selected=true]:text-secondary"},success:{td:"before:bg-success/20 data-[selected=true]:text-success-600 dark:data-[selected=true]:text-success"},warning:{td:"before:bg-warning/20 data-[selected=true]:text-warning-600 dark:data-[selected=true]:text-warning"},danger:{td:"before:bg-danger/20 data-[selected=true]:text-danger dark:data-[selected=true]:text-danger-500"}},layout:{auto:{table:"table-auto"},fixed:{table:"table-fixed"}},shadow:{none:{wrapper:"shadow-none"},sm:{wrapper:"shadow-small"},md:{wrapper:"shadow-medium"},lg:{wrapper:"shadow-large"}},hideHeader:{true:{thead:"hidden"}},isStriped:{true:{td:["group-data-[odd=true]/tr:before:bg-default-100","group-data-[odd=true]/tr:before:opacity-100","group-data-[odd=true]/tr:before:-z-10"]}},isCompact:{true:{td:"py-1"},false:{}},isHeaderSticky:{true:{thead:"sticky top-0 z-20 [&>tr]:first:shadow-small"}},isSelectable:{true:{tr:"cursor-default",td:["group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:bg-default-100","group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:opacity-70"]}},isMultiSelectable:{true:{td:["group-data-[first=true]/tr:first:before:rounded-ss-lg","group-data-[first=true]/tr:last:before:rounded-se-lg","group-data-[middle=true]/tr:before:rounded-none","group-data-[last=true]/tr:first:before:rounded-es-lg","group-data-[last=true]/tr:last:before:rounded-ee-lg"]},false:{td:["first:before:rounded-s-lg","last:before:rounded-e-lg"]}},radius:{none:{wrapper:"rounded-none",th:["first:rounded-s-none","first:before:rounded-s-none","last:rounded-e-none","last:before:rounded-e-none"],td:["first:before:rounded-s-none","last:before:rounded-e-none","group-data-[first=true]/tr:first:before:rounded-ss-none","group-data-[first=true]/tr:last:before:rounded-se-none","group-data-[last=true]/tr:first:before:rounded-es-none","group-data-[last=true]/tr:last:before:rounded-ee-none"]},sm:{wrapper:"rounded-small"},md:{wrapper:"rounded-medium"},lg:{wrapper:"rounded-large"}},fullWidth:{true:{base:"w-full",wrapper:"w-full",table:"w-full"}},align:{start:{th:"text-start",td:"text-start"},center:{th:"text-center",td:"text-center"},end:{th:"text-end",td:"text-end"}}},defaultVariants:{layout:"auto",shadow:"sm",radius:"lg",color:"default",isCompact:!1,hideHeader:!1,isStriped:!1,fullWidth:!0,align:"start"},compoundVariants:[{isStriped:!0,color:"default",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-default/60"}},{isStriped:!0,color:"primary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-primary/20"}},{isStriped:!0,color:"secondary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-secondary/20"}},{isStriped:!0,color:"success",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-success/20"}},{isStriped:!0,color:"warning",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-warning/20"}},{isStriped:!0,color:"danger",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-danger/20"}}]});const he=new WeakMap;function ce(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function cu(e,t){let l=he.get(e);if(!l)throw new Error("Unknown grid");return`${l}-${ce(t)}`}function Te(e,t,l){let u=he.get(e);if(!u)throw new Error("Unknown grid");return`${u}-${ce(t)}-${ce(l)}`}function Re(e,t){return[...e.collection.rowHeaderColumnKeys].map(l=>Te(e,t,l)).join(" ")}var Ve={};Ve={ascending:"تصاعدي",ascendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تصاعدي`,columnSize:e=>`${e.value} بالبكسل`,descending:"تنازلي",descendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب"};var Oe={};Oe={ascending:"възходящ",ascendingSort:e=>`сортирано по колона ${e.columnName} във възходящ ред`,columnSize:e=>`${e.value} пиксела`,descending:"низходящ",descendingSort:e=>`сортирано по колона ${e.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона"};var He={};He={ascending:"vzestupně",ascendingSort:e=>`řazeno vzestupně podle sloupce ${e.columnName}`,columnSize:e=>`${e.value} pixelů`,descending:"sestupně",descendingSort:e=>`řazeno sestupně podle sloupce ${e.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení"};var Le={};Le={ascending:"stigende",ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende rækkefølge`,columnSize:e=>`${e.value} pixels`,descending:"faldende",descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne"};var Ue={};Ue={ascending:"aufsteigend",ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,columnSize:e=>`${e.value} Pixel`,descending:"absteigend",descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte"};var We={};We={ascending:"αύξουσα",ascendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε αύξουσα σειρά`,columnSize:e=>`${e.value} pixel`,descending:"φθίνουσα",descendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής"};var Ge={};Ge={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:"Press Enter to start resizing"};var Ye={};Ye={ascending:"ascendente",ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,columnSize:e=>`${e.value} píxeles`,descending:"descendente",descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable"};var Ze={};Ze={ascending:"tõusev järjestus",ascendingSort:e=>`sorditud veeru järgi ${e.columnName} tõusvas järjestuses`,columnSize:e=>`${e.value} pikslit`,descending:"laskuv järjestus",descendingSort:e=>`sorditud veeru järgi ${e.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg"};var _e={};_e={ascending:"nouseva",ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa järjestyksessä`,columnSize:e=>`${e.value} pikseliä`,descending:"laskeva",descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake"};var qe={};qe={ascending:"croissant",ascendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre croissant`,columnSize:e=>`${e.value} pixels`,descending:"décroissant",descendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable"};var Je={};Je={ascending:"עולה",ascendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר עולה`,columnSize:e=>`${e.value} פיקסלים`,descending:"יורד",descendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין"};var Xe={};Xe={ascending:"rastući",ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastućem redoslijedom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`razvrstano po stupcima ${e.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati"};var Qe={};Qe={ascending:"növekvő",ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, növekvő sorrendben`,columnSize:e=>`${e.value} képpont`,descending:"csökkenő",descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop"};var et={};et={ascending:"crescente",ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,columnSize:e=>`${e.value} pixel`,descending:"decrescente",descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile"};var tt={};tt={ascending:"昇順",ascendingSort:e=>`列 ${e.columnName} を昇順で並べ替え`,columnSize:e=>`${e.value} ピクセル`,descending:"降順",descendingSort:e=>`列 ${e.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列"};var lt={};lt={ascending:"오름차순",ascendingSort:e=>`${e.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:e=>`${e.value} 픽셀`,descending:"내림차순",descendingSort:e=>`${e.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열"};var ut={};ut={ascending:"didėjančia tvarka",ascendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} didėjančia tvarka`,columnSize:e=>`${e.value} piks.`,descending:"mažėjančia tvarka",descendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis"};var nt={};nt={ascending:"augošā secībā",ascendingSort:e=>`kārtots pēc kolonnas ${e.columnName} augošā secībā`,columnSize:e=>`${e.value} pikseļi`,descending:"dilstošā secībā",descendingSort:e=>`kārtots pēc kolonnas ${e.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna"};var ot={};ot={ascending:"stigende",ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkefølge`,columnSize:e=>`${e.value} piksler`,descending:"synkende",descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres"};var st={};st={ascending:"oplopend",ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,columnSize:e=>`${e.value} pixels`,descending:"aflopend",descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom"};var it={};it={ascending:"rosnąco",ascendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku rosnącym`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:"malejąco",descendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania"};var rt={};rt={ascending:"crescente",ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,columnSize:e=>`${e.value} pixels`,descending:"decrescente",descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável"};var at={};at={ascending:"ascendente",ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,columnSize:e=>`${e.value} pixels`,descending:"descendente",descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável"};var ct={};ct={ascending:"crescătoare",ascendingSort:e=>`sortate după coloana ${e.columnName} în ordine crescătoare`,columnSize:e=>`${e.value} pixeli`,descending:"descrescătoare",descendingSort:e=>`sortate după coloana ${e.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă"};var dt={};dt={ascending:"возрастание",ascendingSort:e=>`сортировать столбец ${e.columnName} в порядке возрастания`,columnSize:e=>`${e.value} пикс.`,descending:"убывание",descendingSort:e=>`сортировать столбец ${e.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец"};var mt={};mt={ascending:"vzostupne",ascendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,columnSize:e=>`Počet pixelov: ${e.value}`,descending:"zostupne",descendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec"};var pt={};pt={ascending:"naraščajoče",ascendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v naraščajočem vrstnem redu`,columnSize:e=>`${e.value} slikovnih pik`,descending:"padajoče",descendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec"};var bt={};bt={ascending:"rastući",ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastućim redosledom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`sortirano po kolonama ${e.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati"};var ft={};ft={ascending:"stigande",ascendingSort:e=>`sorterat på kolumn ${e.columnName} i stigande ordning`,columnSize:e=>`${e.value} pixlar`,descending:"fallande",descendingSort:e=>`sorterat på kolumn ${e.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn"};var ht={};ht={ascending:"artan sırada",ascendingSort:e=>`${e.columnName} sütuna göre artan düzende sırala`,columnSize:e=>`${e.value} piksel`,descending:"azalan sırada",descendingSort:e=>`${e.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun"};var vt={};vt={ascending:"висхідний",ascendingSort:e=>`відсортовано за стовпцем ${e.columnName} у висхідному порядку`,columnSize:e=>`${e.value} пікс.`,descending:"низхідний",descendingSort:e=>`відсортовано за стовпцем ${e.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець"};var gt={};gt={ascending:"升序",ascendingSort:e=>`按列 ${e.columnName} 升序排序`,columnSize:e=>`${e.value} 像素`,descending:"降序",descendingSort:e=>`按列 ${e.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列"};var $t={};$t={ascending:"遞增",ascendingSort:e=>`已依據「${e.columnName}」欄遞增排序`,columnSize:e=>`${e.value} 像素`,descending:"遞減",descendingSort:e=>`已依據「${e.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄"};var ne={};ne={"ar-AE":Ve,"bg-BG":Oe,"cs-CZ":He,"da-DK":Le,"de-DE":Ue,"el-GR":We,"en-US":Ge,"es-ES":Ye,"et-EE":Ze,"fi-FI":_e,"fr-FR":qe,"he-IL":Je,"hr-HR":Xe,"hu-HU":Qe,"it-IT":et,"ja-JP":tt,"ko-KR":lt,"lt-LT":ut,"lv-LV":nt,"nb-NO":ot,"nl-NL":st,"pl-PL":it,"pt-BR":rt,"pt-PT":at,"ro-RO":ct,"ru-RU":dt,"sk-SK":mt,"sl-SI":pt,"sr-SP":bt,"sv-SE":ft,"tr-TR":ht,"uk-UA":vt,"zh-CN":gt,"zh-TW":$t};class yt{isCell(t){return t.type==="cell"}isRow(t){return t.type==="row"||t.type==="item"}isDisabled(t){var l;return this.disabledBehavior==="all"&&(((l=t.props)===null||l===void 0?void 0:l.isDisabled)||this.disabledKeys.has(t.key))}findPreviousKey(t,l){let u=t!=null?this.collection.getKeyBefore(t):this.collection.getLastKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;u=this.collection.getKeyBefore(u)}return null}findNextKey(t,l){let u=t!=null?this.collection.getKeyAfter(t):this.collection.getFirstKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;if(u=this.collection.getKeyAfter(u),u==null)return null}return null}getKeyForItemInRowByIndex(t,l=0){if(l<0)return null;let u=this.collection.getItem(t);if(!u)return null;let o=0;for(let r of z(u,this.collection)){var n;if(r.colSpan&&r.colSpan+o>l)return(n=r.key)!==null&&n!==void 0?n:null;r.colSpan&&(o=o+r.colSpan-1);var s;if(o===l)return(s=r.key)!==null&&s!==void 0?s:null;o++}return null}getKeyBelow(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findNextKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyAbove(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findPreviousKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyRightOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let c=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=W(c))===null||u===void 0?void 0:u.key:(o=U(c))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let c=this.collection.getItem(l.parentKey);if(!c)return null;let i=z(c,this.collection);var s;let p=(s=this.direction==="rtl"?te(i,l.index-1):te(i,l.index+1))!==null&&s!==void 0?s:null;var r;if(p)return(r=p.key)!==null&&r!==void 0?r:null;var d;if(this.focusMode==="row")return(d=l.parentKey)!==null&&d!==void 0?d:null;var m;return(m=this.direction==="rtl"?this.getFirstKey(t):this.getLastKey(t))!==null&&m!==void 0?m:null}return null}getKeyLeftOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let c=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=U(c))===null||u===void 0?void 0:u.key:(o=W(c))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let c=this.collection.getItem(l.parentKey);if(!c)return null;let i=z(c,this.collection);var s;let p=(s=this.direction==="rtl"?te(i,l.index+1):te(i,l.index-1))!==null&&s!==void 0?s:null;var r;if(p)return(r=p.key)!==null&&r!==void 0?r:null;var d;if(this.focusMode==="row")return(d=l.parentKey)!==null&&d!==void 0?d:null;var m;return(m=this.direction==="rtl"?this.getLastKey(t):this.getFirstKey(t))!==null&&m!==void 0?m:null}return null}getFirstKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let m=this.collection.getItem(o.parentKey);if(!m)return null;var s;return(s=(n=U(z(m,this.collection)))===null||n===void 0?void 0:n.key)!==null&&s!==void 0?s:null}}if(u=this.findNextKey(void 0,m=>m.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var r;let m=this.collection.getItem(u);if(!m)return null;var d;u=(d=(r=U(z(m,this.collection)))===null||r===void 0?void 0:r.key)!==null&&d!==void 0?d:null}return u}getLastKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let m=this.collection.getItem(o.parentKey);if(!m)return null;let c=z(m,this.collection);var s;return(s=(n=W(c))===null||n===void 0?void 0:n.key)!==null&&s!==void 0?s:null}}if(u=this.findPreviousKey(void 0,m=>m.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var r;let m=this.collection.getItem(u);if(!m)return null;let c=z(m,this.collection);var d;u=(d=(r=W(c))===null||r===void 0?void 0:r.key)!==null&&d!==void 0?d:null}return u}getKeyPageAbove(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=Math.max(0,u.y+u.height-this.layoutDelegate.getVisibleRect().height);for(;u&&u.y>o&&l!=null;){var n;if(l=(n=this.getKeyAbove(l))!==null&&n!==void 0?n:null,l==null)break;u=this.layoutDelegate.getItemRect(l)}return l}getKeyPageBelow(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=this.layoutDelegate.getVisibleRect().height,n=Math.min(this.layoutDelegate.getContentSize().height,u.y+o);for(;u&&u.y+u.heighti.type==="item"),u==null&&!r&&(u=this.getFirstKey(),r=!0)}return null}constructor(t){if(this.collection=t.collection,this.disabledKeys=t.disabledKeys,this.disabledBehavior=t.disabledBehavior||"all",this.direction=t.direction,this.collator=t.collator,!t.layout&&!t.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=t.layoutDelegate||(t.layout?new du(t.layout):new Tl(t.ref)),this.focusMode=t.focusMode||"row"}}class du{getContentSize(){return this.layout.getContentSize()}getItemRect(t){var l;return((l=this.layout.getLayoutInfo(t))===null||l===void 0?void 0:l.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}constructor(t){this.layout=t}}const ve=new WeakMap;var xt={};xt={deselectedItem:e=>`${e.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${t.number(e.count)} عنصر محدد`,other:()=>`${t.number(e.count)} عنصر محدد`})}.`,selectedItem:e=>`${e.item} المحدد`};var Ct={};Ct={deselectedItem:e=>`${e.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Няма избрани елементи",one:()=>`${t.number(e.count)} избран елемент`,other:()=>`${t.number(e.count)} избрани елементи`})}.`,selectedItem:e=>`${e.item} избран.`};var Dt={};Dt={deselectedItem:e=>`Položka ${e.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${t.number(e.count)} položka`,other:()=>`Vybráno ${t.number(e.count)} položek`})}.`,selectedItem:e=>`Vybrána položka ${e.item}.`};var kt={};kt={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer valgt",one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var Bt={};Bt={deselectedItem:e=>`${e.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${t.number(e.count)} Element ausgewählt`,other:()=>`${t.number(e.count)} Elemente ausgewählt`})}.`,selectedItem:e=>`${e.item} ausgewählt.`};var Et={};Et={deselectedItem:e=>`Δεν επιλέχθηκε το στοιχείο ${e.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${t.number(e.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${t.number(e.count)} στοιχεία`})}.`,selectedItem:e=>`Επιλέχθηκε το στοιχείο ${e.item}.`};var St={};St={deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var At={};At={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ningún elemento seleccionado",one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var wt={};wt={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Üksusi pole valitud",one:()=>`${t.number(e.count)} üksus valitud`,other:()=>`${t.number(e.count)} üksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var Nt={};Nt={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var zt={};zt={deselectedItem:e=>`${e.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Aucun élément sélectionné",one:()=>`${t.number(e.count)} élément sélectionné`,other:()=>`${t.number(e.count)} éléments sélectionnés`})}.`,selectedItem:e=>`${e.item} sélectionné.`};var Ft={};Ft={deselectedItem:e=>`${e.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${t.number(e.count)} נבחר`,other:()=>`${t.number(e.count)} פריטים נבחרו`})}.`,selectedItem:e=>`${e.item} נבחר.`};var Pt={};Pt={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Kt={};Kt={deselectedItem:e=>`${e.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${t.number(e.count)} elem kijelölve`,other:()=>`${t.number(e.count)} elem kijelölve`})}.`,selectedItem:e=>`${e.item} kijelölve.`};var It={};It={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nessun elemento selezionato",one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var jt={};jt={deselectedItem:e=>`${e.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"項目が選択されていません",one:()=>`${t.number(e.count)} 項目を選択しました`,other:()=>`${t.number(e.count)} 項目を選択しました`})}。`,selectedItem:e=>`${e.item} を選択しました。`};var Mt={};Mt={deselectedItem:e=>`${e.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"선택된 항목이 없습니다",one:()=>`${t.number(e.count)}개 항목이 선택되었습니다`,other:()=>`${t.number(e.count)}개 항목이 선택되었습니다`})}.`,selectedItem:e=>`${e.item}이(가) 선택되었습니다.`};var Tt={};Tt={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta elementų: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var Rt={};Rt={deselectedItem:e=>`Vienums ${e.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlasīts vienums ${e.item}.`};var Vt={};Vt={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer er valgt",one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Ot={};Ot={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Geen items geselecteerd",one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Ht={};Ht={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych elementów`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var Lt={};Lt={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ut={};Ut={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Wt={};Wt={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Niciun element selectat",one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Gt={};Gt={deselectedItem:e=>`${e.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Нет выбранных элементов",one:()=>`${t.number(e.count)} элемент выбран`,other:()=>`${t.number(e.count)} элементов выбрано`})}.`,selectedItem:e=>`${e.item} выбрано.`};var Yt={};Yt={deselectedItem:e=>`Nevybraté položky: ${e.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Žiadne vybraté položky",one:()=>`${t.number(e.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybraté položky: ${e.item}.`};var Zt={};Zt={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Noben element ni izbran",one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var _t={};_t={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var qt={};qt={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Inga markerade objekt",one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var Jt={};Jt={deselectedItem:e=>`${e.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${t.number(e.count)} öge seçildi`,other:()=>`${t.number(e.count)} öge seçildi`})}.`,selectedItem:e=>`${e.item} seçildi.`};var Xt={};Xt={deselectedItem:e=>`${e.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Жодних елементів не вибрано",one:()=>`${t.number(e.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} вибрано.`};var Qt={};Qt={deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`};var el={};el={deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`};var oe={};oe={"ar-AE":xt,"bg-BG":Ct,"cs-CZ":Dt,"da-DK":kt,"de-DE":Bt,"el-GR":Et,"en-US":St,"es-ES":At,"et-EE":wt,"fi-FI":Nt,"fr-FR":zt,"he-IL":Ft,"hr-HR":Pt,"hu-HU":Kt,"it-IT":It,"ja-JP":jt,"ko-KR":Mt,"lt-LT":Tt,"lv-LV":Rt,"nb-NO":Vt,"nl-NL":Ot,"pl-PL":Ht,"pt-BR":Lt,"pt-PT":Ut,"ro-RO":Wt,"ru-RU":Gt,"sk-SK":Yt,"sl-SI":Zt,"sr-SP":_t,"sv-SE":qt,"tr-TR":Jt,"uk-UA":Xt,"zh-CN":Qt,"zh-TW":el};const tl=7e3;let V=null;function ll(e,t="assertive",l=tl){V?V.announce(e,t,l):(V=new mu,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?V.announce(e,t,l):setTimeout(()=>{V?.isAttached()&&V?.announce(e,t,l)},100))}class mu{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let l=document.createElement("div");return l.setAttribute("role","log"),l.setAttribute("aria-live",t),l.setAttribute("aria-relevant","additions"),l}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,l="assertive",u=tl){var o,n;if(!this.node)return;let s=document.createElement("div");typeof t=="object"?(s.setAttribute("role","img"),s.setAttribute("aria-labelledby",t["aria-labelledby"])):s.textContent=t,l==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(s):(n=this.politeLog)===null||n===void 0||n.appendChild(s),t!==""&&setTimeout(()=>{s.remove()},u)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function pu(e){return e&&e.__esModule?e.default:e}function bu(e,t){let{getRowText:l=r=>{var d,m,c,i;return(i=(d=(m=t.collection).getTextValue)===null||d===void 0?void 0:d.call(m,r))!==null&&i!==void 0?i:(c=t.collection.getItem(r))===null||c===void 0?void 0:c.textValue}}=e,u=_(pu(oe),"@react-aria/grid"),o=t.selectionManager.rawSelection,n=k.useRef(o),s=Rl(()=>{var r;if(!t.selectionManager.isFocused||o===n.current){n.current=o;return}let d=Ee(o,n.current),m=Ee(n.current,o),c=t.selectionManager.selectionBehavior==="replace",i=[];if(t.selectionManager.selectedKeys.size===1&&c){let p=t.selectionManager.selectedKeys.keys().next().value;if(p!=null&&t.collection.getItem(p)){let a=l(p);a&&i.push(u.format("selectedItem",{item:a}))}}else if(d.size===1&&m.size===0){let p=d.keys().next().value;if(p!=null){let a=l(p);a&&i.push(u.format("selectedItem",{item:a}))}}else if(m.size===1&&d.size===0){let p=m.keys().next().value;if(p!=null&&t.collection.getItem(p)){let a=l(p);a&&i.push(u.format("deselectedItem",{item:a}))}}t.selectionManager.selectionMode==="multiple"&&(i.length===0||o==="all"||o.size>1||n.current==="all"||((r=n.current)===null||r===void 0?void 0:r.size)>1)&&i.push(o==="all"?u.format("selectedAll"):u.format("selectedCount",{count:o.size})),i.length>0&&ll(i.join(" ")),n.current=o});Me(()=>{if(t.selectionManager.isFocused)s();else{let r=requestAnimationFrame(s);return()=>cancelAnimationFrame(r)}},[o,t.selectionManager.isFocused])}function Ee(e,t){let l=new Set;if(e==="all"||t==="all")return l;for(let u of e.keys())t.has(u)||l.add(u);return l}function fu(e){return e&&e.__esModule?e.default:e}function hu(e){let t=_(fu(oe),"@react-aria/grid"),l=Vl(),u=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window,o=k.useMemo(()=>{let s=e.selectionManager.selectionMode,r=e.selectionManager.selectionBehavior,d;return u&&(d=t.format("longPressToSelect")),r==="replace"&&s!=="none"&&e.hasItemActions?d:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,u]);return fe(o)}function vu(e,t,l){let{isVirtualized:u,disallowTypeAhead:o,keyboardDelegate:n,focusMode:s,scrollRef:r,getRowText:d,onRowAction:m,onCellAction:c,escapeKeyBehavior:i="clearSelection",shouldSelectOnPressUp:p}=e,{selectionManager:a}=t;!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let b=ze({usage:"search",sensitivity:"base"}),{direction:v}=ue(),g=t.selectionManager.disabledBehavior,x=k.useMemo(()=>n||new yt({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:g,ref:l,direction:v,collator:b,focusMode:s}),[n,t.collection,t.disabledKeys,g,l,v,b,s]),{collectionProps:D}=Ol({ref:l,selectionManager:a,keyboardDelegate:x,isVirtualized:u,scrollRef:r,disallowTypeAhead:o,escapeKeyBehavior:i}),y=pe(e.id);ve.set(t,{keyboardDelegate:x,actions:{onRowAction:m,onCellAction:c},shouldSelectOnPressUp:p});let $=hu({selectionManager:a,hasItemActions:!!(m||c)}),f=Hl(e,{labelable:!0}),E=k.useCallback(C=>{if(a.isFocused){C.currentTarget.contains(C.target)||a.setFocused(!1);return}C.currentTarget.contains(C.target)&&a.setFocused(!0)},[a]),S=k.useMemo(()=>({onBlur:D.onBlur,onFocus:E}),[E,D.onBlur]),A=au(l,{isDisabled:t.collection.size!==0}),B=J(f,{role:"grid",id:y,"aria-multiselectable":a.selectionMode==="multiple"?"true":void 0},t.isKeyboardNavigationDisabled?S:D,t.collection.size===0&&{tabIndex:A?-1:0}||void 0,$);return u&&(B["aria-rowcount"]=t.collection.size,B["aria-colcount"]=t.collection.columnCount),bu({getRowText:d},t),{gridProps:B}}function gu(){return{rowGroupProps:{role:"rowgroup"}}}function $u(e,t,l){var u,o;let{node:n,isVirtualized:s,shouldSelectOnPressUp:r,onAction:d}=e,{actions:m,shouldSelectOnPressUp:c}=ve.get(t),i=m.onRowAction?()=>{var g;return(g=m.onRowAction)===null||g===void 0?void 0:g.call(m,n.key)}:d,{itemProps:p,...a}=je({selectionManager:t.selectionManager,key:n.key,ref:l,isVirtualized:s,shouldSelectOnPressUp:c||r,onAction:i||!(n==null||(u=n.props)===null||u===void 0)&&u.onAction?Ll(n==null||(o=n.props)===null||o===void 0?void 0:o.onAction,i):void 0,isDisabled:t.collection.size===0}),b=t.selectionManager.isSelected(n.key),v={role:"row","aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":a.isDisabled||void 0,...p};return s&&(v["aria-rowindex"]=n.index+1),{rowProps:v,...a}}function ul(e,t,l){let{node:u,isVirtualized:o,focusMode:n="child",shouldSelectOnPressUp:s,onAction:r}=e,{direction:d}=ue(),{keyboardDelegate:m,actions:{onCellAction:c}}=ve.get(t),i=k.useRef(null),p=()=>{if(l.current){let y=ae(l.current);if(n==="child"){if(l.current.contains(document.activeElement)&&l.current!==document.activeElement)return;let $=t.selectionManager.childFocusStrategy==="last"?re(y):y.firstChild();if($){L($);return}}(i.current!=null&&u.key!==i.current||!l.current.contains(document.activeElement))&&L(l.current)}},{itemProps:a,isPressed:b}=je({selectionManager:t.selectionManager,key:u.key,ref:l,isVirtualized:o,focus:p,shouldSelectOnPressUp:s,onAction:c?()=>c(u.key):r,isDisabled:t.collection.size===0}),v=y=>{if(!y.currentTarget.contains(y.target)||t.isKeyboardNavigationDisabled||!l.current||!document.activeElement)return;let $=ae(l.current);switch($.currentNode=document.activeElement,y.key){case"ArrowLeft":{let C=d==="rtl"?$.nextNode():$.previousNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var f;if(((f=m.getKeyLeftOf)===null||f===void 0?void 0:f.call(m,u.key))!==u.key){var E;(E=l.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&d==="rtl"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=d==="rtl"?$.firstChild():re($),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowRight":{let C=d==="rtl"?$.previousNode():$.nextNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var S;if(((S=m.getKeyRightOf)===null||S===void 0?void 0:S.call(m,u.key))!==u.key){var A;(A=l.current.parentElement)===null||A===void 0||A.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&d==="ltr"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=d==="rtl"?re($):$.firstChild(),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowUp":case"ArrowDown":if(!y.altKey&&l.current.contains(y.target)){var B;y.stopPropagation(),y.preventDefault(),(B=l.current.parentElement)===null||B===void 0||B.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent))}break}},g=y=>{if(i.current=u.key,y.target!==l.current){Ul()||t.selectionManager.setFocusedKey(u.key);return}requestAnimationFrame(()=>{n==="child"&&document.activeElement===l.current&&p()})},x=J(a,{role:"gridcell",onKeyDownCapture:v,"aria-colspan":u.colSpan,"aria-colindex":u.colIndex!=null?u.colIndex+1:void 0,colSpan:o?void 0:u.colSpan,onFocus:g});var D;return o&&(x["aria-colindex"]=((D=u.colIndex)!==null&&D!==void 0?D:u.index)+1),s&&x.tabIndex!=null&&x.onPointerDown==null&&(x.onPointerDown=y=>{let $=y.currentTarget,f=$.getAttribute("tabindex");$.removeAttribute("tabindex"),requestAnimationFrame(()=>{f!=null&&$.setAttribute("tabindex",f)})}),{gridCellProps:x,isPressed:b}}function re(e){let t=null,l=null;do l=e.lastChild(),l&&(t=l);while(l);return t}function yu(e){return e&&e.__esModule?e.default:e}function xu(e,t){let{key:l}=e,u=t.selectionManager,o=pe(),n=!t.selectionManager.canSelectItem(l),s=t.selectionManager.isSelected(l),r=()=>u.toggleSelection(l);const d=_(yu(oe),"@react-aria/grid");return{checkboxProps:{id:o,"aria-label":d.format("select"),isSelected:s,isDisabled:n,onChange:r}}}class Cu extends yt{isCell(t){return t.type==="cell"||t.type==="rowheader"||t.type==="column"}getKeyBelow(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let u=U(z(l,this.collection));if(u)return u.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(t)}getKeyAbove(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let n=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return n&&n.type==="column"?n.key:null}let u=super.getKeyAbove(t),o=u!=null?this.collection.getItem(u):null;return o&&o.type!=="headerrow"?u:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(t){let l=this.findNextKey(t.key,o=>o.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level];for(let o of z(u,this.collection))if(o.type==="column")return o.key;return null}findPreviousColumnKey(t){let l=this.findPreviousKey(t.key,n=>n.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level],o=[...z(u,this.collection)];for(let n=o.length-1;n>=0;n--){let s=o[n];if(s.type==="column")return s.key}return null}getKeyRightOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(l):this.findNextColumnKey(l):super.getKeyRightOf(t):null}getKeyLeftOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findNextColumnKey(l):this.findPreviousColumnKey(l):super.getKeyLeftOf(t):null}getKeyForSearch(t,l){if(!this.collator)return null;let u=this.collection,o=l??this.getFirstKey();if(o==null)return null;let n=u.getItem(o);var s;n?.type==="cell"&&(o=(s=n.parentKey)!==null&&s!==void 0?s:null);let r=!1;for(;o!=null;){let d=u.getItem(o);if(!d)return null;if(d.textValue){let m=d.textValue.slice(0,t.length);if(this.collator.compare(m,t)===0)return d.key}for(let m of z(d,this.collection)){let c=u.columns[m.index];if(u.rowHeaderColumnKeys.has(c.key)&&m.textValue){let i=m.textValue.slice(0,t.length);if(this.collator.compare(i,t)===0){let p=l!=null?u.getItem(l):n;return p?.type==="cell"?m.key:d.key}}}o=this.getKeyBelow(o),o==null&&!r&&(o=this.getFirstKey(),r=!0)}return null}}function Du(e){return e&&e.__esModule?e.default:e}function ku(e,t,l){let{keyboardDelegate:u,isVirtualized:o,layoutDelegate:n,layout:s}=e,r=ze({usage:"search",sensitivity:"base"}),{direction:d}=ue(),m=t.selectionManager.disabledBehavior,c=k.useMemo(()=>u||new Cu({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:m,ref:l,direction:d,collator:r,layoutDelegate:n,layout:s}),[u,t.collection,t.disabledKeys,m,l,d,r,n,s]),i=pe(e.id);he.set(t,i);let{gridProps:p}=vu({...e,id:i,keyboardDelegate:c},t,l);o&&(p["aria-rowcount"]=t.collection.size+t.collection.headerRows.length),le()&&"expandedKeys"in t&&(p.role="treegrid");let{column:a,direction:b}=t.sortDescriptor||{},v=_(Du(ne),"@react-aria/table"),g=k.useMemo(()=>{var D,y;let $=(y=(D=t.collection.columns.find(f=>f.key===a))===null||D===void 0?void 0:D.textValue)!==null&&y!==void 0?y:"";return b&&a?v.format(`${b}Sort`,{columnName:$}):void 0},[b,a,t.collection.columns]),x=fe(g);return Me(()=>{g&&ll(g,"assertive",500)},[g]),{gridProps:J(p,x,{"aria-describedby":[x["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")})}}function Bu(e){return e&&e.__esModule?e.default:e}function nl(e,t,l){var u,o;let{node:n}=e,s=n.props.allowsSorting,{gridCellProps:r}=ul({...e,focusMode:"child"},t,l),d=n.props.isSelectionCell&&t.selectionManager.selectionMode==="single",{pressProps:m}=Wl({isDisabled:!s||d,onPress(){t.sort(n.key)},ref:l}),{focusableProps:c}=Gl({},l),i,p=((u=t.sortDescriptor)===null||u===void 0?void 0:u.column)===n.key,a=(o=t.sortDescriptor)===null||o===void 0?void 0:o.direction;n.props.allowsSorting&&!Ce()&&(i=p?a:"none");let b=_(Bu(ne),"@react-aria/table"),v;s&&(v=`${b.format("sortable")}`,p&&a&&Ce()&&(v=`${v}, ${b.format(a)}`));let g=fe(v),x=t.collection.size===0;return k.useEffect(()=>{x&&t.selectionManager.focusedKey===n.key&&t.selectionManager.setFocusedKey(null)},[x,t.selectionManager,n.key]),{columnHeaderProps:{...J(c,r,m,g,x?{tabIndex:-1}:null),role:"columnheader",id:cu(t,n.key),"aria-colspan":n.colSpan&&n.colSpan>1?n.colSpan:void 0,"aria-sort":i}}}const Se={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Eu(e,t,l){let{node:u,isVirtualized:o}=e,{rowProps:n,...s}=$u(e,t,l),{direction:r}=ue();o&&!(le()&&"expandedKeys"in t)?n["aria-rowindex"]=u.index+1+t.collection.headerRows.length:delete n["aria-rowindex"];let d={};if(le()&&"expandedKeys"in t){let f=t.keyMap.get(u.key);if(f!=null){var m,c,i,p,a,b;let E=((m=f.props)===null||m===void 0?void 0:m.UNSTABLE_childItems)||((i=f.props)===null||i===void 0||(c=i.children)===null||c===void 0?void 0:c.length)>t.userColumnCount;var v,g,x,D;d={onKeyDown:S=>{(S.key===Se.expand[r]&&t.selectionManager.focusedKey===f.key&&E&&t.expandedKeys!=="all"&&!t.expandedKeys.has(f.key)||S.key===Se.collapse[r]&&t.selectionManager.focusedKey===f.key&&E&&(t.expandedKeys==="all"||t.expandedKeys.has(f.key)))&&(t.toggleKey(f.key),S.stopPropagation())},"aria-expanded":E?t.expandedKeys==="all"||t.expandedKeys.has(u.key):void 0,"aria-level":f.level,"aria-posinset":((v=f.indexOfType)!==null&&v!==void 0?v:0)+1,"aria-setsize":f.level>1?((x=(p=W((g=(a=t.keyMap.get(f.parentKey))===null||a===void 0?void 0:a.childNodes)!==null&&g!==void 0?g:[]))===null||p===void 0?void 0:p.indexOfType)!==null&&x!==void 0?x:0)+1:((D=(b=W(t.collection.body.childNodes))===null||b===void 0?void 0:b.indexOfType)!==null&&D!==void 0?D:0)+1}}}let y=Yl(u.props),$=s.hasAction?y:{};return{rowProps:{...J(n,d,$),"aria-labelledby":Re(t,u.key)},...s}}function Su(e,t,l){let{node:u,isVirtualized:o}=e,n={role:"row"};return o&&!(le()&&"expandedKeys"in t)&&(n["aria-rowindex"]=u.index+1),{rowProps:n}}function ol(e,t,l){var u;let{gridCellProps:o,isPressed:n}=ul(e,t,l),s=(u=e.node.column)===null||u===void 0?void 0:u.key;return s!=null&&t.collection.rowHeaderColumnKeys.has(s)&&(o.role="rowheader",o.id=Te(t,e.node.parentKey,s)),{gridCellProps:o,isPressed:n}}function Au(e){return e&&e.__esModule?e.default:e}function wu(e,t){let{key:l}=e;const{checkboxProps:u}=xu(e,t);return{checkboxProps:{...u,"aria-labelledby":`${u.id} ${Re(t,l)}`}}}function Nu(e){let{isEmpty:t,isSelectAll:l,selectionMode:u}=e.selectionManager;return{checkboxProps:{"aria-label":_(Au(ne),"@react-aria/table").format(u==="single"?"select":"selectAll"),isSelected:l,isDisabled:u!=="multiple"||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type==="loader",isIndeterminate:!t&&!l,onChange:()=>e.selectionManager.toggleSelectAll()}}}function ge(){return gu()}var sl=T((e,t)=>{var l,u;const{as:o,className:n,node:s,slots:r,state:d,selectionMode:m,color:c,checkboxesProps:i,disableAnimation:p,classNames:a,...b}=e,v=o||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:s},d,x),{isFocusVisible:y,focusProps:$}=X(),{checkboxProps:f}=Nu(d),E=K(a?.th,n,(l=s.props)==null?void 0:l.className),S=m==="single",{onChange:A,...B}=f;return h.jsx(v,{ref:x,"data-focus-visible":w(y),...I(D,$,O(s.props,{enabled:g}),O(b,{enabled:g})),className:(u=r.th)==null?void 0:u.call(r,{class:E}),children:S?h.jsx(be,{children:f["aria-label"]}):h.jsx(Fe,{color:c,disableAnimation:p,onValueChange:A,...I(i,B)})})});sl.displayName="HeroUI.TableSelectAllCheckbox";var il=sl;function zu(e){let{collection:t,focusMode:l}=e,u=e.UNSAFE_selectionState||Zl(e),o=k.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),n=u.setFocusedKey;u.setFocusedKey=(d,m)=>{if(l==="cell"&&d!=null){let b=t.getItem(d);if(b?.type==="item"){var c,i;let v=z(b,t);var p,a;m==="last"?d=(p=(c=W(v))===null||c===void 0?void 0:c.key)!==null&&p!==void 0?p:null:d=(a=(i=U(v))===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:null}}n(d,m)};let s=k.useMemo(()=>new _l(t,u),[t,u]);const r=k.useRef(null);return k.useEffect(()=>{if(u.focusedKey!=null&&r.current&&!t.getItem(u.focusedKey)){const d=r.current.getItem(u.focusedKey),m=d?.parentKey!=null&&(d.type==="cell"||d.type==="rowheader"||d.type==="column")?r.current.getItem(d.parentKey):d;if(!m){u.setFocusedKey(null);return}const c=r.current.rows,i=t.rows,p=c.length-i.length;let a=Math.min(p>1?Math.max(m.index-p+1,0):m.index,i.length-1),b=null;for(;a>=0;){if(!s.isDisabled(i[a].key)&&i[a].type!=="headerrow"){b=i[a];break}am.index&&(a=m.index),a--)}if(b){const v=b.hasChildNodes?[...z(b,t)]:[],g=b.hasChildNodes&&m!==d&&d&&d.index{let p=this.keyMap.get(i.key);t.visitNode&&(i=t.visitNode(i)),this.keyMap.set(i.key,i);let a=new Set,b=null,v=!1;if(i.type==="item"){var g;for(let f of i.childNodes)if(((g=f.props)===null||g===void 0?void 0:g.colSpan)!==void 0){v=!0;break}}for(let f of i.childNodes){if(f.type==="cell"&&v){var x,D;f.colspan=(x=f.props)===null||x===void 0?void 0:x.colSpan,f.colSpan=(D=f.props)===null||D===void 0?void 0:D.colSpan;var y,$;f.colIndex=b?((y=b.colIndex)!==null&&y!==void 0?y:b.index)+(($=b.colSpan)!==null&&$!==void 0?$:1):f.index}f.type==="cell"&&f.parentKey==null&&(f.parentKey=i.key),a.add(f.key),b?(b.nextKey=f.key,f.prevKey=b.key):f.prevKey=null,l(f),b=f}if(b&&(b.nextKey=null),p)for(let f of p.childNodes)a.has(f.key)||u(f)},u=i=>{this.keyMap.delete(i.key);for(let p of i.childNodes)this.keyMap.get(p.key)===p&&u(p)},o=null;for(let[i,p]of t.items.entries()){var n,s,r,d,m,c;let a={...p,level:(n=p.level)!==null&&n!==void 0?n:0,key:(s=p.key)!==null&&s!==void 0?s:"row-"+i,type:(r=p.type)!==null&&r!==void 0?r:"row",value:(d=p.value)!==null&&d!==void 0?d:null,hasChildNodes:!0,childNodes:[...p.childNodes],rendered:p.rendered,textValue:(m=p.textValue)!==null&&m!==void 0?m:"",index:(c=p.index)!==null&&c!==void 0?c:i};o?(o.nextKey=a.key,a.prevKey=o.key):a.prevKey=null,this.rows.push(a),l(a),o=a}o&&(o.nextKey=null)}}const rl="row-header-column-"+Math.random().toString(36).slice(2);let de="row-header-column-"+Math.random().toString(36).slice(2);for(;rl===de;)de="row-header-column-"+Math.random().toString(36).slice(2);function Pu(e,t){if(t.length===0)return[];let l=[],u=new Map;for(let c of t){let i=c.parentKey,p=[c];for(;i;){let a=e.get(i);if(!a)break;if(u.has(a)){var o,n;(n=(o=a).colSpan)!==null&&n!==void 0||(o.colSpan=0),a.colSpan++,a.colspan=a.colSpan;let{column:b,index:v}=u.get(a);if(v>p.length)break;for(let g=v;gc.length)),r=Array(s).fill(0).map(()=>[]),d=0;for(let c of l){let i=s-1;for(let p of c){if(p){let a=r[i],b=a.reduce((v,g)=>{var x;return v+((x=g.colSpan)!==null&&x!==void 0?x:1)},0);if(b0&&(a[a.length-1].nextKey=v.key,v.prevKey=a[a.length-1].key),a.push(v)}a.length>0&&(a[a.length-1].nextKey=p.key,p.prevKey=a[a.length-1].key),p.level=i,p.colIndex=d,a.push(p)}i--}d++}let m=0;for(let c of r){let i=c.reduce((p,a)=>{var b;return p+((b=a.colSpan)!==null&&b!==void 0?b:1)},0);if(i({type:"headerrow",key:"headerrow-"+i,index:i,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:c,textValue:""}))}class Ku extends Fu{*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let l=this.keyMap.get(t);var u;return(u=l?.prevKey)!==null&&u!==void 0?u:null}getKeyAfter(t){let l=this.keyMap.get(t);var u;return(u=l?.nextKey)!==null&&u!==void 0?u:null}getFirstKey(){var t,l;return(l=(t=U(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getLastKey(){var t,l;return(l=(t=W(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getItem(t){var l;return(l=this.keyMap.get(t))!==null&&l!==void 0?l:null}at(t){const l=[...this.getKeys()];return this.getItem(l[t])}getChildren(t){return t===this.body.key?this.body.childNodes:super.getChildren(t)}getTextValue(t){let l=this.getItem(t);if(!l)return"";if(l.textValue)return l.textValue;let u=this.rowHeaderColumnKeys;if(u){let o=[];for(let n of l.childNodes){let s=this.columns[n.index];if(u.has(s.key)&&n.textValue&&o.push(n.textValue),o.length===u.size)break}return o.join(" ")}return""}constructor(t,l,u){let o=new Set,n=null,s=[];if(u?.showSelectionCheckboxes){let i={type:"column",key:rl,value:null,textValue:"",level:0,index:u?.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};s.unshift(i)}if(u?.showDragButtons){let i={type:"column",key:de,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};s.unshift(i)}let r=[],d=new Map,m=i=>{switch(i.type){case"body":n=i;break;case"column":d.set(i.key,i),i.hasChildNodes||(s.push(i),i.props.isRowHeader&&o.add(i.key));break;case"item":r.push(i);return}for(let p of i.childNodes)m(p)};for(let i of t)m(i);let c=Pu(d,s);if(c.forEach((i,p)=>r.splice(p,0,i)),super({columnCount:s.length,items:r,visitNode:i=>(i.column=s[i.index],i)}),this._size=0,this.columns=s,this.rowHeaderColumnKeys=o,this.body=n,this.headerRows=c,this._size=[...n.childNodes].length,this.rowHeaderColumnKeys.size===0){let i=this.columns.find(p=>{var a,b;return!(!((a=p.props)===null||a===void 0)&&a.isDragButtonCell)&&!(!((b=p.props)===null||b===void 0)&&b.isSelectionCell)});i&&this.rowHeaderColumnKeys.add(i.key)}}}const Iu={ascending:"descending",descending:"ascending"};function ju(e){let[t,l]=k.useState(!1),{selectionMode:u="none",showSelectionCheckboxes:o,showDragButtons:n}=e,s=k.useMemo(()=>({showSelectionCheckboxes:o&&u!=="none",showDragButtons:n,selectionMode:u,columns:[]}),[e.children,o,u,n]),r=ql(e,k.useCallback(i=>new Ku(i,null,s),[s]),s),{disabledKeys:d,selectionManager:m}=zu({...e,collection:r,disabledBehavior:e.disabledBehavior||"selection"});var c;return{collection:r,disabledKeys:d,selectionManager:m,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:(c=e.sortDescriptor)!==null&&c!==void 0?c:null,isKeyboardNavigationDisabled:r.size===0||t,setKeyboardNavigationDisabled:l,sort(i,p){var a,b;(b=e.onSortChange)===null||b===void 0||b.call(e,{column:i,direction:p??(((a=e.sortDescriptor)===null||a===void 0?void 0:a.column)===i?Iu[e.sortDescriptor.direction]:"ascending")})}}}function al(e){return null}al.getCollectionNode=function*(t,l){let{children:u,columns:o}=t;if(l.columns=[],typeof u=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let n of o)yield{type:"column",value:n,renderer:u}}else{let n=[];q.Children.forEach(u,s=>{n.push({type:"column",element:s})}),yield*n}};let Mu=al;function cl(e){return null}cl.getCollectionNode=function*(t){let{children:l,items:u}=t;yield{type:"body",hasChildNodes:!0,props:t,*childNodes(){if(typeof l=="function"){if(!u)throw new Error("props.children was a function but props.items is missing");for(let o of u)yield{type:"item",value:o,renderer:l}}else{let o=[];q.Children.forEach(l,n=>{o.push({type:"item",element:n})}),yield*o}}}};let Tu=cl;function dl(e){return null}dl.getCollectionNode=function*(t,l){let{title:u,children:o,childColumns:n}=t,s=u||o,r=t.textValue||(typeof s=="string"?s:"")||t["aria-label"],d=yield{type:"column",hasChildNodes:!!n||!!u&&q.Children.count(o)>0,rendered:s,textValue:r,props:t,*childNodes(){if(n)for(let c of n)yield{type:"column",value:c};else if(u){let c=[];q.Children.forEach(o,i=>{c.push({type:"column",element:i})}),yield*c}},shouldInvalidate(c){return m(c),!1}},m=c=>{for(let i of d)i.hasChildNodes||c.columns.push(i)};m(l)};let Ru=dl;function me(e){return null}me.getCollectionNode=function*(t,l){let{children:u,textValue:o,UNSTABLE_childItems:n}=t;yield{type:"item",props:t,textValue:o,"aria-label":t["aria-label"],hasChildNodes:!0,*childNodes(){if(l.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),l.showSelectionCheckboxes&&l.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof u=="function"){for(let s of l.columns)yield{type:"cell",element:u(s.key),key:s.key};if(n)for(let s of n)yield{type:"item",value:s}}else{let s=[],r=[],d=0;if(q.Children.forEach(u,m=>{if(m.type===me){if(s.lengthr.key!==l.columns[d].key)||s.showSelectionCheckboxes!==l.showSelectionCheckboxes||s.showDragButtons!==l.showDragButtons||s.selectionMode!==l.selectionMode}}};let Vu=me;function ml(e){return null}ml.getCollectionNode=function*(t){let{children:l}=t,u=t.textValue||(typeof l=="string"?l:"")||t["aria-label"]||"";yield{type:"cell",props:t,rendered:l,textValue:u,"aria-label":t["aria-label"],hasChildNodes:!1}};let Ou=ml;function pl(e){var t;const l=Jl(),[u,o]=Pe(e,Be.variantKeys),{ref:n,as:s,baseRef:r,children:d,className:m,classNames:c,removeWrapper:i=!1,disableAnimation:p=(t=l?.disableAnimation)!=null?t:!1,isKeyboardNavigationDisabled:a=!1,selectionMode:b="none",topContentPlacement:v="inside",bottomContentPlacement:g="inside",selectionBehavior:x=b==="none"?null:"toggle",disabledBehavior:D="selection",showSelectionCheckboxes:y=b==="multiple"&&x!=="replace",BaseComponent:$="div",checkboxesProps:f,topContent:E,bottomContent:S,sortIcon:A,onRowAction:B,onCellAction:C,...N}=u,j=s||"table",F=typeof j=="string",R=M(n),Q=M(r),G=ju({...e,children:d,showSelectionCheckboxes:y});a&&!G.isKeyboardNavigationDisabled&&G.setKeyboardNavigationDisabled(!0);const{collection:se}=G,{layout:sn,...Fl}=e,{gridProps:$e}=ku({...Fl},G,R),ee=b!=="none",ye=b==="multiple",H=k.useMemo(()=>Be({...o,isSelectable:ee,isMultiSelectable:ye}),[Ke(o),ee,ye]),xe=K(c?.base,m),Pl=k.useMemo(()=>{var P;return{state:G,slots:H,isSelectable:ee,collection:se,classNames:c,color:e?.color,disableAnimation:p,checkboxesProps:f,isHeaderSticky:(P=e?.isHeaderSticky)!=null?P:!1,selectionMode:b,selectionBehavior:x,disabledBehavior:D,showSelectionCheckboxes:y,onRowAction:B,onCellAction:C}},[H,G,se,ee,c,b,x,f,D,p,y,e?.color,e?.isHeaderSticky,B,C]),Kl=k.useCallback(P=>({...P,ref:Q,className:H.base({class:K(xe,P?.className)})}),[xe,H]),Il=k.useCallback(P=>({...P,ref:Q,className:H.wrapper({class:K(c?.wrapper,P?.className)})}),[c?.wrapper,H]),jl=k.useCallback(P=>({...I($e,O(N,{enabled:F}),P),onKeyDownCapture:void 0,ref:R,className:H.table({class:K(c?.table,P?.className)})}),[c?.table,F,H,$e,N]);return{BaseComponent:$,Component:j,children:d,state:G,collection:se,values:Pl,topContent:E,bottomContent:S,removeWrapper:i,topContentPlacement:v,bottomContentPlacement:g,sortIcon:A,getBaseProps:Kl,getWrapperProps:Il,getTableProps:jl}}var bl=T((e,t)=>{var l,u,o;const{as:n,className:s,node:r,rowKey:d,slots:m,state:c,classNames:i,...p}=e,a=n||"td",b=typeof a=="string",v=M(t),{gridCellProps:g}=ol({node:r},c,v),x=K(i?.td,s,(l=r.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=c.selectionManager.isSelected(d),f=k.useMemo(()=>{const S=typeof r.rendered;return S!=="object"&&S!=="function"?h.jsx("span",{children:r.rendered}):r.rendered},[r.rendered]),E=((u=r.column)==null?void 0:u.props)||{};return h.jsx(a,{ref:v,"data-focus-visible":w(D),"data-selected":w($),...I(g,y,O(r.props,{enabled:b}),p),className:(o=m.td)==null?void 0:o.call(m,{align:E.align,class:x}),children:f})});bl.displayName="HeroUI.TableCell";var fl=bl,hl=T((e,t)=>{var l,u;const{as:o,className:n,node:s,rowKey:r,slots:d,state:m,color:c,disableAnimation:i,checkboxesProps:p,selectionMode:a,classNames:b,...v}=e,g=o||"td",x=typeof g=="string",D=M(t),{gridCellProps:y}=ol({node:s},m,D),{isFocusVisible:$,focusProps:f}=X(),{checkboxProps:E}=wu({key:s?.parentKey||s.key},m),S=K(b?.td,n,(l=s.props)==null?void 0:l.className),A=a==="single",{onChange:B,...C}=E,N=m.selectionManager.isSelected(r);return h.jsx(g,{ref:D,"data-focus-visible":w($),"data-selected":w(N),...I(y,f,O(s.props,{enabled:x}),v),className:(u=d.td)==null?void 0:u.call(d,{class:S}),children:A?h.jsx(be,{children:E["aria-label"]}):h.jsx(Fe,{color:c,disableAnimation:i,onValueChange:B,...I(p,C)})})});hl.displayName="HeroUI.TableCheckboxCell";var vl=hl,gl=T((e,t)=>{var l,u;const{as:o,className:n,children:s,node:r,slots:d,state:m,isSelectable:c,classNames:i,...p}=e,a=o||(e?.href?"a":"tr"),b=typeof a=="string",v=M(t),{rowProps:g}=Eu({node:r},m,v),x=K(i?.tr,n,(l=r.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=m.disabledKeys.has(r.key),f=m.selectionManager.isSelected(r.key),{isHovered:E,hoverProps:S}=Ie({isDisabled:$}),{isFirst:A,isLast:B,isMiddle:C,isOdd:N}=k.useMemo(()=>{const j=r.key===m.collection.getFirstKey(),F=r.key===m.collection.getLastKey(),R=!j&&!F,Q=r?.index?(r.index+1)%2===0:!1;return{isFirst:j,isLast:F,isMiddle:R,isOdd:Q}},[r,m.collection]);return h.jsx(a,{ref:v,"data-disabled":w($),"data-first":w(A),"data-focus-visible":w(D),"data-hover":w(E),"data-last":w(B),"data-middle":w(C),"data-odd":w(N),"data-selected":w(f),...I(g,y,c?S:{},O(r.props,{enabled:b}),p),className:(u=d.tr)==null?void 0:u.call(d,{class:x}),children:s})});gl.displayName="HeroUI.TableRow";var $l=gl,yl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:s,collection:r,isSelectable:d,color:m,disableAnimation:c,checkboxesProps:i,selectionMode:p,classNames:a,rowVirtualizer:b,...v}=e,g=u||"tbody",x=typeof g=="string",D=M(t),{rowGroupProps:y}=ge(),$=K(a?.tbody,o),f=r?.body.props,E=f?.isLoading||f?.loadingState==="loading"||f?.loadingState==="loadingMore",S=[...r.body.childNodes],A=b.getVirtualItems();let B,C;return r.size===0&&f.emptyContent&&(B=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper}),colSpan:r.columnCount,role:"gridcell",children:!E&&f.emptyContent})})),E&&f.loadingContent&&(C=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:a?.loadingWrapper}),colSpan:r.columnCount,role:"gridcell",children:f.loadingContent}),!B&&r.size===0?h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper})}):null]})),h.jsxs(g,{ref:D,...I(y,O(f,{enabled:x}),v),className:(l=n.tbody)==null?void 0:l.call(n,{class:$}),"data-empty":w(r.size===0),"data-loading":w(E),children:[A.map((N,j)=>{const F=S[N.index];return F?h.jsx($l,{classNames:a,isSelectable:d,node:F,slots:n,state:s,style:{transform:`translateY(${N.start-j*N.size}px)`,height:`${N.size}px`},children:[...F.childNodes].map(R=>R.props.isSelectionCell?h.jsx(vl,{checkboxesProps:i,classNames:a,color:m,disableAnimation:c,node:R,rowKey:F.key,selectionMode:p,slots:n,state:s},String(R.key)):h.jsx(fl,{classNames:a,node:R,rowKey:F.key,slots:n,state:s},String(R.key)))},String(F.key)):null}),C,B]})});yl.displayName="HeroUI.VirtualizedTableBody";var Hu=yl,xl=T((e,t)=>{var l,u,o,n,s;const{as:r,className:d,state:m,node:c,slots:i,classNames:p,sortIcon:a,...b}=e,v=r||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:c},m,x),y=K(p?.th,d,(l=c.props)==null?void 0:l.className),{isFocusVisible:$,focusProps:f}=X(),{isHovered:E,hoverProps:S}=Ie({}),{hideHeader:A,align:B,...C}=c.props,N=C.allowsSorting,j={"aria-hidden":!0,"data-direction":(u=m.sortDescriptor)==null?void 0:u.direction,"data-visible":w(((o=m.sortDescriptor)==null?void 0:o.column)===c.key),className:(n=i.sortIcon)==null?void 0:n.call(i,{class:p?.sortIcon})},F=typeof a=="function"?a(j):k.isValidElement(a)&&k.cloneElement(a,j);return h.jsxs(v,{ref:x,colSpan:c.colspan,"data-focus-visible":w($),"data-hover":w(E),"data-sortable":w(N),...I(D,f,O(C,{enabled:g}),N?S:{},b),className:(s=i.th)==null?void 0:s.call(i,{align:B,class:y}),children:[A?h.jsx(be,{children:c.rendered}):c.rendered,N&&(F||h.jsx(su,{strokeWidth:3,...j}))]})});xl.displayName="HeroUI.TableColumnHeader";var Cl=xl,Dl=T((e,t)=>{var l,u;const{as:o,className:n,children:s,node:r,slots:d,classNames:m,state:c,...i}=e,p=o||"tr",a=typeof p=="string",b=M(t),{rowProps:v}=Su({node:r},c),g=K(m?.tr,n,(l=r.props)==null?void 0:l.className);return h.jsx(p,{ref:b,...I(v,O(r.props,{enabled:a}),i),className:(u=d.tr)==null?void 0:u.call(d,{class:g}),children:s})});Dl.displayName="HeroUI.TableHeaderRow";var kl=Dl,Bl=k.forwardRef((e,t)=>{var l;const{as:u,className:o,children:n,slots:s,classNames:r,...d}=e,m=u||"thead",c=M(t),{rowGroupProps:i}=ge(),p=K(r?.thead,o);return h.jsx(m,{ref:c,className:(l=s.thead)==null?void 0:l.call(s,{class:p}),...I(i,d),children:n})});Bl.displayName="HeroUI.TableRowGroup";var El=Bl,Lu={px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Ae=e=>{var t;return(t=Lu[e])!=null?t:e};function Uu(e){const[t,l]=Pe(e,ke.variantKeys),{as:u,className:o,x:n=1,y:s=1,...r}=t,d=u||"span",m=k.useMemo(()=>ke({...l,className:o}),[Ke(l),o]),c=Ae(n),i=Ae(s);return{Component:d,getSpacerProps:(a={})=>({...a,...r,"aria-hidden":w(!0),className:K(m,a.className),style:{...a.style,...r.style,marginLeft:c,marginTop:i}})}}var Sl=T((e,t)=>{const{Component:l,getSpacerProps:u}=Uu({...e});return h.jsx(l,{ref:t,...u()})});Sl.displayName="HeroUI.Spacer";var Al=Sl,wl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:s,topContentPlacement:r,bottomContentPlacement:d,bottomContent:m,getBaseProps:c,getWrapperProps:i,getTableProps:p}=pl({...e,ref:t}),{rowHeight:a=40,maxTableHeight:b=600}=e,v=k.useCallback(({children:A})=>h.jsx(l,{...i(),ref:D,style:{height:b,display:"block"},children:A}),[i,b]),x=[...o.body.childNodes].length,D=k.useRef(null),[y,$]=k.useState(0),f=k.useRef(null);k.useLayoutEffect(()=>{f.current&&$(f.current.getBoundingClientRect().height)},[f]);const E=iu({count:x,getScrollElement:()=>D.current,estimateSize:()=>a,overscan:5}),S=p();return h.jsxs("div",{...c(),children:[r==="outside"&&s,h.jsx(v,{children:h.jsxs(h.Fragment,{children:[r==="inside"&&s,h.jsxs(u,{...S,style:{height:`calc(${E.getTotalSize()+y}px)`,...S.style},children:[h.jsxs(El,{ref:f,classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(A=>h.jsx(kl,{classNames:n.classNames,node:A,slots:n.slots,state:n.state,children:[...A.childNodes].map(B=>{var C;return(C=B?.props)!=null&&C.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:B,selectionMode:n.selectionMode,slots:n.slots,state:n.state},B?.key):h.jsx(Cl,{classNames:n.classNames,node:B,slots:n.slots,state:n.state},B?.key)})},A?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Hu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,rowVirtualizer:E,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),d==="inside"&&m]})}),d==="outside"&&m]})});wl.displayName="HeroUI.VirtualizedTable";var Wu=wl,Nl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:s,collection:r,isSelectable:d,color:m,disableAnimation:c,checkboxesProps:i,selectionMode:p,classNames:a,...b}=e,v=u||"tbody",g=typeof v=="string",x=M(t),{rowGroupProps:D}=ge(),y=K(a?.tbody,o),$=r?.body.props,f=$?.isLoading||$?.loadingState==="loading"||$?.loadingState==="loadingMore",E=k.useMemo(()=>[...r.body.childNodes].map(B=>h.jsx($l,{classNames:a,isSelectable:d,node:B,slots:n,state:s,children:[...B.childNodes].map(C=>C.props.isSelectionCell?h.jsx(vl,{checkboxesProps:i,classNames:a,color:m,disableAnimation:c,node:C,rowKey:B.key,selectionMode:p,slots:n,state:s},C.key):h.jsx(fl,{classNames:a,node:C,rowKey:B.key,slots:n,state:s},C.key))},B.key)),[r.body.childNodes,a,d,n,s]);let S,A;return r.size===0&&$.emptyContent&&(S=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper}),colSpan:r.columnCount,role:"gridcell",children:!f&&$.emptyContent})})),f&&$.loadingContent&&(A=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:a?.loadingWrapper}),colSpan:r.columnCount,role:"gridcell",children:$.loadingContent}),!S&&r.size===0?h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper})}):null]})),h.jsxs(v,{ref:x,...I(D,O($,{enabled:g}),b),className:(l=n.tbody)==null?void 0:l.call(n,{class:y}),"data-empty":w(r.size===0),"data-loading":w(f),children:[E,A,S]})});Nl.displayName="HeroUI.TableBody";var Gu=Nl,zl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:s,topContentPlacement:r,bottomContentPlacement:d,bottomContent:m,removeWrapper:c,sortIcon:i,getBaseProps:p,getWrapperProps:a,getTableProps:b}=pl({...e,ref:t}),{isVirtualized:v,rowHeight:g=40,maxTableHeight:x=600}=e,D=v,y=k.useCallback(({children:$})=>c?$:h.jsx(l,{...a(),children:$}),[c,a]);return D?h.jsx(Wu,{...e,ref:t,maxTableHeight:x,rowHeight:g}):h.jsxs("div",{...p(),children:[r==="outside"&&s,h.jsx(y,{children:h.jsxs(h.Fragment,{children:[r==="inside"&&s,h.jsxs(u,{...b(),children:[h.jsxs(El,{classNames:n.classNames,slots:n.slots,children:[o.headerRows.map($=>h.jsx(kl,{classNames:n.classNames,node:$,slots:n.slots,state:n.state,children:[...$.childNodes].map(f=>{var E;return(E=f?.props)!=null&&E.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:f,selectionMode:n.selectionMode,slots:n.slots,state:n.state},f?.key):h.jsx(Cl,{classNames:n.classNames,node:f,slots:n.slots,sortIcon:i,state:n.state},f?.key)})},$?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Gu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),d==="inside"&&m]})}),d==="outside"&&m]})});zl.displayName="HeroUI.Table";var Yu=zl,Zu=Ru,_u=Zu,qu=Mu,Ju=qu,Xu=Vu,Qu=Xu,en=Tu,tn=en,ln=Ou,un=ln;const nn={n_requests:"Number Of Requests",estimated_cost:"Estimated Cost ($)"},we=["model","n_requests","prompt_tokens","completion_tokens","total_tokens","estimated_cost"];function on(e){return e.replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(t,l,u,o,n){return n<0?l+"0."+Array(1-n-u.length).join("0")+o+u:l+u+o+Array(n-o.length+1).join("0")})}function mn({message:e}){const t=e.usage,{isOpen:l,onOpen:u,onClose:o}=Xl();if(!t||Object.keys(t).length<1)return null;const n=Object.keys(t),s=()=>{o()},r=Object.keys(t[n[0]]),d=[...we.filter(b=>b==="model"||r.includes(b)),...r.filter(b=>!we.includes(b))],m=r.reduce((b,v)=>({...b,[v]:0}),{}),c=n.reduce((b,v)=>(d.reduce((g,x)=>(x==="model"||(g[x]+=t[v][x]),g),b),b),m),i=[...d.map(b=>({key:b,label:nn[b]??De.words(b).map(De.upperFirst).join(" ")}))],p=[...n.map(b=>({model:b,...t[b]})),{model:"Total",...c}],a=h.jsxs("div",{className:"p-2",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[c.prompt_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Prompt tokens"}),h.jsx("span",{children:c.prompt_tokens})]}),c.completion_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Completion tokens"}),h.jsx("span",{children:c.completion_tokens})]}),c.total_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Total tokens"}),h.jsx("span",{children:c.total_tokens})]}),c.estimated_cost!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Estimated cost"}),h.jsxs("span",{children:[on(c.estimated_cost.toString()),"$"]})]})]}),h.jsx("p",{className:"m-auto mt-2 text-center",children:"Show detailed usage breakdown by model."})]});return h.jsxs(h.Fragment,{children:[h.jsx(Ql,{content:a,placement:"bottom",children:h.jsx(eu,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open usage details",onPress:u,children:h.jsx(tu,{icon:"heroicons:information-circle"})})}),h.jsx(lu,{isOpen:l,onOpenChange:s,size:"4xl",children:h.jsx(uu,{children:h.jsxs(h.Fragment,{children:[h.jsx(ru,{className:"text-default-900 flex flex-col gap-1",children:"Usage details"}),h.jsx(nu,{children:h.jsxs(Yu,{"aria-label":"Table with detailed usage statistics for each model used to generate the message.",fullWidth:!0,children:[h.jsx(Ju,{columns:i,children:b=>h.jsx(_u,{children:b.label},b.key)}),h.jsx(tn,{items:p,children:b=>h.jsx(Qu,{className:b.model==="Total"?"border-default-200 border-t-1":"",children:v=>h.jsx(un,{children:ou(b,v)})},b.model)})]})})]})})})]})}export{mn as default}; +import{r as k,aY as Ml,aZ as ae,t as Ne,k as ie,aL as z,a_ as W,a$ as U,b0 as te,b1 as Tl,aU as _,b2 as Rl,b3 as Vl,A as ze,b4 as ue,b5 as Ol,K as pe,H as Hl,J,M as Ll,b6 as L,af as Ul,b7 as Y,b8 as Z,b9 as le,U as Wl,ba as Gl,bb as Ce,bc as Yl,l as T,R as M,W as X,Z as K,j as h,ap as be,au as Fe,v as I,a3 as O,a2 as w,w as Zl,y as _l,x as ql,a5 as q,O as Jl,Q as Pe,a0 as Ke,X as Ie,u as Xl,as as De,D as Ql,d as eu,I as tu,m as lu,e as uu,f as nu,bd as ou}from"./index-DKQs0Q0w.js";import{b as fe,$ as je}from"./useSelectableItem-Svsj-E2p.js";import{C as su,u as iu}from"./index-DgPm4MMk.js";import{m as ru}from"./chunk-IGSAU2ZA-B7iwVIJ3.js";function Me(e,t){const l=k.useRef(!0),u=k.useRef(null);k.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]),k.useEffect(()=>{let o=u.current;l.current?l.current=!1:(!o||t.some((n,s)=>!Object.is(n,o[s])))&&e(),u.current=t},t)}function au(e,t){let l=t?.isDisabled,[u,o]=k.useState(!1);return Ml(()=>{if(e?.current&&!l){let n=()=>{if(e.current){let r=ae(e.current,{tabbable:!0});o(!!r.nextNode())}};n();let s=new MutationObserver(n);return s.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{s.disconnect()}}}),l?!1:u}var ke=Ne({base:"w-px h-px inline-block",variants:{isInline:{true:"inline-block",false:"block"}},defaultVariants:{isInline:!1}}),Be=Ne({slots:{base:"flex flex-col relative gap-4",wrapper:["p-4","z-0","flex","flex-col","relative","justify-between","gap-4","shadow-small","bg-content1","overflow-auto"],table:"min-w-full h-auto",thead:"[&>tr]:first:rounded-lg",tbody:"after:block",tr:["group/tr","outline-hidden",...ie],th:["group/th","px-3","h-10","text-start","align-middle","bg-default-100","whitespace-nowrap","text-foreground-500","text-tiny","font-semibold","first:rounded-s-lg","last:rounded-e-lg","outline-hidden","data-[sortable=true]:cursor-pointer","data-[hover=true]:text-foreground-400",...ie],td:["py-2","px-3","relative","align-middle","whitespace-normal","text-small","font-normal","outline-hidden","[&>*]:z-1","[&>*]:relative",...ie,"before:pointer-events-none","before:content-['']","before:absolute","before:z-0","before:inset-0","before:opacity-0","data-[selected=true]:before:opacity-100","group-data-[disabled=true]/tr:text-foreground-300","group-data-[disabled=true]/tr:cursor-not-allowed"],tfoot:"",sortIcon:["ms-2","mb-px","opacity-0","text-inherit","inline-block","transition-transform-opacity","data-[visible=true]:opacity-100","group-data-[hover=true]/th:opacity-100","data-[direction=ascending]:rotate-180"],emptyWrapper:"text-foreground-400 align-middle text-center h-40",loadingWrapper:"absolute inset-0 flex items-center justify-center"},variants:{color:{default:{td:"before:bg-default/60 data-[selected=true]:text-default-foreground"},primary:{td:"before:bg-primary/20 data-[selected=true]:text-primary"},secondary:{td:"before:bg-secondary/20 data-[selected=true]:text-secondary"},success:{td:"before:bg-success/20 data-[selected=true]:text-success-600 dark:data-[selected=true]:text-success"},warning:{td:"before:bg-warning/20 data-[selected=true]:text-warning-600 dark:data-[selected=true]:text-warning"},danger:{td:"before:bg-danger/20 data-[selected=true]:text-danger dark:data-[selected=true]:text-danger-500"}},layout:{auto:{table:"table-auto"},fixed:{table:"table-fixed"}},shadow:{none:{wrapper:"shadow-none"},sm:{wrapper:"shadow-small"},md:{wrapper:"shadow-medium"},lg:{wrapper:"shadow-large"}},hideHeader:{true:{thead:"hidden"}},isStriped:{true:{td:["group-data-[odd=true]/tr:before:bg-default-100","group-data-[odd=true]/tr:before:opacity-100","group-data-[odd=true]/tr:before:-z-10"]}},isCompact:{true:{td:"py-1"},false:{}},isHeaderSticky:{true:{thead:"sticky top-0 z-20 [&>tr]:first:shadow-small"}},isSelectable:{true:{tr:"cursor-default",td:["group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:bg-default-100","group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:opacity-70"]}},isMultiSelectable:{true:{td:["group-data-[first=true]/tr:first:before:rounded-ss-lg","group-data-[first=true]/tr:last:before:rounded-se-lg","group-data-[middle=true]/tr:before:rounded-none","group-data-[last=true]/tr:first:before:rounded-es-lg","group-data-[last=true]/tr:last:before:rounded-ee-lg"]},false:{td:["first:before:rounded-s-lg","last:before:rounded-e-lg"]}},radius:{none:{wrapper:"rounded-none",th:["first:rounded-s-none","first:before:rounded-s-none","last:rounded-e-none","last:before:rounded-e-none"],td:["first:before:rounded-s-none","last:before:rounded-e-none","group-data-[first=true]/tr:first:before:rounded-ss-none","group-data-[first=true]/tr:last:before:rounded-se-none","group-data-[last=true]/tr:first:before:rounded-es-none","group-data-[last=true]/tr:last:before:rounded-ee-none"]},sm:{wrapper:"rounded-small"},md:{wrapper:"rounded-medium"},lg:{wrapper:"rounded-large"}},fullWidth:{true:{base:"w-full",wrapper:"w-full",table:"w-full"}},align:{start:{th:"text-start",td:"text-start"},center:{th:"text-center",td:"text-center"},end:{th:"text-end",td:"text-end"}}},defaultVariants:{layout:"auto",shadow:"sm",radius:"lg",color:"default",isCompact:!1,hideHeader:!1,isStriped:!1,fullWidth:!0,align:"start"},compoundVariants:[{isStriped:!0,color:"default",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-default/60"}},{isStriped:!0,color:"primary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-primary/20"}},{isStriped:!0,color:"secondary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-secondary/20"}},{isStriped:!0,color:"success",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-success/20"}},{isStriped:!0,color:"warning",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-warning/20"}},{isStriped:!0,color:"danger",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-danger/20"}}]});const he=new WeakMap;function ce(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function cu(e,t){let l=he.get(e);if(!l)throw new Error("Unknown grid");return`${l}-${ce(t)}`}function Te(e,t,l){let u=he.get(e);if(!u)throw new Error("Unknown grid");return`${u}-${ce(t)}-${ce(l)}`}function Re(e,t){return[...e.collection.rowHeaderColumnKeys].map(l=>Te(e,t,l)).join(" ")}var Ve={};Ve={ascending:"تصاعدي",ascendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تصاعدي`,columnSize:e=>`${e.value} بالبكسل`,descending:"تنازلي",descendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب"};var Oe={};Oe={ascending:"възходящ",ascendingSort:e=>`сортирано по колона ${e.columnName} във възходящ ред`,columnSize:e=>`${e.value} пиксела`,descending:"низходящ",descendingSort:e=>`сортирано по колона ${e.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона"};var He={};He={ascending:"vzestupně",ascendingSort:e=>`řazeno vzestupně podle sloupce ${e.columnName}`,columnSize:e=>`${e.value} pixelů`,descending:"sestupně",descendingSort:e=>`řazeno sestupně podle sloupce ${e.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení"};var Le={};Le={ascending:"stigende",ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende rækkefølge`,columnSize:e=>`${e.value} pixels`,descending:"faldende",descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne"};var Ue={};Ue={ascending:"aufsteigend",ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,columnSize:e=>`${e.value} Pixel`,descending:"absteigend",descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte"};var We={};We={ascending:"αύξουσα",ascendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε αύξουσα σειρά`,columnSize:e=>`${e.value} pixel`,descending:"φθίνουσα",descendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής"};var Ge={};Ge={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:"Press Enter to start resizing"};var Ye={};Ye={ascending:"ascendente",ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,columnSize:e=>`${e.value} píxeles`,descending:"descendente",descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable"};var Ze={};Ze={ascending:"tõusev järjestus",ascendingSort:e=>`sorditud veeru järgi ${e.columnName} tõusvas järjestuses`,columnSize:e=>`${e.value} pikslit`,descending:"laskuv järjestus",descendingSort:e=>`sorditud veeru järgi ${e.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg"};var _e={};_e={ascending:"nouseva",ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa järjestyksessä`,columnSize:e=>`${e.value} pikseliä`,descending:"laskeva",descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake"};var qe={};qe={ascending:"croissant",ascendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre croissant`,columnSize:e=>`${e.value} pixels`,descending:"décroissant",descendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable"};var Je={};Je={ascending:"עולה",ascendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר עולה`,columnSize:e=>`${e.value} פיקסלים`,descending:"יורד",descendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין"};var Xe={};Xe={ascending:"rastući",ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastućem redoslijedom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`razvrstano po stupcima ${e.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati"};var Qe={};Qe={ascending:"növekvő",ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, növekvő sorrendben`,columnSize:e=>`${e.value} képpont`,descending:"csökkenő",descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop"};var et={};et={ascending:"crescente",ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,columnSize:e=>`${e.value} pixel`,descending:"decrescente",descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile"};var tt={};tt={ascending:"昇順",ascendingSort:e=>`列 ${e.columnName} を昇順で並べ替え`,columnSize:e=>`${e.value} ピクセル`,descending:"降順",descendingSort:e=>`列 ${e.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列"};var lt={};lt={ascending:"오름차순",ascendingSort:e=>`${e.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:e=>`${e.value} 픽셀`,descending:"내림차순",descendingSort:e=>`${e.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열"};var ut={};ut={ascending:"didėjančia tvarka",ascendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} didėjančia tvarka`,columnSize:e=>`${e.value} piks.`,descending:"mažėjančia tvarka",descendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis"};var nt={};nt={ascending:"augošā secībā",ascendingSort:e=>`kārtots pēc kolonnas ${e.columnName} augošā secībā`,columnSize:e=>`${e.value} pikseļi`,descending:"dilstošā secībā",descendingSort:e=>`kārtots pēc kolonnas ${e.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna"};var ot={};ot={ascending:"stigende",ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkefølge`,columnSize:e=>`${e.value} piksler`,descending:"synkende",descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres"};var st={};st={ascending:"oplopend",ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,columnSize:e=>`${e.value} pixels`,descending:"aflopend",descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom"};var it={};it={ascending:"rosnąco",ascendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku rosnącym`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:"malejąco",descendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania"};var rt={};rt={ascending:"crescente",ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,columnSize:e=>`${e.value} pixels`,descending:"decrescente",descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável"};var at={};at={ascending:"ascendente",ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,columnSize:e=>`${e.value} pixels`,descending:"descendente",descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável"};var ct={};ct={ascending:"crescătoare",ascendingSort:e=>`sortate după coloana ${e.columnName} în ordine crescătoare`,columnSize:e=>`${e.value} pixeli`,descending:"descrescătoare",descendingSort:e=>`sortate după coloana ${e.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă"};var dt={};dt={ascending:"возрастание",ascendingSort:e=>`сортировать столбец ${e.columnName} в порядке возрастания`,columnSize:e=>`${e.value} пикс.`,descending:"убывание",descendingSort:e=>`сортировать столбец ${e.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец"};var mt={};mt={ascending:"vzostupne",ascendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,columnSize:e=>`Počet pixelov: ${e.value}`,descending:"zostupne",descendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec"};var pt={};pt={ascending:"naraščajoče",ascendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v naraščajočem vrstnem redu`,columnSize:e=>`${e.value} slikovnih pik`,descending:"padajoče",descendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec"};var bt={};bt={ascending:"rastući",ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastućim redosledom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`sortirano po kolonama ${e.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati"};var ft={};ft={ascending:"stigande",ascendingSort:e=>`sorterat på kolumn ${e.columnName} i stigande ordning`,columnSize:e=>`${e.value} pixlar`,descending:"fallande",descendingSort:e=>`sorterat på kolumn ${e.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn"};var ht={};ht={ascending:"artan sırada",ascendingSort:e=>`${e.columnName} sütuna göre artan düzende sırala`,columnSize:e=>`${e.value} piksel`,descending:"azalan sırada",descendingSort:e=>`${e.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun"};var vt={};vt={ascending:"висхідний",ascendingSort:e=>`відсортовано за стовпцем ${e.columnName} у висхідному порядку`,columnSize:e=>`${e.value} пікс.`,descending:"низхідний",descendingSort:e=>`відсортовано за стовпцем ${e.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець"};var gt={};gt={ascending:"升序",ascendingSort:e=>`按列 ${e.columnName} 升序排序`,columnSize:e=>`${e.value} 像素`,descending:"降序",descendingSort:e=>`按列 ${e.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列"};var $t={};$t={ascending:"遞增",ascendingSort:e=>`已依據「${e.columnName}」欄遞增排序`,columnSize:e=>`${e.value} 像素`,descending:"遞減",descendingSort:e=>`已依據「${e.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄"};var ne={};ne={"ar-AE":Ve,"bg-BG":Oe,"cs-CZ":He,"da-DK":Le,"de-DE":Ue,"el-GR":We,"en-US":Ge,"es-ES":Ye,"et-EE":Ze,"fi-FI":_e,"fr-FR":qe,"he-IL":Je,"hr-HR":Xe,"hu-HU":Qe,"it-IT":et,"ja-JP":tt,"ko-KR":lt,"lt-LT":ut,"lv-LV":nt,"nb-NO":ot,"nl-NL":st,"pl-PL":it,"pt-BR":rt,"pt-PT":at,"ro-RO":ct,"ru-RU":dt,"sk-SK":mt,"sl-SI":pt,"sr-SP":bt,"sv-SE":ft,"tr-TR":ht,"uk-UA":vt,"zh-CN":gt,"zh-TW":$t};class yt{isCell(t){return t.type==="cell"}isRow(t){return t.type==="row"||t.type==="item"}isDisabled(t){var l;return this.disabledBehavior==="all"&&(((l=t.props)===null||l===void 0?void 0:l.isDisabled)||this.disabledKeys.has(t.key))}findPreviousKey(t,l){let u=t!=null?this.collection.getKeyBefore(t):this.collection.getLastKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;u=this.collection.getKeyBefore(u)}return null}findNextKey(t,l){let u=t!=null?this.collection.getKeyAfter(t):this.collection.getFirstKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;if(u=this.collection.getKeyAfter(u),u==null)return null}return null}getKeyForItemInRowByIndex(t,l=0){if(l<0)return null;let u=this.collection.getItem(t);if(!u)return null;let o=0;for(let r of z(u,this.collection)){var n;if(r.colSpan&&r.colSpan+o>l)return(n=r.key)!==null&&n!==void 0?n:null;r.colSpan&&(o=o+r.colSpan-1);var s;if(o===l)return(s=r.key)!==null&&s!==void 0?s:null;o++}return null}getKeyBelow(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findNextKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyAbove(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findPreviousKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyRightOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let c=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=W(c))===null||u===void 0?void 0:u.key:(o=U(c))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let c=this.collection.getItem(l.parentKey);if(!c)return null;let i=z(c,this.collection);var s;let p=(s=this.direction==="rtl"?te(i,l.index-1):te(i,l.index+1))!==null&&s!==void 0?s:null;var r;if(p)return(r=p.key)!==null&&r!==void 0?r:null;var d;if(this.focusMode==="row")return(d=l.parentKey)!==null&&d!==void 0?d:null;var m;return(m=this.direction==="rtl"?this.getFirstKey(t):this.getLastKey(t))!==null&&m!==void 0?m:null}return null}getKeyLeftOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let c=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=U(c))===null||u===void 0?void 0:u.key:(o=W(c))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let c=this.collection.getItem(l.parentKey);if(!c)return null;let i=z(c,this.collection);var s;let p=(s=this.direction==="rtl"?te(i,l.index+1):te(i,l.index-1))!==null&&s!==void 0?s:null;var r;if(p)return(r=p.key)!==null&&r!==void 0?r:null;var d;if(this.focusMode==="row")return(d=l.parentKey)!==null&&d!==void 0?d:null;var m;return(m=this.direction==="rtl"?this.getLastKey(t):this.getFirstKey(t))!==null&&m!==void 0?m:null}return null}getFirstKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let m=this.collection.getItem(o.parentKey);if(!m)return null;var s;return(s=(n=U(z(m,this.collection)))===null||n===void 0?void 0:n.key)!==null&&s!==void 0?s:null}}if(u=this.findNextKey(void 0,m=>m.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var r;let m=this.collection.getItem(u);if(!m)return null;var d;u=(d=(r=U(z(m,this.collection)))===null||r===void 0?void 0:r.key)!==null&&d!==void 0?d:null}return u}getLastKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let m=this.collection.getItem(o.parentKey);if(!m)return null;let c=z(m,this.collection);var s;return(s=(n=W(c))===null||n===void 0?void 0:n.key)!==null&&s!==void 0?s:null}}if(u=this.findPreviousKey(void 0,m=>m.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var r;let m=this.collection.getItem(u);if(!m)return null;let c=z(m,this.collection);var d;u=(d=(r=W(c))===null||r===void 0?void 0:r.key)!==null&&d!==void 0?d:null}return u}getKeyPageAbove(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=Math.max(0,u.y+u.height-this.layoutDelegate.getVisibleRect().height);for(;u&&u.y>o&&l!=null;){var n;if(l=(n=this.getKeyAbove(l))!==null&&n!==void 0?n:null,l==null)break;u=this.layoutDelegate.getItemRect(l)}return l}getKeyPageBelow(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=this.layoutDelegate.getVisibleRect().height,n=Math.min(this.layoutDelegate.getContentSize().height,u.y+o);for(;u&&u.y+u.heighti.type==="item"),u==null&&!r&&(u=this.getFirstKey(),r=!0)}return null}constructor(t){if(this.collection=t.collection,this.disabledKeys=t.disabledKeys,this.disabledBehavior=t.disabledBehavior||"all",this.direction=t.direction,this.collator=t.collator,!t.layout&&!t.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=t.layoutDelegate||(t.layout?new du(t.layout):new Tl(t.ref)),this.focusMode=t.focusMode||"row"}}class du{getContentSize(){return this.layout.getContentSize()}getItemRect(t){var l;return((l=this.layout.getLayoutInfo(t))===null||l===void 0?void 0:l.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}constructor(t){this.layout=t}}const ve=new WeakMap;var xt={};xt={deselectedItem:e=>`${e.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${t.number(e.count)} عنصر محدد`,other:()=>`${t.number(e.count)} عنصر محدد`})}.`,selectedItem:e=>`${e.item} المحدد`};var Ct={};Ct={deselectedItem:e=>`${e.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Няма избрани елементи",one:()=>`${t.number(e.count)} избран елемент`,other:()=>`${t.number(e.count)} избрани елементи`})}.`,selectedItem:e=>`${e.item} избран.`};var Dt={};Dt={deselectedItem:e=>`Položka ${e.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${t.number(e.count)} položka`,other:()=>`Vybráno ${t.number(e.count)} položek`})}.`,selectedItem:e=>`Vybrána položka ${e.item}.`};var kt={};kt={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer valgt",one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var Bt={};Bt={deselectedItem:e=>`${e.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${t.number(e.count)} Element ausgewählt`,other:()=>`${t.number(e.count)} Elemente ausgewählt`})}.`,selectedItem:e=>`${e.item} ausgewählt.`};var Et={};Et={deselectedItem:e=>`Δεν επιλέχθηκε το στοιχείο ${e.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${t.number(e.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${t.number(e.count)} στοιχεία`})}.`,selectedItem:e=>`Επιλέχθηκε το στοιχείο ${e.item}.`};var St={};St={deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var At={};At={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ningún elemento seleccionado",one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var wt={};wt={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Üksusi pole valitud",one:()=>`${t.number(e.count)} üksus valitud`,other:()=>`${t.number(e.count)} üksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var Nt={};Nt={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var zt={};zt={deselectedItem:e=>`${e.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Aucun élément sélectionné",one:()=>`${t.number(e.count)} élément sélectionné`,other:()=>`${t.number(e.count)} éléments sélectionnés`})}.`,selectedItem:e=>`${e.item} sélectionné.`};var Ft={};Ft={deselectedItem:e=>`${e.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${t.number(e.count)} נבחר`,other:()=>`${t.number(e.count)} פריטים נבחרו`})}.`,selectedItem:e=>`${e.item} נבחר.`};var Pt={};Pt={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Kt={};Kt={deselectedItem:e=>`${e.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${t.number(e.count)} elem kijelölve`,other:()=>`${t.number(e.count)} elem kijelölve`})}.`,selectedItem:e=>`${e.item} kijelölve.`};var It={};It={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nessun elemento selezionato",one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var jt={};jt={deselectedItem:e=>`${e.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"項目が選択されていません",one:()=>`${t.number(e.count)} 項目を選択しました`,other:()=>`${t.number(e.count)} 項目を選択しました`})}。`,selectedItem:e=>`${e.item} を選択しました。`};var Mt={};Mt={deselectedItem:e=>`${e.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"선택된 항목이 없습니다",one:()=>`${t.number(e.count)}개 항목이 선택되었습니다`,other:()=>`${t.number(e.count)}개 항목이 선택되었습니다`})}.`,selectedItem:e=>`${e.item}이(가) 선택되었습니다.`};var Tt={};Tt={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta elementų: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var Rt={};Rt={deselectedItem:e=>`Vienums ${e.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlasīts vienums ${e.item}.`};var Vt={};Vt={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer er valgt",one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Ot={};Ot={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Geen items geselecteerd",one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Ht={};Ht={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych elementów`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var Lt={};Lt={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ut={};Ut={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Wt={};Wt={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Niciun element selectat",one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Gt={};Gt={deselectedItem:e=>`${e.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Нет выбранных элементов",one:()=>`${t.number(e.count)} элемент выбран`,other:()=>`${t.number(e.count)} элементов выбрано`})}.`,selectedItem:e=>`${e.item} выбрано.`};var Yt={};Yt={deselectedItem:e=>`Nevybraté položky: ${e.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Žiadne vybraté položky",one:()=>`${t.number(e.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybraté položky: ${e.item}.`};var Zt={};Zt={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Noben element ni izbran",one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var _t={};_t={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var qt={};qt={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Inga markerade objekt",one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var Jt={};Jt={deselectedItem:e=>`${e.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${t.number(e.count)} öge seçildi`,other:()=>`${t.number(e.count)} öge seçildi`})}.`,selectedItem:e=>`${e.item} seçildi.`};var Xt={};Xt={deselectedItem:e=>`${e.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Жодних елементів не вибрано",one:()=>`${t.number(e.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} вибрано.`};var Qt={};Qt={deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`};var el={};el={deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`};var oe={};oe={"ar-AE":xt,"bg-BG":Ct,"cs-CZ":Dt,"da-DK":kt,"de-DE":Bt,"el-GR":Et,"en-US":St,"es-ES":At,"et-EE":wt,"fi-FI":Nt,"fr-FR":zt,"he-IL":Ft,"hr-HR":Pt,"hu-HU":Kt,"it-IT":It,"ja-JP":jt,"ko-KR":Mt,"lt-LT":Tt,"lv-LV":Rt,"nb-NO":Vt,"nl-NL":Ot,"pl-PL":Ht,"pt-BR":Lt,"pt-PT":Ut,"ro-RO":Wt,"ru-RU":Gt,"sk-SK":Yt,"sl-SI":Zt,"sr-SP":_t,"sv-SE":qt,"tr-TR":Jt,"uk-UA":Xt,"zh-CN":Qt,"zh-TW":el};const tl=7e3;let V=null;function ll(e,t="assertive",l=tl){V?V.announce(e,t,l):(V=new mu,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?V.announce(e,t,l):setTimeout(()=>{V?.isAttached()&&V?.announce(e,t,l)},100))}class mu{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let l=document.createElement("div");return l.setAttribute("role","log"),l.setAttribute("aria-live",t),l.setAttribute("aria-relevant","additions"),l}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,l="assertive",u=tl){var o,n;if(!this.node)return;let s=document.createElement("div");typeof t=="object"?(s.setAttribute("role","img"),s.setAttribute("aria-labelledby",t["aria-labelledby"])):s.textContent=t,l==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(s):(n=this.politeLog)===null||n===void 0||n.appendChild(s),t!==""&&setTimeout(()=>{s.remove()},u)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function pu(e){return e&&e.__esModule?e.default:e}function bu(e,t){let{getRowText:l=r=>{var d,m,c,i;return(i=(d=(m=t.collection).getTextValue)===null||d===void 0?void 0:d.call(m,r))!==null&&i!==void 0?i:(c=t.collection.getItem(r))===null||c===void 0?void 0:c.textValue}}=e,u=_(pu(oe),"@react-aria/grid"),o=t.selectionManager.rawSelection,n=k.useRef(o),s=Rl(()=>{var r;if(!t.selectionManager.isFocused||o===n.current){n.current=o;return}let d=Ee(o,n.current),m=Ee(n.current,o),c=t.selectionManager.selectionBehavior==="replace",i=[];if(t.selectionManager.selectedKeys.size===1&&c){let p=t.selectionManager.selectedKeys.keys().next().value;if(p!=null&&t.collection.getItem(p)){let a=l(p);a&&i.push(u.format("selectedItem",{item:a}))}}else if(d.size===1&&m.size===0){let p=d.keys().next().value;if(p!=null){let a=l(p);a&&i.push(u.format("selectedItem",{item:a}))}}else if(m.size===1&&d.size===0){let p=m.keys().next().value;if(p!=null&&t.collection.getItem(p)){let a=l(p);a&&i.push(u.format("deselectedItem",{item:a}))}}t.selectionManager.selectionMode==="multiple"&&(i.length===0||o==="all"||o.size>1||n.current==="all"||((r=n.current)===null||r===void 0?void 0:r.size)>1)&&i.push(o==="all"?u.format("selectedAll"):u.format("selectedCount",{count:o.size})),i.length>0&&ll(i.join(" ")),n.current=o});Me(()=>{if(t.selectionManager.isFocused)s();else{let r=requestAnimationFrame(s);return()=>cancelAnimationFrame(r)}},[o,t.selectionManager.isFocused])}function Ee(e,t){let l=new Set;if(e==="all"||t==="all")return l;for(let u of e.keys())t.has(u)||l.add(u);return l}function fu(e){return e&&e.__esModule?e.default:e}function hu(e){let t=_(fu(oe),"@react-aria/grid"),l=Vl(),u=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window,o=k.useMemo(()=>{let s=e.selectionManager.selectionMode,r=e.selectionManager.selectionBehavior,d;return u&&(d=t.format("longPressToSelect")),r==="replace"&&s!=="none"&&e.hasItemActions?d:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,u]);return fe(o)}function vu(e,t,l){let{isVirtualized:u,disallowTypeAhead:o,keyboardDelegate:n,focusMode:s,scrollRef:r,getRowText:d,onRowAction:m,onCellAction:c,escapeKeyBehavior:i="clearSelection",shouldSelectOnPressUp:p}=e,{selectionManager:a}=t;!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let b=ze({usage:"search",sensitivity:"base"}),{direction:v}=ue(),g=t.selectionManager.disabledBehavior,x=k.useMemo(()=>n||new yt({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:g,ref:l,direction:v,collator:b,focusMode:s}),[n,t.collection,t.disabledKeys,g,l,v,b,s]),{collectionProps:D}=Ol({ref:l,selectionManager:a,keyboardDelegate:x,isVirtualized:u,scrollRef:r,disallowTypeAhead:o,escapeKeyBehavior:i}),y=pe(e.id);ve.set(t,{keyboardDelegate:x,actions:{onRowAction:m,onCellAction:c},shouldSelectOnPressUp:p});let $=hu({selectionManager:a,hasItemActions:!!(m||c)}),f=Hl(e,{labelable:!0}),E=k.useCallback(C=>{if(a.isFocused){C.currentTarget.contains(C.target)||a.setFocused(!1);return}C.currentTarget.contains(C.target)&&a.setFocused(!0)},[a]),S=k.useMemo(()=>({onBlur:D.onBlur,onFocus:E}),[E,D.onBlur]),A=au(l,{isDisabled:t.collection.size!==0}),B=J(f,{role:"grid",id:y,"aria-multiselectable":a.selectionMode==="multiple"?"true":void 0},t.isKeyboardNavigationDisabled?S:D,t.collection.size===0&&{tabIndex:A?-1:0}||void 0,$);return u&&(B["aria-rowcount"]=t.collection.size,B["aria-colcount"]=t.collection.columnCount),bu({getRowText:d},t),{gridProps:B}}function gu(){return{rowGroupProps:{role:"rowgroup"}}}function $u(e,t,l){var u,o;let{node:n,isVirtualized:s,shouldSelectOnPressUp:r,onAction:d}=e,{actions:m,shouldSelectOnPressUp:c}=ve.get(t),i=m.onRowAction?()=>{var g;return(g=m.onRowAction)===null||g===void 0?void 0:g.call(m,n.key)}:d,{itemProps:p,...a}=je({selectionManager:t.selectionManager,key:n.key,ref:l,isVirtualized:s,shouldSelectOnPressUp:c||r,onAction:i||!(n==null||(u=n.props)===null||u===void 0)&&u.onAction?Ll(n==null||(o=n.props)===null||o===void 0?void 0:o.onAction,i):void 0,isDisabled:t.collection.size===0}),b=t.selectionManager.isSelected(n.key),v={role:"row","aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":a.isDisabled||void 0,...p};return s&&(v["aria-rowindex"]=n.index+1),{rowProps:v,...a}}function ul(e,t,l){let{node:u,isVirtualized:o,focusMode:n="child",shouldSelectOnPressUp:s,onAction:r}=e,{direction:d}=ue(),{keyboardDelegate:m,actions:{onCellAction:c}}=ve.get(t),i=k.useRef(null),p=()=>{if(l.current){let y=ae(l.current);if(n==="child"){if(l.current.contains(document.activeElement)&&l.current!==document.activeElement)return;let $=t.selectionManager.childFocusStrategy==="last"?re(y):y.firstChild();if($){L($);return}}(i.current!=null&&u.key!==i.current||!l.current.contains(document.activeElement))&&L(l.current)}},{itemProps:a,isPressed:b}=je({selectionManager:t.selectionManager,key:u.key,ref:l,isVirtualized:o,focus:p,shouldSelectOnPressUp:s,onAction:c?()=>c(u.key):r,isDisabled:t.collection.size===0}),v=y=>{if(!y.currentTarget.contains(y.target)||t.isKeyboardNavigationDisabled||!l.current||!document.activeElement)return;let $=ae(l.current);switch($.currentNode=document.activeElement,y.key){case"ArrowLeft":{let C=d==="rtl"?$.nextNode():$.previousNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var f;if(((f=m.getKeyLeftOf)===null||f===void 0?void 0:f.call(m,u.key))!==u.key){var E;(E=l.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&d==="rtl"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=d==="rtl"?$.firstChild():re($),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowRight":{let C=d==="rtl"?$.previousNode():$.nextNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var S;if(((S=m.getKeyRightOf)===null||S===void 0?void 0:S.call(m,u.key))!==u.key){var A;(A=l.current.parentElement)===null||A===void 0||A.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&d==="ltr"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=d==="rtl"?re($):$.firstChild(),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowUp":case"ArrowDown":if(!y.altKey&&l.current.contains(y.target)){var B;y.stopPropagation(),y.preventDefault(),(B=l.current.parentElement)===null||B===void 0||B.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent))}break}},g=y=>{if(i.current=u.key,y.target!==l.current){Ul()||t.selectionManager.setFocusedKey(u.key);return}requestAnimationFrame(()=>{n==="child"&&document.activeElement===l.current&&p()})},x=J(a,{role:"gridcell",onKeyDownCapture:v,"aria-colspan":u.colSpan,"aria-colindex":u.colIndex!=null?u.colIndex+1:void 0,colSpan:o?void 0:u.colSpan,onFocus:g});var D;return o&&(x["aria-colindex"]=((D=u.colIndex)!==null&&D!==void 0?D:u.index)+1),s&&x.tabIndex!=null&&x.onPointerDown==null&&(x.onPointerDown=y=>{let $=y.currentTarget,f=$.getAttribute("tabindex");$.removeAttribute("tabindex"),requestAnimationFrame(()=>{f!=null&&$.setAttribute("tabindex",f)})}),{gridCellProps:x,isPressed:b}}function re(e){let t=null,l=null;do l=e.lastChild(),l&&(t=l);while(l);return t}function yu(e){return e&&e.__esModule?e.default:e}function xu(e,t){let{key:l}=e,u=t.selectionManager,o=pe(),n=!t.selectionManager.canSelectItem(l),s=t.selectionManager.isSelected(l),r=()=>u.toggleSelection(l);const d=_(yu(oe),"@react-aria/grid");return{checkboxProps:{id:o,"aria-label":d.format("select"),isSelected:s,isDisabled:n,onChange:r}}}class Cu extends yt{isCell(t){return t.type==="cell"||t.type==="rowheader"||t.type==="column"}getKeyBelow(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let u=U(z(l,this.collection));if(u)return u.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(t)}getKeyAbove(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let n=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return n&&n.type==="column"?n.key:null}let u=super.getKeyAbove(t),o=u!=null?this.collection.getItem(u):null;return o&&o.type!=="headerrow"?u:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(t){let l=this.findNextKey(t.key,o=>o.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level];for(let o of z(u,this.collection))if(o.type==="column")return o.key;return null}findPreviousColumnKey(t){let l=this.findPreviousKey(t.key,n=>n.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level],o=[...z(u,this.collection)];for(let n=o.length-1;n>=0;n--){let s=o[n];if(s.type==="column")return s.key}return null}getKeyRightOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(l):this.findNextColumnKey(l):super.getKeyRightOf(t):null}getKeyLeftOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findNextColumnKey(l):this.findPreviousColumnKey(l):super.getKeyLeftOf(t):null}getKeyForSearch(t,l){if(!this.collator)return null;let u=this.collection,o=l??this.getFirstKey();if(o==null)return null;let n=u.getItem(o);var s;n?.type==="cell"&&(o=(s=n.parentKey)!==null&&s!==void 0?s:null);let r=!1;for(;o!=null;){let d=u.getItem(o);if(!d)return null;if(d.textValue){let m=d.textValue.slice(0,t.length);if(this.collator.compare(m,t)===0)return d.key}for(let m of z(d,this.collection)){let c=u.columns[m.index];if(u.rowHeaderColumnKeys.has(c.key)&&m.textValue){let i=m.textValue.slice(0,t.length);if(this.collator.compare(i,t)===0){let p=l!=null?u.getItem(l):n;return p?.type==="cell"?m.key:d.key}}}o=this.getKeyBelow(o),o==null&&!r&&(o=this.getFirstKey(),r=!0)}return null}}function Du(e){return e&&e.__esModule?e.default:e}function ku(e,t,l){let{keyboardDelegate:u,isVirtualized:o,layoutDelegate:n,layout:s}=e,r=ze({usage:"search",sensitivity:"base"}),{direction:d}=ue(),m=t.selectionManager.disabledBehavior,c=k.useMemo(()=>u||new Cu({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:m,ref:l,direction:d,collator:r,layoutDelegate:n,layout:s}),[u,t.collection,t.disabledKeys,m,l,d,r,n,s]),i=pe(e.id);he.set(t,i);let{gridProps:p}=vu({...e,id:i,keyboardDelegate:c},t,l);o&&(p["aria-rowcount"]=t.collection.size+t.collection.headerRows.length),le()&&"expandedKeys"in t&&(p.role="treegrid");let{column:a,direction:b}=t.sortDescriptor||{},v=_(Du(ne),"@react-aria/table"),g=k.useMemo(()=>{var D,y;let $=(y=(D=t.collection.columns.find(f=>f.key===a))===null||D===void 0?void 0:D.textValue)!==null&&y!==void 0?y:"";return b&&a?v.format(`${b}Sort`,{columnName:$}):void 0},[b,a,t.collection.columns]),x=fe(g);return Me(()=>{g&&ll(g,"assertive",500)},[g]),{gridProps:J(p,x,{"aria-describedby":[x["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")})}}function Bu(e){return e&&e.__esModule?e.default:e}function nl(e,t,l){var u,o;let{node:n}=e,s=n.props.allowsSorting,{gridCellProps:r}=ul({...e,focusMode:"child"},t,l),d=n.props.isSelectionCell&&t.selectionManager.selectionMode==="single",{pressProps:m}=Wl({isDisabled:!s||d,onPress(){t.sort(n.key)},ref:l}),{focusableProps:c}=Gl({},l),i,p=((u=t.sortDescriptor)===null||u===void 0?void 0:u.column)===n.key,a=(o=t.sortDescriptor)===null||o===void 0?void 0:o.direction;n.props.allowsSorting&&!Ce()&&(i=p?a:"none");let b=_(Bu(ne),"@react-aria/table"),v;s&&(v=`${b.format("sortable")}`,p&&a&&Ce()&&(v=`${v}, ${b.format(a)}`));let g=fe(v),x=t.collection.size===0;return k.useEffect(()=>{x&&t.selectionManager.focusedKey===n.key&&t.selectionManager.setFocusedKey(null)},[x,t.selectionManager,n.key]),{columnHeaderProps:{...J(c,r,m,g,x?{tabIndex:-1}:null),role:"columnheader",id:cu(t,n.key),"aria-colspan":n.colSpan&&n.colSpan>1?n.colSpan:void 0,"aria-sort":i}}}const Se={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Eu(e,t,l){let{node:u,isVirtualized:o}=e,{rowProps:n,...s}=$u(e,t,l),{direction:r}=ue();o&&!(le()&&"expandedKeys"in t)?n["aria-rowindex"]=u.index+1+t.collection.headerRows.length:delete n["aria-rowindex"];let d={};if(le()&&"expandedKeys"in t){let f=t.keyMap.get(u.key);if(f!=null){var m,c,i,p,a,b;let E=((m=f.props)===null||m===void 0?void 0:m.UNSTABLE_childItems)||((i=f.props)===null||i===void 0||(c=i.children)===null||c===void 0?void 0:c.length)>t.userColumnCount;var v,g,x,D;d={onKeyDown:S=>{(S.key===Se.expand[r]&&t.selectionManager.focusedKey===f.key&&E&&t.expandedKeys!=="all"&&!t.expandedKeys.has(f.key)||S.key===Se.collapse[r]&&t.selectionManager.focusedKey===f.key&&E&&(t.expandedKeys==="all"||t.expandedKeys.has(f.key)))&&(t.toggleKey(f.key),S.stopPropagation())},"aria-expanded":E?t.expandedKeys==="all"||t.expandedKeys.has(u.key):void 0,"aria-level":f.level,"aria-posinset":((v=f.indexOfType)!==null&&v!==void 0?v:0)+1,"aria-setsize":f.level>1?((x=(p=W((g=(a=t.keyMap.get(f.parentKey))===null||a===void 0?void 0:a.childNodes)!==null&&g!==void 0?g:[]))===null||p===void 0?void 0:p.indexOfType)!==null&&x!==void 0?x:0)+1:((D=(b=W(t.collection.body.childNodes))===null||b===void 0?void 0:b.indexOfType)!==null&&D!==void 0?D:0)+1}}}let y=Yl(u.props),$=s.hasAction?y:{};return{rowProps:{...J(n,d,$),"aria-labelledby":Re(t,u.key)},...s}}function Su(e,t,l){let{node:u,isVirtualized:o}=e,n={role:"row"};return o&&!(le()&&"expandedKeys"in t)&&(n["aria-rowindex"]=u.index+1),{rowProps:n}}function ol(e,t,l){var u;let{gridCellProps:o,isPressed:n}=ul(e,t,l),s=(u=e.node.column)===null||u===void 0?void 0:u.key;return s!=null&&t.collection.rowHeaderColumnKeys.has(s)&&(o.role="rowheader",o.id=Te(t,e.node.parentKey,s)),{gridCellProps:o,isPressed:n}}function Au(e){return e&&e.__esModule?e.default:e}function wu(e,t){let{key:l}=e;const{checkboxProps:u}=xu(e,t);return{checkboxProps:{...u,"aria-labelledby":`${u.id} ${Re(t,l)}`}}}function Nu(e){let{isEmpty:t,isSelectAll:l,selectionMode:u}=e.selectionManager;return{checkboxProps:{"aria-label":_(Au(ne),"@react-aria/table").format(u==="single"?"select":"selectAll"),isSelected:l,isDisabled:u!=="multiple"||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type==="loader",isIndeterminate:!t&&!l,onChange:()=>e.selectionManager.toggleSelectAll()}}}function ge(){return gu()}var sl=T((e,t)=>{var l,u;const{as:o,className:n,node:s,slots:r,state:d,selectionMode:m,color:c,checkboxesProps:i,disableAnimation:p,classNames:a,...b}=e,v=o||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:s},d,x),{isFocusVisible:y,focusProps:$}=X(),{checkboxProps:f}=Nu(d),E=K(a?.th,n,(l=s.props)==null?void 0:l.className),S=m==="single",{onChange:A,...B}=f;return h.jsx(v,{ref:x,"data-focus-visible":w(y),...I(D,$,O(s.props,{enabled:g}),O(b,{enabled:g})),className:(u=r.th)==null?void 0:u.call(r,{class:E}),children:S?h.jsx(be,{children:f["aria-label"]}):h.jsx(Fe,{color:c,disableAnimation:p,onValueChange:A,...I(i,B)})})});sl.displayName="HeroUI.TableSelectAllCheckbox";var il=sl;function zu(e){let{collection:t,focusMode:l}=e,u=e.UNSAFE_selectionState||Zl(e),o=k.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),n=u.setFocusedKey;u.setFocusedKey=(d,m)=>{if(l==="cell"&&d!=null){let b=t.getItem(d);if(b?.type==="item"){var c,i;let v=z(b,t);var p,a;m==="last"?d=(p=(c=W(v))===null||c===void 0?void 0:c.key)!==null&&p!==void 0?p:null:d=(a=(i=U(v))===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:null}}n(d,m)};let s=k.useMemo(()=>new _l(t,u),[t,u]);const r=k.useRef(null);return k.useEffect(()=>{if(u.focusedKey!=null&&r.current&&!t.getItem(u.focusedKey)){const d=r.current.getItem(u.focusedKey),m=d?.parentKey!=null&&(d.type==="cell"||d.type==="rowheader"||d.type==="column")?r.current.getItem(d.parentKey):d;if(!m){u.setFocusedKey(null);return}const c=r.current.rows,i=t.rows,p=c.length-i.length;let a=Math.min(p>1?Math.max(m.index-p+1,0):m.index,i.length-1),b=null;for(;a>=0;){if(!s.isDisabled(i[a].key)&&i[a].type!=="headerrow"){b=i[a];break}am.index&&(a=m.index),a--)}if(b){const v=b.hasChildNodes?[...z(b,t)]:[],g=b.hasChildNodes&&m!==d&&d&&d.index{let p=this.keyMap.get(i.key);t.visitNode&&(i=t.visitNode(i)),this.keyMap.set(i.key,i);let a=new Set,b=null,v=!1;if(i.type==="item"){var g;for(let f of i.childNodes)if(((g=f.props)===null||g===void 0?void 0:g.colSpan)!==void 0){v=!0;break}}for(let f of i.childNodes){if(f.type==="cell"&&v){var x,D;f.colspan=(x=f.props)===null||x===void 0?void 0:x.colSpan,f.colSpan=(D=f.props)===null||D===void 0?void 0:D.colSpan;var y,$;f.colIndex=b?((y=b.colIndex)!==null&&y!==void 0?y:b.index)+(($=b.colSpan)!==null&&$!==void 0?$:1):f.index}f.type==="cell"&&f.parentKey==null&&(f.parentKey=i.key),a.add(f.key),b?(b.nextKey=f.key,f.prevKey=b.key):f.prevKey=null,l(f),b=f}if(b&&(b.nextKey=null),p)for(let f of p.childNodes)a.has(f.key)||u(f)},u=i=>{this.keyMap.delete(i.key);for(let p of i.childNodes)this.keyMap.get(p.key)===p&&u(p)},o=null;for(let[i,p]of t.items.entries()){var n,s,r,d,m,c;let a={...p,level:(n=p.level)!==null&&n!==void 0?n:0,key:(s=p.key)!==null&&s!==void 0?s:"row-"+i,type:(r=p.type)!==null&&r!==void 0?r:"row",value:(d=p.value)!==null&&d!==void 0?d:null,hasChildNodes:!0,childNodes:[...p.childNodes],rendered:p.rendered,textValue:(m=p.textValue)!==null&&m!==void 0?m:"",index:(c=p.index)!==null&&c!==void 0?c:i};o?(o.nextKey=a.key,a.prevKey=o.key):a.prevKey=null,this.rows.push(a),l(a),o=a}o&&(o.nextKey=null)}}const rl="row-header-column-"+Math.random().toString(36).slice(2);let de="row-header-column-"+Math.random().toString(36).slice(2);for(;rl===de;)de="row-header-column-"+Math.random().toString(36).slice(2);function Pu(e,t){if(t.length===0)return[];let l=[],u=new Map;for(let c of t){let i=c.parentKey,p=[c];for(;i;){let a=e.get(i);if(!a)break;if(u.has(a)){var o,n;(n=(o=a).colSpan)!==null&&n!==void 0||(o.colSpan=0),a.colSpan++,a.colspan=a.colSpan;let{column:b,index:v}=u.get(a);if(v>p.length)break;for(let g=v;gc.length)),r=Array(s).fill(0).map(()=>[]),d=0;for(let c of l){let i=s-1;for(let p of c){if(p){let a=r[i],b=a.reduce((v,g)=>{var x;return v+((x=g.colSpan)!==null&&x!==void 0?x:1)},0);if(b0&&(a[a.length-1].nextKey=v.key,v.prevKey=a[a.length-1].key),a.push(v)}a.length>0&&(a[a.length-1].nextKey=p.key,p.prevKey=a[a.length-1].key),p.level=i,p.colIndex=d,a.push(p)}i--}d++}let m=0;for(let c of r){let i=c.reduce((p,a)=>{var b;return p+((b=a.colSpan)!==null&&b!==void 0?b:1)},0);if(i({type:"headerrow",key:"headerrow-"+i,index:i,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:c,textValue:""}))}class Ku extends Fu{*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let l=this.keyMap.get(t);var u;return(u=l?.prevKey)!==null&&u!==void 0?u:null}getKeyAfter(t){let l=this.keyMap.get(t);var u;return(u=l?.nextKey)!==null&&u!==void 0?u:null}getFirstKey(){var t,l;return(l=(t=U(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getLastKey(){var t,l;return(l=(t=W(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getItem(t){var l;return(l=this.keyMap.get(t))!==null&&l!==void 0?l:null}at(t){const l=[...this.getKeys()];return this.getItem(l[t])}getChildren(t){return t===this.body.key?this.body.childNodes:super.getChildren(t)}getTextValue(t){let l=this.getItem(t);if(!l)return"";if(l.textValue)return l.textValue;let u=this.rowHeaderColumnKeys;if(u){let o=[];for(let n of l.childNodes){let s=this.columns[n.index];if(u.has(s.key)&&n.textValue&&o.push(n.textValue),o.length===u.size)break}return o.join(" ")}return""}constructor(t,l,u){let o=new Set,n=null,s=[];if(u?.showSelectionCheckboxes){let i={type:"column",key:rl,value:null,textValue:"",level:0,index:u?.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};s.unshift(i)}if(u?.showDragButtons){let i={type:"column",key:de,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};s.unshift(i)}let r=[],d=new Map,m=i=>{switch(i.type){case"body":n=i;break;case"column":d.set(i.key,i),i.hasChildNodes||(s.push(i),i.props.isRowHeader&&o.add(i.key));break;case"item":r.push(i);return}for(let p of i.childNodes)m(p)};for(let i of t)m(i);let c=Pu(d,s);if(c.forEach((i,p)=>r.splice(p,0,i)),super({columnCount:s.length,items:r,visitNode:i=>(i.column=s[i.index],i)}),this._size=0,this.columns=s,this.rowHeaderColumnKeys=o,this.body=n,this.headerRows=c,this._size=[...n.childNodes].length,this.rowHeaderColumnKeys.size===0){let i=this.columns.find(p=>{var a,b;return!(!((a=p.props)===null||a===void 0)&&a.isDragButtonCell)&&!(!((b=p.props)===null||b===void 0)&&b.isSelectionCell)});i&&this.rowHeaderColumnKeys.add(i.key)}}}const Iu={ascending:"descending",descending:"ascending"};function ju(e){let[t,l]=k.useState(!1),{selectionMode:u="none",showSelectionCheckboxes:o,showDragButtons:n}=e,s=k.useMemo(()=>({showSelectionCheckboxes:o&&u!=="none",showDragButtons:n,selectionMode:u,columns:[]}),[e.children,o,u,n]),r=ql(e,k.useCallback(i=>new Ku(i,null,s),[s]),s),{disabledKeys:d,selectionManager:m}=zu({...e,collection:r,disabledBehavior:e.disabledBehavior||"selection"});var c;return{collection:r,disabledKeys:d,selectionManager:m,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:(c=e.sortDescriptor)!==null&&c!==void 0?c:null,isKeyboardNavigationDisabled:r.size===0||t,setKeyboardNavigationDisabled:l,sort(i,p){var a,b;(b=e.onSortChange)===null||b===void 0||b.call(e,{column:i,direction:p??(((a=e.sortDescriptor)===null||a===void 0?void 0:a.column)===i?Iu[e.sortDescriptor.direction]:"ascending")})}}}function al(e){return null}al.getCollectionNode=function*(t,l){let{children:u,columns:o}=t;if(l.columns=[],typeof u=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let n of o)yield{type:"column",value:n,renderer:u}}else{let n=[];q.Children.forEach(u,s=>{n.push({type:"column",element:s})}),yield*n}};let Mu=al;function cl(e){return null}cl.getCollectionNode=function*(t){let{children:l,items:u}=t;yield{type:"body",hasChildNodes:!0,props:t,*childNodes(){if(typeof l=="function"){if(!u)throw new Error("props.children was a function but props.items is missing");for(let o of u)yield{type:"item",value:o,renderer:l}}else{let o=[];q.Children.forEach(l,n=>{o.push({type:"item",element:n})}),yield*o}}}};let Tu=cl;function dl(e){return null}dl.getCollectionNode=function*(t,l){let{title:u,children:o,childColumns:n}=t,s=u||o,r=t.textValue||(typeof s=="string"?s:"")||t["aria-label"],d=yield{type:"column",hasChildNodes:!!n||!!u&&q.Children.count(o)>0,rendered:s,textValue:r,props:t,*childNodes(){if(n)for(let c of n)yield{type:"column",value:c};else if(u){let c=[];q.Children.forEach(o,i=>{c.push({type:"column",element:i})}),yield*c}},shouldInvalidate(c){return m(c),!1}},m=c=>{for(let i of d)i.hasChildNodes||c.columns.push(i)};m(l)};let Ru=dl;function me(e){return null}me.getCollectionNode=function*(t,l){let{children:u,textValue:o,UNSTABLE_childItems:n}=t;yield{type:"item",props:t,textValue:o,"aria-label":t["aria-label"],hasChildNodes:!0,*childNodes(){if(l.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),l.showSelectionCheckboxes&&l.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof u=="function"){for(let s of l.columns)yield{type:"cell",element:u(s.key),key:s.key};if(n)for(let s of n)yield{type:"item",value:s}}else{let s=[],r=[],d=0;if(q.Children.forEach(u,m=>{if(m.type===me){if(s.lengthr.key!==l.columns[d].key)||s.showSelectionCheckboxes!==l.showSelectionCheckboxes||s.showDragButtons!==l.showDragButtons||s.selectionMode!==l.selectionMode}}};let Vu=me;function ml(e){return null}ml.getCollectionNode=function*(t){let{children:l}=t,u=t.textValue||(typeof l=="string"?l:"")||t["aria-label"]||"";yield{type:"cell",props:t,rendered:l,textValue:u,"aria-label":t["aria-label"],hasChildNodes:!1}};let Ou=ml;function pl(e){var t;const l=Jl(),[u,o]=Pe(e,Be.variantKeys),{ref:n,as:s,baseRef:r,children:d,className:m,classNames:c,removeWrapper:i=!1,disableAnimation:p=(t=l?.disableAnimation)!=null?t:!1,isKeyboardNavigationDisabled:a=!1,selectionMode:b="none",topContentPlacement:v="inside",bottomContentPlacement:g="inside",selectionBehavior:x=b==="none"?null:"toggle",disabledBehavior:D="selection",showSelectionCheckboxes:y=b==="multiple"&&x!=="replace",BaseComponent:$="div",checkboxesProps:f,topContent:E,bottomContent:S,sortIcon:A,onRowAction:B,onCellAction:C,...N}=u,j=s||"table",F=typeof j=="string",R=M(n),Q=M(r),G=ju({...e,children:d,showSelectionCheckboxes:y});a&&!G.isKeyboardNavigationDisabled&&G.setKeyboardNavigationDisabled(!0);const{collection:se}=G,{layout:sn,...Fl}=e,{gridProps:$e}=ku({...Fl},G,R),ee=b!=="none",ye=b==="multiple",H=k.useMemo(()=>Be({...o,isSelectable:ee,isMultiSelectable:ye}),[Ke(o),ee,ye]),xe=K(c?.base,m),Pl=k.useMemo(()=>{var P;return{state:G,slots:H,isSelectable:ee,collection:se,classNames:c,color:e?.color,disableAnimation:p,checkboxesProps:f,isHeaderSticky:(P=e?.isHeaderSticky)!=null?P:!1,selectionMode:b,selectionBehavior:x,disabledBehavior:D,showSelectionCheckboxes:y,onRowAction:B,onCellAction:C}},[H,G,se,ee,c,b,x,f,D,p,y,e?.color,e?.isHeaderSticky,B,C]),Kl=k.useCallback(P=>({...P,ref:Q,className:H.base({class:K(xe,P?.className)})}),[xe,H]),Il=k.useCallback(P=>({...P,ref:Q,className:H.wrapper({class:K(c?.wrapper,P?.className)})}),[c?.wrapper,H]),jl=k.useCallback(P=>({...I($e,O(N,{enabled:F}),P),onKeyDownCapture:void 0,ref:R,className:H.table({class:K(c?.table,P?.className)})}),[c?.table,F,H,$e,N]);return{BaseComponent:$,Component:j,children:d,state:G,collection:se,values:Pl,topContent:E,bottomContent:S,removeWrapper:i,topContentPlacement:v,bottomContentPlacement:g,sortIcon:A,getBaseProps:Kl,getWrapperProps:Il,getTableProps:jl}}var bl=T((e,t)=>{var l,u,o;const{as:n,className:s,node:r,rowKey:d,slots:m,state:c,classNames:i,...p}=e,a=n||"td",b=typeof a=="string",v=M(t),{gridCellProps:g}=ol({node:r},c,v),x=K(i?.td,s,(l=r.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=c.selectionManager.isSelected(d),f=k.useMemo(()=>{const S=typeof r.rendered;return S!=="object"&&S!=="function"?h.jsx("span",{children:r.rendered}):r.rendered},[r.rendered]),E=((u=r.column)==null?void 0:u.props)||{};return h.jsx(a,{ref:v,"data-focus-visible":w(D),"data-selected":w($),...I(g,y,O(r.props,{enabled:b}),p),className:(o=m.td)==null?void 0:o.call(m,{align:E.align,class:x}),children:f})});bl.displayName="HeroUI.TableCell";var fl=bl,hl=T((e,t)=>{var l,u;const{as:o,className:n,node:s,rowKey:r,slots:d,state:m,color:c,disableAnimation:i,checkboxesProps:p,selectionMode:a,classNames:b,...v}=e,g=o||"td",x=typeof g=="string",D=M(t),{gridCellProps:y}=ol({node:s},m,D),{isFocusVisible:$,focusProps:f}=X(),{checkboxProps:E}=wu({key:s?.parentKey||s.key},m),S=K(b?.td,n,(l=s.props)==null?void 0:l.className),A=a==="single",{onChange:B,...C}=E,N=m.selectionManager.isSelected(r);return h.jsx(g,{ref:D,"data-focus-visible":w($),"data-selected":w(N),...I(y,f,O(s.props,{enabled:x}),v),className:(u=d.td)==null?void 0:u.call(d,{class:S}),children:A?h.jsx(be,{children:E["aria-label"]}):h.jsx(Fe,{color:c,disableAnimation:i,onValueChange:B,...I(p,C)})})});hl.displayName="HeroUI.TableCheckboxCell";var vl=hl,gl=T((e,t)=>{var l,u;const{as:o,className:n,children:s,node:r,slots:d,state:m,isSelectable:c,classNames:i,...p}=e,a=o||(e?.href?"a":"tr"),b=typeof a=="string",v=M(t),{rowProps:g}=Eu({node:r},m,v),x=K(i?.tr,n,(l=r.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=m.disabledKeys.has(r.key),f=m.selectionManager.isSelected(r.key),{isHovered:E,hoverProps:S}=Ie({isDisabled:$}),{isFirst:A,isLast:B,isMiddle:C,isOdd:N}=k.useMemo(()=>{const j=r.key===m.collection.getFirstKey(),F=r.key===m.collection.getLastKey(),R=!j&&!F,Q=r?.index?(r.index+1)%2===0:!1;return{isFirst:j,isLast:F,isMiddle:R,isOdd:Q}},[r,m.collection]);return h.jsx(a,{ref:v,"data-disabled":w($),"data-first":w(A),"data-focus-visible":w(D),"data-hover":w(E),"data-last":w(B),"data-middle":w(C),"data-odd":w(N),"data-selected":w(f),...I(g,y,c?S:{},O(r.props,{enabled:b}),p),className:(u=d.tr)==null?void 0:u.call(d,{class:x}),children:s})});gl.displayName="HeroUI.TableRow";var $l=gl,yl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:s,collection:r,isSelectable:d,color:m,disableAnimation:c,checkboxesProps:i,selectionMode:p,classNames:a,rowVirtualizer:b,...v}=e,g=u||"tbody",x=typeof g=="string",D=M(t),{rowGroupProps:y}=ge(),$=K(a?.tbody,o),f=r?.body.props,E=f?.isLoading||f?.loadingState==="loading"||f?.loadingState==="loadingMore",S=[...r.body.childNodes],A=b.getVirtualItems();let B,C;return r.size===0&&f.emptyContent&&(B=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper}),colSpan:r.columnCount,role:"gridcell",children:!E&&f.emptyContent})})),E&&f.loadingContent&&(C=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:a?.loadingWrapper}),colSpan:r.columnCount,role:"gridcell",children:f.loadingContent}),!B&&r.size===0?h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper})}):null]})),h.jsxs(g,{ref:D,...I(y,O(f,{enabled:x}),v),className:(l=n.tbody)==null?void 0:l.call(n,{class:$}),"data-empty":w(r.size===0),"data-loading":w(E),children:[A.map((N,j)=>{const F=S[N.index];return F?h.jsx($l,{classNames:a,isSelectable:d,node:F,slots:n,state:s,style:{transform:`translateY(${N.start-j*N.size}px)`,height:`${N.size}px`},children:[...F.childNodes].map(R=>R.props.isSelectionCell?h.jsx(vl,{checkboxesProps:i,classNames:a,color:m,disableAnimation:c,node:R,rowKey:F.key,selectionMode:p,slots:n,state:s},String(R.key)):h.jsx(fl,{classNames:a,node:R,rowKey:F.key,slots:n,state:s},String(R.key)))},String(F.key)):null}),C,B]})});yl.displayName="HeroUI.VirtualizedTableBody";var Hu=yl,xl=T((e,t)=>{var l,u,o,n,s;const{as:r,className:d,state:m,node:c,slots:i,classNames:p,sortIcon:a,...b}=e,v=r||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:c},m,x),y=K(p?.th,d,(l=c.props)==null?void 0:l.className),{isFocusVisible:$,focusProps:f}=X(),{isHovered:E,hoverProps:S}=Ie({}),{hideHeader:A,align:B,...C}=c.props,N=C.allowsSorting,j={"aria-hidden":!0,"data-direction":(u=m.sortDescriptor)==null?void 0:u.direction,"data-visible":w(((o=m.sortDescriptor)==null?void 0:o.column)===c.key),className:(n=i.sortIcon)==null?void 0:n.call(i,{class:p?.sortIcon})},F=typeof a=="function"?a(j):k.isValidElement(a)&&k.cloneElement(a,j);return h.jsxs(v,{ref:x,colSpan:c.colspan,"data-focus-visible":w($),"data-hover":w(E),"data-sortable":w(N),...I(D,f,O(C,{enabled:g}),N?S:{},b),className:(s=i.th)==null?void 0:s.call(i,{align:B,class:y}),children:[A?h.jsx(be,{children:c.rendered}):c.rendered,N&&(F||h.jsx(su,{strokeWidth:3,...j}))]})});xl.displayName="HeroUI.TableColumnHeader";var Cl=xl,Dl=T((e,t)=>{var l,u;const{as:o,className:n,children:s,node:r,slots:d,classNames:m,state:c,...i}=e,p=o||"tr",a=typeof p=="string",b=M(t),{rowProps:v}=Su({node:r},c),g=K(m?.tr,n,(l=r.props)==null?void 0:l.className);return h.jsx(p,{ref:b,...I(v,O(r.props,{enabled:a}),i),className:(u=d.tr)==null?void 0:u.call(d,{class:g}),children:s})});Dl.displayName="HeroUI.TableHeaderRow";var kl=Dl,Bl=k.forwardRef((e,t)=>{var l;const{as:u,className:o,children:n,slots:s,classNames:r,...d}=e,m=u||"thead",c=M(t),{rowGroupProps:i}=ge(),p=K(r?.thead,o);return h.jsx(m,{ref:c,className:(l=s.thead)==null?void 0:l.call(s,{class:p}),...I(i,d),children:n})});Bl.displayName="HeroUI.TableRowGroup";var El=Bl,Lu={px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Ae=e=>{var t;return(t=Lu[e])!=null?t:e};function Uu(e){const[t,l]=Pe(e,ke.variantKeys),{as:u,className:o,x:n=1,y:s=1,...r}=t,d=u||"span",m=k.useMemo(()=>ke({...l,className:o}),[Ke(l),o]),c=Ae(n),i=Ae(s);return{Component:d,getSpacerProps:(a={})=>({...a,...r,"aria-hidden":w(!0),className:K(m,a.className),style:{...a.style,...r.style,marginLeft:c,marginTop:i}})}}var Sl=T((e,t)=>{const{Component:l,getSpacerProps:u}=Uu({...e});return h.jsx(l,{ref:t,...u()})});Sl.displayName="HeroUI.Spacer";var Al=Sl,wl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:s,topContentPlacement:r,bottomContentPlacement:d,bottomContent:m,getBaseProps:c,getWrapperProps:i,getTableProps:p}=pl({...e,ref:t}),{rowHeight:a=40,maxTableHeight:b=600}=e,v=k.useCallback(({children:A})=>h.jsx(l,{...i(),ref:D,style:{height:b,display:"block"},children:A}),[i,b]),x=[...o.body.childNodes].length,D=k.useRef(null),[y,$]=k.useState(0),f=k.useRef(null);k.useLayoutEffect(()=>{f.current&&$(f.current.getBoundingClientRect().height)},[f]);const E=iu({count:x,getScrollElement:()=>D.current,estimateSize:()=>a,overscan:5}),S=p();return h.jsxs("div",{...c(),children:[r==="outside"&&s,h.jsx(v,{children:h.jsxs(h.Fragment,{children:[r==="inside"&&s,h.jsxs(u,{...S,style:{height:`calc(${E.getTotalSize()+y}px)`,...S.style},children:[h.jsxs(El,{ref:f,classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(A=>h.jsx(kl,{classNames:n.classNames,node:A,slots:n.slots,state:n.state,children:[...A.childNodes].map(B=>{var C;return(C=B?.props)!=null&&C.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:B,selectionMode:n.selectionMode,slots:n.slots,state:n.state},B?.key):h.jsx(Cl,{classNames:n.classNames,node:B,slots:n.slots,state:n.state},B?.key)})},A?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Hu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,rowVirtualizer:E,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),d==="inside"&&m]})}),d==="outside"&&m]})});wl.displayName="HeroUI.VirtualizedTable";var Wu=wl,Nl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:s,collection:r,isSelectable:d,color:m,disableAnimation:c,checkboxesProps:i,selectionMode:p,classNames:a,...b}=e,v=u||"tbody",g=typeof v=="string",x=M(t),{rowGroupProps:D}=ge(),y=K(a?.tbody,o),$=r?.body.props,f=$?.isLoading||$?.loadingState==="loading"||$?.loadingState==="loadingMore",E=k.useMemo(()=>[...r.body.childNodes].map(B=>h.jsx($l,{classNames:a,isSelectable:d,node:B,slots:n,state:s,children:[...B.childNodes].map(C=>C.props.isSelectionCell?h.jsx(vl,{checkboxesProps:i,classNames:a,color:m,disableAnimation:c,node:C,rowKey:B.key,selectionMode:p,slots:n,state:s},C.key):h.jsx(fl,{classNames:a,node:C,rowKey:B.key,slots:n,state:s},C.key))},B.key)),[r.body.childNodes,a,d,n,s]);let S,A;return r.size===0&&$.emptyContent&&(S=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper}),colSpan:r.columnCount,role:"gridcell",children:!f&&$.emptyContent})})),f&&$.loadingContent&&(A=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:a?.loadingWrapper}),colSpan:r.columnCount,role:"gridcell",children:$.loadingContent}),!S&&r.size===0?h.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper})}):null]})),h.jsxs(v,{ref:x,...I(D,O($,{enabled:g}),b),className:(l=n.tbody)==null?void 0:l.call(n,{class:y}),"data-empty":w(r.size===0),"data-loading":w(f),children:[E,A,S]})});Nl.displayName="HeroUI.TableBody";var Gu=Nl,zl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:s,topContentPlacement:r,bottomContentPlacement:d,bottomContent:m,removeWrapper:c,sortIcon:i,getBaseProps:p,getWrapperProps:a,getTableProps:b}=pl({...e,ref:t}),{isVirtualized:v,rowHeight:g=40,maxTableHeight:x=600}=e,D=v,y=k.useCallback(({children:$})=>c?$:h.jsx(l,{...a(),children:$}),[c,a]);return D?h.jsx(Wu,{...e,ref:t,maxTableHeight:x,rowHeight:g}):h.jsxs("div",{...p(),children:[r==="outside"&&s,h.jsx(y,{children:h.jsxs(h.Fragment,{children:[r==="inside"&&s,h.jsxs(u,{...b(),children:[h.jsxs(El,{classNames:n.classNames,slots:n.slots,children:[o.headerRows.map($=>h.jsx(kl,{classNames:n.classNames,node:$,slots:n.slots,state:n.state,children:[...$.childNodes].map(f=>{var E;return(E=f?.props)!=null&&E.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:f,selectionMode:n.selectionMode,slots:n.slots,state:n.state},f?.key):h.jsx(Cl,{classNames:n.classNames,node:f,slots:n.slots,sortIcon:i,state:n.state},f?.key)})},$?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Gu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),d==="inside"&&m]})}),d==="outside"&&m]})});zl.displayName="HeroUI.Table";var Yu=zl,Zu=Ru,_u=Zu,qu=Mu,Ju=qu,Xu=Vu,Qu=Xu,en=Tu,tn=en,ln=Ou,un=ln;const nn={n_requests:"Number Of Requests",estimated_cost:"Estimated Cost ($)"},we=["model","n_requests","prompt_tokens","completion_tokens","total_tokens","estimated_cost"];function on(e){return e.replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(t,l,u,o,n){return n<0?l+"0."+Array(1-n-u.length).join("0")+o+u:l+u+o+Array(n-o.length+1).join("0")})}function mn({message:e}){const t=e.usage,{isOpen:l,onOpen:u,onClose:o}=Xl();if(!t||Object.keys(t).length<1)return null;const n=Object.keys(t),s=()=>{o()},r=Object.keys(t[n[0]]),d=[...we.filter(b=>b==="model"||r.includes(b)),...r.filter(b=>!we.includes(b))],m=r.reduce((b,v)=>({...b,[v]:0}),{}),c=n.reduce((b,v)=>(d.reduce((g,x)=>(x==="model"||(g[x]+=t[v][x]),g),b),b),m),i=[...d.map(b=>({key:b,label:nn[b]??De.words(b).map(De.upperFirst).join(" ")}))],p=[...n.map(b=>({model:b,...t[b]})),{model:"Total",...c}],a=h.jsxs("div",{className:"p-2",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[c.prompt_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Prompt tokens"}),h.jsx("span",{children:c.prompt_tokens})]}),c.completion_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Completion tokens"}),h.jsx("span",{children:c.completion_tokens})]}),c.total_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Total tokens"}),h.jsx("span",{children:c.total_tokens})]}),c.estimated_cost!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Estimated cost"}),h.jsxs("span",{children:[on(c.estimated_cost.toString()),"$"]})]})]}),h.jsx("p",{className:"m-auto mt-2 text-center",children:"Show detailed usage breakdown by model."})]});return h.jsxs(h.Fragment,{children:[h.jsx(Ql,{content:a,placement:"bottom",children:h.jsx(eu,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open usage details",onPress:u,children:h.jsx(tu,{icon:"heroicons:information-circle"})})}),h.jsx(lu,{isOpen:l,onOpenChange:s,size:"4xl",children:h.jsx(uu,{children:h.jsxs(h.Fragment,{children:[h.jsx(ru,{className:"text-default-900 flex flex-col gap-1",children:"Usage details"}),h.jsx(nu,{children:h.jsxs(Yu,{"aria-label":"Table with detailed usage statistics for each model used to generate the message.",fullWidth:!0,children:[h.jsx(Ju,{columns:i,children:b=>h.jsx(_u,{children:b.label},b.key)}),h.jsx(tn,{items:p,children:b=>h.jsx(Qu,{className:b.model==="Total"?"border-default-200 border-t-1":"",children:v=>h.jsx(un,{children:ou(b,v)})},b.model)})]})})]})})})]})}export{mn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DX4sLJ2o.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DVjFDcbE.js similarity index 76% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DX4sLJ2o.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DVjFDcbE.js index ba552d0133..581b03fae4 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DX4sLJ2o.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DVjFDcbE.js @@ -1 +1 @@ -import{bu as s,bv as r}from"./index-Be6O1iVd.js";const i=s(r(t=>({user:null,isAuthenticated:!1,hasHydrated:!1,login:e=>t(a=>{a.user=e,a.isAuthenticated=!0}),logout:()=>t(e=>{e.user=null,e.isAuthenticated=!1}),setHydrated:()=>t(e=>{e.hasHydrated=!0})})));export{i as a}; +import{bu as s,bv as r}from"./index-DKQs0Q0w.js";const i=s(r(t=>({user:null,isAuthenticated:!1,hasHydrated:!1,login:e=>t(a=>{a.user=e,a.isAuthenticated=!0}),logout:()=>t(e=>{e.user=null,e.isAuthenticated=!1}),setHydrated:()=>t(e=>{e.hasHydrated=!0})})));export{i as a}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-B7iwVIJ3.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-B7iwVIJ3.js new file mode 100644 index 0000000000..5edf36cbd4 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-B7iwVIJ3.js @@ -0,0 +1 @@ +import{l as h,av as p,R as x,r as i,j as M,Z as R}from"./index-DKQs0Q0w.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=p(),f=x(o),u=t||"header";return i.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:R(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var H=s;export{H as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-C95SHugN.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-C95SHugN.js deleted file mode 100644 index 53541f365c..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-C95SHugN.js +++ /dev/null @@ -1 +0,0 @@ -import{l as h,be as p,R as x,r as i,j as M,Z as R}from"./index-Be6O1iVd.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=p(),f=x(o),u=t||"header";return i.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:R(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var N=s;export{N as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-C3U6kJ4J.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-O5iifkg7.js similarity index 89% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-C3U6kJ4J.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-O5iifkg7.js index 495123b366..1de49ce6e0 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-C3U6kJ4J.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-O5iifkg7.js @@ -1 +1 @@ -import{l as y,bn as D,j as e,r as t,am as N}from"./index-Be6O1iVd.js";var E=y((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:b,getInputWrapperProps:o,getMainWrapperProps:C,getHelperWrapperProps:I,getDescriptionProps:l,getErrorMessageProps:i,getClearButtonProps:f}=D({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(N,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...I(),children:W?e.jsx("div",{...i(),children:s}):e.jsx("div",{...l(),children:r})})},[x,P,s,r,I,i,l]),a=t.useMemo(()=>e.jsxs("div",{...b(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,b]),R=t.useMemo(()=>m?e.jsxs("div",{...C(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,C,o,i,l]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var U=E;export{U as i}; +import{l as y,bn as D,j as e,r as t,am as N}from"./index-DKQs0Q0w.js";var E=y((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:b,getInputWrapperProps:o,getMainWrapperProps:C,getHelperWrapperProps:I,getDescriptionProps:l,getErrorMessageProps:i,getClearButtonProps:f}=D({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(N,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...I(),children:W?e.jsx("div",{...i(),children:s}):e.jsx("div",{...l(),children:r})})},[x,P,s,r,I,i,l]),a=t.useMemo(()=>e.jsxs("div",{...b(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,b]),R=t.useMemo(()=>m?e.jsxs("div",{...C(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,C,o,i,l]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var U=E;export{U as i}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-8wr_YRsr.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-8wr_YRsr.js new file mode 100644 index 0000000000..9ae8953849 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-8wr_YRsr.js @@ -0,0 +1 @@ +import{bw as a,bx as e,by as t}from"./index-DKQs0Q0w.js";const n={renderer:t,...e,...a};var o=n;export{o as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BSfI8fMz.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BLcaR0iU.js similarity index 99% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BSfI8fMz.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BLcaR0iU.js index 245d54b45e..850cb09171 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BSfI8fMz.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BLcaR0iU.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CQEJd7fb.js","assets/index-Be6O1iVd.js","assets/index-CwtSwCGi.css"])))=>i.map(i=>d[i]); -import{t as P_,k as Qc,l as kr,r as H,$ as O_,j as A,L as Ry,n as xy,T as qy,o as E_,q as ed,_ as A_,s as C_,v as qe,w as I_,x as T_,y as R_,z as x_,A as q_,B as j_,E as N_,G as D_,H as Ou,J as Ir,K as Eu,M as jy,N as F_,O as Au,P as M_,Q as Cu,R as Gn,S as k_,U as Ny,V as L_,W as du,X as Iu,Y as U_,Z as Ee,a0 as Tu,a1 as V_,a2 as be,a3 as Tr,a4 as K_,a5 as B_,a6 as z_,a7 as W_,a8 as H_,a9 as G_,aa as Y_,ab as J_,ac as td,ad as X_,ae as Z_,af as rd,ag as Q_,ah as e0,ai as t0,aj as r0,ak as nd,al as n0,am as a0,an as i0,ao as s0,ap as o0,aq as l0,ar as Lr,g as tn,as as u0,at as c0,au as d0}from"./index-Be6O1iVd.js";import{i as f0}from"./chunk-SSA7SXE4-C3U6kJ4J.js";import{u as p0,$ as h0,a as m0,b as g0,m as y0,c as ad,d as v0,e as b0}from"./useMenuTriggerState-CF7Kywot.js";import{$ as _0}from"./useSelectableItem-DLYBSIKg.js";import{u as S0,C as w0}from"./index-DImPjBZJ.js";var id=P_({slots:{base:["group inline-flex flex-col relative"],label:["block","absolute","z-10","origin-top-left","flex-shrink-0","rtl:origin-top-right","subpixel-antialiased","text-small","text-foreground-500","pointer-events-none","group-data-[has-label-outside=true]:pointer-events-auto"],mainWrapper:"w-full flex flex-col",trigger:"relative px-3 gap-3 w-full inline-flex flex-row items-center shadow-xs outline-hidden tap-highlight-transparent",innerWrapper:"inline-flex h-fit w-[calc(100%_-theme(spacing.6))] min-h-4 items-center gap-1.5 box-border",selectorIcon:"absolute end-3 w-4 h-4",spinner:"absolute end-3",value:["text-foreground-500","font-normal","w-full","text-start"],listboxWrapper:"scroll-py-6 w-full",listbox:"",popoverContent:"w-full p-1 overflow-hidden",clearButton:["w-4","h-4","z-10","mb-4","relative","start-auto","appearance-none","outline-none","select-none","opacity-70","hover:!opacity-100","cursor-pointer","active:!opacity-70","rounded-full",...Qc],helperWrapper:"p-1 flex relative flex-col gap-1.5 group-data-[has-helper=true]:flex",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger",endWrapper:"flex end-18",endContent:"mb-4"},variants:{variant:{flat:{trigger:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-200"],clearButton:"mb-4"},faded:{trigger:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 data-[focus=true]:border-default-400 data-[open=true]:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},bordered:{trigger:["border-medium","border-default-200","data-[hover=true]:border-default-400","data-[open=true]:border-default-foreground","data-[focus=true]:border-default-foreground"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},underlined:{trigger:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","data-[open=true]:after:w-full","data-[focus=true]:after:w-full"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4 me-2"}},color:{default:{},primary:{selectorIcon:"text-primary"},secondary:{selectorIcon:"text-secondary"},success:{selectorIcon:"text-success"},warning:{selectorIcon:"text-warning"},danger:{selectorIcon:"text-danger"}},size:{sm:{label:"text-tiny",trigger:"h-8 min-h-8 px-2 rounded-small",value:"text-small",clearButton:"text-medium"},md:{trigger:"h-10 min-h-10 rounded-medium",value:"text-small",clearButton:"text-large"},lg:{trigger:"h-12 min-h-12 rounded-large",value:"text-medium",clearButton:"mb-5 text-large"}},radius:{none:{trigger:"rounded-none"},sm:{trigger:"rounded-small"},md:{trigger:"rounded-medium"},lg:{trigger:"rounded-large"},full:{trigger:"rounded-full"}},labelPlacement:{outside:{base:"flex flex-col",clearButton:"mb-0"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",label:"relative pe-2 text-foreground",clearButton:"mb-0"},inside:{label:"text-tiny cursor-pointer",trigger:"flex-col items-start justify-center gap-0"}},fullWidth:{true:{base:"w-full"},false:{base:"min-w-40"}},isClearable:{true:{clearButton:"peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block",endContent:"ms-3"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",trigger:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",value:"!text-danger",selectorIcon:"text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",trigger:"!h-auto"},false:{value:"truncate"}},disableAnimation:{true:{trigger:"after:transition-none",base:"transition-none",label:"transition-none",selectorIcon:"transition-none"},false:{base:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","origin-top-left","rtl:origin-top-right","!duration-200","!ease-out","transition-[transform,color,left,opacity,translate,scale]","motion-reduce:transition-none"],selectorIcon:"transition-transform duration-150 ease motion-reduce:transition-none",clearButton:["transition-opacity","motion-reduce:transition-none"]}},disableSelectorIconRotation:{true:{},false:{selectorIcon:"data-[open=true]:rotate-180"}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1,disableSelectorIconRotation:!1},compoundVariants:[{variant:"flat",color:"default",class:{value:"group-data-[has-value=true]:text-default-foreground",trigger:["bg-default-100","data-[hover=true]:bg-default-200"]}},{variant:"flat",color:"primary",class:{trigger:["bg-primary-100","text-primary","data-[hover=true]:bg-primary-50","group-data-[focus=true]:bg-primary-50"],value:"text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{trigger:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50"],value:"text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{trigger:["bg-success-100","text-success-600","dark:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],value:"text-success-600 dark:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{trigger:["bg-warning-100","text-warning-600","dark:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],value:"text-warning-600 dark:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{trigger:["bg-danger-100","text-danger","dark:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],value:"text-danger dark:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{trigger:"data-[hover=true]:border-primary data-[focus=true]:border-primary data-[open=true]:border-primary",label:"text-primary"}},{variant:"faded",color:"secondary",class:{trigger:"data-[hover=true]:border-secondary data-[focus=true]:border-secondary data-[open=true]:border-secondary",label:"text-secondary"}},{variant:"faded",color:"success",class:{trigger:"data-[hover=true]:border-success data-[focus=true]:border-success data-[open=true]:border-success",label:"text-success"}},{variant:"faded",color:"warning",class:{trigger:"data-[hover=true]:border-warning data-[focus=true]:border-warning data-[open=true]:border-warning",label:"text-warning"}},{variant:"faded",color:"danger",class:{trigger:"data-[hover=true]:border-danger data-[focus=true]:border-danger data-[open=true]:border-danger",label:"text-danger"}},{variant:"underlined",color:"default",class:{value:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{trigger:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{trigger:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{trigger:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{trigger:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{trigger:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{trigger:["data-[open=true]:border-primary","data-[focus=true]:border-primary"],label:"text-primary"}},{variant:"bordered",color:"secondary",class:{trigger:["data-[open=true]:border-secondary","data-[focus=true]:border-secondary"],label:"text-secondary"}},{variant:"bordered",color:"success",class:{trigger:["data-[open=true]:border-success","data-[focus=true]:border-success"],label:"text-success"}},{variant:"bordered",color:"warning",class:{trigger:["data-[open=true]:border-warning","data-[focus=true]:border-warning"],label:"text-warning"}},{variant:"bordered",color:"danger",class:{trigger:["data-[open=true]:border-danger","data-[focus=true]:border-danger"],label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled=true]:text-foreground"}},{radius:"full",size:["sm"],class:{trigger:"px-3"}},{radius:"full",size:"md",class:{trigger:"px-4"}},{radius:"full",size:"lg",class:{trigger:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{trigger:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{trigger:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{trigger:[...Qc]}},{isInvalid:!0,variant:"flat",class:{trigger:["bg-danger-50","data-[hover=true]:bg-danger-100","group-data-[focus=true]:bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{trigger:"!border-danger group-data-[focus=true]:border-danger"}},{isInvalid:!0,variant:"underlined",class:{trigger:"after:bg-danger"}},{labelPlacement:"inside",size:"sm",class:{trigger:"h-12 min-h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{trigger:"h-14 min-h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{label:"text-medium",trigger:"h-16 min-h-16 py-2.5 gap-0"}},{labelPlacement:"outside",isMultiline:!1,class:{base:"group relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled=true]:start-0"]}},{labelPlacement:["inside"],class:{label:"group-data-[filled=true]:scale-85"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-5"}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled=true]:-translate-y-[calc(100%_+var(--heroui-font-size-tiny)/2_+_16px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_26px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"md",class:{label:["start-3","text-small","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_30px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"lg",class:{label:["start-3","text-medium","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_34px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{labelPlacement:["outside","outside-left"],isClearable:!0,class:{endContent:["mt-4"],clearButton:["group-data-[has-end-content=true]:mt-4"]}},{isClearable:!1,labelPlacement:["outside","outside-left"],class:{endContent:["mt-4"]}},{isClearable:!0,variant:["underlined"],class:{clearButton:["relative group-data-[has-end-content=true]:left-2"],endContent:["me-2"]}},{isClearable:!1,variant:["underlined"],class:{endContent:["me-2"]}},{isClearable:!0,size:"sm",class:{endContent:"ms-2"}}]}),Dy=()=>A_(()=>import("./index-CQEJd7fb.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Fy=kr(({children:e,motionProps:t,placement:r,disableAnimation:n,style:a={},transformOrigin:i={},...s},o)=>{let l=a;return i.originX!==void 0||i.originY!==void 0?l={...l,transformOrigin:i}:r&&(l={...l,...C_(r==="center"?"top":r)}),n?A.jsx("div",{...s,ref:o,children:e}):A.jsx(Ry,{features:Dy,children:A.jsx(xy.div,{ref:o,animate:"enter",exit:"exit",initial:"initial",style:l,variants:qy.scaleSpringOpacity,...qe(s,t),children:e})})});Fy.displayName="HeroUI.FreeSoloPopoverWrapper";var My=kr(({children:e,transformOrigin:t,disableDialogFocus:r=!1,...n},a)=>{const{Component:i,state:s,placement:o,backdrop:l,portalContainer:u,disableAnimation:c,motionProps:h,isNonModal:g,getPopoverProps:v,getBackdropProps:b,getDialogProps:y,getContentProps:p}=p0({...n,ref:a}),f=H.useRef(null),{dialogProps:d,titleProps:m}=O_({},f),_=y({...!r&&{ref:f},...d}),S=H.useMemo(()=>l==="transparent"?null:c?A.jsx("div",{...b()}):A.jsx(Ry,{features:Dy,children:A.jsx(xy.div,{animate:"enter",exit:"exit",initial:"exit",variants:qy.fade,...b()})}),[l,c,b]);return A.jsxs(E_,{portalContainer:u,children:[!g&&S,A.jsx(i,{...v(),children:A.jsxs(Fy,{disableAnimation:c,motionProps:h,placement:o,tabIndex:-1,transformOrigin:t,..._,children:[!g&&A.jsx(ed,{onDismiss:s.close}),A.jsx("div",{...p(),children:typeof e=="function"?e(m):e}),A.jsx(ed,{onDismiss:s.close})]})})]})});My.displayName="HeroUI.FreeSoloPopover";var $0=My;class sd{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let r=this.keyMap.get(t);var n;return r&&(n=r.prevKey)!==null&&n!==void 0?n:null}getKeyAfter(t){let r=this.keyMap.get(t);var n;return r&&(n=r.nextKey)!==null&&n!==void 0?n:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){var r;return(r=this.keyMap.get(t))!==null&&r!==void 0?r:null}at(t){const r=[...this.getKeys()];return this.getItem(r[t])}getChildren(t){let r=this.keyMap.get(t);return r?.childNodes||[]}constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let r=s=>{if(this.keyMap.set(s.key,s),s.childNodes&&s.type==="section")for(let o of s.childNodes)r(o)};for(let s of t)r(s);let n=null,a=0;for(let[s,o]of this.keyMap)n?(n.nextKey=s,o.prevKey=n.key):(this.firstKey=s,o.prevKey=void 0),o.type==="item"&&(o.index=a++),n=o,n.nextKey=void 0;var i;this.lastKey=(i=n?.key)!==null&&i!==void 0?i:null}}function ky(e){let{filter:t,layoutDelegate:r}=e,n=I_(e),a=H.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),i=H.useCallback(u=>t?new sd(t(u)):new sd(u),[t]),s=H.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),o=T_(e,i,s),l=H.useMemo(()=>new R_(o,n,{layoutDelegate:r}),[o,n,r]);return P0(o,l),{collection:o,disabledKeys:a,selectionManager:l}}function P0(e,t){const r=H.useRef(null);H.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&r.current){const c=r.current.getItem(t.focusedKey),h=[...r.current.getKeys()].map(f=>{const d=r.current.getItem(f);return d?.type==="item"?d:null}).filter(f=>f!==null),g=[...e.getKeys()].map(f=>{const d=e.getItem(f);return d?.type==="item"?d:null}).filter(f=>f!==null);var n,a;const v=((n=h?.length)!==null&&n!==void 0?n:0)-((a=g?.length)!==null&&a!==void 0?a:0);var i,s,o;let b=Math.min(v>1?Math.max(((i=c?.index)!==null&&i!==void 0?i:0)-v+1,0):(s=c?.index)!==null&&s!==void 0?s:0,((o=g?.length)!==null&&o!==void 0?o:0)-1),y=null,p=!1;for(;b>=0;){if(!t.isDisabled(g[b].key)){y=g[b];break}if(b((l=c?.index)!==null&&l!==void 0?l:0)&&(b=(u=c?.index)!==null&&u!==void 0?u:0),b--}}t.setFocusedKey(y?y.key:null)}r.current=e},[e,t])}function O0(e){const{collection:t,disabledKeys:r,selectionManager:n,selectionManager:{setSelectedKeys:a,selectedKeys:i,selectionMode:s}}=ky(e),o=H.useMemo(()=>!e.isLoading&&i.size!==0?Array.from(i).filter(Boolean).filter(u=>!t.getItem(u)):[],[i,t]),l=i.size!==0?Array.from(i).map(u=>t.getItem(u)).filter(Boolean):null;return o.length&&console.warn(`Select: Keys "${o.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:t,disabledKeys:r,selectionManager:n,selectionMode:s,selectedKeys:i,setSelectedKeys:a.bind(n),selectedItems:l}}function E0({validate:e,validationBehavior:t,...r}){const[n,a]=H.useState(!1),[i,s]=H.useState(null),o=h0(r),l=O0({...r,onSelectionChange:h=>{r.onSelectionChange!=null&&(h==="all"?r.onSelectionChange(new Set(l.collection.getKeys())):r.onSelectionChange(h)),r.selectionMode==="single"&&o.close()}}),u=x_({...r,validationBehavior:t,validate:h=>{if(!e)return;const g=Array.from(h);return e(r.selectionMode==="single"?g[0]:g)},value:l.selectedKeys}),c=l.collection.size===0&&r.hideEmptyContent;return{...u,...l,...o,focusStrategy:i,close(){o.close()},open(h=null){c||(s(h),o.open())},toggle(h=null){c||(s(h),o.toggle())},isFocused:n,setFocused:a}}function A0(e,t,r){const{disallowEmptySelection:n,isDisabled:a}=e,i=q_({usage:"search",sensitivity:"base"}),s=H.useMemo(()=>new j_(t.collection,t.disabledKeys,null,i),[t.collection,t.disabledKeys,i]),{menuTriggerProps:o,menuProps:l}=m0({isDisabled:a,type:"listbox"},t,r),u=S=>{if(t.selectionMode==="single")switch(S.key){case"ArrowLeft":{S.preventDefault();const w=t.selectedKeys.size>0?s.getKeyAbove(t.selectedKeys.values().next().value):s.getFirstKey();w&&t.setSelectedKeys([w]);break}case"ArrowRight":{S.preventDefault();const w=t.selectedKeys.size>0?s.getKeyBelow(t.selectedKeys.values().next().value):s.getFirstKey();w&&t.setSelectedKeys([w]);break}}},{typeSelectProps:c}=N_({keyboardDelegate:s,selectionManager:t.selectionManager,onTypeSelect(S){t.setSelectedKeys([S])}}),{isInvalid:h,validationErrors:g,validationDetails:v}=t.displayValidation,{labelProps:b,fieldProps:y,descriptionProps:p,errorMessageProps:f}=D_({...e,labelElementType:"span",isInvalid:h,errorMessage:e.errorMessage||g});c.onKeyDown=c.onKeyDownCapture,delete c.onKeyDownCapture,o.onPressStart=S=>{S.pointerType!=="touch"&&S.pointerType!=="keyboard"&&!a&&t.toggle(S.pointerType==="virtual"?"first":null)};const d=Ou(e,{labelable:!0}),m=Ir(c,o,y),_=Eu();return{labelProps:{...b,onClick:()=>{var S;e.isDisabled||((S=r.current)==null||S.focus(),F_("keyboard"))}},triggerProps:Ir(d,{...m,onKeyDown:jy(m.onKeyDown,u,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[_,m["aria-labelledby"],m["aria-label"]&&!m["aria-labelledby"]?m.id:null].join(","),onFocus(S){t.isFocused||(e.onFocus&&e.onFocus(S),t.setFocused(!0))},onBlur(S){t.isOpen||(e.onBlur&&e.onBlur(S),t.setFocused(!1))}}),valueProps:{id:_},menuProps:{...l,disallowEmptySelection:n,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:S=>{S.currentTarget.contains(S.relatedTarget)||(e.onBlur&&e.onBlur(S),t.setFocused(!1))},onFocus:l?.onFocus,"aria-labelledby":[y["aria-labelledby"],m["aria-label"]&&!y["aria-labelledby"]?m.id:null].filter(Boolean).join(" ")},descriptionProps:p,errorMessageProps:f,isInvalid:h,validationErrors:g,validationDetails:v}}var Ly=new WeakMap;function C0(e){var t,r,n,a,i,s;const o=Au(),{validationBehavior:l}=M_(K_)||{},[u,c]=Cu(e,id.variantKeys),h=(r=(t=e.disableAnimation)!=null?t:o?.disableAnimation)!=null?r:!1,{ref:g,as:v,label:b,name:y,isLoading:p,selectorIcon:f,isOpen:d,defaultOpen:m,onOpenChange:_,startContent:S,endContent:w,description:$,renderValue:O,onSelectionChange:E,placeholder:R,isVirtualized:q,itemHeight:M=36,maxListboxHeight:I=256,children:L,disallowEmptySelection:k=!1,selectionMode:J="single",spinnerRef:X,scrollRef:Y,popoverProps:ne={},scrollShadowProps:K={},listboxProps:j={},spinnerProps:V={},validationState:N,onChange:P,onClose:T,className:D,classNames:U,validationBehavior:Q=(n=l??o?.validationBehavior)!=null?n:"native",hideEmptyContent:B=!1,onClear:G,...C}=u,x=Gn(Y),F={popoverProps:qe({placement:"bottom",triggerScaleOnOpen:!1,offset:5,disableAnimation:h},ne),scrollShadowProps:qe({ref:x,isEnabled:(a=e.showScrollIndicators)!=null?a:!0,hideScrollBar:!0,offset:15},K),listboxProps:qe({disableAnimation:h},j)},z=v||"button",W=typeof z=="string",Z=Gn(g),ee=H.useRef(null),ce=H.useRef(null),se=H.useRef(null);let re=E0({...u,isOpen:d,selectionMode:J,disallowEmptySelection:k,validationBehavior:Q,children:L,isRequired:e.isRequired,isDisabled:e.isDisabled,isInvalid:e.isInvalid,defaultOpen:m,hideEmptyContent:B,onOpenChange:te=>{_?.(te),te||T?.()},onSelectionChange:te=>{E?.(te),P&&typeof P=="function"&&P({target:{...Z.current&&{...Z.current,name:Z.current.name},value:Array.from(te).join(",")}}),re.commitValidation()}});re={...re,...e.isDisabled&&{disabledKeys:new Set([...re.collection.getKeys()])}},k_(()=>{var te;(te=Z.current)!=null&&te.value&&re.setSelectedKeys(new Set([...re.selectedKeys,Z.current.value]))},[Z.current]);const{labelProps:de,triggerProps:ie,valueProps:ue,menuProps:Ae,descriptionProps:Te,errorMessageProps:Ve,isInvalid:Xe,validationErrors:je,validationDetails:It}=A0({...u,disallowEmptySelection:k,isDisabled:e.isDisabled},re,ee),Gt=H.useCallback(()=>{var te;re.setSelectedKeys(new Set([])),G?.(),(te=ee.current)==null||te.focus()},[G,re]),{pressProps:en}=Ny({isDisabled:!!e?.isDisabled,onPress:Gt}),ot=e.isInvalid||N==="invalid"||Xe,{isPressed:We,buttonProps:Ze}=L_(ie,ee),{focusProps:Fc,isFocused:Mc,isFocusVisible:kc}=du(),{focusProps:Lc,isFocusVisible:Uc}=du(),{isHovered:Vc,hoverProps:Kc}=Iu({isDisabled:e.isDisabled}),Tt=U_({labelPlacement:e.labelPlacement,label:b}),ja=!!R,Bc=Tt==="outside-left"||Tt==="outside",n_=Tt==="inside",zc=Tt==="outside-left",Wc=e.isClearable,Hc=re.isOpen||ja||!!((i=re.selectedItems)!=null&&i.length)||!!S||!!w||!!e.isMultiline,Gc=!!((s=re.selectedItems)!=null&&s.length),Na=!!b,Yc=Na&&(zc||Bc&&ja),Jc=Ee(U?.base,D),fe=H.useMemo(()=>id({...c,isInvalid:ot,isClearable:Wc,labelPlacement:Tt,disableAnimation:h}),[Tu(c),ot,Tt,h]);V_({isDisabled:!re.isOpen});const Xc=typeof u.errorMessage=="function"?u.errorMessage({isInvalid:ot,validationErrors:je,validationDetails:It}):u.errorMessage||je?.join(" "),Da=!!$||!!Xc,a_=!!w;H.useEffect(()=>{if(re.isOpen&&se.current&&ee.current){let te=ee.current.getBoundingClientRect(),Rt=se.current;Rt.style.width=te.width+"px"}},[re.isOpen]);const i_=H.useCallback((te={})=>({"data-slot":"base","data-filled":be(Hc),"data-has-value":be(Gc),"data-has-label":be(Na),"data-has-helper":be(Da),"data-has-end-content":be(a_),"data-invalid":be(ot),"data-has-label-outside":be(Yc),className:fe.base({class:Ee(Jc,te.className)}),...te}),[fe,Da,Gc,Na,Yc,Hc,Jc]),s_=H.useCallback((te={})=>({ref:ee,"data-slot":"trigger","data-open":be(re.isOpen),"data-disabled":be(e?.isDisabled),"data-focus":be(Mc),"data-pressed":be(We),"data-focus-visible":be(kc),"data-hover":be(Vc),className:fe.trigger({class:U?.trigger}),...qe(Ze,Fc,Kc,Tr(C,{enabled:W}),Tr(te))}),[fe,ee,re.isOpen,U?.trigger,e?.isDisabled,Mc,We,kc,Vc,Ze,Fc,Kc,C,W]),o_=H.useCallback((te={})=>({state:re,triggerRef:ee,selectRef:Z,selectionMode:J,label:e?.label,name:e?.name,isRequired:e?.isRequired,autoComplete:e?.autoComplete,isDisabled:e?.isDisabled,form:e?.form,onChange:P,...te}),[re,J,e?.label,e?.autoComplete,e?.name,e?.isDisabled,ee]),l_=H.useCallback((te={})=>({"data-slot":"label",className:fe.label({class:Ee(U?.label,te.className)}),...de,...te}),[fe,U?.label,de]),u_=H.useCallback((te={})=>({"data-slot":"value",className:fe.value({class:Ee(U?.value,te.className)}),...ue,...te}),[fe,U?.value,ue]),c_=H.useCallback((te={})=>({"data-slot":"listboxWrapper",className:fe.listboxWrapper({class:Ee(U?.listboxWrapper,te?.className)}),style:{maxHeight:I??256,...te.style},...qe(F.scrollShadowProps,te)}),[fe.listboxWrapper,U?.listboxWrapper,F.scrollShadowProps,I]),d_=(te={})=>{const Rt=q??re.collection.size>50;return{state:re,ref:ce,isVirtualized:Rt,virtualization:Rt?{maxListboxHeight:I,itemHeight:M}:void 0,"data-slot":"listbox",className:fe.listbox({class:Ee(U?.listbox,te?.className)}),scrollShadowProps:F.scrollShadowProps,...qe(F.listboxProps,te,Ae)}},f_=H.useCallback((te={})=>{var Rt,Zc;const $_=qe(F.popoverProps,te);return{state:re,triggerRef:ee,ref:se,"data-slot":"popover",scrollRef:ce,triggerType:"listbox",classNames:{content:fe.popoverContent({class:Ee(U?.popoverContent,te.className)})},...$_,offset:re.selectedItems&&re.selectedItems.length>0?re.selectedItems.length*1e-8+(((Rt=F.popoverProps)==null?void 0:Rt.offset)||0):(Zc=F.popoverProps)==null?void 0:Zc.offset}},[fe,U?.popoverContent,F.popoverProps,ee,re,re.selectedItems]),p_=H.useCallback(()=>({"data-slot":"selectorIcon","aria-hidden":be(!0),"data-open":be(re.isOpen),className:fe.selectorIcon({class:U?.selectorIcon})}),[fe,U?.selectorIcon,re.isOpen]),h_=H.useCallback((te={})=>({...te,"data-slot":"innerWrapper",className:fe.innerWrapper({class:Ee(U?.innerWrapper,te?.className)})}),[fe,U?.innerWrapper]),m_=H.useCallback((te={})=>({...te,"data-slot":"helperWrapper",className:fe.helperWrapper({class:Ee(U?.helperWrapper,te?.className)})}),[fe,U?.helperWrapper]),g_=H.useCallback((te={})=>({...te,...Te,"data-slot":"description",className:fe.description({class:Ee(U?.description,te?.className)})}),[fe,U?.description]),y_=H.useCallback((te={})=>({...te,"data-slot":"mainWrapper",className:fe.mainWrapper({class:Ee(U?.mainWrapper,te?.className)})}),[fe,U?.mainWrapper]),v_=H.useCallback((te={})=>({...te,"data-slot":"end-wrapper",className:fe.endWrapper({class:Ee(U?.endWrapper,te?.className)})}),[fe,U?.endWrapper]),b_=H.useCallback((te={})=>({...te,"data-slot":"end-content",className:fe.endContent({class:Ee(U?.endContent,te?.className)})}),[fe,U?.endContent]),__=H.useCallback((te={})=>({...te,...Ve,"data-slot":"error-message",className:fe.errorMessage({class:Ee(U?.errorMessage,te?.className)})}),[fe,Ve,U?.errorMessage]),S_=H.useCallback((te={})=>({"aria-hidden":be(!0),"data-slot":"spinner",color:"current",size:"sm",...V,...te,ref:X,className:fe.spinner({class:Ee(U?.spinner,te?.className)})}),[fe,X,V,U?.spinner]),w_=H.useCallback((te={})=>({...te,type:"button",tabIndex:-1,"aria-label":"clear selection","data-slot":"clear-button","data-focus-visible":be(Uc),className:fe.clearButton({class:Ee(U?.clearButton,te?.className)}),...qe(en,Lc)}),[fe,Uc,en,Lc,U?.clearButton]);return Ly.set(re,{isDisabled:e?.isDisabled,isRequired:e?.isRequired,name:e?.name,isInvalid:ot,validationBehavior:Q}),{Component:z,domRef:Z,state:re,label:b,name:y,triggerRef:ee,isLoading:p,placeholder:R,startContent:S,endContent:w,description:$,selectorIcon:f,hasHelper:Da,labelPlacement:Tt,hasPlaceholder:ja,renderValue:O,selectionMode:J,disableAnimation:h,isOutsideLeft:zc,shouldLabelBeOutside:Bc,shouldLabelBeInside:n_,isInvalid:ot,errorMessage:Xc,isClearable:Wc,getClearButtonProps:w_,getBaseProps:i_,getTriggerProps:s_,getLabelProps:l_,getValueProps:u_,getListboxProps:d_,getPopoverProps:f_,getSpinnerProps:S_,getMainWrapperProps:y_,getListboxWrapperProps:c_,getHiddenSelectProps:o_,getInnerWrapperProps:h_,getHelperWrapperProps:m_,getDescriptionProps:g_,getErrorMessageProps:__,getSelectorIconProps:p_,getEndWrapperProps:v_,getEndContentProps:b_}}var I0=typeof document<"u"?B_.useLayoutEffect:()=>{};function T0(e){const t=H.useRef(null);return I0(()=>{t.current=e},[e]),H.useCallback((...r)=>{const n=t.current;return n?.(...r)},[])}function R0(e,t,r){let n=H.useRef(t),a=T0(()=>{r&&r(n.current)});H.useEffect(()=>{var i;let s=(i=e?.current)==null?void 0:i.form;return s?.addEventListener("reset",a),()=>{s?.removeEventListener("reset",a)}},[e,a])}function x0(e,t,r){var n;let a=Ly.get(t)||{},{autoComplete:i,name:s=a.name,isDisabled:o=a.isDisabled,selectionMode:l,onChange:u,form:c}=e,{validationBehavior:h,isRequired:g,isInvalid:v}=a,{visuallyHiddenProps:b}=z_();return R0(e.selectRef,t.selectedKeys,t.setSelectedKeys),W_({validationBehavior:h,focus:()=>{var y;return(y=r.current)==null?void 0:y.focus()}},t,e.selectRef),{containerProps:{...b,"aria-hidden":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{form:c,autoComplete:i,disabled:o,"aria-invalid":v||void 0,"aria-required":g&&h==="aria"||void 0,required:g&&h==="native",name:s,tabIndex:-1,value:l==="multiple"?[...t.selectedKeys].map(y=>String(y)):(n=[...t.selectedKeys][0])!=null?n:"",multiple:l==="multiple",onChange:y=>{t.setSelectedKeys(y.target.value),u?.(y)}}}}function q0(e){var t;let{state:r,triggerRef:n,selectRef:a,label:i,name:s,isDisabled:o,form:l}=e,{containerProps:u,selectProps:c}=x0({...e,selectRef:a},r,n);return r.collection.size<=300?A.jsx("div",{...u,"data-testid":"hidden-select-container",children:A.jsxs("label",{children:[i,A.jsxs("select",{...c,ref:a,children:[A.jsx("option",{}),[...r.collection.getKeys()].map(h=>{let g=r.collection.getItem(h);if(g?.type==="item")return A.jsx("option",{value:g.key,children:g.textValue},g.key)})]})]})}):s?A.jsx("input",{autoComplete:c.autoComplete,disabled:o,form:l,name:s,type:"hidden",value:(t=[...r.selectedKeys].join(","))!=null?t:""}):null}var j0=H_,N0=j0;const Ru=new WeakMap;function D0(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function F0(e,t){let r=Ru.get(e);if(!r)throw new Error("Unknown list");return`${r.id}-option-${D0(t)}`}function M0(e,t,r){let n=Ou(e,{labelable:!0}),a=e.selectionBehavior||"toggle",i=e.linkBehavior||(a==="replace"?"action":"override");a==="toggle"&&i==="action"&&(i="override");let{listProps:s}=G_({...e,ref:r,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,linkBehavior:i}),{focusWithinProps:o}=Y_({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),l=Eu(e.id);Ru.set(t,{id:l,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction,linkBehavior:i});let{labelProps:u,fieldProps:c}=J_({...e,id:l,labelElementType:"span"});return{labelProps:u,listBoxProps:Ir(n,o,t.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...Ir(c,s)})}}function k0(e,t,r){var n,a;let{key:i}=e,s=Ru.get(t);var o;let l=(o=e.isDisabled)!==null&&o!==void 0?o:t.selectionManager.isDisabled(i);var u;let c=(u=e.isSelected)!==null&&u!==void 0?u:t.selectionManager.isSelected(i);var h;let g=(h=e.shouldSelectOnPressUp)!==null&&h!==void 0?h:s?.shouldSelectOnPressUp;var v;let b=(v=e.shouldFocusOnHover)!==null&&v!==void 0?v:s?.shouldFocusOnHover;var y;let p=(y=e.shouldUseVirtualFocus)!==null&&y!==void 0?y:s?.shouldUseVirtualFocus;var f;let d=(f=e.isVirtualized)!==null&&f!==void 0?f:s?.isVirtualized,m=td(),_=td(),S={role:"option","aria-disabled":l||void 0,"aria-selected":t.selectionManager.selectionMode!=="none"?c:void 0};X_()&&Z_()||(S["aria-label"]=e["aria-label"],S["aria-labelledby"]=m,S["aria-describedby"]=_);let w=t.collection.getItem(i);if(d){let X=Number(w?.index);S["aria-posinset"]=Number.isNaN(X)?void 0:X+1,S["aria-setsize"]=g0(t.collection)}let $=s?.onAction?()=>{var X;return s==null||(X=s.onAction)===null||X===void 0?void 0:X.call(s,i)}:void 0,O=F0(t,i),{itemProps:E,isPressed:R,isFocused:q,hasAction:M,allowsSelection:I}=_0({selectionManager:t.selectionManager,key:i,ref:r,shouldSelectOnPressUp:g,allowsDifferentPressOrigin:g&&b,isVirtualized:d,shouldUseVirtualFocus:p,isDisabled:l,onAction:$||!(w==null||(n=w.props)===null||n===void 0)&&n.onAction?jy(w==null||(a=w.props)===null||a===void 0?void 0:a.onAction,$):void 0,linkBehavior:s?.linkBehavior,id:O}),{hoverProps:L}=Iu({isDisabled:l||!b,onHoverStart(){rd()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(i))}}),k=Ou(w?.props);delete k.id;let J=Q_(w?.props);return{optionProps:{...S,...Ir(k,E,L,J),id:O},labelProps:{id:m},descriptionProps:{id:_},isFocused:q,isFocusVisible:q&&t.selectionManager.isFocused&&rd(),isSelected:c,isDisabled:l,isPressed:R,allowsSelection:I,hasAction:M}}function L0(e){let{heading:t,"aria-label":r}=e,n=Eu();return{itemProps:{role:"presentation"},headingProps:t?{id:n,role:"presentation"}:{},groupProps:{role:"group","aria-label":r,"aria-labelledby":t?n:void 0}}}function U0(e){var t;const r=Au(),{ref:n,as:a,state:i,variant:s,color:o,onAction:l,children:u,onSelectionChange:c,disableAnimation:h=(t=r?.disableAnimation)!=null?t:!1,itemClasses:g,className:v,topContent:b,bottomContent:y,emptyContent:p="No items.",hideSelectedIcon:f=!1,hideEmptyContent:d=!1,shouldHighlightOnFocus:m=!1,classNames:_,...S}=e,w=a||"ul",$=typeof w=="string",O=Gn(n),E=ky({...e,children:u,onSelectionChange:c}),R=i||E,{listBoxProps:q}=M0({...e,onAction:l},R,O),M=H.useMemo(()=>y0(),[]),I=Ee(_?.base,v);return{Component:w,state:R,variant:s,color:o,slots:M,classNames:_,topContent:b,bottomContent:y,emptyContent:p,hideEmptyContent:d,shouldHighlightOnFocus:m,hideSelectedIcon:f,disableAnimation:h,className:v,itemClasses:g,getBaseProps:(X={})=>({ref:O,"data-slot":"base",className:M.base({class:I}),...Tr(S,{enabled:$}),...X}),getListProps:(X={})=>({"data-slot":"list",className:M.list({class:_?.list}),...q,...X}),getEmptyContentProps:(X={})=>({"data-slot":"empty-content",children:p,className:M.emptyContent({class:_?.emptyContent}),...X})}}function V0(e){const{isSelected:t,disableAnimation:r,...n}=e;return A.jsx("svg",{"aria-hidden":"true","data-selected":t,role:"presentation",viewBox:"0 0 17 18",...n,children:A.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:t?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:r?{}:{transition:"stroke-dashoffset 200ms ease"}})})}function K0(e){var t,r;const n=Au(),[a,i]=Cu(e,ad.variantKeys),{as:s,item:o,state:l,description:u,startContent:c,endContent:h,isVirtualized:g,selectedIcon:v,className:b,classNames:y,autoFocus:p,onPress:f,onPressUp:d,onPressStart:m,onPressEnd:_,onPressChange:S,onClick:w,shouldHighlightOnFocus:$,hideSelectedIcon:O=!1,isReadOnly:E=!1,...R}=a,q=(r=(t=e.disableAnimation)!=null?t:n?.disableAnimation)!=null?r:!1,M=H.useRef(null),I=s||(e.href?"a":"li"),L=typeof I=="string",{rendered:k,key:J}=o,X=l.disabledKeys.has(J)||e.isDisabled,Y=l.selectionManager.selectionMode!=="none",ne=v0(),{pressProps:K,isPressed:j}=Ny({ref:M,isDisabled:X,onClick:w,onPress:f,onPressUp:d,onPressStart:m,onPressEnd:_,onPressChange:S}),{isHovered:V,hoverProps:N}=Iu({isDisabled:X}),{isFocusVisible:P,focusProps:T}=du({autoFocus:p}),{isFocused:D,isSelected:U,optionProps:Q,labelProps:B,descriptionProps:G}=k0({key:J,isDisabled:X,"aria-label":a["aria-label"],isVirtualized:g},l,M);let C=Q;const x=H.useMemo(()=>ad({...i,isDisabled:X,disableAnimation:q,hasTitleTextChild:typeof k=="string",hasDescriptionTextChild:typeof u=="string"}),[Tu(i),X,q,k,u]),F=Ee(y?.base,b);E&&(C=e0(C));const z=$&&D||(ne?V||j:V||D&&!P),W=(re={})=>({ref:M,...qe(C,E?{}:qe(T,K),N,Tr(R,{enabled:L}),re),"data-selectable":be(Y),"data-focus":be(D),"data-hover":be(z),"data-disabled":be(X),"data-selected":be(U),"data-pressed":be(j),"data-focus-visible":be(P),className:x.base({class:Ee(F,re.className)})}),Z=(re={})=>({...qe(B,re),"data-label":be(!0),className:x.title({class:y?.title})}),ee=(re={})=>({...qe(G,re),className:x.description({class:y?.description})}),ce=(re={})=>({...qe(re),className:x.wrapper({class:y?.wrapper})}),se=H.useCallback((re={})=>({"aria-hidden":be(!0),"data-disabled":be(X),className:x.selectedIcon({class:y?.selectedIcon}),...re}),[X,x,y]);return{Component:I,domRef:M,slots:x,classNames:y,isSelectable:Y,isSelected:U,isDisabled:X,rendered:k,description:u,startContent:c,endContent:h,selectedIcon:v,hideSelectedIcon:O,disableAnimation:q,getItemProps:W,getLabelProps:Z,getWrapperProps:ce,getDescriptionProps:ee,getSelectedIconProps:se}}var Uy=e=>{const{Component:t,rendered:r,description:n,isSelectable:a,isSelected:i,isDisabled:s,selectedIcon:o,startContent:l,endContent:u,hideSelectedIcon:c,disableAnimation:h,getItemProps:g,getLabelProps:v,getWrapperProps:b,getDescriptionProps:y,getSelectedIconProps:p}=K0(e),f=H.useMemo(()=>{const d=A.jsx(V0,{disableAnimation:h,isSelected:i});return typeof o=="function"?o({icon:d,isSelected:i,isDisabled:s}):o||d},[o,i,s,h]);return A.jsxs(t,{...g(),children:[l,n?A.jsxs("div",{...b(),children:[A.jsx("span",{...v(),children:r}),A.jsx("span",{...y(),children:n})]}):A.jsx("span",{...v(),children:r}),a&&!c&&A.jsx("span",{...p(),children:f}),u]})};Uy.displayName="HeroUI.ListboxItem";var xu=Uy,Vy=kr(({item:e,state:t,as:r,variant:n,color:a,disableAnimation:i,className:s,classNames:o,hideSelectedIcon:l,showDivider:u=!1,dividerProps:c={},itemClasses:h,title:g,items:v,...b},y)=>{const p=r||"li",f=H.useMemo(()=>b0(),[]),d=Ee(o?.base,s),m=Ee(o?.divider,c?.className),{itemProps:_,headingProps:S,groupProps:w}=L0({heading:e.rendered,"aria-label":e["aria-label"]});return A.jsxs(p,{"data-slot":"base",...qe(_,b),className:f.base({class:d}),children:[e.rendered&&A.jsx("span",{...S,className:f.heading({class:o?.heading}),"data-slot":"heading",children:e.rendered}),A.jsxs("ul",{...w,className:f.group({class:o?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map($=>{const{key:O,props:E}=$;let R=A.jsx(xu,{classNames:h,color:a,disableAnimation:i,hideSelectedIcon:l,item:$,state:t,variant:n,...E},O);return $.wrapper&&(R=$.wrapper(R)),R}),u&&A.jsx(t0,{as:"li",className:f.divider({class:m}),...c})]})]},e.key)});Vy.displayName="HeroUI.ListboxSection";var Ky=Vy;function B0(e={}){const{domRef:t,isEnabled:r=!0,overflowCheck:n="vertical",visibility:a="auto",offset:i=0,onVisibilityChange:s,updateDeps:o=[]}=e,l=H.useRef(a);H.useEffect(()=>{const u=t?.current;if(!u||!r)return;const c=(v,b,y,p,f)=>{if(a==="auto"){const d=`${p}${n0(f)}Scroll`;b&&y?(u.dataset[d]="true",u.removeAttribute(`data-${p}-scroll`),u.removeAttribute(`data-${f}-scroll`)):(u.dataset[`${p}Scroll`]=b.toString(),u.dataset[`${f}Scroll`]=y.toString(),u.removeAttribute(`data-${p}-${f}-scroll`))}else{const d=b&&y?"both":b?p:y?f:"none";d!==l.current&&(s?.(d),l.current=d)}},h=()=>{var v,b;const y=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],p=u.querySelector('ul[data-slot="list"]'),f=+((v=p?.getAttribute("data-virtual-scroll-height"))!=null?v:u.scrollHeight),d=+((b=p?.getAttribute("data-virtual-scroll-top"))!=null?b:u.scrollTop);for(const{type:m,prefix:_,suffix:S}of y)if(n===m||n==="both"){const w=m==="vertical"?d>i:u.scrollLeft>i,$=m==="vertical"?d+u.clientHeight+i{["top","bottom","top-bottom","left","right","left-right"].forEach(v=>{u.removeAttribute(`data-${v}-scroll`)})};return h(),u.addEventListener("scroll",h,!0),a!=="auto"&&(g(),a==="both"?(u.dataset.topBottomScroll=String(n==="vertical"),u.dataset.leftRightScroll=String(n==="horizontal")):(u.dataset.topBottomScroll="false",u.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(v=>{u.dataset[`${v}Scroll`]=String(a===v)}))),()=>{u.removeEventListener("scroll",h,!0),g()}},[...o,r,a,n,s,t])}function z0(e){var t;const[r,n]=Cu(e,nd.variantKeys),{ref:a,as:i,children:s,className:o,style:l,size:u=40,offset:c=0,visibility:h="auto",isEnabled:g=!0,onVisibilityChange:v,...b}=r,y=i||"div",p=Gn(a);B0({domRef:p,offset:c,visibility:h,isEnabled:g,onVisibilityChange:v,updateDeps:[s],overflowCheck:(t=e.orientation)!=null?t:"vertical"});const f=H.useMemo(()=>nd({...n,className:o}),[Tu(n),o]);return{Component:y,styles:f,domRef:p,children:s,getBaseProps:(m={})=>{var _;return{ref:p,className:f,"data-orientation":(_=e.orientation)!=null?_:"vertical",style:{"--scroll-shadow-size":`${u}px`,...l,...m.style},...b,...m}}}}var W0=(e,t)=>{const r=[];for(const n of e)n.type==="section"?r.push(([...n.childNodes].length+1)*t):r.push(t);return r},H0=e=>{if(!e||e.scrollTop===void 0||e.clientHeight===void 0||e.scrollHeight===void 0)return{isTop:!1,isBottom:!1,isMiddle:!1};const t=e.scrollTop===0,r=Math.ceil(e.scrollTop+e.clientHeight)>=e.scrollHeight;return{isTop:t,isBottom:r,isMiddle:!t&&!r}},G0=e=>{var t;const{Component:r,state:n,color:a,variant:i,itemClasses:s,getBaseProps:o,topContent:l,bottomContent:u,hideEmptyContent:c,hideSelectedIcon:h,shouldHighlightOnFocus:g,disableAnimation:v,getEmptyContentProps:b,getListProps:y,scrollShadowProps:p}=e,{virtualization:f}=e;if(!f||!r0(f)&&!f.maxListboxHeight&&!f.itemHeight)throw new Error("You are using a virtualized listbox. VirtualizedListbox requires 'virtualization' props with 'maxListboxHeight' and 'itemHeight' properties. This error might have originated from autocomplete components that use VirtualizedListbox. Please provide these props to use the virtualized listbox.");const{maxListboxHeight:d,itemHeight:m}=f,_=Math.min(d,m*n.collection.size),S=H.useRef(null),w=H.useMemo(()=>W0([...n.collection],m),[n.collection,m]),$=S0({count:[...n.collection].length,getScrollElement:()=>S.current,estimateSize:k=>w[k]}),O=$.getVirtualItems(),E=$.getTotalSize(),{getBaseProps:R}=z0({...p}),q=k=>{var J;const X=[...n.collection][k.index];if(!X)return null;const Y={color:a,item:X,state:n,variant:i,disableAnimation:v,hideSelectedIcon:h,...X.props},ne={position:"absolute",top:0,left:0,width:"100%",height:`${k.size}px`,transform:`translateY(${k.start}px)`};if(X.type==="section")return A.jsx(Ky,{...Y,itemClasses:s,style:{...ne,...Y.style}},X.key);let K=A.jsx(xu,{...Y,classNames:qe(s,(J=X.props)==null?void 0:J.classNames),shouldHighlightOnFocus:g,style:{...ne,...Y.style}},X.key);return X.wrapper&&(K=X.wrapper(K)),K},[M,I]=H.useState({isTop:!1,isBottom:!0,isMiddle:!1}),L=A.jsxs(r,{...y(),"data-virtual-scroll-height":E,"data-virtual-scroll-top":(t=S?.current)==null?void 0:t.scrollTop,children:[!n.collection.size&&!c&&A.jsx("li",{children:A.jsx("div",{...b()})}),A.jsx("div",{...Tr(R()),ref:S,style:{height:d,overflow:"auto"},onScroll:k=>{I(H0(k.target))},children:_>0&&m>0&&A.jsx("div",{style:{height:`${E}px`,width:"100%",position:"relative"},children:O.map(k=>q(k))})})]});return A.jsxs("div",{...o(),children:[l,L,u]})},Y0=G0,J0=kr(function(t,r){const{isVirtualized:n,...a}=t,i=U0({...a,ref:r}),{Component:s,state:o,color:l,variant:u,itemClasses:c,getBaseProps:h,topContent:g,bottomContent:v,hideEmptyContent:b,hideSelectedIcon:y,shouldHighlightOnFocus:p,disableAnimation:f,getEmptyContentProps:d,getListProps:m}=i;if(n)return A.jsx(Y0,{...t,...i});const _=A.jsxs(s,{...m(),children:[!o.collection.size&&!b&&A.jsx("li",{children:A.jsx("div",{...d()})}),[...o.collection].map(S=>{var w;const $={color:l,item:S,state:o,variant:u,disableAnimation:f,hideSelectedIcon:y,...S.props};if(S.type==="section")return A.jsx(Ky,{...$,itemClasses:c},S.key);let O=A.jsx(xu,{...$,classNames:qe(c,(w=S.props)==null?void 0:w.classNames),shouldHighlightOnFocus:p},S.key);return S.wrapper&&(O=S.wrapper(O)),O})]});return A.jsxs("div",{...h(),children:[g,_,v]})}),X0=J0,Z0=kr(function(t,r){var n;const{Component:a,state:i,label:s,hasHelper:o,isLoading:l,triggerRef:u,selectorIcon:c=A.jsx(w0,{}),description:h,errorMessage:g,isInvalid:v,startContent:b,endContent:y,placeholder:p,renderValue:f,shouldLabelBeOutside:d,disableAnimation:m,getBaseProps:_,getLabelProps:S,getTriggerProps:w,getValueProps:$,getListboxProps:O,getPopoverProps:E,getSpinnerProps:R,getMainWrapperProps:q,getInnerWrapperProps:M,getHiddenSelectProps:I,getHelperWrapperProps:L,getListboxWrapperProps:k,getDescriptionProps:J,getErrorMessageProps:X,getSelectorIconProps:Y,isClearable:ne,getClearButtonProps:K,getEndWrapperProps:j,getEndContentProps:V}=C0({...t,ref:r}),N=s?A.jsx("label",{...S(),children:s}):null,P=H.cloneElement(c,Y()),T=H.useMemo(()=>{var C;return ne&&((C=i.selectedItems)!=null&&C.length)?A.jsx("span",{...K(),children:A.jsx(a0,{})}):null},[ne,K,(n=i.selectedItems)==null?void 0:n.length]),D=H.useMemo(()=>T?A.jsxs("div",{...j(),children:[T,y&&A.jsx("span",{...V(),children:y})]}):y&&A.jsx("span",{...V(),children:y}),[T,y,j,V]),U=H.useMemo(()=>{const C=v&&g;return!o||!(C||h)?null:A.jsx("div",{...L(),children:C?A.jsx("div",{...X(),children:g}):A.jsx("div",{...J(),children:h})})},[o,v,g,h,L,X,J]),Q=H.useMemo(()=>{var C;if(!((C=i.selectedItems)!=null&&C.length))return p;if(f&&typeof f=="function"){const x=[...i.selectedItems].map(F=>({key:F.key,data:F.value,type:F.type,props:F.props,textValue:F.textValue,rendered:F.rendered,"aria-label":F["aria-label"]}));return f(x)}return i.selectedItems.map(x=>x.textValue).join(", ")},[i.selectedItems,f,p]),B=H.useMemo(()=>l?A.jsx(i0,{...R()}):P,[l,P,R]),G=H.useMemo(()=>i.isOpen?A.jsx($0,{...E(),children:A.jsx(s0,{...k(),children:A.jsx(X0,{...O()})})}):null,[i.isOpen,E,i,u,k,O]);return A.jsxs("div",{..._(),children:[A.jsx(q0,{...I()}),d?N:null,A.jsxs("div",{...q(),children:[A.jsxs(a,{...w(),children:[d?null:N,A.jsxs("div",{...M(),children:[b,A.jsx("span",{...$(),children:Q}),y&&i.selectedItems&&A.jsx(o0,{elementType:"span",children:","}),D]}),B]}),U]}),m?G:A.jsx(l0,{children:G})]})}),Q0=Z0;function he(e){return typeof e!="object"||e===null||typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function eS(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),he(e.additionalItems)}function od(e){if(e==="")return;if(e===null)return null;if(/\.$/.test(e)||/\.0$/.test(e)||/\.\d*0$/.test(e))return e;const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)?t:e}const Ur="__additional_property",fu="additionalProperties",ir="allOf",Ge="anyOf",ht="const",tS="default",na="dependencies",rS="enum",Me="__errors",Pt="$id",nS="if",Ot="items",aS="_$junk_option_schema_id$_",Kn="$name",ke="oneOf",Oe="properties",iS="required",Yn="submitButtonOptions",Ce="$ref",qu="__rjsf_additionalProperties",By="__rjsf_rootSchema",sS="ui:field",ju="ui:widget",Pr="ui:options",oS="ui:globalOptions";function pe(e={},t={}){return Object.keys(e).filter(r=>r.indexOf("ui:")===0).reduce((r,n)=>{const a=e[n];return n===ju&&he(a)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),r):n===Pr&&he(a)?{...r,...a}:{...r,[n.substring(3)]:a}},{...t})}function lS(e,t={},r){if(!e.additionalProperties)return!1;const{expandable:n=!0}=pe(t);return n===!1?n:e.maxProperties!==void 0&&r?Object.keys(r).length({...r,[a]:Jn(n)}),t);if(Ft(e)){const r=e;return Object.keys(r).reduce((n,a)=>({...n,[a]:Jn(r[a])}),t)}return t}function $S(){this.__data__=[],this.size=0}function Vr(e,t){return e===t||e!==e&&t!==t}function ia(e,t){for(var r=e.length;r--;)if(Vr(e[r][0],t))return r;return-1}var PS=Array.prototype,OS=PS.splice;function ES(e){var t=this.__data__,r=ia(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():OS.call(t,r,1),--this.size,!0}function AS(e){var t=this.__data__,r=ia(t,e);return r<0?void 0:t[r][1]}function CS(e){return ia(this.__data__,e)>-1}function IS(e,t){var r=this.__data__,n=ia(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function vt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var h=-1,g=!0,v=r&_1?new Qt:void 0;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=H1}var G1="[object Arguments]",Y1="[object Array]",J1="[object Boolean]",X1="[object Date]",Z1="[object Error]",Q1="[object Function]",ew="[object Map]",tw="[object Number]",rw="[object Object]",nw="[object RegExp]",aw="[object Set]",iw="[object String]",sw="[object WeakMap]",ow="[object ArrayBuffer]",lw="[object DataView]",uw="[object Float32Array]",cw="[object Float64Array]",dw="[object Int8Array]",fw="[object Int16Array]",pw="[object Int32Array]",hw="[object Uint8Array]",mw="[object Uint8ClampedArray]",gw="[object Uint16Array]",yw="[object Uint32Array]",$e={};$e[uw]=$e[cw]=$e[dw]=$e[fw]=$e[pw]=$e[hw]=$e[mw]=$e[gw]=$e[yw]=!0;$e[G1]=$e[Y1]=$e[ow]=$e[J1]=$e[lw]=$e[X1]=$e[Z1]=$e[Q1]=$e[ew]=$e[tw]=$e[rw]=$e[nw]=$e[aw]=$e[iw]=$e[sw]=!1;function vw(e){return ze(e)&&ku(e.length)&&!!$e[yt(e)]}function Lu(e){return function(t){return e(t)}}var tv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Or=tv&&typeof module=="object"&&module&&!module.nodeType&&module,bw=Or&&Or.exports===tv,ka=bw&&zy.process,tr=(function(){try{var e=Or&&Or.require&&Or.require("util").types;return e||ka&&ka.binding&&ka.binding("util")}catch{}})(),md=tr&&tr.isTypedArray,Kr=md?Lu(md):vw,_w=Object.prototype,Sw=_w.hasOwnProperty;function rv(e,t){var r=Ie(e),n=!r&&er(e),a=!r&&!n&&kt(e),i=!r&&!n&&!a&&Kr(e),s=r||n||a||i,o=s?Zy(e.length,String):[],l=o.length;for(var u in e)(t||Sw.call(e,u))&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||la(u,l)))&&o.push(u);return o}var ww=Object.prototype;function ua(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ww;return e===r}var $w=Hy(Object.keys,Object),Pw=Object.prototype,Ow=Pw.hasOwnProperty;function nv(e){if(!ua(e))return $w(e);var t=[];for(var r in Object(e))Ow.call(e,r)&&r!="constructor"&&t.push(r);return t}function sr(e){return e!=null&&ku(e.length)&&!sa(e)}function et(e){return sr(e)?rv(e):nv(e)}function pu(e){return Jy(e,et,Mu)}var Ew=1,Aw=Object.prototype,Cw=Aw.hasOwnProperty;function Iw(e,t,r,n,a,i){var s=r&Ew,o=pu(e),l=o.length,u=pu(t),c=u.length;if(l!=c&&!s)return!1;for(var h=l;h--;){var g=o[h];if(!(s?g in t:Cw.call(t,g)))return!1}var v=i.get(e),b=i.get(t);if(v&&b)return v==t&&b==e;var y=!0;i.set(e,t),i.set(t,e);for(var p=s;++h{if(typeof r=="function"&&typeof n=="function")return!0})}var Lw="[object Symbol]";function Br(e){return typeof e=="symbol"||ze(e)&&yt(e)==Lw}var Uw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vw=/^\w*$/;function Uu(e,t){if(Ie(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Br(e)?!0:Vw.test(e)||!Uw.test(e)||t!=null&&e in Object(t)}var Kw="Expected a function";function Vu(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Kw);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Vu.Cache||bt),r}Vu.Cache=bt;var Bw=500;function zw(e){var t=Vu(e,function(n){return r.size===Bw&&r.clear(),n}),r=t.cache;return t}var Ww=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hw=/\\(\\)?/g,av=zw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ww,function(r,n,a,i){t.push(a?i.replace(Hw,"$1"):n||r)}),t});function da(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++rb,typeof u[g]>"u"&&(Array.isArray(u)&&g==="-"&&(g=u.length),v&&(c[b]!==""&&c[b]<1/0||c[b]==="-"?u[g]=[]:u[g]={})),!v)break;u=u[g]}var p=u[g];return h===void 0?delete u[g]:u[g]=h,p}function i(u){if(typeof u=="string"){if(u=u.split("/"),u[0]==="")return u;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(u)){for(const c of u)if(typeof c!="string"&&typeof c!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return u}throw new Error("Invalid JSON pointer.")}function s(u,c){if(typeof u!="object")throw new Error("Invalid input object.");c=i(c);var h=c.length;if(h===1)return u;for(var g=1;ga?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n0&&r(o)?t>1?Wr(o,t-1,r,n,a):Fu(a,o):n||(a[a.length]=o)}return a}function OP(e){var t=e==null?0:e.length;return t?Wr(e,1):[]}function EP(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Dd=Math.max;function yv(e,t,r){return t=Dd(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=Dd(n.length-t,0),s=Array(i);++a0){if(++t>=IP)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var vv=xP(CP);function bv(e){return vv(yv(e,void 0,OP),e+"")}var qP=1,jP=2,NP=4,Qn=bv(function(e,t){var r={};if(e==null)return r;var n=!1;t=da(t,function(i){return i=or(i,e),n||(n=i.length>1),i}),lr(e,Hu(e),r),n&&(r=Er(r,qP|jP|NP,$P));for(var a=t.length;a--;)gv(r,t[a]);return r});function Yu(e,t){const r=t[e];return[Qn(t,[e]),r]}function _v(e,t={},r=[]){const n=e||"";let a;if(n.startsWith("#"))a=decodeURIComponent(n.substring(1));else throw new Error(`Could not find a definition for ${e}.`);const i=e$.get(t,a);if(i===void 0)throw new Error(`Could not find a definition for ${e}.`);const s=i[Ce];if(s){if(r.includes(s)){if(r.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[c,...h]=r,g=[...h,n,c].join(" -> ");throw new Error(`Definition for ${c} contains a circular reference through ${g}`)}const[o,l]=Yu(Ce,i),u=_v(l,t,[...r,n]);return Object.keys(o).length>0?{...o,...u}:u}return i}function Sv(e,t={}){return _v(e,t,[])}var DP=Object.prototype,FP=DP.hasOwnProperty;function MP(e,t){return e!=null&&FP.call(e,t)}function wv(e,t,r){t=or(t,e);for(var n=-1,a=t.length,i=!1;++ngO)return[];var r=La,n=yO(e,La);t=Tv(t),e-=La;for(var a=Zy(n,t);++r({required:[c]}))};let u;if(o.anyOf){const{...c}=o;c.allOf?c.allOf=c.allOf.slice():c.allOf=[],c.allOf.push(l),u=c}else u=Object.assign({},o,l);if(delete u.required,e.isValid(u,t,n))return s}else if(e.isValid(o,t,n))return s}return 0}function Xu(e,t,r,n,a){return qv(e,t,r,n,a)}function Zu(e,t,r,n){if(!we(e))return e;t=or(t,e);for(var a=-1,i=t.length,s=i-1,o=e;o!=null&&++a1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,s&&SO(r[0],r[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++n-1}function TO(){}var RO=1/0,xO=Zt&&1/Du(new Zt([,-0]))[1]==RO?function(e){return new Zt(e)}:TO,qO=200;function Dv(e,t,r){var n=-1,a=Nv,i=e.length,s=!0,o=[],l=o;if(i>=qO){var u=xO(e);if(u)return Du(u);s=!1,a=Nu,l=new Qt}else l=o;e:for(;++n-1}return Wa=t,Wa}var Ha,zd;function kO(){if(zd)return Ha;zd=1;var e=ma();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Ha=t,Ha}var Ga,Wd;function ga(){if(Wd)return Ga;Wd=1;var e=NO(),t=DO(),r=FO(),n=MO(),a=kO();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Ki=t,Ki}var Bi,Bf;function fE(){if(Bf)return Bi;Bf=1;var e=Vt(),t=ic(),r=st(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",h="[object Object]",g="[object RegExp]",v="[object Set]",b="[object String]",y="[object WeakMap]",p="[object ArrayBuffer]",f="[object DataView]",d="[object Float32Array]",m="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",w="[object Int32Array]",$="[object Uint8Array]",O="[object Uint8ClampedArray]",E="[object Uint16Array]",R="[object Uint32Array]",q={};q[d]=q[m]=q[_]=q[S]=q[w]=q[$]=q[O]=q[E]=q[R]=!0,q[n]=q[a]=q[p]=q[i]=q[f]=q[s]=q[o]=q[l]=q[u]=q[c]=q[h]=q[g]=q[v]=q[b]=q[y]=!1;function M(I){return r(I)&&t(I.length)&&!!q[e(I)]}return Bi=M,Bi}var zi,zf;function Bt(){if(zf)return zi;zf=1;function e(t){return function(r){return t(r)}}return zi=e,zi}var wr={exports:{}};wr.exports;var Wf;function sc(){return Wf||(Wf=1,(function(e,t){var r=Fv(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,o=(function(){try{var l=a&&a.require&&a.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(wr,wr.exports)),wr.exports}var Wi,Hf;function oc(){if(Hf)return Wi;Hf=1;var e=fE(),t=Bt(),r=sc(),n=r&&r.isTypedArray,a=n?t(n):e;return Wi=a,Wi}var Hi,Gf;function Vv(){if(Gf)return Hi;Gf=1;var e=uE(),t=_a(),r=Ue(),n=Sa(),a=ac(),i=oc(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var h=r(u),g=!h&&t(u),v=!h&&!g&&n(u),b=!h&&!g&&!v&&i(u),y=h||g||v||b,p=y?e(u.length,String):[],f=p.length;for(var d in u)(c||o.call(u,d))&&!(y&&(d=="length"||v&&(d=="offset"||d=="parent")||b&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||a(d,f)))&&p.push(d);return p}return Hi=l,Hi}var Gi,Yf;function lc(){if(Yf)return Gi;Yf=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return Gi=t,Gi}var Yi,Jf;function Kv(){if(Jf)return Yi;Jf=1;function e(t,r){return function(n){return t(r(n))}}return Yi=e,Yi}var Ji,Xf;function pE(){if(Xf)return Ji;Xf=1;var e=Kv(),t=e(Object.keys,Object);return Ji=t,Ji}var Xi,Zf;function hE(){if(Zf)return Xi;Zf=1;var e=lc(),t=pE(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var s=[];for(var o in Object(i))n.call(i,o)&&o!="constructor"&&s.push(o);return s}return Xi=a,Xi}var Zi,Qf;function dr(){if(Qf)return Zi;Qf=1;var e=ec(),t=ic();function r(n){return n!=null&&t(n.length)&&!e(n)}return Zi=r,Zi}var Qi,ep;function Gr(){if(ep)return Qi;ep=1;var e=Vv(),t=hE(),r=dr();function n(a){return r(a)?e(a):t(a)}return Qi=n,Qi}var es,tp;function mE(){if(tp)return es;tp=1;var e=Hr(),t=Gr();function r(n,a){return n&&e(a,t(a),n)}return es=r,es}var ts,rp;function gE(){if(rp)return ts;rp=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return ts=e,ts}var rs,np;function yE(){if(np)return rs;np=1;var e=it(),t=lc(),r=gE(),n=Object.prototype,a=n.hasOwnProperty;function i(s){if(!e(s))return r(s);var o=t(s),l=[];for(var u in s)u=="constructor"&&(o||!a.call(s,u))||l.push(u);return l}return rs=i,rs}var ns,ap;function fr(){if(ap)return ns;ap=1;var e=Vv(),t=yE(),r=dr();function n(a){return r(a)?e(a,!0):t(a)}return ns=n,ns}var as,ip;function vE(){if(ip)return as;ip=1;var e=Hr(),t=fr();function r(n,a){return n&&e(a,t(a),n)}return as=r,as}var $r={exports:{}};$r.exports;var sp;function Bv(){return sp||(sp=1,(function(e,t){var r=at(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,o=s?s.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var h=u.length,g=o?o(h):new u.constructor(h);return u.copy(g),g}e.exports=l})($r,$r.exports)),$r.exports}var is,op;function uc(){if(op)return is;op=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++nv))return!1;var y=h.get(s),p=h.get(o);if(y&&p)return y==o&&p==s;var f=-1,d=!0,m=l&a?new e:void 0;for(h.set(s,o),h.set(o,s);++f0&&i(c)?a>1?r(c,a-1,i,s,o):e(o,c):s||(o[o.length]=c)}return o}return Zs=r,Zs}var Qs,th;function zt(){if(th)return Qs;th=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=Array(a);++nn||o&&l&&c&&!u&&!h||i&&l&&c||!a&&c||!s)return 1;if(!i&&!o&&!h&&r=u)return c;var h=a[i];return c*(h=="desc"?-1:1)}}return r.index-n.index}return jo=t,jo}var No,Dh;function gA(){if(Dh)return No;Dh=1;var e=zt(),t=vc(),r=lA(),n=fA(),a=pA(),i=Bt(),s=mA(),o=Yr(),l=Ue();function u(c,h,g){h.length?h=e(h,function(y){return l(y)?function(p){return t(p,y.length===1?y[0]:y)}:y}):h=[o];var v=-1;h=e(h,i(r));var b=n(c,function(y,p,f){var d=e(h,function(m){return m(y)});return{criteria:d,index:++v,value:y}});return a(b,function(y,p){return s(y,p,g)})}return No=u,No}var Do,Fh;function sb(){if(Fh)return Do;Fh=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Do=e,Do}var Fo,Mh;function yA(){if(Mh)return Fo;Mh=1;var e=sb(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var s=arguments,o=-1,l=t(s.length-a,0),u=Array(l);++o0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Lo=n,Lo}var Uo,Vh;function SA(){if(Vh)return Uo;Vh=1;var e=bA(),t=_A(),r=t(e);return Uo=r,Uo}var Vo,Kh;function Wt(){if(Kh)return Vo;Kh=1;var e=Yr(),t=yA(),r=SA();function n(a,i){return r(t(a,i,e),a+"")}return Vo=n,Vo}var Ko,Bh;function bc(){if(Bh)return Ko;Bh=1;var e=ur(),t=dr(),r=ac(),n=it();function a(i,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?t(o)&&r(s,o.length):l=="string"&&s in o)?e(o[s],i):!1}return Ko=a,Ko}var Bo,zh;function ob(){if(zh)return Bo;zh=1;var e=gc(),t=gA(),r=Wt(),n=bc(),a=r(function(i,s){if(i==null)return[];var o=s.length;return o>1&&n(i,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return Bo=a,Bo}var zo,Wh;function wA(){if(Wh)return zo;Wh=1;function e(t,r,n,a){for(var i=t.length,s=n+(a?1:-1);a?s--:++s-1}return Yo=t,Yo}var Jo,Xh;function Sc(){if(Xh)return Jo;Xh=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a=s){var f=u?null:a(l);if(f)return i(f);b=!1,g=n,p=new e}else p=u?[]:y;e:for(;++h2?l[2]:void 0;for(h&&r(l[0],l[1],h)&&(c=1);++u=120&&d.length>=120)?new e(b&&d):void 0}d=l[0];var m=-1,_=y[0];e:for(;++mArray.isArray(I)?I:[I],u=I=>I===void 0,c=I=>s(I)||Array.isArray(I)?Object.keys(I):[],h=(I,L)=>I.hasOwnProperty(L),g=I=>t(r(I)),v=I=>u(I)||Array.isArray(I)&&I.length===0,b=(I,L,k,J)=>L&&h(L,k)&&I&&h(I,k)&&J(I[k],L[k]),y=(I,L)=>u(I)&&L===0||u(L)&&I===0||e(I,L),p=(I,L)=>u(I)&&L===!1||u(L)&&I===!1||e(I,L),f=I=>u(I)||e(I,{})||I===!0,d=I=>u(I)||e(I,{}),m=I=>u(I)||s(I)||I===!0||I===!1;function _(I,L){return v(I)&&v(L)?!0:e(g(I),g(L))}function S(I,L){return I=l(I),L=l(L),e(g(I),g(L))}function w(I,L,k,J){var X=r(c(I).concat(c(L)));return d(I)&&d(L)?!0:d(I)&&c(L).length||d(L)&&c(I).length?!1:X.every(function(Y){var ne=I[Y],K=L[Y];return Array.isArray(ne)&&Array.isArray(K)?e(g(I),g(L)):Array.isArray(ne)&&!Array.isArray(K)||Array.isArray(K)&&!Array.isArray(ne)?!1:b(I,L,Y,J)})}function $(I,L,k,J){return s(I)&&s(L)?J(I,L):Array.isArray(I)&&Array.isArray(L)?w(I,L,k,J):e(I,L)}function O(I,L,k,J){var X=n(I,J),Y=n(L,J),ne=i(X,Y,J);return ne.length===Math.max(X.length,Y.length)}var E={title:e,uniqueItems:p,minLength:y,minItems:y,minProperties:y,required:_,enum:_,type:S,items:$,anyOf:O,allOf:O,oneOf:O,properties:w,patternProperties:w,dependencies:w},R=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],q=["additionalProperties","additionalItems","contains","propertyNames","not"];function M(I,L,k){if(k=a(k,{ignore:[]}),f(I)&&f(L))return!0;if(!m(I)||!m(L))throw new Error("Either of the values are not a JSON schema.");if(I===L)return!0;if(o(I)&&o(L))return I===L;if(I===void 0&&L===!1||L===void 0&&I===!1||u(I)&&!u(L)||!u(I)&&u(L))return!1;var J=r(Object.keys(I).concat(Object.keys(L)));if(k.ignore.length&&(J=J.filter(Y=>k.ignore.indexOf(Y)===-1)),!J.length)return!0;function X(Y,ne){return M(Y,ne,k)}return J.every(function(Y){var ne=I[Y],K=L[Y];if(q.indexOf(Y)!==-1)return M(ne,K,k);var j=E[Y];if(j||(j=e),e(ne,K))return!0;if(R.indexOf(Y)===-1&&(!h(I,Y)&&h(L,Y)||h(I,Y)&&!h(L,Y)))return ne===K;var V=j(ne,K,Y,X);if(!o(V))throw new Error("Comparer must return true or false");return V})}return cl=M,cl}var dl,fm;function Ec(){if(fm)return dl;fm=1;function e(t){return Object.prototype.toString.call(t)==="[object Array]"}return dl=Array.isArray||e,dl}var fl,pm;function TA(){if(pm)return fl;pm=1;function e(t){return(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")&&t.valueOf()===t.valueOf()}return fl=e,fl}var pl,hm;function RA(){if(hm)return pl;hm=1;var e=TA();function t(r){return e(r)&&r%1===0}return pl=t,pl}var hl,mm;function pb(){if(mm)return hl;mm=1;var e=Ec(),t=RA();function r(n){var a;if(!e(n)||(a=n.length,!a))return!1;for(var i=0;il&&(c=l,l=o,o=c),l=l-o}return u*o}function i(o,l){var u=0,c;if(o===0)return l;if(l===0)return o;for(;(o&1)===0&&(l&1)===0;)o>>>=1,l>>>=1,u++;for(;(o&1)===0;)o>>>=1;for(;l;){for(;(l&1)===0;)l>>>=1;o>l&&(c=l,l=o,o=c),l=l-o}return o<1){if(c=l[0],u=l[1],!r(u))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+u+"`.")}else c=l[0];else throw new TypeError("gcd()::invalid input argument. Must provide an array of integers. Value: `"+l[0]+"`.");if(h=c.length,h<2)return null;if(u){for(g=new Array(h),b=0;b1){if(l=s[0],o=s[1],!n(o))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+o+"`.")}else l=s[0];else throw new TypeError("lcm()::invalid input argument. Must provide an array of integers. Value: `"+s[0]+"`.");if(u=l.length,u<2)return null;if(o){for(c=new Array(u),g=0;g1?i[o-1]:void 0,u=o>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(o--,l):void 0,u&&t(i[0],i[1],u)&&(l=o<3?void 0:l,o=1),a=Object(a);++s-1;)y!==l&&s.call(y,p,1),s.call(l,p,1);return l}return Rl=o,Rl}var xl,qm;function KA(){if(qm)return xl;qm=1;var e=VA();function t(r,n){return r&&r.length&&n&&n.length?e(r,n):r}return xl=t,xl}var ql,jm;function BA(){if(jm)return ql;jm=1;var e=Yr();function t(r){return typeof r=="function"?r:e}return ql=t,ql}var jl,Nm;function _b(){if(Nm)return jl;Nm=1;var e=kv(),t=ib(),r=BA(),n=Ue();function a(i,s){var o=n(i)?e:t;return o(i,r(s))}return jl=a,jl}var Nl,Dm;function zA(){if(Dm)return Nl;Dm=1;var e=$a(),t=_c(),r=Sc(),n=zt(),a=Bt(),i=Pa(),s=200;function o(l,u,c,h){var g=-1,v=t,b=!0,y=l.length,p=[],f=u.length;if(!y)return p;c&&(u=n(u,a(c))),h?(v=r,b=!1):u.length>=s&&(v=i,b=!1,u=new e(u));e:for(;++gn(t(y.map(c))),l=(y,p)=>y.map(f=>f&&f[p]),u=(y,p)=>Object.prototype.hasOwnProperty.call(y,p),c=y=>r(y)||Array.isArray(y)?Object.keys(y):[],h=y=>y!==void 0,g=y=>r(y)||y===!0||y===!1,v=y=>!c(y).length&&y!==!1&&y!==!0;return Fl={allUniqueKeys:o,deleteUndefinedProps:s,getValues:l,has:u,isEmptySchema:v,isSchema:g,keys:c,notUndefined:h,uniqWith:a,withoutArr:(y,...p)=>i.apply(null,[y].concat(e(p)))},Fl}var Ml,km;function HA(){if(km)return Ml;km=1;const e=Oc(),t=_b(),{allUniqueKeys:r,deleteUndefinedProps:n,getValues:a,keys:i,notUndefined:s,uniqWith:o,withoutArr:l}=Sb();function u(h){t(h,function(g,v){g===!1&&delete h[v]})}function c(h,g){return r(h).reduce(function(b,y){const p=a(h,y),f=o(p.filter(s),e);return b[y]=g(f,y),b},{})}return Ml={keywords:["properties","patternProperties","additionalProperties"],resolver(h,g,v,b){b.ignoreAdditionalProperties||(h.forEach(function(p){const f=h.filter(S=>S!==p),d=i(p.properties),_=i(p.patternProperties).map(S=>new RegExp(S));f.forEach(function(S){const w=i(S.properties),$=w.filter(E=>_.some(R=>R.test(E)));l(w,d,$).forEach(function(E){S.properties[E]=v.properties([S.properties[E],p.additionalProperties],E)})})}),h.forEach(function(p){const f=h.filter(m=>m!==p),d=i(p.patternProperties);p.additionalProperties===!1&&f.forEach(function(m){const _=i(m.patternProperties);l(_,d).forEach(w=>delete m.patternProperties[w])})}));const y={additionalProperties:v.additionalProperties(h.map(p=>p.additionalProperties)),patternProperties:c(h.map(p=>p.patternProperties),v.patternProperties),properties:c(h.map(p=>p.properties),v.properties)};return y.additionalProperties===!1&&u(y.properties),n(y)}},Ml}var kl,Lm;function GA(){if(Lm)return kl;Lm=1;const e=Oc(),t=_b(),{allUniqueKeys:r,deleteUndefinedProps:n,has:a,isSchema:i,notUndefined:s,uniqWith:o}=Sb();function l(g){t(g,function(v,b){v===!1&&g.splice(b,1)})}function u(g,v){return g.map(function(b){if(b)if(Array.isArray(b.items)){const y=b.items[v];if(i(y))return y;if(a(b,"additionalItems"))return b.additionalItems}else return b.items})}function c(g){return g.map(function(v){if(v)return Array.isArray(v.items)?v.additionalItems:v.items})}function h(g,v,b){return r(b).reduce(function(p,f){const d=u(g,f),m=o(d.filter(s),e);return p[f]=v(m,f),p},[])}return kl={keywords:["items","additionalItems"],resolver(g,v,b){const y=g.map(m=>m.items),p=y.filter(s),f={};p.every(i)?f.items=b.items(y):f.items=h(g,b.items,y);let d;return p.every(Array.isArray)?d=g.map(m=>m.additionalItems):p.some(Array.isArray)&&(d=c(g)),d&&(f.additionalItems=b.additionalItems(d)),f.additionalItems===!1&&Array.isArray(f.items)&&l(f.items),n(f)}},kl}var Ll,Um;function YA(){if(Um)return Ll;Um=1;const e=FE(),t=Oc(),r=qA(),n=kA(),a=vb(),i=bb(),s=LA(),o=fb(),l=eb(),u=Aa(),c=KA(),h=ob(),g=wc(),v=$c(),b=HA(),y=GA(),p=(B,G)=>B.indexOf(G)!==-1,f=B=>u(B)||B===!0||B===!1,d=B=>B===!1,m=B=>B===!0,_=(B,G,C)=>C(B),S=B=>h(g(i(B))),w=B=>B!==void 0,$=B=>g(i(B.map(Y))),O=B=>B[0],E=B=>S(B),R=B=>Math.max.apply(Math,B),q=B=>Math.min.apply(Math,B),M=B=>B.some(m),I=B=>v(a(B),l);function L(B){return function(G,C){return t({[B]:G},{[B]:C})}}function k(B){let{allOf:G=[],...C}=B;return C=u(B)?C:B,[C,...G.map(k)]}function J(B,G){return B.map(C=>C&&C[G])}function X(B,G){return B.map(function(C,x){try{return G(C,x)}catch{return}}).filter(w)}function Y(B){return u(B)||Array.isArray(B)?Object.keys(B):[]}function ne(B,G){if(G=G||[],!B.length)return G;const C=B.slice(0).shift(),x=B.slice(1);return G.length?ne(x,a(G.map(F=>C.map(z=>[z].concat(F))))):ne(x,C.map(F=>F))}function K(B,G){let C;try{C=B.map(function(x){return JSON.stringify(x,null,2)}).join(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-8wr_YRsr.js","assets/index-DKQs0Q0w.js","assets/index-CDmU1Tem.css"])))=>i.map(i=>d[i]); +import{t as P_,k as Qc,l as kr,r as H,$ as O_,j as A,L as Ry,n as xy,T as qy,o as E_,q as ed,_ as A_,s as C_,v as qe,w as I_,x as T_,y as R_,z as x_,A as q_,B as j_,E as N_,G as D_,H as Ou,J as Ir,K as Eu,M as jy,N as F_,O as Au,P as M_,Q as Cu,R as Gn,S as k_,U as Ny,V as L_,W as du,X as Iu,Y as U_,Z as Ee,a0 as Tu,a1 as V_,a2 as be,a3 as Tr,a4 as K_,a5 as B_,a6 as z_,a7 as W_,a8 as H_,a9 as G_,aa as Y_,ab as J_,ac as td,ad as X_,ae as Z_,af as rd,ag as Q_,ah as e0,ai as t0,aj as r0,ak as nd,al as n0,am as a0,an as i0,ao as s0,ap as o0,aq as l0,ar as Lr,g as tn,as as u0,at as c0,au as d0}from"./index-DKQs0Q0w.js";import{i as f0}from"./chunk-SSA7SXE4-O5iifkg7.js";import{u as p0,$ as h0,a as m0,b as g0,m as y0,c as ad,d as v0,e as b0}from"./useMenuTriggerState-DIuhWKKT.js";import{$ as _0}from"./useSelectableItem-Svsj-E2p.js";import{u as S0,C as w0}from"./index-DgPm4MMk.js";var id=P_({slots:{base:["group inline-flex flex-col relative"],label:["block","absolute","z-10","origin-top-left","flex-shrink-0","rtl:origin-top-right","subpixel-antialiased","text-small","text-foreground-500","pointer-events-none","group-data-[has-label-outside=true]:pointer-events-auto"],mainWrapper:"w-full flex flex-col",trigger:"relative px-3 gap-3 w-full inline-flex flex-row items-center shadow-xs outline-hidden tap-highlight-transparent",innerWrapper:"inline-flex h-fit w-[calc(100%_-theme(spacing.6))] min-h-4 items-center gap-1.5 box-border",selectorIcon:"absolute end-3 w-4 h-4",spinner:"absolute end-3",value:["text-foreground-500","font-normal","w-full","text-start"],listboxWrapper:"scroll-py-6 w-full",listbox:"",popoverContent:"w-full p-1 overflow-hidden",clearButton:["w-4","h-4","z-10","mb-4","relative","start-auto","appearance-none","outline-none","select-none","opacity-70","hover:!opacity-100","cursor-pointer","active:!opacity-70","rounded-full",...Qc],helperWrapper:"p-1 flex relative flex-col gap-1.5 group-data-[has-helper=true]:flex",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger",endWrapper:"flex end-18",endContent:"mb-4"},variants:{variant:{flat:{trigger:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-200"],clearButton:"mb-4"},faded:{trigger:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 data-[focus=true]:border-default-400 data-[open=true]:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},bordered:{trigger:["border-medium","border-default-200","data-[hover=true]:border-default-400","data-[open=true]:border-default-foreground","data-[focus=true]:border-default-foreground"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},underlined:{trigger:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","data-[open=true]:after:w-full","data-[focus=true]:after:w-full"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4 me-2"}},color:{default:{},primary:{selectorIcon:"text-primary"},secondary:{selectorIcon:"text-secondary"},success:{selectorIcon:"text-success"},warning:{selectorIcon:"text-warning"},danger:{selectorIcon:"text-danger"}},size:{sm:{label:"text-tiny",trigger:"h-8 min-h-8 px-2 rounded-small",value:"text-small",clearButton:"text-medium"},md:{trigger:"h-10 min-h-10 rounded-medium",value:"text-small",clearButton:"text-large"},lg:{trigger:"h-12 min-h-12 rounded-large",value:"text-medium",clearButton:"mb-5 text-large"}},radius:{none:{trigger:"rounded-none"},sm:{trigger:"rounded-small"},md:{trigger:"rounded-medium"},lg:{trigger:"rounded-large"},full:{trigger:"rounded-full"}},labelPlacement:{outside:{base:"flex flex-col",clearButton:"mb-0"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",label:"relative pe-2 text-foreground",clearButton:"mb-0"},inside:{label:"text-tiny cursor-pointer",trigger:"flex-col items-start justify-center gap-0"}},fullWidth:{true:{base:"w-full"},false:{base:"min-w-40"}},isClearable:{true:{clearButton:"peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block",endContent:"ms-3"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",trigger:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",value:"!text-danger",selectorIcon:"text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",trigger:"!h-auto"},false:{value:"truncate"}},disableAnimation:{true:{trigger:"after:transition-none",base:"transition-none",label:"transition-none",selectorIcon:"transition-none"},false:{base:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","origin-top-left","rtl:origin-top-right","!duration-200","!ease-out","transition-[transform,color,left,opacity,translate,scale]","motion-reduce:transition-none"],selectorIcon:"transition-transform duration-150 ease motion-reduce:transition-none",clearButton:["transition-opacity","motion-reduce:transition-none"]}},disableSelectorIconRotation:{true:{},false:{selectorIcon:"data-[open=true]:rotate-180"}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1,disableSelectorIconRotation:!1},compoundVariants:[{variant:"flat",color:"default",class:{value:"group-data-[has-value=true]:text-default-foreground",trigger:["bg-default-100","data-[hover=true]:bg-default-200"]}},{variant:"flat",color:"primary",class:{trigger:["bg-primary-100","text-primary","data-[hover=true]:bg-primary-50","group-data-[focus=true]:bg-primary-50"],value:"text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{trigger:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50"],value:"text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{trigger:["bg-success-100","text-success-600","dark:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],value:"text-success-600 dark:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{trigger:["bg-warning-100","text-warning-600","dark:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],value:"text-warning-600 dark:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{trigger:["bg-danger-100","text-danger","dark:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],value:"text-danger dark:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{trigger:"data-[hover=true]:border-primary data-[focus=true]:border-primary data-[open=true]:border-primary",label:"text-primary"}},{variant:"faded",color:"secondary",class:{trigger:"data-[hover=true]:border-secondary data-[focus=true]:border-secondary data-[open=true]:border-secondary",label:"text-secondary"}},{variant:"faded",color:"success",class:{trigger:"data-[hover=true]:border-success data-[focus=true]:border-success data-[open=true]:border-success",label:"text-success"}},{variant:"faded",color:"warning",class:{trigger:"data-[hover=true]:border-warning data-[focus=true]:border-warning data-[open=true]:border-warning",label:"text-warning"}},{variant:"faded",color:"danger",class:{trigger:"data-[hover=true]:border-danger data-[focus=true]:border-danger data-[open=true]:border-danger",label:"text-danger"}},{variant:"underlined",color:"default",class:{value:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{trigger:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{trigger:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{trigger:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{trigger:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{trigger:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{trigger:["data-[open=true]:border-primary","data-[focus=true]:border-primary"],label:"text-primary"}},{variant:"bordered",color:"secondary",class:{trigger:["data-[open=true]:border-secondary","data-[focus=true]:border-secondary"],label:"text-secondary"}},{variant:"bordered",color:"success",class:{trigger:["data-[open=true]:border-success","data-[focus=true]:border-success"],label:"text-success"}},{variant:"bordered",color:"warning",class:{trigger:["data-[open=true]:border-warning","data-[focus=true]:border-warning"],label:"text-warning"}},{variant:"bordered",color:"danger",class:{trigger:["data-[open=true]:border-danger","data-[focus=true]:border-danger"],label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled=true]:text-foreground"}},{radius:"full",size:["sm"],class:{trigger:"px-3"}},{radius:"full",size:"md",class:{trigger:"px-4"}},{radius:"full",size:"lg",class:{trigger:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{trigger:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{trigger:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{trigger:[...Qc]}},{isInvalid:!0,variant:"flat",class:{trigger:["bg-danger-50","data-[hover=true]:bg-danger-100","group-data-[focus=true]:bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{trigger:"!border-danger group-data-[focus=true]:border-danger"}},{isInvalid:!0,variant:"underlined",class:{trigger:"after:bg-danger"}},{labelPlacement:"inside",size:"sm",class:{trigger:"h-12 min-h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{trigger:"h-14 min-h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{label:"text-medium",trigger:"h-16 min-h-16 py-2.5 gap-0"}},{labelPlacement:"outside",isMultiline:!1,class:{base:"group relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled=true]:start-0"]}},{labelPlacement:["inside"],class:{label:"group-data-[filled=true]:scale-85"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-5"}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled=true]:-translate-y-[calc(100%_+var(--heroui-font-size-tiny)/2_+_16px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_26px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"md",class:{label:["start-3","text-small","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_30px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"lg",class:{label:["start-3","text-medium","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_34px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{labelPlacement:["outside","outside-left"],isClearable:!0,class:{endContent:["mt-4"],clearButton:["group-data-[has-end-content=true]:mt-4"]}},{isClearable:!1,labelPlacement:["outside","outside-left"],class:{endContent:["mt-4"]}},{isClearable:!0,variant:["underlined"],class:{clearButton:["relative group-data-[has-end-content=true]:left-2"],endContent:["me-2"]}},{isClearable:!1,variant:["underlined"],class:{endContent:["me-2"]}},{isClearable:!0,size:"sm",class:{endContent:"ms-2"}}]}),Dy=()=>A_(()=>import("./index-8wr_YRsr.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Fy=kr(({children:e,motionProps:t,placement:r,disableAnimation:n,style:a={},transformOrigin:i={},...s},o)=>{let l=a;return i.originX!==void 0||i.originY!==void 0?l={...l,transformOrigin:i}:r&&(l={...l,...C_(r==="center"?"top":r)}),n?A.jsx("div",{...s,ref:o,children:e}):A.jsx(Ry,{features:Dy,children:A.jsx(xy.div,{ref:o,animate:"enter",exit:"exit",initial:"initial",style:l,variants:qy.scaleSpringOpacity,...qe(s,t),children:e})})});Fy.displayName="HeroUI.FreeSoloPopoverWrapper";var My=kr(({children:e,transformOrigin:t,disableDialogFocus:r=!1,...n},a)=>{const{Component:i,state:s,placement:o,backdrop:l,portalContainer:u,disableAnimation:c,motionProps:h,isNonModal:g,getPopoverProps:v,getBackdropProps:b,getDialogProps:y,getContentProps:p}=p0({...n,ref:a}),f=H.useRef(null),{dialogProps:d,titleProps:m}=O_({},f),_=y({...!r&&{ref:f},...d}),S=H.useMemo(()=>l==="transparent"?null:c?A.jsx("div",{...b()}):A.jsx(Ry,{features:Dy,children:A.jsx(xy.div,{animate:"enter",exit:"exit",initial:"exit",variants:qy.fade,...b()})}),[l,c,b]);return A.jsxs(E_,{portalContainer:u,children:[!g&&S,A.jsx(i,{...v(),children:A.jsxs(Fy,{disableAnimation:c,motionProps:h,placement:o,tabIndex:-1,transformOrigin:t,..._,children:[!g&&A.jsx(ed,{onDismiss:s.close}),A.jsx("div",{...p(),children:typeof e=="function"?e(m):e}),A.jsx(ed,{onDismiss:s.close})]})})]})});My.displayName="HeroUI.FreeSoloPopover";var $0=My;class sd{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let r=this.keyMap.get(t);var n;return r&&(n=r.prevKey)!==null&&n!==void 0?n:null}getKeyAfter(t){let r=this.keyMap.get(t);var n;return r&&(n=r.nextKey)!==null&&n!==void 0?n:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){var r;return(r=this.keyMap.get(t))!==null&&r!==void 0?r:null}at(t){const r=[...this.getKeys()];return this.getItem(r[t])}getChildren(t){let r=this.keyMap.get(t);return r?.childNodes||[]}constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let r=s=>{if(this.keyMap.set(s.key,s),s.childNodes&&s.type==="section")for(let o of s.childNodes)r(o)};for(let s of t)r(s);let n=null,a=0;for(let[s,o]of this.keyMap)n?(n.nextKey=s,o.prevKey=n.key):(this.firstKey=s,o.prevKey=void 0),o.type==="item"&&(o.index=a++),n=o,n.nextKey=void 0;var i;this.lastKey=(i=n?.key)!==null&&i!==void 0?i:null}}function ky(e){let{filter:t,layoutDelegate:r}=e,n=I_(e),a=H.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),i=H.useCallback(u=>t?new sd(t(u)):new sd(u),[t]),s=H.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),o=T_(e,i,s),l=H.useMemo(()=>new R_(o,n,{layoutDelegate:r}),[o,n,r]);return P0(o,l),{collection:o,disabledKeys:a,selectionManager:l}}function P0(e,t){const r=H.useRef(null);H.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&r.current){const c=r.current.getItem(t.focusedKey),h=[...r.current.getKeys()].map(f=>{const d=r.current.getItem(f);return d?.type==="item"?d:null}).filter(f=>f!==null),g=[...e.getKeys()].map(f=>{const d=e.getItem(f);return d?.type==="item"?d:null}).filter(f=>f!==null);var n,a;const v=((n=h?.length)!==null&&n!==void 0?n:0)-((a=g?.length)!==null&&a!==void 0?a:0);var i,s,o;let b=Math.min(v>1?Math.max(((i=c?.index)!==null&&i!==void 0?i:0)-v+1,0):(s=c?.index)!==null&&s!==void 0?s:0,((o=g?.length)!==null&&o!==void 0?o:0)-1),y=null,p=!1;for(;b>=0;){if(!t.isDisabled(g[b].key)){y=g[b];break}if(b((l=c?.index)!==null&&l!==void 0?l:0)&&(b=(u=c?.index)!==null&&u!==void 0?u:0),b--}}t.setFocusedKey(y?y.key:null)}r.current=e},[e,t])}function O0(e){const{collection:t,disabledKeys:r,selectionManager:n,selectionManager:{setSelectedKeys:a,selectedKeys:i,selectionMode:s}}=ky(e),o=H.useMemo(()=>!e.isLoading&&i.size!==0?Array.from(i).filter(Boolean).filter(u=>!t.getItem(u)):[],[i,t]),l=i.size!==0?Array.from(i).map(u=>t.getItem(u)).filter(Boolean):null;return o.length&&console.warn(`Select: Keys "${o.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:t,disabledKeys:r,selectionManager:n,selectionMode:s,selectedKeys:i,setSelectedKeys:a.bind(n),selectedItems:l}}function E0({validate:e,validationBehavior:t,...r}){const[n,a]=H.useState(!1),[i,s]=H.useState(null),o=h0(r),l=O0({...r,onSelectionChange:h=>{r.onSelectionChange!=null&&(h==="all"?r.onSelectionChange(new Set(l.collection.getKeys())):r.onSelectionChange(h)),r.selectionMode==="single"&&o.close()}}),u=x_({...r,validationBehavior:t,validate:h=>{if(!e)return;const g=Array.from(h);return e(r.selectionMode==="single"?g[0]:g)},value:l.selectedKeys}),c=l.collection.size===0&&r.hideEmptyContent;return{...u,...l,...o,focusStrategy:i,close(){o.close()},open(h=null){c||(s(h),o.open())},toggle(h=null){c||(s(h),o.toggle())},isFocused:n,setFocused:a}}function A0(e,t,r){const{disallowEmptySelection:n,isDisabled:a}=e,i=q_({usage:"search",sensitivity:"base"}),s=H.useMemo(()=>new j_(t.collection,t.disabledKeys,null,i),[t.collection,t.disabledKeys,i]),{menuTriggerProps:o,menuProps:l}=m0({isDisabled:a,type:"listbox"},t,r),u=S=>{if(t.selectionMode==="single")switch(S.key){case"ArrowLeft":{S.preventDefault();const w=t.selectedKeys.size>0?s.getKeyAbove(t.selectedKeys.values().next().value):s.getFirstKey();w&&t.setSelectedKeys([w]);break}case"ArrowRight":{S.preventDefault();const w=t.selectedKeys.size>0?s.getKeyBelow(t.selectedKeys.values().next().value):s.getFirstKey();w&&t.setSelectedKeys([w]);break}}},{typeSelectProps:c}=N_({keyboardDelegate:s,selectionManager:t.selectionManager,onTypeSelect(S){t.setSelectedKeys([S])}}),{isInvalid:h,validationErrors:g,validationDetails:v}=t.displayValidation,{labelProps:b,fieldProps:y,descriptionProps:p,errorMessageProps:f}=D_({...e,labelElementType:"span",isInvalid:h,errorMessage:e.errorMessage||g});c.onKeyDown=c.onKeyDownCapture,delete c.onKeyDownCapture,o.onPressStart=S=>{S.pointerType!=="touch"&&S.pointerType!=="keyboard"&&!a&&t.toggle(S.pointerType==="virtual"?"first":null)};const d=Ou(e,{labelable:!0}),m=Ir(c,o,y),_=Eu();return{labelProps:{...b,onClick:()=>{var S;e.isDisabled||((S=r.current)==null||S.focus(),F_("keyboard"))}},triggerProps:Ir(d,{...m,onKeyDown:jy(m.onKeyDown,u,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[_,m["aria-labelledby"],m["aria-label"]&&!m["aria-labelledby"]?m.id:null].join(","),onFocus(S){t.isFocused||(e.onFocus&&e.onFocus(S),t.setFocused(!0))},onBlur(S){t.isOpen||(e.onBlur&&e.onBlur(S),t.setFocused(!1))}}),valueProps:{id:_},menuProps:{...l,disallowEmptySelection:n,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:S=>{S.currentTarget.contains(S.relatedTarget)||(e.onBlur&&e.onBlur(S),t.setFocused(!1))},onFocus:l?.onFocus,"aria-labelledby":[y["aria-labelledby"],m["aria-label"]&&!y["aria-labelledby"]?m.id:null].filter(Boolean).join(" ")},descriptionProps:p,errorMessageProps:f,isInvalid:h,validationErrors:g,validationDetails:v}}var Ly=new WeakMap;function C0(e){var t,r,n,a,i,s;const o=Au(),{validationBehavior:l}=M_(K_)||{},[u,c]=Cu(e,id.variantKeys),h=(r=(t=e.disableAnimation)!=null?t:o?.disableAnimation)!=null?r:!1,{ref:g,as:v,label:b,name:y,isLoading:p,selectorIcon:f,isOpen:d,defaultOpen:m,onOpenChange:_,startContent:S,endContent:w,description:$,renderValue:O,onSelectionChange:E,placeholder:R,isVirtualized:q,itemHeight:M=36,maxListboxHeight:I=256,children:L,disallowEmptySelection:k=!1,selectionMode:J="single",spinnerRef:X,scrollRef:Y,popoverProps:ne={},scrollShadowProps:K={},listboxProps:j={},spinnerProps:V={},validationState:N,onChange:P,onClose:T,className:D,classNames:U,validationBehavior:Q=(n=l??o?.validationBehavior)!=null?n:"native",hideEmptyContent:B=!1,onClear:G,...C}=u,x=Gn(Y),F={popoverProps:qe({placement:"bottom",triggerScaleOnOpen:!1,offset:5,disableAnimation:h},ne),scrollShadowProps:qe({ref:x,isEnabled:(a=e.showScrollIndicators)!=null?a:!0,hideScrollBar:!0,offset:15},K),listboxProps:qe({disableAnimation:h},j)},z=v||"button",W=typeof z=="string",Z=Gn(g),ee=H.useRef(null),ce=H.useRef(null),se=H.useRef(null);let re=E0({...u,isOpen:d,selectionMode:J,disallowEmptySelection:k,validationBehavior:Q,children:L,isRequired:e.isRequired,isDisabled:e.isDisabled,isInvalid:e.isInvalid,defaultOpen:m,hideEmptyContent:B,onOpenChange:te=>{_?.(te),te||T?.()},onSelectionChange:te=>{E?.(te),P&&typeof P=="function"&&P({target:{...Z.current&&{...Z.current,name:Z.current.name},value:Array.from(te).join(",")}}),re.commitValidation()}});re={...re,...e.isDisabled&&{disabledKeys:new Set([...re.collection.getKeys()])}},k_(()=>{var te;(te=Z.current)!=null&&te.value&&re.setSelectedKeys(new Set([...re.selectedKeys,Z.current.value]))},[Z.current]);const{labelProps:de,triggerProps:ie,valueProps:ue,menuProps:Ae,descriptionProps:Te,errorMessageProps:Ve,isInvalid:Xe,validationErrors:je,validationDetails:It}=A0({...u,disallowEmptySelection:k,isDisabled:e.isDisabled},re,ee),Gt=H.useCallback(()=>{var te;re.setSelectedKeys(new Set([])),G?.(),(te=ee.current)==null||te.focus()},[G,re]),{pressProps:en}=Ny({isDisabled:!!e?.isDisabled,onPress:Gt}),ot=e.isInvalid||N==="invalid"||Xe,{isPressed:We,buttonProps:Ze}=L_(ie,ee),{focusProps:Fc,isFocused:Mc,isFocusVisible:kc}=du(),{focusProps:Lc,isFocusVisible:Uc}=du(),{isHovered:Vc,hoverProps:Kc}=Iu({isDisabled:e.isDisabled}),Tt=U_({labelPlacement:e.labelPlacement,label:b}),ja=!!R,Bc=Tt==="outside-left"||Tt==="outside",n_=Tt==="inside",zc=Tt==="outside-left",Wc=e.isClearable,Hc=re.isOpen||ja||!!((i=re.selectedItems)!=null&&i.length)||!!S||!!w||!!e.isMultiline,Gc=!!((s=re.selectedItems)!=null&&s.length),Na=!!b,Yc=Na&&(zc||Bc&&ja),Jc=Ee(U?.base,D),fe=H.useMemo(()=>id({...c,isInvalid:ot,isClearable:Wc,labelPlacement:Tt,disableAnimation:h}),[Tu(c),ot,Tt,h]);V_({isDisabled:!re.isOpen});const Xc=typeof u.errorMessage=="function"?u.errorMessage({isInvalid:ot,validationErrors:je,validationDetails:It}):u.errorMessage||je?.join(" "),Da=!!$||!!Xc,a_=!!w;H.useEffect(()=>{if(re.isOpen&&se.current&&ee.current){let te=ee.current.getBoundingClientRect(),Rt=se.current;Rt.style.width=te.width+"px"}},[re.isOpen]);const i_=H.useCallback((te={})=>({"data-slot":"base","data-filled":be(Hc),"data-has-value":be(Gc),"data-has-label":be(Na),"data-has-helper":be(Da),"data-has-end-content":be(a_),"data-invalid":be(ot),"data-has-label-outside":be(Yc),className:fe.base({class:Ee(Jc,te.className)}),...te}),[fe,Da,Gc,Na,Yc,Hc,Jc]),s_=H.useCallback((te={})=>({ref:ee,"data-slot":"trigger","data-open":be(re.isOpen),"data-disabled":be(e?.isDisabled),"data-focus":be(Mc),"data-pressed":be(We),"data-focus-visible":be(kc),"data-hover":be(Vc),className:fe.trigger({class:U?.trigger}),...qe(Ze,Fc,Kc,Tr(C,{enabled:W}),Tr(te))}),[fe,ee,re.isOpen,U?.trigger,e?.isDisabled,Mc,We,kc,Vc,Ze,Fc,Kc,C,W]),o_=H.useCallback((te={})=>({state:re,triggerRef:ee,selectRef:Z,selectionMode:J,label:e?.label,name:e?.name,isRequired:e?.isRequired,autoComplete:e?.autoComplete,isDisabled:e?.isDisabled,form:e?.form,onChange:P,...te}),[re,J,e?.label,e?.autoComplete,e?.name,e?.isDisabled,ee]),l_=H.useCallback((te={})=>({"data-slot":"label",className:fe.label({class:Ee(U?.label,te.className)}),...de,...te}),[fe,U?.label,de]),u_=H.useCallback((te={})=>({"data-slot":"value",className:fe.value({class:Ee(U?.value,te.className)}),...ue,...te}),[fe,U?.value,ue]),c_=H.useCallback((te={})=>({"data-slot":"listboxWrapper",className:fe.listboxWrapper({class:Ee(U?.listboxWrapper,te?.className)}),style:{maxHeight:I??256,...te.style},...qe(F.scrollShadowProps,te)}),[fe.listboxWrapper,U?.listboxWrapper,F.scrollShadowProps,I]),d_=(te={})=>{const Rt=q??re.collection.size>50;return{state:re,ref:ce,isVirtualized:Rt,virtualization:Rt?{maxListboxHeight:I,itemHeight:M}:void 0,"data-slot":"listbox",className:fe.listbox({class:Ee(U?.listbox,te?.className)}),scrollShadowProps:F.scrollShadowProps,...qe(F.listboxProps,te,Ae)}},f_=H.useCallback((te={})=>{var Rt,Zc;const $_=qe(F.popoverProps,te);return{state:re,triggerRef:ee,ref:se,"data-slot":"popover",scrollRef:ce,triggerType:"listbox",classNames:{content:fe.popoverContent({class:Ee(U?.popoverContent,te.className)})},...$_,offset:re.selectedItems&&re.selectedItems.length>0?re.selectedItems.length*1e-8+(((Rt=F.popoverProps)==null?void 0:Rt.offset)||0):(Zc=F.popoverProps)==null?void 0:Zc.offset}},[fe,U?.popoverContent,F.popoverProps,ee,re,re.selectedItems]),p_=H.useCallback(()=>({"data-slot":"selectorIcon","aria-hidden":be(!0),"data-open":be(re.isOpen),className:fe.selectorIcon({class:U?.selectorIcon})}),[fe,U?.selectorIcon,re.isOpen]),h_=H.useCallback((te={})=>({...te,"data-slot":"innerWrapper",className:fe.innerWrapper({class:Ee(U?.innerWrapper,te?.className)})}),[fe,U?.innerWrapper]),m_=H.useCallback((te={})=>({...te,"data-slot":"helperWrapper",className:fe.helperWrapper({class:Ee(U?.helperWrapper,te?.className)})}),[fe,U?.helperWrapper]),g_=H.useCallback((te={})=>({...te,...Te,"data-slot":"description",className:fe.description({class:Ee(U?.description,te?.className)})}),[fe,U?.description]),y_=H.useCallback((te={})=>({...te,"data-slot":"mainWrapper",className:fe.mainWrapper({class:Ee(U?.mainWrapper,te?.className)})}),[fe,U?.mainWrapper]),v_=H.useCallback((te={})=>({...te,"data-slot":"end-wrapper",className:fe.endWrapper({class:Ee(U?.endWrapper,te?.className)})}),[fe,U?.endWrapper]),b_=H.useCallback((te={})=>({...te,"data-slot":"end-content",className:fe.endContent({class:Ee(U?.endContent,te?.className)})}),[fe,U?.endContent]),__=H.useCallback((te={})=>({...te,...Ve,"data-slot":"error-message",className:fe.errorMessage({class:Ee(U?.errorMessage,te?.className)})}),[fe,Ve,U?.errorMessage]),S_=H.useCallback((te={})=>({"aria-hidden":be(!0),"data-slot":"spinner",color:"current",size:"sm",...V,...te,ref:X,className:fe.spinner({class:Ee(U?.spinner,te?.className)})}),[fe,X,V,U?.spinner]),w_=H.useCallback((te={})=>({...te,type:"button",tabIndex:-1,"aria-label":"clear selection","data-slot":"clear-button","data-focus-visible":be(Uc),className:fe.clearButton({class:Ee(U?.clearButton,te?.className)}),...qe(en,Lc)}),[fe,Uc,en,Lc,U?.clearButton]);return Ly.set(re,{isDisabled:e?.isDisabled,isRequired:e?.isRequired,name:e?.name,isInvalid:ot,validationBehavior:Q}),{Component:z,domRef:Z,state:re,label:b,name:y,triggerRef:ee,isLoading:p,placeholder:R,startContent:S,endContent:w,description:$,selectorIcon:f,hasHelper:Da,labelPlacement:Tt,hasPlaceholder:ja,renderValue:O,selectionMode:J,disableAnimation:h,isOutsideLeft:zc,shouldLabelBeOutside:Bc,shouldLabelBeInside:n_,isInvalid:ot,errorMessage:Xc,isClearable:Wc,getClearButtonProps:w_,getBaseProps:i_,getTriggerProps:s_,getLabelProps:l_,getValueProps:u_,getListboxProps:d_,getPopoverProps:f_,getSpinnerProps:S_,getMainWrapperProps:y_,getListboxWrapperProps:c_,getHiddenSelectProps:o_,getInnerWrapperProps:h_,getHelperWrapperProps:m_,getDescriptionProps:g_,getErrorMessageProps:__,getSelectorIconProps:p_,getEndWrapperProps:v_,getEndContentProps:b_}}var I0=typeof document<"u"?B_.useLayoutEffect:()=>{};function T0(e){const t=H.useRef(null);return I0(()=>{t.current=e},[e]),H.useCallback((...r)=>{const n=t.current;return n?.(...r)},[])}function R0(e,t,r){let n=H.useRef(t),a=T0(()=>{r&&r(n.current)});H.useEffect(()=>{var i;let s=(i=e?.current)==null?void 0:i.form;return s?.addEventListener("reset",a),()=>{s?.removeEventListener("reset",a)}},[e,a])}function x0(e,t,r){var n;let a=Ly.get(t)||{},{autoComplete:i,name:s=a.name,isDisabled:o=a.isDisabled,selectionMode:l,onChange:u,form:c}=e,{validationBehavior:h,isRequired:g,isInvalid:v}=a,{visuallyHiddenProps:b}=z_();return R0(e.selectRef,t.selectedKeys,t.setSelectedKeys),W_({validationBehavior:h,focus:()=>{var y;return(y=r.current)==null?void 0:y.focus()}},t,e.selectRef),{containerProps:{...b,"aria-hidden":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{form:c,autoComplete:i,disabled:o,"aria-invalid":v||void 0,"aria-required":g&&h==="aria"||void 0,required:g&&h==="native",name:s,tabIndex:-1,value:l==="multiple"?[...t.selectedKeys].map(y=>String(y)):(n=[...t.selectedKeys][0])!=null?n:"",multiple:l==="multiple",onChange:y=>{t.setSelectedKeys(y.target.value),u?.(y)}}}}function q0(e){var t;let{state:r,triggerRef:n,selectRef:a,label:i,name:s,isDisabled:o,form:l}=e,{containerProps:u,selectProps:c}=x0({...e,selectRef:a},r,n);return r.collection.size<=300?A.jsx("div",{...u,"data-testid":"hidden-select-container",children:A.jsxs("label",{children:[i,A.jsxs("select",{...c,ref:a,children:[A.jsx("option",{}),[...r.collection.getKeys()].map(h=>{let g=r.collection.getItem(h);if(g?.type==="item")return A.jsx("option",{value:g.key,children:g.textValue},g.key)})]})]})}):s?A.jsx("input",{autoComplete:c.autoComplete,disabled:o,form:l,name:s,type:"hidden",value:(t=[...r.selectedKeys].join(","))!=null?t:""}):null}var j0=H_,N0=j0;const Ru=new WeakMap;function D0(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function F0(e,t){let r=Ru.get(e);if(!r)throw new Error("Unknown list");return`${r.id}-option-${D0(t)}`}function M0(e,t,r){let n=Ou(e,{labelable:!0}),a=e.selectionBehavior||"toggle",i=e.linkBehavior||(a==="replace"?"action":"override");a==="toggle"&&i==="action"&&(i="override");let{listProps:s}=G_({...e,ref:r,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,linkBehavior:i}),{focusWithinProps:o}=Y_({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),l=Eu(e.id);Ru.set(t,{id:l,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction,linkBehavior:i});let{labelProps:u,fieldProps:c}=J_({...e,id:l,labelElementType:"span"});return{labelProps:u,listBoxProps:Ir(n,o,t.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...Ir(c,s)})}}function k0(e,t,r){var n,a;let{key:i}=e,s=Ru.get(t);var o;let l=(o=e.isDisabled)!==null&&o!==void 0?o:t.selectionManager.isDisabled(i);var u;let c=(u=e.isSelected)!==null&&u!==void 0?u:t.selectionManager.isSelected(i);var h;let g=(h=e.shouldSelectOnPressUp)!==null&&h!==void 0?h:s?.shouldSelectOnPressUp;var v;let b=(v=e.shouldFocusOnHover)!==null&&v!==void 0?v:s?.shouldFocusOnHover;var y;let p=(y=e.shouldUseVirtualFocus)!==null&&y!==void 0?y:s?.shouldUseVirtualFocus;var f;let d=(f=e.isVirtualized)!==null&&f!==void 0?f:s?.isVirtualized,m=td(),_=td(),S={role:"option","aria-disabled":l||void 0,"aria-selected":t.selectionManager.selectionMode!=="none"?c:void 0};X_()&&Z_()||(S["aria-label"]=e["aria-label"],S["aria-labelledby"]=m,S["aria-describedby"]=_);let w=t.collection.getItem(i);if(d){let X=Number(w?.index);S["aria-posinset"]=Number.isNaN(X)?void 0:X+1,S["aria-setsize"]=g0(t.collection)}let $=s?.onAction?()=>{var X;return s==null||(X=s.onAction)===null||X===void 0?void 0:X.call(s,i)}:void 0,O=F0(t,i),{itemProps:E,isPressed:R,isFocused:q,hasAction:M,allowsSelection:I}=_0({selectionManager:t.selectionManager,key:i,ref:r,shouldSelectOnPressUp:g,allowsDifferentPressOrigin:g&&b,isVirtualized:d,shouldUseVirtualFocus:p,isDisabled:l,onAction:$||!(w==null||(n=w.props)===null||n===void 0)&&n.onAction?jy(w==null||(a=w.props)===null||a===void 0?void 0:a.onAction,$):void 0,linkBehavior:s?.linkBehavior,id:O}),{hoverProps:L}=Iu({isDisabled:l||!b,onHoverStart(){rd()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(i))}}),k=Ou(w?.props);delete k.id;let J=Q_(w?.props);return{optionProps:{...S,...Ir(k,E,L,J),id:O},labelProps:{id:m},descriptionProps:{id:_},isFocused:q,isFocusVisible:q&&t.selectionManager.isFocused&&rd(),isSelected:c,isDisabled:l,isPressed:R,allowsSelection:I,hasAction:M}}function L0(e){let{heading:t,"aria-label":r}=e,n=Eu();return{itemProps:{role:"presentation"},headingProps:t?{id:n,role:"presentation"}:{},groupProps:{role:"group","aria-label":r,"aria-labelledby":t?n:void 0}}}function U0(e){var t;const r=Au(),{ref:n,as:a,state:i,variant:s,color:o,onAction:l,children:u,onSelectionChange:c,disableAnimation:h=(t=r?.disableAnimation)!=null?t:!1,itemClasses:g,className:v,topContent:b,bottomContent:y,emptyContent:p="No items.",hideSelectedIcon:f=!1,hideEmptyContent:d=!1,shouldHighlightOnFocus:m=!1,classNames:_,...S}=e,w=a||"ul",$=typeof w=="string",O=Gn(n),E=ky({...e,children:u,onSelectionChange:c}),R=i||E,{listBoxProps:q}=M0({...e,onAction:l},R,O),M=H.useMemo(()=>y0(),[]),I=Ee(_?.base,v);return{Component:w,state:R,variant:s,color:o,slots:M,classNames:_,topContent:b,bottomContent:y,emptyContent:p,hideEmptyContent:d,shouldHighlightOnFocus:m,hideSelectedIcon:f,disableAnimation:h,className:v,itemClasses:g,getBaseProps:(X={})=>({ref:O,"data-slot":"base",className:M.base({class:I}),...Tr(S,{enabled:$}),...X}),getListProps:(X={})=>({"data-slot":"list",className:M.list({class:_?.list}),...q,...X}),getEmptyContentProps:(X={})=>({"data-slot":"empty-content",children:p,className:M.emptyContent({class:_?.emptyContent}),...X})}}function V0(e){const{isSelected:t,disableAnimation:r,...n}=e;return A.jsx("svg",{"aria-hidden":"true","data-selected":t,role:"presentation",viewBox:"0 0 17 18",...n,children:A.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:t?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:r?{}:{transition:"stroke-dashoffset 200ms ease"}})})}function K0(e){var t,r;const n=Au(),[a,i]=Cu(e,ad.variantKeys),{as:s,item:o,state:l,description:u,startContent:c,endContent:h,isVirtualized:g,selectedIcon:v,className:b,classNames:y,autoFocus:p,onPress:f,onPressUp:d,onPressStart:m,onPressEnd:_,onPressChange:S,onClick:w,shouldHighlightOnFocus:$,hideSelectedIcon:O=!1,isReadOnly:E=!1,...R}=a,q=(r=(t=e.disableAnimation)!=null?t:n?.disableAnimation)!=null?r:!1,M=H.useRef(null),I=s||(e.href?"a":"li"),L=typeof I=="string",{rendered:k,key:J}=o,X=l.disabledKeys.has(J)||e.isDisabled,Y=l.selectionManager.selectionMode!=="none",ne=v0(),{pressProps:K,isPressed:j}=Ny({ref:M,isDisabled:X,onClick:w,onPress:f,onPressUp:d,onPressStart:m,onPressEnd:_,onPressChange:S}),{isHovered:V,hoverProps:N}=Iu({isDisabled:X}),{isFocusVisible:P,focusProps:T}=du({autoFocus:p}),{isFocused:D,isSelected:U,optionProps:Q,labelProps:B,descriptionProps:G}=k0({key:J,isDisabled:X,"aria-label":a["aria-label"],isVirtualized:g},l,M);let C=Q;const x=H.useMemo(()=>ad({...i,isDisabled:X,disableAnimation:q,hasTitleTextChild:typeof k=="string",hasDescriptionTextChild:typeof u=="string"}),[Tu(i),X,q,k,u]),F=Ee(y?.base,b);E&&(C=e0(C));const z=$&&D||(ne?V||j:V||D&&!P),W=(re={})=>({ref:M,...qe(C,E?{}:qe(T,K),N,Tr(R,{enabled:L}),re),"data-selectable":be(Y),"data-focus":be(D),"data-hover":be(z),"data-disabled":be(X),"data-selected":be(U),"data-pressed":be(j),"data-focus-visible":be(P),className:x.base({class:Ee(F,re.className)})}),Z=(re={})=>({...qe(B,re),"data-label":be(!0),className:x.title({class:y?.title})}),ee=(re={})=>({...qe(G,re),className:x.description({class:y?.description})}),ce=(re={})=>({...qe(re),className:x.wrapper({class:y?.wrapper})}),se=H.useCallback((re={})=>({"aria-hidden":be(!0),"data-disabled":be(X),className:x.selectedIcon({class:y?.selectedIcon}),...re}),[X,x,y]);return{Component:I,domRef:M,slots:x,classNames:y,isSelectable:Y,isSelected:U,isDisabled:X,rendered:k,description:u,startContent:c,endContent:h,selectedIcon:v,hideSelectedIcon:O,disableAnimation:q,getItemProps:W,getLabelProps:Z,getWrapperProps:ce,getDescriptionProps:ee,getSelectedIconProps:se}}var Uy=e=>{const{Component:t,rendered:r,description:n,isSelectable:a,isSelected:i,isDisabled:s,selectedIcon:o,startContent:l,endContent:u,hideSelectedIcon:c,disableAnimation:h,getItemProps:g,getLabelProps:v,getWrapperProps:b,getDescriptionProps:y,getSelectedIconProps:p}=K0(e),f=H.useMemo(()=>{const d=A.jsx(V0,{disableAnimation:h,isSelected:i});return typeof o=="function"?o({icon:d,isSelected:i,isDisabled:s}):o||d},[o,i,s,h]);return A.jsxs(t,{...g(),children:[l,n?A.jsxs("div",{...b(),children:[A.jsx("span",{...v(),children:r}),A.jsx("span",{...y(),children:n})]}):A.jsx("span",{...v(),children:r}),a&&!c&&A.jsx("span",{...p(),children:f}),u]})};Uy.displayName="HeroUI.ListboxItem";var xu=Uy,Vy=kr(({item:e,state:t,as:r,variant:n,color:a,disableAnimation:i,className:s,classNames:o,hideSelectedIcon:l,showDivider:u=!1,dividerProps:c={},itemClasses:h,title:g,items:v,...b},y)=>{const p=r||"li",f=H.useMemo(()=>b0(),[]),d=Ee(o?.base,s),m=Ee(o?.divider,c?.className),{itemProps:_,headingProps:S,groupProps:w}=L0({heading:e.rendered,"aria-label":e["aria-label"]});return A.jsxs(p,{"data-slot":"base",...qe(_,b),className:f.base({class:d}),children:[e.rendered&&A.jsx("span",{...S,className:f.heading({class:o?.heading}),"data-slot":"heading",children:e.rendered}),A.jsxs("ul",{...w,className:f.group({class:o?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map($=>{const{key:O,props:E}=$;let R=A.jsx(xu,{classNames:h,color:a,disableAnimation:i,hideSelectedIcon:l,item:$,state:t,variant:n,...E},O);return $.wrapper&&(R=$.wrapper(R)),R}),u&&A.jsx(t0,{as:"li",className:f.divider({class:m}),...c})]})]},e.key)});Vy.displayName="HeroUI.ListboxSection";var Ky=Vy;function B0(e={}){const{domRef:t,isEnabled:r=!0,overflowCheck:n="vertical",visibility:a="auto",offset:i=0,onVisibilityChange:s,updateDeps:o=[]}=e,l=H.useRef(a);H.useEffect(()=>{const u=t?.current;if(!u||!r)return;const c=(v,b,y,p,f)=>{if(a==="auto"){const d=`${p}${n0(f)}Scroll`;b&&y?(u.dataset[d]="true",u.removeAttribute(`data-${p}-scroll`),u.removeAttribute(`data-${f}-scroll`)):(u.dataset[`${p}Scroll`]=b.toString(),u.dataset[`${f}Scroll`]=y.toString(),u.removeAttribute(`data-${p}-${f}-scroll`))}else{const d=b&&y?"both":b?p:y?f:"none";d!==l.current&&(s?.(d),l.current=d)}},h=()=>{var v,b;const y=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],p=u.querySelector('ul[data-slot="list"]'),f=+((v=p?.getAttribute("data-virtual-scroll-height"))!=null?v:u.scrollHeight),d=+((b=p?.getAttribute("data-virtual-scroll-top"))!=null?b:u.scrollTop);for(const{type:m,prefix:_,suffix:S}of y)if(n===m||n==="both"){const w=m==="vertical"?d>i:u.scrollLeft>i,$=m==="vertical"?d+u.clientHeight+i{["top","bottom","top-bottom","left","right","left-right"].forEach(v=>{u.removeAttribute(`data-${v}-scroll`)})};return h(),u.addEventListener("scroll",h,!0),a!=="auto"&&(g(),a==="both"?(u.dataset.topBottomScroll=String(n==="vertical"),u.dataset.leftRightScroll=String(n==="horizontal")):(u.dataset.topBottomScroll="false",u.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(v=>{u.dataset[`${v}Scroll`]=String(a===v)}))),()=>{u.removeEventListener("scroll",h,!0),g()}},[...o,r,a,n,s,t])}function z0(e){var t;const[r,n]=Cu(e,nd.variantKeys),{ref:a,as:i,children:s,className:o,style:l,size:u=40,offset:c=0,visibility:h="auto",isEnabled:g=!0,onVisibilityChange:v,...b}=r,y=i||"div",p=Gn(a);B0({domRef:p,offset:c,visibility:h,isEnabled:g,onVisibilityChange:v,updateDeps:[s],overflowCheck:(t=e.orientation)!=null?t:"vertical"});const f=H.useMemo(()=>nd({...n,className:o}),[Tu(n),o]);return{Component:y,styles:f,domRef:p,children:s,getBaseProps:(m={})=>{var _;return{ref:p,className:f,"data-orientation":(_=e.orientation)!=null?_:"vertical",style:{"--scroll-shadow-size":`${u}px`,...l,...m.style},...b,...m}}}}var W0=(e,t)=>{const r=[];for(const n of e)n.type==="section"?r.push(([...n.childNodes].length+1)*t):r.push(t);return r},H0=e=>{if(!e||e.scrollTop===void 0||e.clientHeight===void 0||e.scrollHeight===void 0)return{isTop:!1,isBottom:!1,isMiddle:!1};const t=e.scrollTop===0,r=Math.ceil(e.scrollTop+e.clientHeight)>=e.scrollHeight;return{isTop:t,isBottom:r,isMiddle:!t&&!r}},G0=e=>{var t;const{Component:r,state:n,color:a,variant:i,itemClasses:s,getBaseProps:o,topContent:l,bottomContent:u,hideEmptyContent:c,hideSelectedIcon:h,shouldHighlightOnFocus:g,disableAnimation:v,getEmptyContentProps:b,getListProps:y,scrollShadowProps:p}=e,{virtualization:f}=e;if(!f||!r0(f)&&!f.maxListboxHeight&&!f.itemHeight)throw new Error("You are using a virtualized listbox. VirtualizedListbox requires 'virtualization' props with 'maxListboxHeight' and 'itemHeight' properties. This error might have originated from autocomplete components that use VirtualizedListbox. Please provide these props to use the virtualized listbox.");const{maxListboxHeight:d,itemHeight:m}=f,_=Math.min(d,m*n.collection.size),S=H.useRef(null),w=H.useMemo(()=>W0([...n.collection],m),[n.collection,m]),$=S0({count:[...n.collection].length,getScrollElement:()=>S.current,estimateSize:k=>w[k]}),O=$.getVirtualItems(),E=$.getTotalSize(),{getBaseProps:R}=z0({...p}),q=k=>{var J;const X=[...n.collection][k.index];if(!X)return null;const Y={color:a,item:X,state:n,variant:i,disableAnimation:v,hideSelectedIcon:h,...X.props},ne={position:"absolute",top:0,left:0,width:"100%",height:`${k.size}px`,transform:`translateY(${k.start}px)`};if(X.type==="section")return A.jsx(Ky,{...Y,itemClasses:s,style:{...ne,...Y.style}},X.key);let K=A.jsx(xu,{...Y,classNames:qe(s,(J=X.props)==null?void 0:J.classNames),shouldHighlightOnFocus:g,style:{...ne,...Y.style}},X.key);return X.wrapper&&(K=X.wrapper(K)),K},[M,I]=H.useState({isTop:!1,isBottom:!0,isMiddle:!1}),L=A.jsxs(r,{...y(),"data-virtual-scroll-height":E,"data-virtual-scroll-top":(t=S?.current)==null?void 0:t.scrollTop,children:[!n.collection.size&&!c&&A.jsx("li",{children:A.jsx("div",{...b()})}),A.jsx("div",{...Tr(R()),ref:S,style:{height:d,overflow:"auto"},onScroll:k=>{I(H0(k.target))},children:_>0&&m>0&&A.jsx("div",{style:{height:`${E}px`,width:"100%",position:"relative"},children:O.map(k=>q(k))})})]});return A.jsxs("div",{...o(),children:[l,L,u]})},Y0=G0,J0=kr(function(t,r){const{isVirtualized:n,...a}=t,i=U0({...a,ref:r}),{Component:s,state:o,color:l,variant:u,itemClasses:c,getBaseProps:h,topContent:g,bottomContent:v,hideEmptyContent:b,hideSelectedIcon:y,shouldHighlightOnFocus:p,disableAnimation:f,getEmptyContentProps:d,getListProps:m}=i;if(n)return A.jsx(Y0,{...t,...i});const _=A.jsxs(s,{...m(),children:[!o.collection.size&&!b&&A.jsx("li",{children:A.jsx("div",{...d()})}),[...o.collection].map(S=>{var w;const $={color:l,item:S,state:o,variant:u,disableAnimation:f,hideSelectedIcon:y,...S.props};if(S.type==="section")return A.jsx(Ky,{...$,itemClasses:c},S.key);let O=A.jsx(xu,{...$,classNames:qe(c,(w=S.props)==null?void 0:w.classNames),shouldHighlightOnFocus:p},S.key);return S.wrapper&&(O=S.wrapper(O)),O})]});return A.jsxs("div",{...h(),children:[g,_,v]})}),X0=J0,Z0=kr(function(t,r){var n;const{Component:a,state:i,label:s,hasHelper:o,isLoading:l,triggerRef:u,selectorIcon:c=A.jsx(w0,{}),description:h,errorMessage:g,isInvalid:v,startContent:b,endContent:y,placeholder:p,renderValue:f,shouldLabelBeOutside:d,disableAnimation:m,getBaseProps:_,getLabelProps:S,getTriggerProps:w,getValueProps:$,getListboxProps:O,getPopoverProps:E,getSpinnerProps:R,getMainWrapperProps:q,getInnerWrapperProps:M,getHiddenSelectProps:I,getHelperWrapperProps:L,getListboxWrapperProps:k,getDescriptionProps:J,getErrorMessageProps:X,getSelectorIconProps:Y,isClearable:ne,getClearButtonProps:K,getEndWrapperProps:j,getEndContentProps:V}=C0({...t,ref:r}),N=s?A.jsx("label",{...S(),children:s}):null,P=H.cloneElement(c,Y()),T=H.useMemo(()=>{var C;return ne&&((C=i.selectedItems)!=null&&C.length)?A.jsx("span",{...K(),children:A.jsx(a0,{})}):null},[ne,K,(n=i.selectedItems)==null?void 0:n.length]),D=H.useMemo(()=>T?A.jsxs("div",{...j(),children:[T,y&&A.jsx("span",{...V(),children:y})]}):y&&A.jsx("span",{...V(),children:y}),[T,y,j,V]),U=H.useMemo(()=>{const C=v&&g;return!o||!(C||h)?null:A.jsx("div",{...L(),children:C?A.jsx("div",{...X(),children:g}):A.jsx("div",{...J(),children:h})})},[o,v,g,h,L,X,J]),Q=H.useMemo(()=>{var C;if(!((C=i.selectedItems)!=null&&C.length))return p;if(f&&typeof f=="function"){const x=[...i.selectedItems].map(F=>({key:F.key,data:F.value,type:F.type,props:F.props,textValue:F.textValue,rendered:F.rendered,"aria-label":F["aria-label"]}));return f(x)}return i.selectedItems.map(x=>x.textValue).join(", ")},[i.selectedItems,f,p]),B=H.useMemo(()=>l?A.jsx(i0,{...R()}):P,[l,P,R]),G=H.useMemo(()=>i.isOpen?A.jsx($0,{...E(),children:A.jsx(s0,{...k(),children:A.jsx(X0,{...O()})})}):null,[i.isOpen,E,i,u,k,O]);return A.jsxs("div",{..._(),children:[A.jsx(q0,{...I()}),d?N:null,A.jsxs("div",{...q(),children:[A.jsxs(a,{...w(),children:[d?null:N,A.jsxs("div",{...M(),children:[b,A.jsx("span",{...$(),children:Q}),y&&i.selectedItems&&A.jsx(o0,{elementType:"span",children:","}),D]}),B]}),U]}),m?G:A.jsx(l0,{children:G})]})}),Q0=Z0;function he(e){return typeof e!="object"||e===null||typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function eS(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),he(e.additionalItems)}function od(e){if(e==="")return;if(e===null)return null;if(/\.$/.test(e)||/\.0$/.test(e)||/\.\d*0$/.test(e))return e;const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)?t:e}const Ur="__additional_property",fu="additionalProperties",ir="allOf",Ge="anyOf",ht="const",tS="default",na="dependencies",rS="enum",Me="__errors",Pt="$id",nS="if",Ot="items",aS="_$junk_option_schema_id$_",Kn="$name",ke="oneOf",Oe="properties",iS="required",Yn="submitButtonOptions",Ce="$ref",qu="__rjsf_additionalProperties",By="__rjsf_rootSchema",sS="ui:field",ju="ui:widget",Pr="ui:options",oS="ui:globalOptions";function pe(e={},t={}){return Object.keys(e).filter(r=>r.indexOf("ui:")===0).reduce((r,n)=>{const a=e[n];return n===ju&&he(a)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),r):n===Pr&&he(a)?{...r,...a}:{...r,[n.substring(3)]:a}},{...t})}function lS(e,t={},r){if(!e.additionalProperties)return!1;const{expandable:n=!0}=pe(t);return n===!1?n:e.maxProperties!==void 0&&r?Object.keys(r).length({...r,[a]:Jn(n)}),t);if(Ft(e)){const r=e;return Object.keys(r).reduce((n,a)=>({...n,[a]:Jn(r[a])}),t)}return t}function $S(){this.__data__=[],this.size=0}function Vr(e,t){return e===t||e!==e&&t!==t}function ia(e,t){for(var r=e.length;r--;)if(Vr(e[r][0],t))return r;return-1}var PS=Array.prototype,OS=PS.splice;function ES(e){var t=this.__data__,r=ia(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():OS.call(t,r,1),--this.size,!0}function AS(e){var t=this.__data__,r=ia(t,e);return r<0?void 0:t[r][1]}function CS(e){return ia(this.__data__,e)>-1}function IS(e,t){var r=this.__data__,n=ia(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function vt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var h=-1,g=!0,v=r&_1?new Qt:void 0;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=H1}var G1="[object Arguments]",Y1="[object Array]",J1="[object Boolean]",X1="[object Date]",Z1="[object Error]",Q1="[object Function]",ew="[object Map]",tw="[object Number]",rw="[object Object]",nw="[object RegExp]",aw="[object Set]",iw="[object String]",sw="[object WeakMap]",ow="[object ArrayBuffer]",lw="[object DataView]",uw="[object Float32Array]",cw="[object Float64Array]",dw="[object Int8Array]",fw="[object Int16Array]",pw="[object Int32Array]",hw="[object Uint8Array]",mw="[object Uint8ClampedArray]",gw="[object Uint16Array]",yw="[object Uint32Array]",$e={};$e[uw]=$e[cw]=$e[dw]=$e[fw]=$e[pw]=$e[hw]=$e[mw]=$e[gw]=$e[yw]=!0;$e[G1]=$e[Y1]=$e[ow]=$e[J1]=$e[lw]=$e[X1]=$e[Z1]=$e[Q1]=$e[ew]=$e[tw]=$e[rw]=$e[nw]=$e[aw]=$e[iw]=$e[sw]=!1;function vw(e){return ze(e)&&ku(e.length)&&!!$e[yt(e)]}function Lu(e){return function(t){return e(t)}}var tv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Or=tv&&typeof module=="object"&&module&&!module.nodeType&&module,bw=Or&&Or.exports===tv,ka=bw&&zy.process,tr=(function(){try{var e=Or&&Or.require&&Or.require("util").types;return e||ka&&ka.binding&&ka.binding("util")}catch{}})(),md=tr&&tr.isTypedArray,Kr=md?Lu(md):vw,_w=Object.prototype,Sw=_w.hasOwnProperty;function rv(e,t){var r=Ie(e),n=!r&&er(e),a=!r&&!n&&kt(e),i=!r&&!n&&!a&&Kr(e),s=r||n||a||i,o=s?Zy(e.length,String):[],l=o.length;for(var u in e)(t||Sw.call(e,u))&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||la(u,l)))&&o.push(u);return o}var ww=Object.prototype;function ua(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ww;return e===r}var $w=Hy(Object.keys,Object),Pw=Object.prototype,Ow=Pw.hasOwnProperty;function nv(e){if(!ua(e))return $w(e);var t=[];for(var r in Object(e))Ow.call(e,r)&&r!="constructor"&&t.push(r);return t}function sr(e){return e!=null&&ku(e.length)&&!sa(e)}function et(e){return sr(e)?rv(e):nv(e)}function pu(e){return Jy(e,et,Mu)}var Ew=1,Aw=Object.prototype,Cw=Aw.hasOwnProperty;function Iw(e,t,r,n,a,i){var s=r&Ew,o=pu(e),l=o.length,u=pu(t),c=u.length;if(l!=c&&!s)return!1;for(var h=l;h--;){var g=o[h];if(!(s?g in t:Cw.call(t,g)))return!1}var v=i.get(e),b=i.get(t);if(v&&b)return v==t&&b==e;var y=!0;i.set(e,t),i.set(t,e);for(var p=s;++h{if(typeof r=="function"&&typeof n=="function")return!0})}var Lw="[object Symbol]";function Br(e){return typeof e=="symbol"||ze(e)&&yt(e)==Lw}var Uw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vw=/^\w*$/;function Uu(e,t){if(Ie(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Br(e)?!0:Vw.test(e)||!Uw.test(e)||t!=null&&e in Object(t)}var Kw="Expected a function";function Vu(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Kw);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Vu.Cache||bt),r}Vu.Cache=bt;var Bw=500;function zw(e){var t=Vu(e,function(n){return r.size===Bw&&r.clear(),n}),r=t.cache;return t}var Ww=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hw=/\\(\\)?/g,av=zw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ww,function(r,n,a,i){t.push(a?i.replace(Hw,"$1"):n||r)}),t});function da(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++rb,typeof u[g]>"u"&&(Array.isArray(u)&&g==="-"&&(g=u.length),v&&(c[b]!==""&&c[b]<1/0||c[b]==="-"?u[g]=[]:u[g]={})),!v)break;u=u[g]}var p=u[g];return h===void 0?delete u[g]:u[g]=h,p}function i(u){if(typeof u=="string"){if(u=u.split("/"),u[0]==="")return u;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(u)){for(const c of u)if(typeof c!="string"&&typeof c!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return u}throw new Error("Invalid JSON pointer.")}function s(u,c){if(typeof u!="object")throw new Error("Invalid input object.");c=i(c);var h=c.length;if(h===1)return u;for(var g=1;ga?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n0&&r(o)?t>1?Wr(o,t-1,r,n,a):Fu(a,o):n||(a[a.length]=o)}return a}function OP(e){var t=e==null?0:e.length;return t?Wr(e,1):[]}function EP(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Dd=Math.max;function yv(e,t,r){return t=Dd(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=Dd(n.length-t,0),s=Array(i);++a0){if(++t>=IP)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var vv=xP(CP);function bv(e){return vv(yv(e,void 0,OP),e+"")}var qP=1,jP=2,NP=4,Qn=bv(function(e,t){var r={};if(e==null)return r;var n=!1;t=da(t,function(i){return i=or(i,e),n||(n=i.length>1),i}),lr(e,Hu(e),r),n&&(r=Er(r,qP|jP|NP,$P));for(var a=t.length;a--;)gv(r,t[a]);return r});function Yu(e,t){const r=t[e];return[Qn(t,[e]),r]}function _v(e,t={},r=[]){const n=e||"";let a;if(n.startsWith("#"))a=decodeURIComponent(n.substring(1));else throw new Error(`Could not find a definition for ${e}.`);const i=e$.get(t,a);if(i===void 0)throw new Error(`Could not find a definition for ${e}.`);const s=i[Ce];if(s){if(r.includes(s)){if(r.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[c,...h]=r,g=[...h,n,c].join(" -> ");throw new Error(`Definition for ${c} contains a circular reference through ${g}`)}const[o,l]=Yu(Ce,i),u=_v(l,t,[...r,n]);return Object.keys(o).length>0?{...o,...u}:u}return i}function Sv(e,t={}){return _v(e,t,[])}var DP=Object.prototype,FP=DP.hasOwnProperty;function MP(e,t){return e!=null&&FP.call(e,t)}function wv(e,t,r){t=or(t,e);for(var n=-1,a=t.length,i=!1;++ngO)return[];var r=La,n=yO(e,La);t=Tv(t),e-=La;for(var a=Zy(n,t);++r({required:[c]}))};let u;if(o.anyOf){const{...c}=o;c.allOf?c.allOf=c.allOf.slice():c.allOf=[],c.allOf.push(l),u=c}else u=Object.assign({},o,l);if(delete u.required,e.isValid(u,t,n))return s}else if(e.isValid(o,t,n))return s}return 0}function Xu(e,t,r,n,a){return qv(e,t,r,n,a)}function Zu(e,t,r,n){if(!we(e))return e;t=or(t,e);for(var a=-1,i=t.length,s=i-1,o=e;o!=null&&++a1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,s&&SO(r[0],r[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++n-1}function TO(){}var RO=1/0,xO=Zt&&1/Du(new Zt([,-0]))[1]==RO?function(e){return new Zt(e)}:TO,qO=200;function Dv(e,t,r){var n=-1,a=Nv,i=e.length,s=!0,o=[],l=o;if(i>=qO){var u=xO(e);if(u)return Du(u);s=!1,a=Nu,l=new Qt}else l=o;e:for(;++n-1}return Wa=t,Wa}var Ha,zd;function kO(){if(zd)return Ha;zd=1;var e=ma();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Ha=t,Ha}var Ga,Wd;function ga(){if(Wd)return Ga;Wd=1;var e=NO(),t=DO(),r=FO(),n=MO(),a=kO();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Ki=t,Ki}var Bi,Bf;function fE(){if(Bf)return Bi;Bf=1;var e=Vt(),t=ic(),r=st(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",h="[object Object]",g="[object RegExp]",v="[object Set]",b="[object String]",y="[object WeakMap]",p="[object ArrayBuffer]",f="[object DataView]",d="[object Float32Array]",m="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",w="[object Int32Array]",$="[object Uint8Array]",O="[object Uint8ClampedArray]",E="[object Uint16Array]",R="[object Uint32Array]",q={};q[d]=q[m]=q[_]=q[S]=q[w]=q[$]=q[O]=q[E]=q[R]=!0,q[n]=q[a]=q[p]=q[i]=q[f]=q[s]=q[o]=q[l]=q[u]=q[c]=q[h]=q[g]=q[v]=q[b]=q[y]=!1;function M(I){return r(I)&&t(I.length)&&!!q[e(I)]}return Bi=M,Bi}var zi,zf;function Bt(){if(zf)return zi;zf=1;function e(t){return function(r){return t(r)}}return zi=e,zi}var wr={exports:{}};wr.exports;var Wf;function sc(){return Wf||(Wf=1,(function(e,t){var r=Fv(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,o=(function(){try{var l=a&&a.require&&a.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(wr,wr.exports)),wr.exports}var Wi,Hf;function oc(){if(Hf)return Wi;Hf=1;var e=fE(),t=Bt(),r=sc(),n=r&&r.isTypedArray,a=n?t(n):e;return Wi=a,Wi}var Hi,Gf;function Vv(){if(Gf)return Hi;Gf=1;var e=uE(),t=_a(),r=Ue(),n=Sa(),a=ac(),i=oc(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var h=r(u),g=!h&&t(u),v=!h&&!g&&n(u),b=!h&&!g&&!v&&i(u),y=h||g||v||b,p=y?e(u.length,String):[],f=p.length;for(var d in u)(c||o.call(u,d))&&!(y&&(d=="length"||v&&(d=="offset"||d=="parent")||b&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||a(d,f)))&&p.push(d);return p}return Hi=l,Hi}var Gi,Yf;function lc(){if(Yf)return Gi;Yf=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return Gi=t,Gi}var Yi,Jf;function Kv(){if(Jf)return Yi;Jf=1;function e(t,r){return function(n){return t(r(n))}}return Yi=e,Yi}var Ji,Xf;function pE(){if(Xf)return Ji;Xf=1;var e=Kv(),t=e(Object.keys,Object);return Ji=t,Ji}var Xi,Zf;function hE(){if(Zf)return Xi;Zf=1;var e=lc(),t=pE(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var s=[];for(var o in Object(i))n.call(i,o)&&o!="constructor"&&s.push(o);return s}return Xi=a,Xi}var Zi,Qf;function dr(){if(Qf)return Zi;Qf=1;var e=ec(),t=ic();function r(n){return n!=null&&t(n.length)&&!e(n)}return Zi=r,Zi}var Qi,ep;function Gr(){if(ep)return Qi;ep=1;var e=Vv(),t=hE(),r=dr();function n(a){return r(a)?e(a):t(a)}return Qi=n,Qi}var es,tp;function mE(){if(tp)return es;tp=1;var e=Hr(),t=Gr();function r(n,a){return n&&e(a,t(a),n)}return es=r,es}var ts,rp;function gE(){if(rp)return ts;rp=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return ts=e,ts}var rs,np;function yE(){if(np)return rs;np=1;var e=it(),t=lc(),r=gE(),n=Object.prototype,a=n.hasOwnProperty;function i(s){if(!e(s))return r(s);var o=t(s),l=[];for(var u in s)u=="constructor"&&(o||!a.call(s,u))||l.push(u);return l}return rs=i,rs}var ns,ap;function fr(){if(ap)return ns;ap=1;var e=Vv(),t=yE(),r=dr();function n(a){return r(a)?e(a,!0):t(a)}return ns=n,ns}var as,ip;function vE(){if(ip)return as;ip=1;var e=Hr(),t=fr();function r(n,a){return n&&e(a,t(a),n)}return as=r,as}var $r={exports:{}};$r.exports;var sp;function Bv(){return sp||(sp=1,(function(e,t){var r=at(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,o=s?s.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var h=u.length,g=o?o(h):new u.constructor(h);return u.copy(g),g}e.exports=l})($r,$r.exports)),$r.exports}var is,op;function uc(){if(op)return is;op=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++nv))return!1;var y=h.get(s),p=h.get(o);if(y&&p)return y==o&&p==s;var f=-1,d=!0,m=l&a?new e:void 0;for(h.set(s,o),h.set(o,s);++f0&&i(c)?a>1?r(c,a-1,i,s,o):e(o,c):s||(o[o.length]=c)}return o}return Zs=r,Zs}var Qs,th;function zt(){if(th)return Qs;th=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=Array(a);++nn||o&&l&&c&&!u&&!h||i&&l&&c||!a&&c||!s)return 1;if(!i&&!o&&!h&&r=u)return c;var h=a[i];return c*(h=="desc"?-1:1)}}return r.index-n.index}return jo=t,jo}var No,Dh;function gA(){if(Dh)return No;Dh=1;var e=zt(),t=vc(),r=lA(),n=fA(),a=pA(),i=Bt(),s=mA(),o=Yr(),l=Ue();function u(c,h,g){h.length?h=e(h,function(y){return l(y)?function(p){return t(p,y.length===1?y[0]:y)}:y}):h=[o];var v=-1;h=e(h,i(r));var b=n(c,function(y,p,f){var d=e(h,function(m){return m(y)});return{criteria:d,index:++v,value:y}});return a(b,function(y,p){return s(y,p,g)})}return No=u,No}var Do,Fh;function sb(){if(Fh)return Do;Fh=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Do=e,Do}var Fo,Mh;function yA(){if(Mh)return Fo;Mh=1;var e=sb(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var s=arguments,o=-1,l=t(s.length-a,0),u=Array(l);++o0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Lo=n,Lo}var Uo,Vh;function SA(){if(Vh)return Uo;Vh=1;var e=bA(),t=_A(),r=t(e);return Uo=r,Uo}var Vo,Kh;function Wt(){if(Kh)return Vo;Kh=1;var e=Yr(),t=yA(),r=SA();function n(a,i){return r(t(a,i,e),a+"")}return Vo=n,Vo}var Ko,Bh;function bc(){if(Bh)return Ko;Bh=1;var e=ur(),t=dr(),r=ac(),n=it();function a(i,s,o){if(!n(o))return!1;var l=typeof s;return(l=="number"?t(o)&&r(s,o.length):l=="string"&&s in o)?e(o[s],i):!1}return Ko=a,Ko}var Bo,zh;function ob(){if(zh)return Bo;zh=1;var e=gc(),t=gA(),r=Wt(),n=bc(),a=r(function(i,s){if(i==null)return[];var o=s.length;return o>1&&n(i,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return Bo=a,Bo}var zo,Wh;function wA(){if(Wh)return zo;Wh=1;function e(t,r,n,a){for(var i=t.length,s=n+(a?1:-1);a?s--:++s-1}return Yo=t,Yo}var Jo,Xh;function Sc(){if(Xh)return Jo;Xh=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a=s){var f=u?null:a(l);if(f)return i(f);b=!1,g=n,p=new e}else p=u?[]:y;e:for(;++h2?l[2]:void 0;for(h&&r(l[0],l[1],h)&&(c=1);++u=120&&d.length>=120)?new e(b&&d):void 0}d=l[0];var m=-1,_=y[0];e:for(;++mArray.isArray(I)?I:[I],u=I=>I===void 0,c=I=>s(I)||Array.isArray(I)?Object.keys(I):[],h=(I,L)=>I.hasOwnProperty(L),g=I=>t(r(I)),v=I=>u(I)||Array.isArray(I)&&I.length===0,b=(I,L,k,J)=>L&&h(L,k)&&I&&h(I,k)&&J(I[k],L[k]),y=(I,L)=>u(I)&&L===0||u(L)&&I===0||e(I,L),p=(I,L)=>u(I)&&L===!1||u(L)&&I===!1||e(I,L),f=I=>u(I)||e(I,{})||I===!0,d=I=>u(I)||e(I,{}),m=I=>u(I)||s(I)||I===!0||I===!1;function _(I,L){return v(I)&&v(L)?!0:e(g(I),g(L))}function S(I,L){return I=l(I),L=l(L),e(g(I),g(L))}function w(I,L,k,J){var X=r(c(I).concat(c(L)));return d(I)&&d(L)?!0:d(I)&&c(L).length||d(L)&&c(I).length?!1:X.every(function(Y){var ne=I[Y],K=L[Y];return Array.isArray(ne)&&Array.isArray(K)?e(g(I),g(L)):Array.isArray(ne)&&!Array.isArray(K)||Array.isArray(K)&&!Array.isArray(ne)?!1:b(I,L,Y,J)})}function $(I,L,k,J){return s(I)&&s(L)?J(I,L):Array.isArray(I)&&Array.isArray(L)?w(I,L,k,J):e(I,L)}function O(I,L,k,J){var X=n(I,J),Y=n(L,J),ne=i(X,Y,J);return ne.length===Math.max(X.length,Y.length)}var E={title:e,uniqueItems:p,minLength:y,minItems:y,minProperties:y,required:_,enum:_,type:S,items:$,anyOf:O,allOf:O,oneOf:O,properties:w,patternProperties:w,dependencies:w},R=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],q=["additionalProperties","additionalItems","contains","propertyNames","not"];function M(I,L,k){if(k=a(k,{ignore:[]}),f(I)&&f(L))return!0;if(!m(I)||!m(L))throw new Error("Either of the values are not a JSON schema.");if(I===L)return!0;if(o(I)&&o(L))return I===L;if(I===void 0&&L===!1||L===void 0&&I===!1||u(I)&&!u(L)||!u(I)&&u(L))return!1;var J=r(Object.keys(I).concat(Object.keys(L)));if(k.ignore.length&&(J=J.filter(Y=>k.ignore.indexOf(Y)===-1)),!J.length)return!0;function X(Y,ne){return M(Y,ne,k)}return J.every(function(Y){var ne=I[Y],K=L[Y];if(q.indexOf(Y)!==-1)return M(ne,K,k);var j=E[Y];if(j||(j=e),e(ne,K))return!0;if(R.indexOf(Y)===-1&&(!h(I,Y)&&h(L,Y)||h(I,Y)&&!h(L,Y)))return ne===K;var V=j(ne,K,Y,X);if(!o(V))throw new Error("Comparer must return true or false");return V})}return cl=M,cl}var dl,fm;function Ec(){if(fm)return dl;fm=1;function e(t){return Object.prototype.toString.call(t)==="[object Array]"}return dl=Array.isArray||e,dl}var fl,pm;function TA(){if(pm)return fl;pm=1;function e(t){return(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")&&t.valueOf()===t.valueOf()}return fl=e,fl}var pl,hm;function RA(){if(hm)return pl;hm=1;var e=TA();function t(r){return e(r)&&r%1===0}return pl=t,pl}var hl,mm;function pb(){if(mm)return hl;mm=1;var e=Ec(),t=RA();function r(n){var a;if(!e(n)||(a=n.length,!a))return!1;for(var i=0;il&&(c=l,l=o,o=c),l=l-o}return u*o}function i(o,l){var u=0,c;if(o===0)return l;if(l===0)return o;for(;(o&1)===0&&(l&1)===0;)o>>>=1,l>>>=1,u++;for(;(o&1)===0;)o>>>=1;for(;l;){for(;(l&1)===0;)l>>>=1;o>l&&(c=l,l=o,o=c),l=l-o}return o<1){if(c=l[0],u=l[1],!r(u))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+u+"`.")}else c=l[0];else throw new TypeError("gcd()::invalid input argument. Must provide an array of integers. Value: `"+l[0]+"`.");if(h=c.length,h<2)return null;if(u){for(g=new Array(h),b=0;b1){if(l=s[0],o=s[1],!n(o))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+o+"`.")}else l=s[0];else throw new TypeError("lcm()::invalid input argument. Must provide an array of integers. Value: `"+s[0]+"`.");if(u=l.length,u<2)return null;if(o){for(c=new Array(u),g=0;g1?i[o-1]:void 0,u=o>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(o--,l):void 0,u&&t(i[0],i[1],u)&&(l=o<3?void 0:l,o=1),a=Object(a);++s-1;)y!==l&&s.call(y,p,1),s.call(l,p,1);return l}return Rl=o,Rl}var xl,qm;function KA(){if(qm)return xl;qm=1;var e=VA();function t(r,n){return r&&r.length&&n&&n.length?e(r,n):r}return xl=t,xl}var ql,jm;function BA(){if(jm)return ql;jm=1;var e=Yr();function t(r){return typeof r=="function"?r:e}return ql=t,ql}var jl,Nm;function _b(){if(Nm)return jl;Nm=1;var e=kv(),t=ib(),r=BA(),n=Ue();function a(i,s){var o=n(i)?e:t;return o(i,r(s))}return jl=a,jl}var Nl,Dm;function zA(){if(Dm)return Nl;Dm=1;var e=$a(),t=_c(),r=Sc(),n=zt(),a=Bt(),i=Pa(),s=200;function o(l,u,c,h){var g=-1,v=t,b=!0,y=l.length,p=[],f=u.length;if(!y)return p;c&&(u=n(u,a(c))),h?(v=r,b=!1):u.length>=s&&(v=i,b=!1,u=new e(u));e:for(;++gn(t(y.map(c))),l=(y,p)=>y.map(f=>f&&f[p]),u=(y,p)=>Object.prototype.hasOwnProperty.call(y,p),c=y=>r(y)||Array.isArray(y)?Object.keys(y):[],h=y=>y!==void 0,g=y=>r(y)||y===!0||y===!1,v=y=>!c(y).length&&y!==!1&&y!==!0;return Fl={allUniqueKeys:o,deleteUndefinedProps:s,getValues:l,has:u,isEmptySchema:v,isSchema:g,keys:c,notUndefined:h,uniqWith:a,withoutArr:(y,...p)=>i.apply(null,[y].concat(e(p)))},Fl}var Ml,km;function HA(){if(km)return Ml;km=1;const e=Oc(),t=_b(),{allUniqueKeys:r,deleteUndefinedProps:n,getValues:a,keys:i,notUndefined:s,uniqWith:o,withoutArr:l}=Sb();function u(h){t(h,function(g,v){g===!1&&delete h[v]})}function c(h,g){return r(h).reduce(function(b,y){const p=a(h,y),f=o(p.filter(s),e);return b[y]=g(f,y),b},{})}return Ml={keywords:["properties","patternProperties","additionalProperties"],resolver(h,g,v,b){b.ignoreAdditionalProperties||(h.forEach(function(p){const f=h.filter(S=>S!==p),d=i(p.properties),_=i(p.patternProperties).map(S=>new RegExp(S));f.forEach(function(S){const w=i(S.properties),$=w.filter(E=>_.some(R=>R.test(E)));l(w,d,$).forEach(function(E){S.properties[E]=v.properties([S.properties[E],p.additionalProperties],E)})})}),h.forEach(function(p){const f=h.filter(m=>m!==p),d=i(p.patternProperties);p.additionalProperties===!1&&f.forEach(function(m){const _=i(m.patternProperties);l(_,d).forEach(w=>delete m.patternProperties[w])})}));const y={additionalProperties:v.additionalProperties(h.map(p=>p.additionalProperties)),patternProperties:c(h.map(p=>p.patternProperties),v.patternProperties),properties:c(h.map(p=>p.properties),v.properties)};return y.additionalProperties===!1&&u(y.properties),n(y)}},Ml}var kl,Lm;function GA(){if(Lm)return kl;Lm=1;const e=Oc(),t=_b(),{allUniqueKeys:r,deleteUndefinedProps:n,has:a,isSchema:i,notUndefined:s,uniqWith:o}=Sb();function l(g){t(g,function(v,b){v===!1&&g.splice(b,1)})}function u(g,v){return g.map(function(b){if(b)if(Array.isArray(b.items)){const y=b.items[v];if(i(y))return y;if(a(b,"additionalItems"))return b.additionalItems}else return b.items})}function c(g){return g.map(function(v){if(v)return Array.isArray(v.items)?v.additionalItems:v.items})}function h(g,v,b){return r(b).reduce(function(p,f){const d=u(g,f),m=o(d.filter(s),e);return p[f]=v(m,f),p},[])}return kl={keywords:["items","additionalItems"],resolver(g,v,b){const y=g.map(m=>m.items),p=y.filter(s),f={};p.every(i)?f.items=b.items(y):f.items=h(g,b.items,y);let d;return p.every(Array.isArray)?d=g.map(m=>m.additionalItems):p.some(Array.isArray)&&(d=c(g)),d&&(f.additionalItems=b.additionalItems(d)),f.additionalItems===!1&&Array.isArray(f.items)&&l(f.items),n(f)}},kl}var Ll,Um;function YA(){if(Um)return Ll;Um=1;const e=FE(),t=Oc(),r=qA(),n=kA(),a=vb(),i=bb(),s=LA(),o=fb(),l=eb(),u=Aa(),c=KA(),h=ob(),g=wc(),v=$c(),b=HA(),y=GA(),p=(B,G)=>B.indexOf(G)!==-1,f=B=>u(B)||B===!0||B===!1,d=B=>B===!1,m=B=>B===!0,_=(B,G,C)=>C(B),S=B=>h(g(i(B))),w=B=>B!==void 0,$=B=>g(i(B.map(Y))),O=B=>B[0],E=B=>S(B),R=B=>Math.max.apply(Math,B),q=B=>Math.min.apply(Math,B),M=B=>B.some(m),I=B=>v(a(B),l);function L(B){return function(G,C){return t({[B]:G},{[B]:C})}}function k(B){let{allOf:G=[],...C}=B;return C=u(B)?C:B,[C,...G.map(k)]}function J(B,G){return B.map(C=>C&&C[G])}function X(B,G){return B.map(function(C,x){try{return G(C,x)}catch{return}}).filter(w)}function Y(B){return u(B)||Array.isArray(B)?Object.keys(B):[]}function ne(B,G){if(G=G||[],!B.length)return G;const C=B.slice(0).shift(),x=B.slice(1);return G.length?ne(x,a(G.map(F=>C.map(z=>[z].concat(F))))):ne(x,C.map(F=>F))}function K(B,G){let C;try{C=B.map(function(x){return JSON.stringify(x,null,2)}).join(` `)}catch{C=B.join(", ")}throw new Error('Could not resolve values for path:"'+G.join(".")+`". They are probably incompatible. Values: `+C)}function j(B,G,C,x,F,z){if(B.length){const W=F.complexResolvers[G];if(!W||!W.resolver)throw new Error("No resolver found for "+G);const Z=C.map(re=>B.reduce((de,ie)=>(re[ie]!==void 0&&(de[ie]=re[ie]),de),{})),ee=v(Z,t),ce=W.keywords.reduce((re,de)=>({...re,[de]:(ie,ue=[])=>x(ie,null,z.concat(de,ue))}),{}),se=W.resolver(ee,z.concat(G),ce,F);return u(se)||K(ee,z.concat(G)),se}}function V(B){return{required:B}}const N=["properties","patternProperties","definitions","dependencies"],P=["anyOf","oneOf"],T=["additionalProperties","additionalItems","contains","propertyNames","not","items"],D={type(B){if(B.some(Array.isArray)){const G=B.map(function(x){return Array.isArray(x)?x:[x]}),C=s.apply(null,G);if(C.length===1)return C[0];if(C.length>1)return g(C)}},dependencies(B,G,C){return $(B).reduce(function(F,z){const W=J(B,z);let Z=v(W.filter(w),l);const ee=Z.filter(Array.isArray);if(ee.length){if(ee.length===Z.length)F[z]=S(Z);else{const ce=Z.filter(f),se=ee.map(V);F[z]=C(ce.concat(se),z)}return F}return Z=v(Z,t),F[z]=C(Z,z),F},{})},oneOf(B,G,C){const x=ne(e(B)),F=X(x,C),z=v(F,t);if(z.length)return z},not(B){return{anyOf:B}},pattern(B){return B.map(G=>"(?="+G+")").join("")},multipleOf(B){let G=B.slice(0),C=1;for(;G.some(x=>!Number.isInteger(x));)G=G.map(x=>x*10),C=C*10;return r(G)/C},enum(B){const G=o.apply(null,B.concat(l));if(G.length)return h(G)}};D.$id=O,D.$ref=O,D.$schema=O,D.additionalItems=_,D.additionalProperties=_,D.anyOf=D.oneOf,D.contains=_,D.default=O,D.definitions=D.dependencies,D.description=O,D.examples=I,D.exclusiveMaximum=q,D.exclusiveMinimum=R,D.items=y,D.maximum=q,D.maxItems=q,D.maxLength=q,D.maxProperties=q,D.minimum=R,D.minItems=R,D.minLength=R,D.minProperties=R,D.properties=b,D.propertyNames=_,D.required=E,D.title=O,D.uniqueItems=M;const U={properties:b,items:y};function Q(B,G,C){G=n(G,{ignoreAdditionalProperties:!1,resolvers:D,complexResolvers:U,deep:!0});const x=Object.entries(G.complexResolvers);function F(Z,ee,ce){Z=e(Z.filter(w)),ce=ce||[];const se=u(ee)?ee:{};if(!Z.length)return;if(Z.some(d))return!1;if(Z.every(m))return!0;Z=Z.filter(u);const re=$(Z);if(G.deep&&p(re,"allOf"))return Q({allOf:Z},G);const de=x.map(([ie,ue])=>re.filter(Ae=>ue.keywords.includes(Ae)));return de.forEach(ie=>c(re,ie)),re.forEach(function(ie){const ue=J(Z,ie),Ae=v(ue.filter(w),L(ie));if(Ae.length===1&&p(P,ie))se[ie]=Ae[0].map(Te=>F([Te],Te));else if(Ae.length===1&&!p(N,ie)&&!p(T,ie))se[ie]=Ae[0];else{const Te=G.resolvers[ie]||G.resolvers.defaultResolver;if(!Te)throw new Error("No resolver found for key "+ie+". You can provide a resolver for this keyword in the options, or provide a default resolver.");const Ve=(Xe,je=[])=>F(Xe,null,ce.concat(ie,je));se[ie]=Te(Ae,ce.concat(ie),Ve,G),se[ie]===void 0?K(Ae,ce.concat(ie)):se[ie]===void 0&&delete se[ie]}}),x.reduce((ie,[ue,Ae],Te)=>({...ie,...j(de[Te],ue,Z,F,G,ce)}),se)}const z=i(k(B));return F(z)}return Q.options={resolvers:D},Ll=Q,Ll}var JA=YA();const XA=Lr(JA);function nr(e){let t;const r=ae(e,"discriminator.propertyName",void 0);return ha(r)?t=r:r!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function qr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":e==null?"null":typeof e=="boolean"?"boolean":isNaN(e)?typeof e=="object"?"object":"string":"number"}var ZA=Qu(function(e){return Dv(Wr(e,1,ea,!0))});function mt(e){let{type:t}=e;return!t&&e.const?qr(e.const):!t&&e.enum?"string":!t&&(e.properties||e.additionalProperties)?"object":(Array.isArray(t)&&(t.length===2&&t.includes("null")?t=t.find(r=>r!=="null"):t=t[0]),t)}function gt(e,t){const r=Object.assign({},e);return Object.keys(t).reduce((n,a)=>{const i=e?e[a]:{},s=t[a];return e&&a in e&&he(s)?n[a]=gt(i,s):e&&t&&(mt(e)==="object"||mt(t)==="object")&&a===iS&&Array.isArray(i)&&Array.isArray(s)?n[a]=ZA(i,s):n[a]=s,n},r)}function Le(e,t,r={},n,a){return tt(e,t,r,n,void 0,void 0,a)[0]}function QA(e,t,r,n,a,i,s){const{if:o,then:l,else:u,...c}=t,h=e.isValid(o,i||{},r);let g=[c],v=[];if(n)l&&typeof l!="boolean"&&(v=v.concat(tt(e,l,r,i,n,a,s))),u&&typeof u!="boolean"&&(v=v.concat(tt(e,u,r,i,n,a,s)));else{const b=h?l:u;b&&typeof b!="boolean"&&(v=v.concat(tt(e,b,r,i,n,a,s)))}return v.length&&(g=v.map(b=>gt(c,b))),g.flatMap(b=>tt(e,b,r,i,n,a,s))}function wb(e){return e.reduce((r,n)=>n.length>1?n.flatMap(a=>Rv(r.length,i=>[...r[i]].concat(a))):(r.forEach(a=>a.push(n[0])),r),[[]])}function eC(e,t,r,n,a,i,s){const o=$b(e,t,r,n,a,i);if(o.length>1||o[0]!==t)return o;if(na in t)return Pb(e,t,r,n,a,i).flatMap(u=>tt(e,u,r,i,n,a,s));if(ir in t&&Array.isArray(t.allOf)){const l=t.allOf.map(c=>tt(e,c,r,i,n,a,s));return wb(l).map(c=>({...t,allOf:c}))}return[t]}function $b(e,t,r,n,a,i,s){const o=jr(t,r,a);return o!==t?tt(e,o,r,i,n,a,s):[t]}function jr(e,t,r){if(!he(e))return e;let n=e;if(Ce in n){const{$ref:a,...i}=n;if(r.includes(a))return n;r.push(a),n={...Sv(a,t),...i}}if(Oe in n){const a=[],i=vO(n[Oe],(s,o,l)=>{const u=[...r];s[l]=jr(o,t,u),a.push(u)},{});$O(r,jO(OO(a))),n={...n,[Oe]:i}}return Ot in n&&!Array.isArray(n.items)&&typeof n.items!="boolean"&&(n={...n,items:jr(n.items,t,r)}),Pe(e,n)?e:n}function tC(e,t,r,n,a){const i={...t,properties:{...t.properties}},s=n&&he(n)?n:{};return Object.keys(s).forEach(o=>{if(o in i.properties)return;let l={};typeof i.additionalProperties!="boolean"?Ce in i.additionalProperties?l=Le(e,{$ref:ae(i.additionalProperties,[Ce])},r,s,a):"type"in i.additionalProperties?l={...i.additionalProperties}:Ge in i.additionalProperties||ke in i.additionalProperties?l={type:"object",...i.additionalProperties}:l={type:qr(ae(s,[o]))}:l={type:qr(ae(s,[o]))},i.properties[o]=l,xe(i.properties,[o,Ur],!0)}),i}function tt(e,t,r,n,a=!1,i=[],s){return he(t)?eC(e,t,r,a,i,n,s).flatMap(l=>{var u;let c=l;if(nS in c)return QA(e,c,r,a,i,n,s);if(ir in c){if(a){const{allOf:g,...v}=c;return[...g,v]}try{const g=[],v=[];(u=c.allOf)===null||u===void 0||u.forEach(b=>{typeof b=="object"&&b.contains?g.push(b):v.push(b)}),g.length&&(c={...c,allOf:v}),c=s?s(c):XA(c,{deep:!1}),g.length&&(c.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf: `,g);const{allOf:v,...b}=c;return b}}return fu in c&&c.additionalProperties!==!1?tC(e,c,r,n,s):c}):[{}]}function rC(e,t,r,n,a){let i;const{oneOf:s,anyOf:o,...l}=t;if(Array.isArray(s)?i=s:Array.isArray(o)&&(i=o),i){const u=a===void 0&&n?{}:a,c=nr(t);i=i.map(g=>jr(g,r,[]));const h=Xu(e,u,i,r,c);if(n)return i.map(g=>gt(l,g));t=gt(l,i[h])}return[t]}function Pb(e,t,r,n,a,i,s){const{dependencies:o,...l}=t;return rC(e,l,r,n,i).flatMap(c=>Ob(e,o,c,r,n,a,i,s))}function Ob(e,t,r,n,a,i,s,o){let l=[r];for(const u in t){if(!a&&ae(s,[u])===void 0||r.properties&&!(u in r.properties))continue;const[c,h]=Yu(u,t);return Array.isArray(h)?l[0]=nC(r,h):he(h)&&(l=aC(e,r,n,u,h,a,i,s,o)),l.flatMap(g=>Ob(e,c,g,n,a,i,s,o))}return l}function nC(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function aC(e,t,r,n,a,i,s,o,l){return tt(e,a,r,o,i,s,l).flatMap(c=>{const{oneOf:h,...g}=c;if(t=gt(t,g),h===void 0)return t;const v=h.map(y=>typeof y=="boolean"||!(Ce in y)?[y]:$b(e,y,r,i,s,o));return wb(v).flatMap(y=>iC(e,t,r,n,y,i,s,o,l))})}function iC(e,t,r,n,a,i,s,o,l){const u=a.filter(c=>{if(typeof c=="boolean"||!c||!c.properties)return!1;const{[n]:h}=c.properties;if(h){const g={type:"object",properties:{[n]:h}};return e.isValid(g,o,r)||i}return!1});return!i&&u.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t]):u.flatMap(c=>{const h=c,[g]=Yu(n,h.properties),v={...h,properties:g};return tt(e,v,r,o,i,s,l).map(y=>gt(t,y))})}const sC={type:"object",$id:aS,properties:{__not_really_there__:{type:"number"}}};function bu(e,t,r,n,a){let i=0;return r&&(we(r.properties)?i+=nO(r.properties,(s,o,l)=>{const u=ae(n,l);if(typeof o=="boolean")return s;if(De(o,Ce)){const c=Le(e,o,t,u,a);return s+bu(e,t,c,u||{},a)}if((De(o,ke)||De(o,Ge))&&u){const c=De(o,ke)?ke:Ge,h=nr(o);return s+Nr(e,t,u,ae(o,c),-1,h,a)}if(o.type==="object")return we(u)&&(s+=1),s+bu(e,t,o,u,a);if(o.type===qr(u)){let c=s+1;return o.default?c+=u===o.default?1:-1:o.const&&(c+=u===o.const?1:-1),c}return s},0):ha(r.type)&&r.type===qr(n)&&(i+=1)),i}function Nr(e,t,r,n,a=-1,i,s){const o=n.map(g=>jr(g,t,[])),l=xv(r,n,i);if($v(l))return l;const u=o.reduce((g,v,b)=>(Xu(e,r,[sC,v],t,i)===1&&g.push(b),g),[]);if(u.length===1)return u[0];u.length||Rv(o.length,g=>u.push(g));const c=new Set,{bestIndex:h}=u.reduce((g,v)=>{const{bestScore:b}=g,y=o[v],p=bu(e,t,y,r,s);return c.add(p),p>b?{bestIndex:v,bestScore:p}:g},{bestIndex:a,bestScore:0});return c.size===1&&a>=0?a:h}function _u(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(t=>he(t))}function Ar(e){return e==null}function Dr(e,t,r=!1,n=!1,a=!1){if(Array.isArray(t)){const i=Array.isArray(e)?e:[],s=a?i:t,o=a?t:i,l=s.map((u,c)=>o[c]!==void 0?Dr(i[c],t[c],r,n,a):u);return(r||a)&&l.length{const l=ae(t,o),u=he(e)&&o in e,c=o in t;return s[o]=Dr(e?ae(e,o):{},l,r,n,a&&(u||!c)),s},i)}return n&&(!Ar(e)&&Ar(t)||typeof t=="number"&&isNaN(t))||a&&!Ar(t)?e:t}function ft(e,t,r=!1){return Object.keys(t).reduce((n,a)=>{const i=e?e[a]:{},s=t[a];if(e&&a in e&&he(s))n[a]=ft(i,s,r);else if(r&&Array.isArray(i)&&Array.isArray(s)){let o=s;r==="preventDuplicates"&&(o=s.reduce((l,u)=>(i.includes(u)||l.push(u),l),[])),n[a]=i.concat(o)}else n[a]=s;return n},Object.assign({},e))}function Eb(e){return Array.isArray(e.enum)&&e.enum.length===1||ht in e}function Ac(e,t,r={},n){const a=Le(e,t,r,void 0,n),i=a.oneOf||a.anyOf;return Array.isArray(a.enum)?!0:Array.isArray(i)?i.every(s=>typeof s!="boolean"&&Eb(s)):!1}function Cc(e,t,r,n){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:Ac(e,t.items,r,n)}function Ab(e){const t=e[ht],r=mt(e);return he(t)&&ha(t?.$data)&&r!=="object"&&r!=="array"}function oC(e){if(rS in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(ht in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Fr(e,t){const r=e;if(e.enum){let i;if(t){const{enumNames:s}=pe(t);i=s}return!i&&r.enumNames&&(i=r.enumNames),e.enum.map((s,o)=>({label:i?.[o]||String(s),value:s}))}let n,a;return e.anyOf?(n=e.anyOf,a=t?.anyOf):e.oneOf&&(n=e.oneOf,a=t?.oneOf),n&&n.map((i,s)=>{const{title:o}=pe(a?.[s]),l=i,u=oC(l),c=o||l.title||String(u);return{schema:l,label:c,value:u}})}const lC=["string","number","integer","boolean","null"];var ar;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(ar||(ar={}));function Ul(e,t=ar.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&rEt(e,_,{rootSchema:i,includeUndefinedValues:s,_recurseList:o,experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:u,parentDefaults:Array.isArray(n)?n[S]:void 0,rawFormData:g,required:c,shouldMergeDefaultsIntoFormData:h}));else if(ke in v){const{oneOf:_,...S}=v;if(_.length===0)return;const w=nr(v),{type:$="null"}=S;!Array.isArray($)&&lC.includes($)&&p?.constAsDefaults==="skipOneOf"&&(p={...p,constAsDefaults:"never"}),y=_[Nr(e,i,a??v.default,_,0,w,u)],y=gt(S,y)}else if(Ge in v){const{anyOf:_,...S}=v;if(_.length===0)return;const w=nr(v);y=_[Nr(e,i,a??v.default,_,0,w,u)],y=gt(S,y)}if(y)return Et(e,y,{rootSchema:i,includeUndefinedValues:s,_recurseList:f,experimental_defaultFormStateBehavior:p,experimental_customMergeAllOf:u,parentDefaults:b,rawFormData:a??g,required:c,shouldMergeDefaultsIntoFormData:h});b===void 0&&(b=v.default);const d=Km(e,v,r,b);let m=d??b;if(h){const{arrayMinItems:_={}}=l||{},{mergeExtraDefaults:S}=_,w=uC(e,v,i,a,l,u);(!he(a)||ir in v)&&(m=Dr(m,w,S,!0))}return m}function uC(e,t,r,n,a,i){const s=!Eb(t)&&Ac(e,t,r,i);let o=n;if(s){const u=Fr(t);o=u?.some(h=>Pe(h.value,n))?n:void 0}return t[ht]&&a?.constAsDefaults==="always"&&(o=t.const),o}function cC(e,t,{rawFormData:r,rootSchema:n={},includeUndefinedValues:a=!1,_recurseList:i=[],experimental_defaultFormStateBehavior:s=void 0,experimental_customMergeAllOf:o=void 0,required:l,shouldMergeDefaultsIntoFormData:u}={},c){{const h=he(r)?r:{},g=t,v=s?.allOf==="populateDefaults"&&ir in g?Le(e,g,n,h,o):g,b=v[ht],y=Object.keys(v.properties||{}).reduce((p,f)=>{var d;const m=ae(v,[Oe,f]),_=he(b)&&b[f]!==void 0,S=(he(m)&&ht in m||_)&&s?.constAsDefaults!=="never"&&!Ab(m),w=Et(e,m,{rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,includeUndefinedValues:a===!0,parentDefaults:ae(c,[f]),rawFormData:ae(h,[f]),required:(d=v.required)===null||d===void 0?void 0:d.includes(f),shouldMergeDefaultsIntoFormData:u});return Vm(p,f,w,a,l,v.required,s,S),p},{});if(v.additionalProperties){const p=he(v.additionalProperties)?v.additionalProperties:{},f=new Set;he(c)&&Object.keys(c).filter(m=>!v.properties||!v.properties[m]).forEach(m=>f.add(m));const d=[];Object.keys(h).filter(m=>!v.properties||!v.properties[m]).forEach(m=>{f.add(m),d.push(m)}),f.forEach(m=>{var _;const S=Et(e,p,{rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,includeUndefinedValues:a===!0,parentDefaults:ae(c,[m]),rawFormData:ae(h,[m]),required:(_=v.required)===null||_===void 0?void 0:_.includes(m),shouldMergeDefaultsIntoFormData:u});Vm(y,m,S,a,l,d)})}return y}}function dC(e,t,{rawFormData:r,rootSchema:n={},_recurseList:a=[],experimental_defaultFormStateBehavior:i=void 0,experimental_customMergeAllOf:s=void 0,required:o,shouldMergeDefaultsIntoFormData:l}={},u){var c,h;const g=t,v=(c=i?.arrayMinItems)!==null&&c!==void 0?c:{},{populate:b,mergeExtraDefaults:y}=v,p=b==="never",f=b==="requiredOnly",d=b==="all"||!p&&!f,m=(h=v?.computeSkipPopulate)!==null&&h!==void 0?h:(()=>!1),S=i?.emptyObjectFields==="skipEmptyDefaults"?void 0:[];if(Array.isArray(u)&&(u=u.map((M,I)=>{const L=Ul(g,ar.Fallback,I);return Et(e,L,{rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,parentDefaults:M,required:o,shouldMergeDefaultsIntoFormData:l})})),Array.isArray(r)){const M=Ul(g);if(p)u=r;else{const I=r.map((k,J)=>Et(e,M,{rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,rawFormData:k,parentDefaults:ae(u,[J]),required:o,shouldMergeDefaultsIntoFormData:l}));u=Dr(u,I,(f&&o||d)&&y)}}if((he(g)&&ht in g&&i?.constAsDefaults!=="never")===!1){if(p)return u??S;if(f&&!o)return u||void 0}const $=Array.isArray(u)?u.length:0;if(!g.minItems||Cc(e,g,n,s)||m(e,g,n)||g.minItems<=$)return u||S;const O=u||[],E=Ul(g,ar.Invert),R=E.default,q=new Array(g.minItems-$).fill(Et(e,E,{parentDefaults:R,rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,required:o,shouldMergeDefaultsIntoFormData:l}));return O.concat(q)}function Km(e,t,r={},n){switch(mt(t)){case"object":return cC(e,t,r,n);case"array":return dC(e,t,r,n)}}function Cb(e,t,r,n,a=!1,i,s){if(!he(t))throw new Error("Invalid schema: "+t);const o=Le(e,t,n,r,s),l=Et(e,o,{rootSchema:n,includeUndefinedValues:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,rawFormData:r,shouldMergeDefaultsIntoFormData:!0});if(he(r)||Array.isArray(r)){const{mergeDefaultsIntoFormData:u}=i||{};return Dr(l,r,!0,u==="useDefaultIfFormDataUndefined",!0)}return l}function Ib(e={}){return"widget"in pe(e)&&pe(e).widget!=="hidden"}function Tb(e,t,r={},n,a){if(r[ju]==="files")return!0;if(t.items){const i=Le(e,t.items,n,void 0,a);return i.type==="string"&&i.format==="data-url"}return!1}function fC(e,t,r={},n,a,i){const s=pe(r,a),{label:o=!0}=s;let l=!!o;const u=mt(t);return u==="array"&&(l=Cc(e,t,n,i)||Tb(e,t,r,n,i)||Ib(r)),u==="object"&&(l=!1),u==="boolean"&&!r[ju]&&(l=!1),r[sS]&&(l=!1),l}function pC(e,t,r){if(!r)return t;const{errors:n,errorSchema:a}=t;let i=e.toErrorList(r),s=r;return rr(a)||(s=ft(a,r,!0),i=[...n].concat(i)),{errorSchema:s,errors:i}}const Yt=Symbol("no Value");function Su(e,t,r,n,a={},i){let s;if(De(r,Oe)){const o={};if(De(n,Oe)){const c=ae(n,Oe,{});Object.keys(c).forEach(h=>{De(a,h)&&(o[h]=void 0)})}const l=Object.keys(ae(r,Oe,{})),u={};l.forEach(c=>{const h=ae(a,c);let g=ae(n,[Oe,c],{}),v=ae(r,[Oe,c],{});De(g,Ce)&&(g=Le(e,g,t,h,i)),De(v,Ce)&&(v=Le(e,v,t,h,i));const b=ae(g,"type"),y=ae(v,"type");if(!b||b===y)if(De(o,c)&&delete o[c],y==="object"||y==="array"&&Array.isArray(h)){const p=Su(e,t,v,g,h,i);(p!==void 0||y==="array")&&(u[c]=p)}else{const p=ae(v,"default",Yt),f=ae(g,"default",Yt);p!==Yt&&p!==h&&(f===h?o[c]=p:ae(v,"readOnly")===!0&&(o[c]=void 0));const d=ae(v,"const",Yt),m=ae(g,"const",Yt);d!==Yt&&d!==h&&(o[c]=m===h?d:void 0)}}),s={...typeof a=="string"||Array.isArray(a)?void 0:a,...o,...u}}else if(ae(n,"type")==="array"&&ae(r,"type")==="array"&&Array.isArray(a)){let o=ae(n,"items"),l=ae(r,"items");if(typeof o=="object"&&typeof l=="object"&&!Array.isArray(o)&&!Array.isArray(l)){De(o,Ce)&&(o=Le(e,o,t,a,i)),De(l,Ce)&&(l=Le(e,l,t,a,i));const u=ae(o,"type"),c=ae(l,"type");if(!u||u===c){const h=ae(r,"maxItems",-1);c==="object"?s=a.reduce((g,v)=>{const b=Su(e,t,l,o,v,i);return b!==void 0&&(h<0||g.length0&&a.length>h?a.slice(0,h):a}}else typeof o=="boolean"&&typeof l=="boolean"&&o===l&&(s=a)}return s}function Bn(e,t,r,n,a,i,s,o=[],l){if(Ce in t||na in t||ir in t){const h=Le(e,t,i,s,l);if(o.findIndex(v=>Pe(v,h))===-1)return Bn(e,h,r,n,a,i,s,o.concat(h),l)}if(Ot in t&&!ae(t,[Ot,Ce]))return Bn(e,ae(t,Ot),r,n,a,i,s,o,l);const c={$id:a||r};if(mt(t)==="object"&&Oe in t)for(const h in t.properties){const g=ae(t,[Oe,h]),v=c[Pt]+n+h;c[h]=Bn(e,he(g)?g:{},r,n,v,i,ae(s,[h]),o,l)}return c}function hC(e,t,r,n,a,i="root",s="_",o){return Bn(e,t,i,s,r,n,a,void 0,o)}function Nt(e,t,r,n,a,i=[],s){if(Ce in t||na in t||ir in t){const l=Le(e,t,n,a,s);if(i.findIndex(c=>Pe(c,l))===-1)return Nt(e,l,r,n,a,i.concat(l),s)}let o={[Kn]:r.replace(/^\./,"")};if(ke in t||Ge in t){const l=ke in t?t.oneOf:t.anyOf,u=nr(t),c=Nr(e,n,a,l,0,u,s),h=l[c];o={...o,...Nt(e,h,r,n,a,i,s)}}if(fu in t&&t[fu]!==!1&&xe(o,qu,!0),Ot in t&&Array.isArray(a)){const{items:l,additionalItems:u}=t;Array.isArray(l)?a.forEach((c,h)=>{l[h]?o[h]=Nt(e,l[h],`${r}.${h}`,n,c,i,s):u?o[h]=Nt(e,u,`${r}.${h}`,n,c,i,s):console.warn(`Unable to generate path schema for "${r}.${h}". No schema defined for it`)}):a.forEach((c,h)=>{o[h]=Nt(e,l,`${r}.${h}`,n,c,i,s)})}else if(Oe in t)for(const l in t.properties){const u=ae(t,[Oe,l]);o[l]=Nt(e,u,`${r}.${l}`,n,ae(a,[l]),i,s)}return o}function mC(e,t,r="",n,a,i){return Nt(e,t,r,n,a,void 0,i)}class gC{constructor(t,r,n,a){this.rootSchema=r,this.validator=t,this.experimental_defaultFormStateBehavior=n,this.experimental_customMergeAllOf=a}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,r,n={},a){return!t||!r?!1:this.validator!==t||!Pe(this.rootSchema,r)||!Pe(this.experimental_defaultFormStateBehavior,n)||this.experimental_customMergeAllOf!==a}getDefaultFormState(t,r,n=!1){return Cb(this.validator,t,r,this.rootSchema,n,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(t,r,n){return fC(this.validator,t,r,this.rootSchema,n,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,r,n,a){return Nr(this.validator,this.rootSchema,t,r,n,a,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,r,n){return Xu(this.validator,t,r,this.rootSchema,n)}getMatchingOption(t,r,n){return qv(this.validator,t,r,this.rootSchema,n)}isFilesArray(t,r){return Tb(this.validator,t,r,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return Cc(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return Ac(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(t,r){return pC(this.validator,t,r)}retrieveSchema(t,r){return Le(this.validator,t,this.rootSchema,r,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(t,r,n){return Su(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}toIdSchema(t,r,n,a="root",i="_"){return hC(this.validator,t,r,this.rootSchema,n,a,i,this.experimental_customMergeAllOf)}toPathSchema(t,r,n){return mC(this.validator,t,r,this.rootSchema,n,this.experimental_customMergeAllOf)}}function yC(e,t,r={},n){return new gC(e,t,r,n)}function vC(e){var t;if(e.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const n=e.slice(5).split(";base64,");if(n.length!==2)throw new Error("File is invalid: dataURI must be base64");const[a,i]=n,[s,...o]=a.split(";"),l=s||"",u=decodeURI(((t=o.map(c=>c.split("=")).find(([c])=>c==="name"))===null||t===void 0?void 0:t[1])||"unknown");try{const c=atob(i),h=new Array(c.length);for(let v=0;v 0, got one of each`);if(e>t)return Rb(t,e).reverse();const r=[];for(let n=e;n<=t;n++)r.push({value:n,label:$t(n,2)});return r}function bC(e,t){let r=e;if(Array.isArray(t)){const n=r.split(/(%\d)/);t.forEach((a,i)=>{const s=n.findIndex(o=>o===`%${i+1}`);s>=0&&(n[s]=a)}),r=n.join("")}return r}function _C(e,t){return bC(e,t)}function rt(e,t=[],r){if(Array.isArray(e))return e.map(i=>rt(i,t)).filter(i=>i!==r);const n=e===""||e===null?-1:Number(e),a=t[n];return a?a.value:r}function SC(e,t,r=[]){const n=rt(e,r);return Array.isArray(t)?t.filter(a=>!Pe(a,n)):Pe(n,t)?void 0:t}function Ic(e,t){return Array.isArray(t)?t.some(r=>Pe(r,e)):Pe(t,e)}function wC(e,t=[],r=!1){const n=t.map((a,i)=>Ic(a.value,e)?String(i):void 0).filter(a=>typeof a<"u");return r?n:n[0]}function $C(e,t,r=[]){const n=rt(e,r);if(!Ar(n)){const a=r.findIndex(o=>n===o.value),i=r.map(({value:o})=>o);return t.slice(0,a).concat(n,t.slice(a)).sort((o,l)=>+(i.indexOf(o)>i.indexOf(l)))}return t}var PC=1,OC=4;function xb(e){return Er(e,PC|OC)}function EC(e,t,r,n){return n=typeof n=="function"?n:void 0,e==null?e:Zu(e,t,r,n)}class AC{constructor(t){this.errorSchema={},this.resetAllErrors(t)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(t){let n=Array.isArray(t)&&t.length>0||typeof t=="string"?ae(this.errorSchema,t):this.errorSchema;return!n&&t&&(n={},EC(this.errorSchema,t,n,Object)),n}resetAllErrors(t){return this.errorSchema=t?xb(t):{},this}addErrors(t,r){const n=this.getOrCreateErrorBlock(r);let a=ae(n,Me);return Array.isArray(a)||(a=[],n[Me]=a),Array.isArray(t)?xe(n,Me,[...new Set([...a,...t])]):xe(n,Me,[...new Set([...a,t])]),this}setErrors(t,r){const n=this.getOrCreateErrorBlock(r),a=Array.isArray(t)?[...new Set([...t])]:[t];return xe(n,Me,a),this}clearErrors(t){const r=this.getOrCreateErrorBlock(t);return xe(r,Me,[]),this}}function CC(e,t,r=[1900,new Date().getFullYear()+2],n="YMD"){const{day:a,month:i,year:s,hour:o,minute:l,second:u}=e,c={type:"day",range:[1,31],value:a},h={type:"month",range:[1,12],value:i},g={type:"year",range:r,value:s},v=[];switch(n){case"MDY":v.push(h,c,g);break;case"DMY":v.push(c,h,g);break;default:v.push(g,h,c)}return t&&v.push({type:"hour",range:[0,23],value:o},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:u}),v}function IC(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||e.minimum===0)&&(t.min=e.minimum),(e.maximum||e.maximum===0)&&(t.max=e.maximum),t}function qb(e,t,r={},n=!0){const a={type:t||"text",...IC(e)};return r.inputType?a.type=r.inputType:t||(e.type==="number"?(a.type="number",n&&a.step===void 0&&(a.step="any")):e.type==="integer"&&(a.type="number",a.step===void 0&&(a.step=1))),r.autocomplete&&(a.autoComplete=r.autocomplete),r.accept&&(a.accept=r.accept),a}const Bm={props:{disabled:!1},submitText:"Submit",norender:!1};function TC(e={}){const t=pe(e);if(t&&t[Yn]){const r=t[Yn];return{...Bm,...r}}return Bm}function ye(e,t,r={}){const{templates:n}=t;return e==="ButtonTemplates"?n[e]:r[e]||n[e]}var Vl={exports:{}},ge={};var zm;function RC(){if(zm)return ge;zm=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function y(p){if(typeof p=="object"&&p!==null){var f=p.$$typeof;switch(f){case e:switch(p=p.type,p){case r:case a:case n:case u:case c:return p;default:switch(p=p&&p.$$typeof,p){case o:case s:case l:case g:case h:case i:return p;default:return f}}case t:return f}}}return ge.ContextConsumer=s,ge.ContextProvider=i,ge.Element=e,ge.ForwardRef=l,ge.Fragment=r,ge.Lazy=g,ge.Memo=h,ge.Portal=t,ge.Profiler=a,ge.StrictMode=n,ge.Suspense=u,ge.SuspenseList=c,ge.isAsyncMode=function(){return!1},ge.isConcurrentMode=function(){return!1},ge.isContextConsumer=function(p){return y(p)===s},ge.isContextProvider=function(p){return y(p)===i},ge.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===e},ge.isForwardRef=function(p){return y(p)===l},ge.isFragment=function(p){return y(p)===r},ge.isLazy=function(p){return y(p)===g},ge.isMemo=function(p){return y(p)===h},ge.isPortal=function(p){return y(p)===t},ge.isProfiler=function(p){return y(p)===a},ge.isStrictMode=function(p){return y(p)===n},ge.isSuspense=function(p){return y(p)===u},ge.isSuspenseList=function(p){return y(p)===c},ge.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===a||p===n||p===u||p===c||p===v||typeof p=="object"&&p!==null&&(p.$$typeof===g||p.$$typeof===h||p.$$typeof===i||p.$$typeof===s||p.$$typeof===l||p.$$typeof===b||p.getModuleId!==void 0)},ge.typeOf=y,ge}var Wm;function xC(){return Wm||(Wm=1,Vl.exports=RC()),Vl.exports}var qC=xC();const Hm=Lr(qC),Kl={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function jC(e){let t=ae(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=({options:n,...a})=>A.jsx(e,{options:{...r,...n},...a}),xe(e,"MergedWidget",t)}return t}function pt(e,t,r={}){const n=mt(e);if(typeof t=="function"||t&&Hm.isForwardRef(H.createElement(t))||Hm.isMemo(t))return jC(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t}`);if(t in r){const a=r[t];return pt(e,a,r)}if(typeof n=="string"){if(!(n in Kl))throw new Error(`No widget for type '${n}'`);if(t in Kl[n]){const a=r[Kl[n][t]];return pt(e,a,r)}}throw new Error(`No widget '${t}' for type '${n}'`)}function NC(e){let t=0;for(let r=0;r(t.add(r),n)),NC(JSON.stringify(e,Array.from(t).sort()))}function FC(e,t,r={}){try{return pt(e,t,r),!0}catch(n){const a=n;if(a.message&&(a.message.startsWith("No widget")||a.message.startsWith("Unsupported widget")))return!1;throw n}}function Jr(e,t){return`${ha(e)?e:e[Pt]}__${t}`}function Xr(e){return Jr(e,"description")}function jb(e){return Jr(e,"error")}function wu(e){return Jr(e,"examples")}function Nb(e){return Jr(e,"help")}function Db(e){return Jr(e,"title")}function Ht(e,t=!1){const r=t?` ${wu(e)}`:"";return`${jb(e)} ${Xr(e)} ${Nb(e)}${r}`}function Fb(e,t){return`${e}-${t}`}function MC(e,t,r){return t?r:e}function kC(e){return e?new Date(e).toJSON():void 0}function LC(e,t){if(!Array.isArray(t))return e;const r=c=>c.reduce((h,g)=>(h[g]=!0,h),{}),n=c=>c.length>1?`properties '${c.join("', '")}'`:`property '${c[0]}'`,a=r(e),i=t.filter(c=>c==="*"||a[c]),s=r(i),o=e.filter(c=>!s[c]),l=i.indexOf("*");if(l===-1){if(o.length)throw new Error(`uiSchema order list does not contain ${n(o)}`);return i}if(l!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const u=[...i];return u.splice(l,1,...o),u}function Bl(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const r=new Date(e);if(Number.isNaN(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}}function zn(e){if(e.const||e.enum&&e.enum.length===1&&e.enum[0]===!0)return!0;if(e.anyOf&&e.anyOf.length===1)return zn(e.anyOf[0]);if(e.oneOf&&e.oneOf.length===1)return zn(e.oneOf[0]);if(e.allOf){const t=r=>zn(r);return e.allOf.some(t)}return!1}function UC(e,t,r){const{props:n,state:a}=e;return!Pe(n,t)||!Pe(a,r)}function Gm(e,t=!0){const{year:r,month:n,day:a,hour:i=0,minute:s=0,second:o=0}=e,l=Date.UTC(r,n-1,a,i,s,o),u=new Date(l).toJSON();return t?u:u.slice(0,10)}function Mr(e,t=[]){if(!e)return[];let r=[];return Me in e&&(r=r.concat(e[Me].map(n=>{const a=`.${t.join(".")}`;return{property:a,message:n,stack:`${a} ${n}`}}))),Object.keys(e).reduce((n,a)=>{if(a!==Me){const i=e[a];Ft(i)&&(n=n.concat(Mr(i,[...t,a])))}return n},r)}function Mb(e){return Ie(e)?da(e,At):Br(e)?[e]:Wu(av(sv(e)))}function VC(e){const t=new AC;return e.length&&e.forEach(r=>{const{property:n,message:a}=r,i=n==="."?[]:Mb(n);i.length>0&&i[0]===""&&i.splice(0,1),a&&t.addErrors(a,i)}),t.ErrorSchema}function Tc(e){return Object.keys(e).reduce((t,r)=>{if(r==="addError")return t;{const n=e[r];return Ft(n)?{...t,[r]:Tc(n)}:{...t,[r]:n}}},{})}function KC(e){if(!e)return"";const t=new Date(e),r=$t(t.getFullYear(),4),n=$t(t.getMonth()+1,2),a=$t(t.getDate(),2),i=$t(t.getHours(),2),s=$t(t.getMinutes(),2),o=$t(t.getSeconds(),2),l=$t(t.getMilliseconds(),3);return`${r}-${n}-${a}T${i}:${s}:${o}.${l}`}function Wn(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let a=Mr(t),i=t;return rr(n)||(i=ft(n,t,!0),a=[...r].concat(a)),{errorSchema:i,errors:a}}function BC(e){for(const t in e){const r=e,n=r[t];t===Ce&&typeof n=="string"&&n.startsWith("#")?r[t]=By+n:r[t]=Rc(n)}return e}function zC(e){for(let t=0;t=HC&&(i=Nu,s=!1,t=new Qt(t));e:for(;++a!Pe(s,ae(t,o)))),i=YC(et(t),et(e));return[...a,...i]}}var _e;(function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"})(_e||(_e={}));function XC(e,t){var r=Ie(e)?Ku:Ev;return r(e,Tv(t))}function ZC(e,t){return kb(e,t,function(r,n){return Iv(e,n)})}var Ym=bv(function(e,t){return e==null?{}:ZC(e,t)});let QC=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");function $u(){return QC()}function Jm(e){return Array.isArray(e)?e.map(t=>({key:$u(),item:t})):[]}function mr(e){return Array.isArray(e)?e.map(t=>t.item):[]}class eI extends H.Component{constructor(t){super(t);const{formData:r=[]}=t,n=Jm(r);this.state={keyedFormData:n,updatedKeyedFormData:!1}}static getDerivedStateFromProps(t,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};const n=Array.isArray(t.formData)?t.formData:[],a=r.keyedFormData||[];return{keyedFormData:n.length===a.length?a.map((s,o)=>({key:s.key,item:n[o]})):Jm(n)}}get itemTitle(){const{schema:t,registry:r}=this.props,{translateString:n}=r;return ae(t,[Ot,"title"],ae(t,[Ot,"description"],n(_e.ArrayItemTitle)))}isItemRequired(t){return Array.isArray(t.type)?!t.type.includes("null"):t.type!=="null"}canAddItem(t){const{schema:r,uiSchema:n,registry:a}=this.props;let{addable:i}=pe(n,a.globalUiOptions);return i!==!1&&(r.maxItems!==void 0?i=t.length{const{schema:t,registry:r}=this.props,{schemaUtils:n}=r;let a=t.items;return _u(t)&&eS(t)&&(a=t.additionalItems),n.getDefaultFormState(a)};_handleAddClick(t,r){t&&t.preventDefault();const{onChange:n,errorSchema:a}=this.props,{keyedFormData:i}=this.state;let s;if(a){s={};for(const u in a){const c=parseInt(u);r===void 0||c=r&&xe(s,[c+1],a[u])}}const o={key:$u(),item:this._getNewFormDataRow()},l=[...i];r!==void 0?l.splice(r,0,o):l.push(o),this.setState({keyedFormData:l,updatedKeyedFormData:!0},()=>n(mr(l),s))}onAddClick=t=>{this._handleAddClick(t)};onAddIndexClick=t=>r=>{this._handleAddClick(r,t)};onCopyIndexClick=t=>r=>{r&&r.preventDefault();const{onChange:n,errorSchema:a}=this.props,{keyedFormData:i}=this.state;let s;if(a){s={};for(const u in a){const c=parseInt(u);c<=t?xe(s,[c],a[u]):c>t&&xe(s,[c+1],a[u])}}const o={key:$u(),item:xb(i[t].item)},l=[...i];t!==void 0?l.splice(t+1,0,o):l.push(o),this.setState({keyedFormData:l,updatedKeyedFormData:!0},()=>n(mr(l),s))};onDropIndexClick=t=>r=>{r&&r.preventDefault();const{onChange:n,errorSchema:a}=this.props,{keyedFormData:i}=this.state;let s;if(a){s={};for(const l in a){const u=parseInt(l);ut&&xe(s,[u-1],a[l])}}const o=i.filter((l,u)=>u!==t);this.setState({keyedFormData:o,updatedKeyedFormData:!0},()=>n(mr(o),s))};onReorderClick=(t,r)=>n=>{n&&(n.preventDefault(),n.currentTarget.blur());const{onChange:a,errorSchema:i}=this.props;let s;if(i){s={};for(const c in i){const h=parseInt(c);h==t?xe(s,[r],i[t]):h==r?xe(s,[t],i[r]):xe(s,[c],i[h])}}const{keyedFormData:o}=this.state;function l(){const c=o.slice();return c.splice(t,1),c.splice(r,0,o[t]),c}const u=l();this.setState({keyedFormData:u},()=>a(mr(u),s))};onChangeForIndex=t=>(r,n,a)=>{const{formData:i,onChange:s,errorSchema:o}=this.props,u=(Array.isArray(i)?i:[]).map((c,h)=>t===h?typeof r>"u"?null:r:c);s(u,o&&o&&{...o,[t]:n},a)};onSelectChange=t=>{const{onChange:r,idSchema:n}=this.props;r(t,void 0,n&&n.$id)};render(){const{schema:t,uiSchema:r,idSchema:n,registry:a}=this.props,{schemaUtils:i,translateString:s}=a;if(!(Ot in t)){const o=pe(r),l=ye("UnsupportedFieldTemplate",a,o);return A.jsx(l,{schema:t,idSchema:n,reason:s(_e.MissingItems),registry:a})}return i.isMultiSelect(t)?this.renderMultiSelect():Ib(r)?this.renderCustomWidget():_u(t)?this.renderFixedArray():i.isFilesArray(t,r)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:t,uiSchema:r={},errorSchema:n,idSchema:a,name:i,title:s,disabled:o=!1,readonly:l=!1,autofocus:u=!1,required:c=!1,registry:h,onBlur:g,onFocus:v,idPrefix:b,idSeparator:y="_",rawErrors:p}=this.props,{keyedFormData:f}=this.state,d=t.title||s||i,{schemaUtils:m,formContext:_}=h,S=pe(r),w=we(t.items)?t.items:{},$=m.retrieveSchema(w),O=mr(this.state.keyedFormData),E=this.canAddItem(O),R={canAdd:E,items:f.map((M,I)=>{const{key:L,item:k}=M,J=k,X=m.retrieveSchema(w,J),Y=n?n[I]:void 0,ne=a.$id+y+I,K=m.toIdSchema(X,ne,J,b,y);return this.renderArrayFieldItem({key:L,index:I,name:i&&`${i}-${I}`,title:d?`${d}-${I+1}`:void 0,canAdd:E,canMoveUp:I>0,canMoveDown:Iw.retrieveSchema(L,n[k])),R=we(t.additionalItems)?w.retrieveSchema(t.additionalItems,n):null;(!m||m.length{const{key:J,item:X}=L,Y=X,ne=k>=E.length,K=(ne&&we(t.additionalItems)?w.retrieveSchema(t.additionalItems,Y):E[k])||{},j=o.$id+s+k,V=w.toIdSchema(K,j,Y,i,s),N=ne?r.additionalItems||{}:Array.isArray(r.items)?r.items[k]:r.items||{},P=a?a[k]:void 0;return this.renderArrayFieldItem({key:J,index:k,name:l&&`${l}-${k}`,title:_?`${_}-${k+1}`:void 0,canAdd:q,canRemove:ne,canMoveUp:k>=E.length+1,canMoveDown:ne&&kne[K]),{children:A.jsx(k,{name:a,title:m,index:n,schema:u,uiSchema:h,formData:c,formContext:q,errorSchema:v,idPrefix:w,idSeparator:$,idSchema:g,required:this.isItemRequired(u),onChange:this.onChangeForIndex(n),onBlur:y,onFocus:p,registry:R,disabled:_,readonly:O,hideError:S,autofocus:b,rawErrors:f}),className:"array-item",disabled:_,canAdd:i,hasCopy:ne.copy,hasToolbar:ne.toolbar,hasMoveUp:ne.moveUp,hasMoveDown:ne.moveDown,hasRemove:ne.remove,index:n,totalItems:d,key:r,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:O,registry:R,schema:u,uiSchema:h}}}function tI(e){const{schema:t,name:r,uiSchema:n,idSchema:a,formData:i,registry:s,required:o,disabled:l,readonly:u,hideError:c,autofocus:h,title:g,onChange:v,onFocus:b,onBlur:y,rawErrors:p}=e,{title:f}=t,{widgets:d,formContext:m,translateString:_,globalUiOptions:S}=s,{widget:w="checkbox",title:$,label:O=!0,...E}=pe(n,S),R=pt(t,w,d),q=_(_e.YesLabel),M=_(_e.NoLabel);let I;const L=$??f??g??r;if(Array.isArray(t.oneOf))I=Fr({oneOf:t.oneOf.map(k=>{if(we(k))return{...k,title:k.title||(k.const===!0?q:M)}}).filter(k=>k)},n);else{const k=t,J=t.enum??[!0,!1];!k.enumNames&&J.length===2&&J.every(X=>typeof X=="boolean")?I=[{value:J[0],label:J[0]?q:M},{value:J[1],label:J[1]?q:M}]:I=Fr({enum:J,enumNames:k.enumNames},n)}return A.jsx(R,{options:{...E,enumOptions:I},schema:t,uiSchema:n,id:a.$id,name:r,onChange:v,onFocus:b,onBlur:y,label:L,hideLabel:!O,value:i,required:o,disabled:l,readonly:u,hideError:c,registry:s,formContext:m,autofocus:h,rawErrors:p})}class Xm extends H.Component{constructor(t){super(t);const{formData:r,options:n,registry:{schemaUtils:a}}=this.props,i=n.map(s=>a.retrieveSchema(s,r));this.state={retrievedOptions:i,selectedOption:this.getMatchingOption(0,r,i)}}componentDidUpdate(t,r){const{formData:n,options:a,idSchema:i}=this.props,{selectedOption:s}=this.state;let o=this.state;if(!Pe(t.options,a)){const{registry:{schemaUtils:l}}=this.props,u=a.map(c=>l.retrieveSchema(c,n));o={selectedOption:s,retrievedOptions:u}}if(!Pe(n,t.formData)&&i.$id===t.idSchema.$id){const{retrievedOptions:l}=o,u=this.getMatchingOption(s,n,l);r&&u!==s&&(o={selectedOption:u,retrievedOptions:l})}o!==this.state&&this.setState(o)}getMatchingOption(t,r,n){const{schema:a,registry:{schemaUtils:i}}=this.props,s=nr(a);return i.getClosestMatchingOption(r,n,t,s)}onOptionChange=t=>{const{selectedOption:r,retrievedOptions:n}=this.state,{formData:a,onChange:i,registry:s}=this.props,{schemaUtils:o}=s,l=t!==void 0?parseInt(t,10):-1;if(l===r)return;const u=l>=0?n[l]:void 0,c=r>=0?n[r]:void 0;let h=o.sanitizeDataForNewSchema(u,c,a);u&&(h=o.getDefaultFormState(u,h,"excludeObjectChildren")),this.setState({selectedOption:l},()=>{i(h,void 0,this.getFieldId())})};getFieldId(){const{idSchema:t,schema:r}=this.props;return`${t.$id}${r.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:t,disabled:r=!1,errorSchema:n={},formContext:a,onBlur:i,onFocus:s,readonly:o,registry:l,schema:u,uiSchema:c}=this.props,{widgets:h,fields:g,translateString:v,globalUiOptions:b,schemaUtils:y}=l,{SchemaField:p}=g,{selectedOption:f,retrievedOptions:d}=this.state,{widget:m="select",placeholder:_,autofocus:S,autocomplete:w,title:$=u.title,...O}=pe(c,b),E=pt({type:"number"},m,h),R=ae(n,Me,[]),q=Qn(n,[Me]),M=y.getDisplayLabel(u,c,b),I=f>=0&&d[f]||null;let L;if(I){const{required:K}=u;L=K?gt({required:K},I):I}let k=[];ke in u&&c&&ke in c?Array.isArray(c[ke])?k=c[ke]:console.warn(`uiSchema.oneOf is not an array for "${$||t}"`):Ge in u&&c&&Ge in c&&(Array.isArray(c[Ge])?k=c[Ge]:console.warn(`uiSchema.anyOf is not an array for "${$||t}"`));let J=c;f>=0&&k.length>f&&(J=k[f]);const X=$?_e.TitleOptionPrefix:_e.OptionPrefix,Y=$?[$]:[],ne=d.map((K,j)=>{const{title:V=K.title}=pe(k[j]);return{label:V||v(X,Y.concat(String(j+1))),value:j}});return A.jsxs("div",{className:"panel panel-default panel-body",children:[A.jsx("div",{className:"form-group",children:A.jsx(E,{id:this.getFieldId(),name:`${t}${u.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:i,onFocus:s,disabled:r||rr(ne),multiple:!1,rawErrors:R,errorSchema:q,value:f>=0?f:void 0,options:{enumOptions:ne,...O},registry:l,formContext:a,placeholder:_,autocomplete:w,autofocus:S,label:$??t,hideLabel:!M,readonly:o})}),L&&L.type!=="null"&&A.jsx(p,{...this.props,schema:L,uiSchema:J})]})}}const rI=/\.([0-9]*0)*$/,nI=/[0.]0*$/;function aI(e){const{registry:t,onChange:r,formData:n,value:a}=e,[i,s]=H.useState(a),{StringField:o}=t.fields;let l=n;const u=H.useCallback((c,h,g)=>{s(c),`${c}`.charAt(0)==="."&&(c=`0${c}`);const v=typeof c=="string"&&c.match(rI)?od(c.replace(nI,"")):od(c);r(v,h,g)},[r]);if(typeof i=="string"&&typeof l=="number"){const c=new RegExp(`^(${String(l).replace(".","\\.")})?\\.?0*$`);i.match(c)&&(l=i)}return A.jsx(o,{...e,formData:l,onChange:u})}function Dt(){return Dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),Qm={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},sI=["style","script"],oI=["src","href","data","formAction","srcDoc","action"],lI=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,uI=/mailto:/i,cI=/\n{2,}$/,eg=/^(\s*>[\s\S]*?)(?=\n\n|$)/,dI=/^ *> ?/gm,fI=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,pI=/^ {2,}\n/,hI=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,tg=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,rg=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,mI=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,gI=/^(?:\n *)*\n/,yI=/\r\n?/g,vI=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,bI=/^\[\^([^\]]+)]/,_I=/\f/g,SI=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,wI=/^\s*?\[(x|\s)\]/,ng=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,ag=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,ig=/^([^\n]+)\n *(=|-){3,} *\n/,zl=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,$I=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,sg=/^)/,PI=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,Wl=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,OI=/^\{.*\}$/,EI=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,AI=/^<([^ >]+@[^ >]+)>/,CI=/^<([^ >]+:\/[^ >]+)>/,II=/-([a-z])?/gi,og=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,TI=/^[^\n]+(?: \n|\n{2,})/,RI=/^\[([^\]]*)\]:\s+]+)>?\s*("([^"]*)")?/,xI=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,qI=/^\[([^\]]*)\] ?\[([^\]]*)\]/,jI=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,NI=/\t/g,DI=/(^ *\||\| *$)/g,FI=/^ *:-+: *$/,MI=/^ *:-+ *$/,kI=/^ *-+: *$/,Ca="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",LI=RegExp(`^([*_])\\1${Ca}\\1\\1(?!\\1)`),UI=RegExp(`^([*_])${Ca}\\1(?!\\1)`),VI=RegExp(`^(==)${Ca}\\1`),KI=RegExp(`^(~~)${Ca}\\1`),BI=/^\\([^0-9A-Za-z\s])/,lg=/\\([^0-9A-Za-z\s])/g,zI=/^[\s\S](?:(?! |[0-9]\.|http)[^=*_~\-\n<`\\\[!])*/,WI=/^\n+/,HI=/^([ \t]*)/,GI=/\\([^\\])/g,YI=/(?:^|\n)( *)$/,xc="(?:\\d+\\.)",qc="(?:[*+-])";function Lb(e){return"( *)("+(e===1?xc:qc)+") +"}const Ub=Lb(1),Vb=Lb(2);function Kb(e){return RegExp("^"+(e===1?Ub:Vb))}const JI=Kb(1),XI=Kb(2);function Bb(e){return RegExp("^"+(e===1?Ub:Vb)+"[^\\n]*(?:\\n(?!\\1"+(e===1?xc:qc)+" )[^\\n]*)*(\\n|$)","gm")}const ZI=Bb(1),QI=Bb(2);function zb(e){const t=e===1?xc:qc;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Wb=zb(1),Hb=zb(2);function ug(e,t){const r=t===1,n=r?Wb:Hb,a=r?ZI:QI,i=r?JI:XI;return{t:s=>i.test(s),o:Zr(function(s,o){const l=YI.exec(o.prevCapture);return l&&(o.list||!o.inline&&!o.simple)?n.exec(s=l[1]+s):null}),i:1,u(s,o,l){const u=r?+s[2]:void 0,c=s[0].replace(cI,` diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-Be6O1iVd.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-Be6O1iVd.js deleted file mode 100644 index b36e9605e0..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-Be6O1iVd.js +++ /dev/null @@ -1,83 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedbackForm-4ocPbX4e.js","assets/index-BSfI8fMz.js","assets/chunk-SSA7SXE4-C3U6kJ4J.js","assets/useMenuTriggerState-CF7Kywot.js","assets/useSelectableItem-DLYBSIKg.js","assets/index-DImPjBZJ.js","assets/chunk-IGSAU2ZA-C95SHugN.js","assets/ChatOptionsForm-DBuZluwC.js","assets/ShareButton-DpNPT4em.js","assets/ChatHistory-B32DGMwk.js","assets/CredentialsLogin-DQf8u3KV.js","assets/authStore-DX4sLJ2o.js","assets/useInitializeUserStore-BqNjwnPQ.js","assets/AuthGuard-CoMO0eC0.js","assets/LogoutButton-CLxY8Frn.js","assets/UsageButton-DXMuUpgY.js"])))=>i.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 sg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ky={exports:{}},hp={},Hy={exports:{}},pt={};var a1;function yL(){if(a1)return pt;a1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function b(W){return W===null||typeof W!="object"?null:(W=g&&W[g]||W["@@iterator"],typeof W=="function"?W:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,P={};function T(W,re,j){this.props=W,this.context=re,this.refs=P,this.updater=j||x}T.prototype.isReactComponent={},T.prototype.setState=function(W,re){if(typeof W!="object"&&typeof W!="function"&&W!=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,W,re,"setState")},T.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function _(){}_.prototype=T.prototype;function R(W,re,j){this.props=W,this.context=re,this.refs=P,this.updater=j||x}var D=R.prototype=new _;D.constructor=R,k(D,T.prototype),D.isPureReactComponent=!0;var F=Array.isArray,z=Object.prototype.hasOwnProperty,$={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function Z(W,re,j){var me,Ee={},ye=null,De=null;if(re!=null)for(me in re.ref!==void 0&&(De=re.ref),re.key!==void 0&&(ye=""+re.key),re)z.call(re,me)&&!U.hasOwnProperty(me)&&(Ee[me]=re[me]);var Ve=arguments.length-2;if(Ve===1)Ee.children=j;else if(1>>1,re=V[W];if(0>>1;Wi(Ee,M))yei(De,Ee)?(V[W]=De,V[ye]=M,W=ye):(V[W]=Ee,V[me]=M,W=me);else if(yei(De,M))V[W]=De,V[ye]=M,W=ye;else break e}}return se}function i(V,se){var M=V.sortIndex-se.sortIndex;return M!==0?M:V.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],h=[],m=1,g=null,b=3,x=!1,k=!1,P=!1,T=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function D(V){for(var se=n(h);se!==null;){if(se.callback===null)r(h);else if(se.startTime<=V)r(h),se.sortIndex=se.expirationTime,t(d,se);else break;se=n(h)}}function F(V){if(P=!1,D(V),!k)if(n(d)!==null)k=!0,J(z);else{var se=n(h);se!==null&&X(F,se.startTime-V)}}function z(V,se){k=!1,P&&(P=!1,_(Z),Z=-1),x=!0;var M=b;try{for(D(se),g=n(d);g!==null&&(!(g.expirationTime>se)||V&&!G());){var W=g.callback;if(typeof W=="function"){g.callback=null,b=g.priorityLevel;var re=W(g.expirationTime<=se);se=e.unstable_now(),typeof re=="function"?g.callback=re:g===n(d)&&r(d),D(se)}else r(d);g=n(d)}if(g!==null)var j=!0;else{var me=n(h);me!==null&&X(F,me.startTime-se),j=!1}return j}finally{g=null,b=M,x=!1}}var $=!1,U=null,Z=-1,ae=5,B=-1;function G(){return!(e.unstable_now()-BV||125W?(V.sortIndex=M,t(h,V),n(d)===null&&V===n(h)&&(P?(_(Z),Z=-1):P=!0,X(F,M-W))):(V.sortIndex=re,t(d,V),k||x||(k=!0,J(z))),V},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(V){var se=b;return function(){var M=b;b=se;try{return V.apply(this,arguments)}finally{b=M}}}})(Yy)),Yy}var d1;function SL(){return d1||(d1=1,qy.exports=wL()),qy.exports}var p1;function kL(){if(p1)return si;p1=1;var e=fx(),t=SL();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,p=1;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},g={};function b(o){return d.call(g,o)?!0:d.call(m,o)?!1:h.test(o)?g[o]=!0:(m[o]=!0,!1)}function x(o,l,p,v){if(p!==null&&p.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:p!==null?!p.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function k(o,l,p,v){if(l===null||typeof l>"u"||x(o,l,p,v))return!0;if(v)return!1;if(p!==null)switch(p.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function P(o,l,p,v,w,E,L){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=o,this.type=l,this.sanitizeURL=E,this.removeEmptyString=L}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){T[o]=new P(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];T[l]=new P(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){T[o]=new P(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){T[o]=new P(o,2,!1,o,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(o){T[o]=new P(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){T[o]=new P(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){T[o]=new P(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){T[o]=new P(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){T[o]=new P(o,5,!1,o.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function R(o){return o[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(o){var l=o.replace(_,R);T[l]=new P(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(_,R);T[l]=new P(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(_,R);T[l]=new P(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){T[o]=new P(o,1,!1,o.toLowerCase(),null,!1,!1)}),T.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){T[o]=new P(o,1,!1,o.toLowerCase(),null,!0,!0)});function D(o,l,p,v){var w=T.hasOwnProperty(l)?T[l]:null;(w!==null?w.type!==0:v||!(2H||w[L]!==E[H]){var Q=` -`+w[L].replace(" at new "," at ");return o.displayName&&Q.includes("")&&(Q=Q.replace("",o.displayName)),Q}while(1<=L&&0<=H);break}}}finally{j=!1,Error.prepareStackTrace=p}return(o=o?o.displayName||o.name:"")?re(o):""}function Ee(o){switch(o.tag){case 5:return re(o.type);case 16:return re("Lazy");case 13:return re("Suspense");case 19:return re("SuspenseList");case 0:case 2:case 15:return o=me(o.type,!1),o;case 11:return o=me(o.type.render,!1),o;case 1:return o=me(o.type,!0),o;default:return""}}function ye(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case U:return"Fragment";case $:return"Portal";case ae:return"Profiler";case Z:return"StrictMode";case te:return"Suspense";case K:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case G:return(o.displayName||"Context")+".Consumer";case B:return(o._context.displayName||"Context")+".Provider";case q:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case oe:return l=o.displayName||null,l!==null?l:ye(o.type)||"Memo";case J:l=o._payload,o=o._init;try{return ye(o(l))}catch{}}return null}function De(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(l);case 8:return l===Z?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Ve(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function _e(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ge(o){var l=_e(o)?"checked":"value",p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),v=""+o[l];if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,E=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(L){v=""+L,E.call(this,L)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return v},setValue:function(L){v=""+L},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function ft(o){o._valueTracker||(o._valueTracker=Ge(o))}function Re(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var p=l.getValue(),v="";return o&&(v=_e(o)?o.checked?"true":"false":o.value),o=v,o!==p?(l.setValue(o),!0):!1}function dt(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Mt(o,l){var p=l.checked;return M({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??o._wrapperState.initialChecked})}function It(o,l){var p=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;p=Ve(l.value!=null?l.value:p),o._wrapperState={initialChecked:v,initialValue:p,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Fe(o,l){l=l.checked,l!=null&&D(o,"checked",l,!1)}function yt(o,l){Fe(o,l);var p=Ve(l.value),v=l.type;if(p!=null)v==="number"?(p===0&&o.value===""||o.value!=p)&&(o.value=""+p):o.value!==""+p&&(o.value=""+p);else if(v==="submit"||v==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Un(o,l.type,p):l.hasOwnProperty("defaultValue")&&Un(o,l.type,Ve(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Et(o,l,p){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,p||l===o.value||(o.value=l),o.defaultValue=l}p=o.name,p!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,p!==""&&(o.name=p)}function Un(o,l,p){(l!=="number"||dt(o.ownerDocument)!==o)&&(p==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+p&&(o.defaultValue=""+p))}var Nn=Array.isArray;function Xt(o,l,p,v){if(o=o.options,l){l={};for(var w=0;w"+l.valueOf().toString()+"",l=Ue.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function st(o,l){if(l){var p=o.firstChild;if(p&&p===o.lastChild&&p.nodeType===3){p.nodeValue=l;return}}o.textContent=l}var Vt={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},Kn=["Webkit","ms","Moz","O"];Object.keys(Vt).forEach(function(o){Kn.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Vt[l]=Vt[o]})});function Qt(o,l,p){return l==null||typeof l=="boolean"||l===""?"":p||typeof l!="number"||l===0||Vt.hasOwnProperty(o)&&Vt[o]?(""+l).trim():l+"px"}function Rt(o,l){o=o.style;for(var p in l)if(l.hasOwnProperty(p)){var v=p.indexOf("--")===0,w=Qt(p,l[p],v);p==="float"&&(p="cssFloat"),v?o.setProperty(p,w):o[p]=w}}var Ir=M({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 Ft(o,l){if(l){if(Ir[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function sr(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 Jt=null;function oa(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ds=null,$i=null,hi=null;function sa(o){if(o=Do(o)){if(typeof ds!="function")throw Error(n(280));var l=o.stateNode;l&&(l=at(l),ds(o.stateNode,o.type,l))}}function ju(o){$i?hi?hi.push(o):hi=[o]:$i=o}function ps(){if($i){var o=$i,l=hi;if(hi=$i=null,sa(o),l)for(o=0;o>>=0,o===0?32:31-(Gv(o)/zh|0)|0}var ul=64,ca=4194304;function cl(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function fl(o,l){var p=o.pendingLanes;if(p===0)return 0;var v=0,w=o.suspendedLanes,E=o.pingedLanes,L=p&268435455;if(L!==0){var H=L&~w;H!==0?v=cl(H):(E&=L,E!==0&&(v=cl(E)))}else L=p&~w,L!==0?v=cl(L):E!==0&&(v=cl(E));if(v===0)return 0;if(l!==0&&l!==v&&(l&w)===0&&(w=v&-v,E=l&-l,w>=E||w===16&&(E&4194240)!==0))return l;if((v&4)!==0&&(v|=p&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=v;0p;p++)l.push(o);return l}function ms(o,l,p){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-mi(l),o[l]=p}function qv(o,l){var p=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var v=o.eventTimes;for(o=o.expirationTimes;0=ys),md=" ",tm=!1;function nm(o,l){switch(o){case"keyup":return em.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rm(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ma=!1;function oy(o,l){switch(o){case"compositionend":return rm(l);case"keypress":return l.which!==32?null:(tm=!0,md);case"textInput":return o=l.data,o===md&&tm?null:o;default:return null}}function ga(o,l){if(ma)return o==="compositionend"||!lr&&nm(o,l)?(o=Eo(),da=vn=Co=null,ma=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:p,offset:l-o};o=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Me(p)}}function St(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?St(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function un(){for(var o=window,l=dt();l instanceof o.HTMLIFrameElement;){try{var p=typeof l.contentWindow.location.href=="string"}catch{p=!1}if(p)o=l.contentWindow;else break;l=dt(o.document)}return l}function At(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function vd(o){var l=un(),p=o.focusedElem,v=o.selectionRange;if(l!==p&&p&&p.ownerDocument&&St(p.ownerDocument.documentElement,p)){if(v!==null&&At(p)){if(l=v.start,o=v.end,o===void 0&&(o=l),"selectionStart"in p)p.selectionStart=l,p.selectionEnd=Math.min(o,p.value.length);else if(o=(l=p.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=p.textContent.length,E=Math.min(v.start,w);v=v.end===void 0?E:Math.min(v.end,w),!o.extend&&E>v&&(w=v,v=E,E=w),w=rt(p,E);var L=rt(p,v);w&&L&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==L.node||o.focusOffset!==L.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),E>v?(o.addRange(l),o.extend(L.node,L.offset)):(l.setEnd(L.node,L.offset),o.addRange(l)))}}for(l=[],o=p;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p=document.documentMode,Fn=null,ba=null,xl=null,Ro=!1;function wl(o,l,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Ro||Fn==null||Fn!==dt(v)||(v=Fn,"selectionStart"in v&&At(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),xl&&de(xl,v)||(xl=v,v=Il(ba,"onSelect"),0Pa||(o.current=Sd[Pa],Sd[Pa]=null,Pa--)}function Dt(o,l){Pa++,Sd[Pa]=o.current,o.current=l}var Fo={},qn=No(Fo),gr=No(!1),ks=Fo;function vr(o,l){var p=o.type.contextTypes;if(!p)return Fo;var v=o.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var w={},E;for(E in p)w[E]=l[E];return v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function yr(o){return o=o.childContextTypes,o!=null}function hc(){_t(gr),_t(qn)}function gm(o,l,p){if(qn.current!==Fo)throw Error(n(168));Dt(qn,l),Dt(gr,p)}function vm(o,l,p){var v=o.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return p;v=v.getChildContext();for(var w in v)if(!(w in l))throw Error(n(108,De(o)||"Unknown",w));return M({},p,v)}function mc(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Fo,ks=qn.current,Dt(qn,o),Dt(gr,gr.current),!0}function Di(o,l,p){var v=o.stateNode;if(!v)throw Error(n(169));p?(o=vm(o,l,ks),v.__reactInternalMemoizedMergedChildContext=o,_t(gr),_t(qn),Dt(qn,o)):_t(gr),Dt(gr,p)}var to=null,gc=!1,kd=!1;function ym(o){to===null?to=[o]:to.push(o)}function dy(o){gc=!0,ym(o)}function br(){if(!kd&&to!==null){kd=!0;var o=0,l=Pt;try{var p=to;for(Pt=1;o>=L,w-=L,no=1<<32-mi(l)+w|p<et?(wn=Xe,Xe=null):wn=Xe.sibling;var kt=be(ue,Xe,ce[et],Ce);if(kt===null){Xe===null&&(Xe=wn);break}o&&Xe&&kt.alternate===null&&l(ue,Xe),ne=E(kt,ne,et),Ye===null?ze=kt:Ye.sibling=kt,Ye=kt,Xe=wn}if(et===ce.length)return p(ue,Xe),Wt&&Oo(ue,et),ze;if(Xe===null){for(;etet?(wn=Xe,Xe=null):wn=Xe.sibling;var es=be(ue,Xe,kt.value,Ce);if(es===null){Xe===null&&(Xe=wn);break}o&&Xe&&es.alternate===null&&l(ue,Xe),ne=E(es,ne,et),Ye===null?ze=es:Ye.sibling=es,Ye=es,Xe=wn}if(kt.done)return p(ue,Xe),Wt&&Oo(ue,et),ze;if(Xe===null){for(;!kt.done;et++,kt=ce.next())kt=Se(ue,kt.value,Ce),kt!==null&&(ne=E(kt,ne,et),Ye===null?ze=kt:Ye.sibling=kt,Ye=kt);return Wt&&Oo(ue,et),ze}for(Xe=v(ue,Xe);!kt.done;et++,kt=ce.next())kt=Le(Xe,ue,et,kt.value,Ce),kt!==null&&(o&&kt.alternate!==null&&Xe.delete(kt.key===null?et:kt.key),ne=E(kt,ne,et),Ye===null?ze=kt:Ye.sibling=kt,Ye=kt);return o&&Xe.forEach(function(Ay){return l(ue,Ay)}),Wt&&Oo(ue,et),ze}function nn(ue,ne,ce,Ce){if(typeof ce=="object"&&ce!==null&&ce.type===U&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case z:e:{for(var ze=ce.key,Ye=ne;Ye!==null;){if(Ye.key===ze){if(ze=ce.type,ze===U){if(Ye.tag===7){p(ue,Ye.sibling),ne=w(Ye,ce.props.children),ne.return=ue,ue=ne;break e}}else if(Ye.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===J&&Fl(ze)===Ye.type){p(ue,Ye.sibling),ne=w(Ye,ce.props),ne.ref=Ia(ue,Ye,ce),ne.return=ue,ue=ne;break e}p(ue,Ye);break}else l(ue,Ye);Ye=Ye.sibling}ce.type===U?(ne=Bs(ce.props.children,ue.mode,Ce,ce.key),ne.return=ue,ue=ne):(Ce=js(ce.type,ce.key,ce.props,null,ue.mode,Ce),Ce.ref=Ia(ue,ne,ce),Ce.return=ue,ue=Ce)}return L(ue);case $:e:{for(Ye=ce.key;ne!==null;){if(ne.key===Ye)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){p(ue,ne.sibling),ne=w(ne,ce.children||[]),ne.return=ue,ue=ne;break e}else{p(ue,ne);break}else l(ue,ne);ne=ne.sibling}ne=up(ce,ue.mode,Ce),ne.return=ue,ue=ne}return L(ue);case J:return Ye=ce._init,nn(ue,ne,Ye(ce._payload),Ce)}if(Nn(ce))return Ne(ue,ne,ce,Ce);if(se(ce))return Oe(ue,ne,ce,Ce);bc(ue,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,ne!==null&&ne.tag===6?(p(ue,ne.sibling),ne=w(ne,ce),ne.return=ue,ue=ne):(p(ue,ne),ne=lp(ce,ue.mode,Ce),ne.return=ue,ue=ne),L(ue)):p(ue,ne)}return nn}var Ts=wm(!0),_n=wm(!1),Ra=No(null),Ol=null,ur=null,zl=null;function $a(){zl=ur=Ol=null}function io(o){var l=Ra.current;_t(Ra),o._currentValue=l}function xc(o,l,p){for(;o!==null;){var v=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),o===p)break;o=o.return}}function cn(o,l){Ol=o,zl=ur=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(jn=!0),o.firstContext=null)}function wr(o){var l=o._currentValue;if(zl!==o)if(o={context:o,memoizedValue:l,next:null},ur===null){if(Ol===null)throw Error(n(308));ur=o,Ol.dependencies={lanes:0,firstContext:o}}else ur=ur.next=o;return l}var _s=null;function Pd(o){_s===null?_s=[o]:_s.push(o)}function Sm(o,l,p,v){var w=l.interleaved;return w===null?(p.next=p,Pd(l)):(p.next=w.next,w.next=p),l.interleaved=p,vi(o,v)}function vi(o,l){o.lanes|=l;var p=o.alternate;for(p!==null&&(p.lanes|=l),p=o,o=o.return;o!==null;)o.childLanes|=l,p=o.alternate,p!==null&&(p.childLanes|=l),p=o,o=o.return;return p.tag===3?p.stateNode:null}var jo=!1;function Is(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Td(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function oo(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Bo(o,l,p){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(xt&2)!==0){var w=v.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),v.pending=l,vi(o,p)}return w=v.interleaved,w===null?(l.next=l,Pd(v)):(l.next=w.next,w.next=l),v.interleaved=l,vi(o,p)}function Vo(o,l,p){if(l=l.updateQueue,l!==null&&(l=l.shared,(p&4194240)!==0)){var v=l.lanes;v&=o.pendingLanes,p|=v,l.lanes=p,qu(o,p)}}function km(o,l){var p=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var w=null,E=null;if(p=p.firstBaseUpdate,p!==null){do{var L={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};E===null?w=E=L:E=E.next=L,p=p.next}while(p!==null);E===null?w=E=l:E=E.next=l}else w=E=l;p={baseState:v.baseState,firstBaseUpdate:w,lastBaseUpdate:E,shared:v.shared,effects:v.effects},o.updateQueue=p;return}o=p.lastBaseUpdate,o===null?p.firstBaseUpdate=l:o.next=l,p.lastBaseUpdate=l}function wc(o,l,p,v){var w=o.updateQueue;jo=!1;var E=w.firstBaseUpdate,L=w.lastBaseUpdate,H=w.shared.pending;if(H!==null){w.shared.pending=null;var Q=H,fe=Q.next;Q.next=null,L===null?E=fe:L.next=fe,L=Q;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,H=xe.lastBaseUpdate,H!==L&&(H===null?xe.firstBaseUpdate=fe:H.next=fe,xe.lastBaseUpdate=Q))}if(E!==null){var Se=w.baseState;L=0,xe=fe=Q=null,H=E;do{var be=H.lane,Le=H.eventTime;if((v&be)===be){xe!==null&&(xe=xe.next={eventTime:Le,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var Ne=o,Oe=H;switch(be=l,Le=p,Oe.tag){case 1:if(Ne=Oe.payload,typeof Ne=="function"){Se=Ne.call(Le,Se,be);break e}Se=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Oe.payload,be=typeof Ne=="function"?Ne.call(Le,Se,be):Ne,be==null)break e;Se=M({},Se,be);break e;case 2:jo=!0}}H.callback!==null&&H.lane!==0&&(o.flags|=64,be=w.effects,be===null?w.effects=[H]:be.push(H))}else Le={eventTime:Le,lane:be,tag:H.tag,payload:H.payload,callback:H.callback,next:null},xe===null?(fe=xe=Le,Q=Se):xe=xe.next=Le,L|=be;if(H=H.next,H===null){if(H=w.shared.pending,H===null)break;be=H,H=be.next,be.next=null,w.lastBaseUpdate=be,w.shared.pending=null}}while(!0);if(xe===null&&(Q=Se),w.baseState=Q,w.firstBaseUpdate=fe,w.lastBaseUpdate=xe,l=w.shared.interleaved,l!==null){w=l;do L|=w.lane,w=w.next;while(w!==l)}else E===null&&(w.shared.lanes=0);Ns|=L,o.lanes=L,o.memoizedState=Se}}function Sc(o,l,p){if(o=l.effects,l.effects=null,o!==null)for(l=0;lp?p:4,o(!0);var v=Ec.transition;Ec.transition={};try{o(!1),l()}finally{Pt=p,Ec.transition=v}}function Od(){return Jr().memoizedState}function Tm(o,l,p){var v=Qo(o);if(p={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null},zd(o))jd(l,p);else if(p=Sm(o,l,p,v),p!==null){var w=tr();wi(p,o,v,w),cr(p,l,v)}}function hy(o,l,p){var v=Qo(o),w={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(zd(o))jd(l,w);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var L=l.lastRenderedState,H=E(L,p);if(w.hasEagerState=!0,w.eagerState=H,he(H,L)){var Q=l.interleaved;Q===null?(w.next=w,Pd(l)):(w.next=Q.next,Q.next=w),l.interleaved=w;return}}catch{}p=Sm(o,l,w,v),p!==null&&(w=tr(),wi(p,o,v,w),cr(p,l,v))}}function zd(o){var l=o.alternate;return o===Ht||l!==null&&l===Ht}function jd(o,l){$s=Kl=!0;var p=o.pending;p===null?l.next=l:(l.next=p.next,p.next=l),o.pending=l}function cr(o,l,p){if((p&4194240)!==0){var v=l.lanes;v&=o.pendingLanes,p|=v,l.lanes=p,qu(o,p)}}var Lr={readContext:wr,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},my={readContext:wr,useCallback:function(o,l){return yi().memoizedState=[o,l===void 0?null:l],o},useContext:wr,useEffect:_c,useImperativeHandle:function(o,l,p){return p=p!=null?p.concat([o]):null,Da(4194308,4,lo.bind(null,l,o),p)},useLayoutEffect:function(o,l){return Da(4194308,4,o,l)},useInsertionEffect:function(o,l){return Da(4,2,o,l)},useMemo:function(o,l){var p=yi();return l=l===void 0?null:l,o=o(),p.memoizedState=[o,l],o},useReducer:function(o,l,p){var v=yi();return l=p!==void 0?p(l):l,v.memoizedState=v.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},v.queue=o,o=o.dispatch=Tm.bind(null,Ht,o),[v.memoizedState,o]},useRef:function(o){var l=yi();return o={current:o},l.memoizedState=o},useState:Dd,useDebugValue:Ic,useDeferredValue:function(o){return yi().memoizedState=o},useTransition:function(){var o=Dd(!1),l=o[0];return o=py.bind(null,o[1]),yi().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,p){var v=Ht,w=yi();if(Wt){if(p===void 0)throw Error(n(407));p=p()}else{if(p=l(),$n===null)throw Error(n(349));(Rs&30)!==0||Ld(v,l,p)}w.memoizedState=p;var E={value:p,getSnapshot:l};return w.queue=E,_c(kr.bind(null,v,E,o),[o]),v.flags|=2048,Wo(9,Md.bind(null,v,E,p,l),void 0,null),p},useId:function(){var o=yi(),l=$n.identifierPrefix;if(Wt){var p=Ni,v=no;p=(v&~(1<<32-mi(v)-1)).toString(32)+p,l=":"+l+"R"+p,p=Hl++,0<\/script>",o=o.removeChild(o.firstChild)):typeof v.is=="string"?o=L.createElement(p,{is:v.is}):(o=L.createElement(p),p==="select"&&(L=o,v.multiple?L.multiple=!0:v.size&&(L.size=v.size))):o=L.createElementNS(o,p),o[Mi]=l,o[Ml]=v,Hd(o,l,!1,!1),l.stateNode=o;e:{switch(L=sr(p,v),p){case"dialog":Ot("cancel",o),Ot("close",o),w=v;break;case"iframe":case"object":case"embed":Ot("load",o),w=v;break;case"video":case"audio":for(w=0;wVa&&(l.flags|=128,v=!0,za(E,!1),l.lanes=4194304)}else{if(!v)if(o=Ul(L),o!==null){if(l.flags|=128,v=!0,p=o.updateQueue,p!==null&&(l.updateQueue=p,l.flags|=4),za(E,!0),E.tail===null&&E.tailMode==="hidden"&&!L.alternate&&!Wt)return Jn(l),null}else 2*sn()-E.renderingStartTime>Va&&p!==1073741824&&(l.flags|=128,v=!0,za(E,!1),l.lanes=4194304);E.isBackwards?(L.sibling=l.child,l.child=L):(p=E.last,p!==null?p.sibling=L:l.child=L,E.last=L)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=sn(),l.sibling=null,p=Kt.current,Dt(Kt,v?p&1|2:p&1),l):(Jn(l),null);case 22:case 23:return op(),v=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==v&&(l.flags|=8192),v&&(l.mode&1)!==0?(Mr&1073741824)!==0&&(Jn(l),l.subtreeFlags&6&&(l.flags|=8192)):Jn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function vy(o,l){switch(Dl(l),l.tag){case 1:return yr(l.type)&&hc(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return La(),_t(gr),_t(qn),_d(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Cc(l),null;case 13:if(_t(Kt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Es()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return _t(Kt),null;case 4:return La(),null;case 10:return io(l.type._context),null;case 22:case 23:return op(),null;case 24:return null;default:return null}}var Vc=!1,Zn=!1,co=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function Ko(o,l){var p=o.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(v){Gt(o,l,v)}else p.current=null}function Gd(o,l,p){try{p()}catch(v){Gt(o,l,v)}}var Uc=!1;function yy(o,l){if(wd=Zu,o=un(),At(o)){if("selectionStart"in o)var p={start:o.selectionStart,end:o.selectionEnd};else e:{p=(p=o.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var w=v.anchorOffset,E=v.focusNode;v=v.focusOffset;try{p.nodeType,E.nodeType}catch{p=null;break e}var L=0,H=-1,Q=-1,fe=0,xe=0,Se=o,be=null;t:for(;;){for(var Le;Se!==p||w!==0&&Se.nodeType!==3||(H=L+w),Se!==E||v!==0&&Se.nodeType!==3||(Q=L+v),Se.nodeType===3&&(L+=Se.nodeValue.length),(Le=Se.firstChild)!==null;)be=Se,Se=Le;for(;;){if(Se===o)break t;if(be===p&&++fe===w&&(H=L),be===E&&++xe===v&&(Q=L),(Le=Se.nextSibling)!==null)break;Se=be,be=Se.parentNode}Se=Le}p=H===-1||Q===-1?null:{start:H,end:Q}}else p=null}p=p||{start:0,end:0}}else p=null;for($l={focusedElem:o,selectionRange:p},Zu=!1,Ie=l;Ie!==null;)if(l=Ie,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ie=o;else for(;Ie!==null;){l=Ie;try{var Ne=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Oe=Ne.memoizedProps,nn=Ne.memoizedState,ue=l.stateNode,ne=ue.getSnapshotBeforeUpdate(l.elementType===l.type?Oe:Xn(l.type,Oe),nn);ue.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var ce=l.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Gt(l,l.return,Ce)}if(o=l.sibling,o!==null){o.return=l.return,Ie=o;break}Ie=l.return}return Ne=Uc,Uc=!1,Ne}function nu(o,l,p){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var w=v=v.next;do{if((w.tag&o)===o){var E=w.destroy;w.destroy=void 0,E!==void 0&&Gd(l,p,E)}w=w.next}while(w!==v)}}function Ho(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&o)===o){var v=p.create;p.destroy=v()}p=p.next}while(p!==l)}}function Wc(o){var l=o.ref;if(l!==null){var p=o.stateNode;o.tag,o=p,typeof l=="function"?l(o):l.current=o}}function qd(o){var l=o.alternate;l!==null&&(o.alternate=null,qd(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Mi],delete l[Ml],delete l[Ss],delete l[mm],delete l[N])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Om(o){return o.tag===5||o.tag===3||o.tag===4}function zm(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Om(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Yd(o,l,p){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?p.nodeType===8?p.parentNode.insertBefore(o,l):p.insertBefore(o,l):(p.nodeType===8?(l=p.parentNode,l.insertBefore(o,p)):(l=p,l.appendChild(o)),p=p._reactRootContainer,p!=null||l.onclick!==null||(l.onclick=Rl));else if(v!==4&&(o=o.child,o!==null))for(Yd(o,l,p),o=o.sibling;o!==null;)Yd(o,l,p),o=o.sibling}function Xd(o,l,p){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?p.insertBefore(o,l):p.appendChild(o);else if(v!==4&&(o=o.child,o!==null))for(Xd(o,l,p),o=o.sibling;o!==null;)Xd(o,l,p),o=o.sibling}var Rn=null,Zr=!1;function Go(o,l,p){for(p=p.child;p!==null;)Kc(o,l,p),p=p.sibling}function Kc(o,l,p){if(Li&&typeof Li.onCommitFiberUnmount=="function")try{Li.onCommitFiberUnmount(ll,p)}catch{}switch(p.tag){case 5:Zn||Ko(p,l);case 6:var v=Rn,w=Zr;Rn=null,Go(o,l,p),Rn=v,Zr=w,Rn!==null&&(Zr?(o=Rn,p=p.stateNode,o.nodeType===8?o.parentNode.removeChild(p):o.removeChild(p)):Rn.removeChild(p.stateNode));break;case 18:Rn!==null&&(Zr?(o=Rn,p=p.stateNode,o.nodeType===8?Lo(o.parentNode,p):o.nodeType===1&&Lo(o,p),$t(o)):Lo(Rn,p.stateNode));break;case 4:v=Rn,w=Zr,Rn=p.stateNode.containerInfo,Zr=!0,Go(o,l,p),Rn=v,Zr=w;break;case 0:case 11:case 14:case 15:if(!Zn&&(v=p.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){w=v=v.next;do{var E=w,L=E.destroy;E=E.tag,L!==void 0&&((E&2)!==0||(E&4)!==0)&&Gd(p,l,L),w=w.next}while(w!==v)}Go(o,l,p);break;case 1:if(!Zn&&(Ko(p,l),v=p.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=p.memoizedProps,v.state=p.memoizedState,v.componentWillUnmount()}catch(H){Gt(p,l,H)}Go(o,l,p);break;case 21:Go(o,l,p);break;case 22:p.mode&1?(Zn=(v=Zn)||p.memoizedState!==null,Go(o,l,p),Zn=v):Go(o,l,p);break;default:Go(o,l,p)}}function Qd(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var p=o.stateNode;p===null&&(p=o.stateNode=new co),l.forEach(function(v){var w=Ey.bind(null,o,v);p.has(v)||(p.add(v),v.then(w,w))})}}function fr(o,l){var p=l.deletions;if(p!==null)for(var v=0;vw&&(w=L),v&=~E}if(v=w,v=sn()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*by(v/1960))-v,10o?16:o,Xo===null)var v=!1;else{if(o=Xo,Xo=null,Xc=0,(xt&6)!==0)throw Error(n(331));var w=xt;for(xt|=4,Ie=o.current;Ie!==null;){var E=Ie,L=E.child;if((Ie.flags&16)!==0){var H=E.deletions;if(H!==null){for(var Q=0;Qsn()-ep?Os(o,0):Gc|=p),Er(o,l)}function Ym(o,l){l===0&&((o.mode&1)===0?l=1:(l=ca,ca<<=1,(ca&130023424)===0&&(ca=4194304)));var p=tr();o=vi(o,l),o!==null&&(ms(o,l,p),Er(o,p))}function Cy(o){var l=o.memoizedState,p=0;l!==null&&(p=l.retryLane),Ym(o,p)}function Ey(o,l){var p=0;switch(o.tag){case 13:var v=o.stateNode,w=o.memoizedState;w!==null&&(p=w.retryLane);break;case 19:v=o.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),Ym(o,p)}var Xm;Xm=function(o,l,p){if(o!==null)if(o.memoizedProps!==l.pendingProps||gr.current)jn=!0;else{if((o.lanes&p)===0&&(l.flags&128)===0)return jn=!1,Kd(o,l,p);jn=(o.flags&131072)!==0}else jn=!1,Wt&&(l.flags&1048576)!==0&&bm(l,vc,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;zi(o,l),o=l.pendingProps;var w=vr(l,qn.current);cn(l,p),w=$d(null,l,v,o,w,p);var E=As();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,yr(v)?(E=!0,mc(l)):E=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Is(l),w.updater=Ql,l.stateNode=w,w._reactInternals=l,Ms(l,v,o,p),l=zc(null,l,v,!0,E,p)):(l.tag=0,Wt&&E&&Cd(l),Qn(null,l,w,p),l=l.child),l;case 16:v=l.elementType;e:{switch(zi(o,l),o=l.pendingProps,w=v._init,v=w(v._payload),l.type=v,w=l.tag=Jm(v),o=Xn(v,o),w){case 0:l=Oc(null,l,v,o,p);break e;case 1:l=Am(null,l,v,o,p);break e;case 11:l=Fc(null,l,v,o,p);break e;case 14:l=$m(null,l,v,Xn(v.type,o),p);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Xn(v,w),Oc(o,l,v,w,p);case 1:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Xn(v,w),Am(o,l,v,w,p);case 3:e:{if(Lm(l),o===null)throw Error(n(387));v=l.pendingProps,E=l.memoizedState,w=E.element,Td(o,l),wc(l,v,null,p);var L=l.memoizedState;if(v=L.element,E.isDehydrated)if(E={element:v,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){w=Na(Error(n(423)),l),l=Mm(o,l,v,p,w);break e}else if(v!==w){w=Na(Error(n(424)),l),l=Mm(o,l,v,p,w);break e}else for(Yn=Mo(l.stateNode.containerInfo.firstChild),zn=l,Wt=!0,Qr=null,p=_n(l,null,v,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Es(),v===w){l=uo(o,l,p);break e}Qn(o,l,v,p)}l=l.child}return l;case 5:return kc(l),o===null&&ro(l),v=l.type,w=l.pendingProps,E=o!==null?o.memoizedProps:null,L=w.children,ws(v,w)?L=null:E!==null&&ws(v,E)&&(l.flags|=32),Wd(o,l),Qn(o,l,L,p),l.child;case 6:return o===null&&ro(l),null;case 13:return jc(o,l,p);case 4:return Vl(l,l.stateNode.containerInfo),v=l.pendingProps,o===null?l.child=Ts(l,null,v,p):Qn(o,l,v,p),l.child;case 11:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Xn(v,w),Fc(o,l,v,w,p);case 7:return Qn(o,l,l.pendingProps,p),l.child;case 8:return Qn(o,l,l.pendingProps.children,p),l.child;case 12:return Qn(o,l,l.pendingProps.children,p),l.child;case 10:e:{if(v=l.type._context,w=l.pendingProps,E=l.memoizedProps,L=w.value,Dt(Ra,v._currentValue),v._currentValue=L,E!==null)if(he(E.value,L)){if(E.children===w.children&&!gr.current){l=uo(o,l,p);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var H=E.dependencies;if(H!==null){L=E.child;for(var Q=H.firstContext;Q!==null;){if(Q.context===v){if(E.tag===1){Q=oo(-1,p&-p),Q.tag=2;var fe=E.updateQueue;if(fe!==null){fe=fe.shared;var xe=fe.pending;xe===null?Q.next=Q:(Q.next=xe.next,xe.next=Q),fe.pending=Q}}E.lanes|=p,Q=E.alternate,Q!==null&&(Q.lanes|=p),xc(E.return,p,l),H.lanes|=p;break}Q=Q.next}}else if(E.tag===10)L=E.type===l.type?null:E.child;else if(E.tag===18){if(L=E.return,L===null)throw Error(n(341));L.lanes|=p,H=L.alternate,H!==null&&(H.lanes|=p),xc(L,p,l),L=E.sibling}else L=E.child;if(L!==null)L.return=E;else for(L=E;L!==null;){if(L===l){L=null;break}if(E=L.sibling,E!==null){E.return=L.return,L=E;break}L=L.return}E=L}Qn(o,l,w.children,p),l=l.child}return l;case 9:return w=l.type,v=l.pendingProps.children,cn(l,p),w=wr(w),v=v(w),l.flags|=1,Qn(o,l,v,p),l.child;case 14:return v=l.type,w=Xn(v,l.pendingProps),w=Xn(v.type,w),$m(o,l,v,w,p);case 15:return Ud(o,l,l.type,l.pendingProps,p);case 17:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Xn(v,w),zi(o,l),l.tag=1,yr(v)?(o=!0,mc(l)):o=!1,cn(l,p),Bd(l,v,w),Ms(l,v,w,p),zc(null,l,v,!0,o,p);case 19:return Bc(o,l,p);case 22:return Oi(o,l,p)}throw Error(n(156,l.tag))};function Qm(o,l){return Dh(o,l)}function Py(o,l,p,v){this.tag=o,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(o,l,p,v){return new Py(o,l,p,v)}function ap(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Jm(o){if(typeof o=="function")return ap(o)?1:0;if(o!=null){if(o=o.$$typeof,o===q)return 11;if(o===oe)return 14}return 2}function Zo(o,l){var p=o.alternate;return p===null?(p=ni(o.tag,l,o.key,o.mode),p.elementType=o.elementType,p.type=o.type,p.stateNode=o.stateNode,p.alternate=o,o.alternate=p):(p.pendingProps=l,p.type=o.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=o.flags&14680064,p.childLanes=o.childLanes,p.lanes=o.lanes,p.child=o.child,p.memoizedProps=o.memoizedProps,p.memoizedState=o.memoizedState,p.updateQueue=o.updateQueue,l=o.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=o.sibling,p.index=o.index,p.ref=o.ref,p}function js(o,l,p,v,w,E){var L=2;if(v=o,typeof o=="function")ap(o)&&(L=1);else if(typeof o=="string")L=5;else e:switch(o){case U:return Bs(p.children,w,E,l);case Z:L=8,w|=8;break;case ae:return o=ni(12,p,l,w|2),o.elementType=ae,o.lanes=E,o;case te:return o=ni(13,p,l,w),o.elementType=te,o.lanes=E,o;case K:return o=ni(19,p,l,w),o.elementType=K,o.lanes=E,o;case X:return ef(p,w,E,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case B:L=10;break e;case G:L=9;break e;case q:L=11;break e;case oe:L=14;break e;case J:L=16,v=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ni(L,p,l,w),l.elementType=o,l.type=v,l.lanes=E,l}function Bs(o,l,p,v){return o=ni(7,o,v,l),o.lanes=p,o}function ef(o,l,p,v){return o=ni(22,o,v,l),o.elementType=X,o.lanes=p,o.stateNode={isHidden:!1},o}function lp(o,l,p){return o=ni(6,o,null,l),o.lanes=p,o}function up(o,l,p){return l=ni(4,o.children!==null?o.children:[],o.key,l),l.lanes=p,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function Ty(o,l,p,v,w){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gu(0),this.expirationTimes=Gu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gu(0),this.identifierPrefix=v,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function cp(o,l,p,v,w,E,L,H,Q){return o=new Ty(o,l,p,H,Q),l===1?(l=1,E===!0&&(l|=8)):l=0,E=ni(3,null,null,l),o.current=E,E.stateNode=o,E.memoizedState={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Is(E),o}function _y(o,l,p){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gy.exports=kL(),Gy.exports}var m1;function CL(){if(m1)return ag;m1=1;var e=_E();return ag.createRoot=e.createRoot,ag.hydrateRoot=e.hydrateRoot,ag}var EL=CL();function gv(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=S.createContext(void 0);i.displayName=r;function s(){var a;const c=S.useContext(i);if(!c&&t){const d=new Error(n);throw d.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,d,s),d}return c}return[i.Provider,s,i]}function PL(e){return{UNSAFE_getDOMNode(){return e.current}}}function Pi(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current),t}function dx(e){return Array.isArray(e)}function TL(e){return dx(e)&&e.length===0}function px(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!dx(e)}function _L(e){return px(e)&&Object.keys(e).length===0}function IL(e){return dx(e)?TL(e):px(e)?_L(e):e==null||e===""}function RL(e){return typeof e=="function"}var Ae=e=>e?"true":void 0;function IE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tpx(e)?e instanceof Array?[...e]:e[t]:e,RE=(...e)=>{let t=" ";for(const n of e)if(typeof n=="string"&&n.length>0){t=n;break}return t},$L=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"";function g1(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function AL(e){return`${e}-${Math.floor(Math.random()*1e6)}`}function Cq(e){for(const t in e)t.startsWith("on")&&delete e[t];return e}function cs(e){if(!e||typeof e!="object")return"";try{return JSON.stringify(e)}catch{return""}}function LL(e,t,n){return Math.min(Math.max(e,t),n)}function ML(e,t=100){return Math.min(Math.max(e,0),t)}var v1={};function DL(e,t,...n){const i=`[Hero UI] : ${e}`;typeof console>"u"||v1[i]||(v1[i]=!0)}function Ja(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}var y1=new Map;function NL(e,t){if(e===t)return e;let n=y1.get(e);if(n)return n.forEach(i=>i.current=t),t;let r=y1.get(t);return r?(r.forEach(i=>i.current=e),e):t}function en(...e){let t={...e[0]};for(let n=1;n=65&&i.charCodeAt(2)<=90?t[i]=Ja(s,a):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof a=="string"?t[i]=jt(s,a):i==="id"&&s&&a?t.id=NL(s,a):t[i]=a!==void 0?a:s}}return t}function $E(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const r=e.map(i=>{const s=b1(i,t);return n||(n=typeof s=="function"),s});if(n)return()=>{r.forEach((i,s)=>{typeof i=="function"?i?.():b1(e[s],null)})}}}function b1(e,t){if(typeof e=="function")return()=>e(t);e!=null&&"current"in e&&(e.current=t)}function FL(e,t){if(e!=null){if(RL(e)){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function AE(...e){return t=>{e.forEach(n=>FL(n,t))}}function OL(){const e=()=>()=>{};return S.useSyncExternalStore(e,()=>!0,()=>!1)}var zL=new Set(["id","type","style","title","role","tabIndex","htmlFor","width","height","abbr","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","challenge","charset","checked","cite","class","className","cols","colSpan","command","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","dropzone","encType","enterKeyHint","for","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","hidden","high","href","hrefLang","httpEquiv","icon","inputMode","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","list","loop","manifest","max","maxLength","media","mediaGroup","method","min","minLength","multiple","muted","name","noValidate","open","optimum","pattern","ping","placeholder","poster","preload","radioGroup","referrerPolicy","readOnly","rel","required","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","slot","sortable","span","spellCheck","src","srcDoc","srcSet","start","step","target","translate","typeMustMatch","useMap","value","wmode","wrap"]),jL=new Set(["onCopy","onCut","onPaste","onLoad","onError","onWheel","onScroll","onCompositionEnd","onCompositionStart","onCompositionUpdate","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onSubmit","onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerDown","onPointerEnter","onPointerLeave","onPointerUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd"]),x1=/^(data-.*)$/,BL=/^(aria-.*)$/,lg=/^(on[A-Z].*)$/;function Rf(e,t={}){let{labelable:n=!0,enabled:r=!0,propNames:i,omitPropNames:s,omitEventNames:a,omitDataProps:c,omitEventProps:d}=t,h={};if(!r)return e;for(const m in e)s?.has(m)||a?.has(m)&&lg.test(m)||lg.test(m)&&!jL.has(m)||c&&x1.test(m)||d&&lg.test(m)||(Object.prototype.hasOwnProperty.call(e,m)&&(zL.has(m)||n&&BL.test(m)||i?.has(m)||x1.test(m))||lg.test(m))&&(h[m]=e[m]);return h}var[VL,di]=gv({name:"ProviderContext",strict:!1});const UL=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),WL=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function LE(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return UL.has(n.script)}let t=e.split("-")[0];return WL.has(t)}const ME={prefix:String(Math.round(Math.random()*1e10)),current:0},DE=He.createContext(ME),KL=He.createContext(!1);let Xy=new WeakMap;function HL(e=!1){let t=S.useContext(DE),n=S.useRef(null);if(n.current===null&&!e){var r,i;let s=(i=He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(s){let a=Xy.get(s);a==null?Xy.set(s,{id:t.current,state:s.memoizedState}):s.memoizedState!==a.state&&(t.current=a.id,Xy.delete(s))}n.current=++t.current}return n.current}function GL(e){let t=S.useContext(DE),n=HL(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function qL(e){let t=He.useId(),[n]=S.useState(mh()),r=n?"react-aria":`react-aria${ME.prefix}`;return e||`${r}-${t}`}const YL=typeof He.useId=="function"?qL:GL;function XL(){return!1}function QL(){return!0}function JL(e){return()=>{}}function mh(){return typeof He.useSyncExternalStore=="function"?He.useSyncExternalStore(JL,XL,QL):S.useContext(KL)}const ZL=Symbol.for("react-aria.i18n.locale");function NE(){let e=typeof window<"u"&&window[ZL]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:LE(e)?"rtl":"ltr"}}let Q0=NE(),Ip=new Set;function w1(){Q0=NE();for(let e of Ip)e(Q0)}function FE(){let e=mh(),[t,n]=S.useState(Q0);return S.useEffect(()=>(Ip.size===0&&window.addEventListener("languagechange",w1),Ip.add(n),()=>{Ip.delete(n),Ip.size===0&&window.removeEventListener("languagechange",w1)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const OE=He.createContext(null);function eM(e){let{locale:t,children:n}=e,r=FE(),i=He.useMemo(()=>t?{locale:t,direction:LE(t)?"rtl":"ltr"}:r,[r,t]);return He.createElement(OE.Provider,{value:i},n)}function gh(){let e=FE();return S.useContext(OE)||e}const tM=Symbol.for("react-aria.i18n.locale"),nM=Symbol.for("react-aria.i18n.strings");let ff;class vv{getStringForLocale(t,n){let i=this.getStringsForLocale(n)[t];if(!i)throw new Error(`Could not find intl message ${t} in ${n} locale`);return i}getStringsForLocale(t){let n=this.strings[t];return n||(n=rM(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[tM];if(ff===void 0){let i=window[nM];if(!i)return null;ff={};for(let s in i)ff[s]=new vv({[n]:i[s]},n)}let r=ff?.[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function rM(e,t,n="en-US"){if(t[e])return t[e];let r=iM(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}function iM(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const S1=new Map,k1=new Map;class oM{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let i=n["="+t];if(i)return typeof i=="function"?i():i;let s=this.locale+":"+r,a=S1.get(s);a||(a=new Intl.PluralRules(this.locale,{type:r}),S1.set(s,a));let c=a.select(t);return i=n[c]||n.other,typeof i=="function"?i():i}number(t){let n=k1.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),k1.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const C1=new WeakMap;function sM(e){let t=C1.get(e);return t||(t=new vv(e),C1.set(e,t)),t}function aM(e,t){return t&&vv.getGlobalDictionaryForPackage(t)||sM(e)}function lM(e,t){let{locale:n}=gh(),r=aM(e,t);return S.useMemo(()=>new oM(n,r),[n,r])}function uM(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cM(e,t,n){uM(e,t),t.set(e,n)}const rn=typeof document<"u"?He.useLayoutEffect:()=>{};function Vn(e){const t=S.useRef(null);return rn(()=>{t.current=e},[e]),S.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function fM(e){let[t,n]=S.useState(e),r=S.useRef(null),i=Vn(()=>{if(!r.current)return;let a=r.current.next();if(a.done){r.current=null;return}t===a.value?i():n(a.value)});rn(()=>{r.current&&i()});let s=Vn(a=>{r.current=a(t),i()});return[t,s]}let dM=!!(typeof window<"u"&&window.document&&window.document.createElement),Ef=new Map,Rp;typeof FinalizationRegistry<"u"&&(Rp=new FinalizationRegistry(e=>{Ef.delete(e)}));function $f(e){let[t,n]=S.useState(e),r=S.useRef(null),i=YL(t),s=S.useRef(null);if(Rp&&Rp.register(s,i),dM){const a=Ef.get(i);a&&!a.includes(r)?a.push(r):Ef.set(i,[r])}return rn(()=>{let a=i;return()=>{Rp&&Rp.unregister(s),Ef.delete(a)}},[i]),S.useEffect(()=>{let a=r.current;return a&&n(a),()=>{a&&(r.current=null)}}),i}function pM(e,t){if(e===t)return e;let n=Ef.get(e);if(n)return n.forEach(i=>i.current=t),t;let r=Ef.get(t);return r?(r.forEach(i=>i.current=e),e):t}function J0(e=[]){let t=$f(),[n,r]=fM(t),i=S.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return rn(i,[t,i,...e]),n}function Af(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Nt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Gi=e=>e&&"window"in e&&e.window===e?e:Nt(e).defaultView||window;function hM(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function mM(e){return hM(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let gM=!1,vM=!1;function Eq(){return gM}function yv(){return vM}function ui(e,t){if(!yv())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:mM(n)?n=n.host:n=n.parentNode}return!1}const Br=(e=document)=>{var t;if(!yv())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Pn(e){return yv()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class yM{get currentNode(){return this._currentNode}set currentNode(t){if(!ui(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,i=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const a=r,c=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});n.push(c),c.currentNode=i,this._currentSetFor.add(c),r=i=a.host}else r=r.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=i,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ui(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let i;if(typeof this.filter=="function"?i=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(i=this.filter.acceptNode(t)),i===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let s=this.nextNode();return s&&(this.currentNode=s),s}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let i=this.previousNode();return i&&(this.currentNode=i),i}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(n)),s===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let a=this.lastChild();return a&&(this.currentNode=a),a}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let i=this.previousNode();return i&&(this.currentNode=i),i}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,n,r,i){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=a=>{if(a.nodeType===Node.ELEMENT_NODE){const d=a.shadowRoot;if(d){const h=this._doc.createTreeWalker(d,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(h),NodeFilter.FILTER_ACCEPT}else{var c;if(typeof this.filter=="function")return this.filter(a);if(!((c=this.filter)===null||c===void 0)&&c.acceptNode)return this.filter.acceptNode(a);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=i??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const s=n.shadowRoot;if(s){const a=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(a)}}}function bM(e,t,n,r){return yv()?new yM(e,t,n,r):e.createTreeWalker(t,n,r)}function zE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t=65&&i.charCodeAt(2)<=90?t[i]=Af(s,a):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof a=="string"?t[i]=xM(s,a):i==="id"&&s&&a?t.id=pM(s,a):t[i]=a!==void 0?a:s}}return t}const wM=new Set(["id"]),SM=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),kM=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),CM=/^(data-.*)$/;function Du(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,s={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(wM.has(a)||n&&SM.has(a)||r&&kM.has(a)||i?.has(a)||CM.test(a))&&(s[a]=e[a]);return s}function Za(e){if(EM())e.focus({preventScroll:!0});else{let t=PM(e);e.focus(),TM(t)}}let ug=null;function EM(){if(ug==null){ug=!1;try{document.createElement("div").focus({get preventScroll(){return ug=!0,!0}})}catch{}}return ug}function PM(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function hx(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ea(e){let t=null;return()=>(t==null&&(t=e()),t)}const Pu=ea(function(){return hx(/^Mac/i)}),_M=ea(function(){return hx(/^iPhone/i)}),jE=ea(function(){return hx(/^iPad/i)||Pu()&&navigator.maxTouchPoints>1}),xv=ea(function(){return _M()||jE()}),IM=ea(function(){return Pu()||xv()}),BE=ea(function(){return bv(/AppleWebKit/i)&&!VE()}),VE=ea(function(){return bv(/Chrome/i)}),mx=ea(function(){return bv(/Android/i)}),RM=ea(function(){return bv(/Firefox/i)}),UE=S.createContext({isNative:!0,open:LM,useHref:e=>e});function $M(e){let{children:t,navigate:n,useHref:r}=e,i=S.useMemo(()=>({isNative:!1,open:(s,a,c,d)=>{WE(s,h=>{AM(h,a)?n(c,d):Tu(h,a)})},useHref:r||(s=>s)}),[n,r]);return He.createElement(UE.Provider,{value:i},t)}function gx(){return S.useContext(UE)}function AM(e,t){let n=e.getAttribute("target");return(!n||n==="_self")&&e.origin===location.origin&&!e.hasAttribute("download")&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function Tu(e,t,n=!0){var r,i;let{metaKey:s,ctrlKey:a,altKey:c,shiftKey:d}=t;RM()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Pu()?s=!0:a=!0);let h=BE()&&Pu()&&!jE()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:a,altKey:c,shiftKey:d}):new MouseEvent("click",{metaKey:s,ctrlKey:a,altKey:c,shiftKey:d,bubbles:!0,cancelable:!0});Tu.isOpening=n,Za(e),e.dispatchEvent(h),Tu.isOpening=!1}Tu.isOpening=!1;function WE(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function LM(e,t){WE(e,n=>Tu(n,t))}function Pq(e){let t=gx();var n;const r=t.useHref((n=e.href)!==null&&n!==void 0?n:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function Tq(e){let t=gx();var n;const r=t.useHref((n=e?.href)!==null&&n!==void 0?n:"");return{href:e?.href?r:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}let qa=new Map,Z0=new Set;function E1(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=qa.get(r.target);i||(i=new Set,qa.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=qa.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),qa.delete(r.target)),qa.size===0)){for(let s of Z0)s();Z0.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?E1():document.addEventListener("DOMContentLoaded",E1));function MM(){for(const[e]of qa)"isConnected"in e&&!e.isConnected&&qa.delete(e)}function KE(e){requestAnimationFrame(()=>{MM(),qa.size===0?e():Z0.add(e)})}function vx(){let e=S.useRef(new Map),t=S.useCallback((i,s,a,c)=>{let d=c?.once?(...h)=>{e.current.delete(a),a(...h)}:a;e.current.set(a,{type:s,eventTarget:i,fn:d,options:c}),i.addEventListener(s,d,c)},[]),n=S.useCallback((i,s,a,c)=>{var d;let h=((d=e.current.get(a))===null||d===void 0?void 0:d.fn)||a;i.removeEventListener(s,h,c),e.current.delete(a)},[]),r=S.useCallback(()=>{e.current.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})},[n]);return S.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function HE(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=$f(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function P1(e,t){const n=S.useRef(!0),r=S.useRef(null);rn(()=>(n.current=!0,()=>{n.current=!1}),[]),rn(()=>{n.current?n.current=!1:(!r.current||t.some((i,s)=>!Object.is(i,r[s])))&&e(),r.current=t},t)}function DM(){return typeof window.ResizeObserver<"u"}function T1(e){const{ref:t,box:n,onResize:r}=e;S.useEffect(()=>{let i=t?.current;if(i)if(DM()){const s=new window.ResizeObserver(a=>{a.length&&r()});return s.observe(i,{box:n}),()=>{i&&s.unobserve(i)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[r,t,n])}function GE(e,t){rn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Xp(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function qE(e,t){let n=e;for(Xp(n,t)&&(n=n.parentElement);n&&!Xp(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function NM(e,t){const n=[];for(;e&&e!==document.documentElement;)Xp(e,t)&&n.push(e),e=e.parentElement;return n}function cg(e,t,n,r){let i=Vn(n),s=n==null;S.useEffect(()=>{if(s||!e.current)return;let a=e.current;return a.addEventListener(t,i,r),()=>{a.removeEventListener(t,i,r)}},[e,t,r,s,i])}function YE(e,t){let n=_1(e,t,"left"),r=_1(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight,a=e.scrollLeft,c=e.scrollTop,{borderTopWidth:d,borderLeftWidth:h,scrollPaddingTop:m,scrollPaddingRight:g,scrollPaddingBottom:b,scrollPaddingLeft:x}=getComputedStyle(e),k=a+parseInt(h,10),P=c+parseInt(d,10),T=k+e.clientWidth,_=P+e.clientHeight,R=parseInt(m,10)||0,D=parseInt(b,10)||0,F=parseInt(g,10)||0,z=parseInt(x,10)||0;n<=a+z?a=n-parseInt(h,10)-z:n+i>T-F&&(a+=n+i-T+F),r<=P+R?c=r-parseInt(d,10)-R:r+s>_-D&&(c+=r+s-_+D),e.scrollLeft=a,e.scrollTop=c}function _1(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function I1(e,t){if(e&&document.contains(e)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let d=NM(e);for(let h of d)YE(h,e)}else{var n;let{left:d,top:h}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:m,top:g}=e.getBoundingClientRect();if(Math.abs(d-m)>1||Math.abs(h-g)>1){var r,i,s;t==null||(i=t.containingElement)===null||i===void 0||(r=i.scrollIntoView)===null||r===void 0||r.call(i,{block:"center",inline:"center"}),(s=e.scrollIntoView)===null||s===void 0||s.call(e,{block:"nearest"})}}}}function XE(e){return e.mozInputSource===0&&e.isTrusted?!0:mx()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function FM(e){return!mx()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function QE(e,t,n){let r=S.useRef(t),i=Vn(()=>{n&&n(r.current)});S.useEffect(()=>{var s;let a=e==null||(s=e.current)===null||s===void 0?void 0:s.form;return a?.addEventListener("reset",i),()=>{a?.removeEventListener("reset",i)}},[e,i])}const OM="react-aria-clear-focus",zM="react-aria-focus";function mp(e){return Pu()?e.metaKey:e.ctrlKey}var JE=_E();const ZE=mv(JE),yx=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],jM=yx.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";yx.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const BM=yx.join(':not([hidden]):not([tabindex="-1"]),');function eP(e){return e.matches(jM)}function VM(e){return e.matches(BM)}function Nu(e,t,n){let[r,i]=S.useState(e||t),s=S.useRef(e!==void 0),a=e!==void 0;S.useEffect(()=>{s.current,s.current=a},[a]);let c=a?e:r,d=S.useCallback((h,...m)=>{let g=(b,...x)=>{n&&(Object.is(c,b)||n(b,...x)),a||(c=b)};typeof h=="function"?i((x,...k)=>{let P=h(a?c:x,...k);return g(P,...m),a?x:P}):(a||i(h),g(h,...m))},[a,c,n]);return[c,d]}function Ug(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}let Qy=new Map,eb=!1;try{eb=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Wg=!1;try{Wg=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const tP={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class UM{format(t){let n="";if(!eb&&this.options.signDisplay!=null?n=KM(this.numberFormatter,this.options.signDisplay,t):n=this.numberFormatter.format(t),this.options.style==="unit"&&!Wg){var r;let{unit:i,unitDisplay:s="short",locale:a}=this.resolvedOptions();if(!i)return n;let c=(r=tP[i])===null||r===void 0?void 0:r[s];n+=c[a]||c.default}return n}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,n);if(n= start date");return`${this.format(t)} – ${this.format(n)}`}formatRangeToParts(t,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,n);if(n= start date");let r=this.numberFormatter.formatToParts(t),i=this.numberFormatter.formatToParts(n);return[...r.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!eb&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!Wg&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,n={}){this.numberFormatter=WM(t,n),this.options=n}}function WM(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),t.style==="unit"&&!Wg){var r;let{unit:a,unitDisplay:c="short"}=t;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=tP[a])===null||r===void 0)&&r[c]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${c}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((a,c)=>a[0]0||Object.is(n,0):t==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let i=e.format(-n),s=e.format(n),a=i.replace(s,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(s,"!!!").replace(a,"+").replace("!!!",s)}else return e.format(n)}}function HM(e={}){let{locale:t}=gh();return S.useMemo(()=>new UM(t,e),[t,e])}let Jy=new Map;function GM(e){let{locale:t}=gh(),n=t+(e?Object.entries(e).sort((i,s)=>i[0]-1&&e.splice(n,1)}const Qs=(e,t,n)=>n>t?t:n{};const us={},nP=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function rP(e){return typeof e=="object"&&e!==null}const iP=e=>/^0[^.\s]+$/u.test(e);function Cx(e){let t;return()=>(t===void 0&&(t=e()),t)}const qi=e=>e,qM=(e,t)=>n=>t(e(n)),yh=(...e)=>e.reduce(qM),Jp=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ex{constructor(){this.subscriptions=[]}add(t){return wx(this.subscriptions,t),()=>Sx(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;se*1e3,ss=e=>e/1e3;function oP(e,t){return t?e*(1e3/t):0}const sP=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,YM=1e-7,XM=12;function QM(e,t,n,r,i){let s,a,c=0;do a=t+(n-t)/2,s=sP(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>YM&&++cQM(s,0,1,e,n);return s=>s===0||s===1?s:sP(i(s),t,r)}const aP=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,lP=e=>t=>1-e(1-t),uP=bh(.33,1.53,.69,.99),Px=lP(uP),cP=aP(Px),fP=e=>(e*=2)<1?.5*Px(e):.5*(2-Math.pow(2,-10*(e-1))),Tx=e=>1-Math.sin(Math.acos(e)),dP=lP(Tx),pP=aP(Tx),JM=bh(.42,0,1,1),ZM=bh(0,0,.58,1),hP=bh(.42,0,.58,1),eD=e=>Array.isArray(e)&&typeof e[0]!="number",mP=e=>Array.isArray(e)&&typeof e[0]=="number",tD={linear:qi,easeIn:JM,easeInOut:hP,easeOut:ZM,circIn:Tx,circInOut:pP,circOut:dP,backIn:Px,backInOut:cP,backOut:uP,anticipate:fP},nD=e=>typeof e=="string",R1=e=>{if(mP(e)){kx(e.length===4);const[t,n,r,i]=e;return bh(t,n,r,i)}else if(nD(e))return tD[e];return e},fg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rD(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(m){a.has(m)&&(h.schedule(m),e()),m(c)}const h={schedule:(m,g=!1,b=!1)=>{const k=b&&i?n:r;return g&&a.add(m),k.has(m)||k.add(m),m},cancel:m=>{r.delete(m),a.delete(m)},process:m=>{if(c=m,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(d),n.clear(),i=!1,s&&(s=!1,h.process(m))}};return h}const iD=40;function gP(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=fg.reduce((D,F)=>(D[F]=rD(s),D),{}),{setup:c,read:d,resolveKeyframes:h,preUpdate:m,update:g,preRender:b,render:x,postRender:k}=a,P=()=>{const D=us.useManualTiming?i.timestamp:performance.now();n=!1,us.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(D-i.timestamp,iD),1)),i.timestamp=D,i.isProcessing=!0,c.process(i),d.process(i),h.process(i),m.process(i),g.process(i),b.process(i),x.process(i),k.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(P))},T=()=>{n=!0,r=!0,i.isProcessing||e(P)};return{schedule:fg.reduce((D,F)=>{const z=a[F];return D[F]=($,U=!1,Z=!1)=>(n||T(),z.schedule($,U,Z)),D},{}),cancel:D=>{for(let F=0;F($g===void 0&&ci.set(pr.isProcessing||us.useManualTiming?pr.timestamp:performance.now()),$g),set:e=>{$g=e,queueMicrotask(oD)}},vP=e=>t=>typeof t=="string"&&t.startsWith(e),_x=vP("--"),sD=vP("var(--"),Ix=e=>sD(e)?aD.test(e.split("/*")[0].trim()):!1,aD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Zp={...Bf,transform:e=>Qs(0,1,e)},dg={...Bf,default:1},Np=e=>Math.round(e*1e5)/1e5,Rx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lD(e){return e==null}const uD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$x=(e,t)=>n=>!!(typeof n=="string"&&uD.test(n)&&n.startsWith(e)||t&&!lD(n)&&Object.prototype.hasOwnProperty.call(n,t)),yP=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,c]=r.match(Rx);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},cD=e=>Qs(0,255,e),e0={...Bf,transform:e=>Math.round(cD(e))},xu={test:$x("rgb","red"),parse:yP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+e0.transform(e)+", "+e0.transform(t)+", "+e0.transform(n)+", "+Np(Zp.transform(r))+")"};function fD(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const tb={test:$x("#"),parse:fD,transform:xu.transform},xh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ga=xh("deg"),as=xh("%"),it=xh("px"),dD=xh("vh"),pD=xh("vw"),$1={...as,parse:e=>as.parse(e)/100,transform:e=>as.transform(e*100)},bf={test:$x("hsl","hue"),parse:yP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+as.transform(Np(t))+", "+as.transform(Np(n))+", "+Np(Zp.transform(r))+")"},Ln={test:e=>xu.test(e)||tb.test(e)||bf.test(e),parse:e=>xu.test(e)?xu.parse(e):bf.test(e)?bf.parse(e):tb.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xu.transform(e):bf.transform(e),getAnimatableNone:e=>{const t=Ln.parse(e);return t.alpha=0,Ln.transform(t)}},hD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mD(e){return isNaN(e)&&typeof e=="string"&&(e.match(Rx)?.length||0)+(e.match(hD)?.length||0)>0}const bP="number",xP="color",gD="var",vD="var(",A1="${}",yD=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function eh(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const c=t.replace(yD,d=>(Ln.test(d)?(r.color.push(s),i.push(xP),n.push(Ln.parse(d))):d.startsWith(vD)?(r.var.push(s),i.push(gD),n.push(d)):(r.number.push(s),i.push(bP),n.push(parseFloat(d))),++s,A1)).split(A1);return{values:n,split:c,indexes:r,types:i}}function wP(e){return eh(e).values}function SP(e){const{split:t,types:n}=eh(e),r=t.length;return i=>{let s="";for(let a=0;atypeof e=="number"?0:Ln.test(e)?Ln.getAnimatableNone(e):e;function xD(e){const t=wP(e);return SP(e)(t.map(bD))}const tl={test:mD,parse:wP,createTransformer:SP,getAnimatableNone:xD};function t0(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wD({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;i=t0(d,c,e+1/3),s=t0(d,c,e),a=t0(d,c,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Kg(e,t){return n=>n>0?t:e}const ln=(e,t,n)=>e+(t-e)*n,n0=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},SD=[tb,xu,bf],kD=e=>SD.find(t=>t.test(e));function L1(e){const t=kD(e);if(!t)return!1;let n=t.parse(e);return t===bf&&(n=wD(n)),n}const M1=(e,t)=>{const n=L1(e),r=L1(t);if(!n||!r)return Kg(e,t);const i={...n};return s=>(i.red=n0(n.red,r.red,s),i.green=n0(n.green,r.green,s),i.blue=n0(n.blue,r.blue,s),i.alpha=ln(n.alpha,r.alpha,s),xu.transform(i))},nb=new Set(["none","hidden"]);function CD(e,t){return nb.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ED(e,t){return n=>ln(e,t,n)}function Ax(e){return typeof e=="number"?ED:typeof e=="string"?Ix(e)?Kg:Ln.test(e)?M1:_D:Array.isArray(e)?kP:typeof e=="object"?Ln.test(e)?M1:PD:Kg}function kP(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>Ax(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in r)n[s]=r[s](i);return n}}function TD(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i{const n=tl.createTransformer(t),r=eh(e),i=eh(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?nb.has(e)&&!i.values.length||nb.has(t)&&!r.values.length?CD(e,t):yh(kP(TD(r,i),i.values),n):Kg(e,t)};function CP(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ln(e,t,n):Ax(e)(e,t)}const ID=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>tn.update(t,n),stop:()=>el(t),now:()=>pr.isProcessing?pr.timestamp:ci.now()}},EP=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s=Hg?1/0:t}function RD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Lx(r),Hg);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ss(i)}}const $D=5;function PP(e,t,n){const r=Math.max(t-$D,0);return oP(n-e(r),t-r)}const hn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},r0=.001;function AD({duration:e=hn.duration,bounce:t=hn.bounce,velocity:n=hn.velocity,mass:r=hn.mass}){let i,s,a=1-t;a=Qs(hn.minDamping,hn.maxDamping,a),e=Qs(hn.minDuration,hn.maxDuration,ss(e)),a<1?(i=h=>{const m=h*a,g=m*e,b=m-n,x=rb(h,a),k=Math.exp(-g);return r0-b/x*k},s=h=>{const g=h*a*e,b=g*n+n,x=Math.pow(a,2)*Math.pow(h,2)*e,k=Math.exp(-g),P=rb(Math.pow(h,2),a);return(-i(h)+r0>0?-1:1)*((b-x)*k)/P}):(i=h=>{const m=Math.exp(-h*e),g=(h-n)*e+1;return-r0+m*g},s=h=>{const m=Math.exp(-h*e),g=(n-h)*(e*e);return m*g});const c=5/e,d=MD(i,s,c);if(e=os(e),isNaN(d))return{stiffness:hn.stiffness,damping:hn.damping,duration:e};{const h=Math.pow(d,2)*r;return{stiffness:h,damping:a*2*Math.sqrt(r*h),duration:e}}}const LD=12;function MD(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function FD(e){let t={velocity:hn.velocity,stiffness:hn.stiffness,damping:hn.damping,mass:hn.mass,isResolvedFromDuration:!1,...e};if(!D1(e,ND)&&D1(e,DD))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Qs(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:hn.mass,stiffness:i,damping:s}}else{const n=AD(e);t={...t,...n,mass:hn.mass},t.isResolvedFromDuration=!0}return t}function Gg(e=hn.visualDuration,t=hn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:d,damping:h,mass:m,duration:g,velocity:b,isResolvedFromDuration:x}=FD({...n,velocity:-ss(n.velocity||0)}),k=b||0,P=h/(2*Math.sqrt(d*m)),T=a-s,_=ss(Math.sqrt(d/m)),R=Math.abs(T)<5;r||(r=R?hn.restSpeed.granular:hn.restSpeed.default),i||(i=R?hn.restDelta.granular:hn.restDelta.default);let D;if(P<1){const z=rb(_,P);D=$=>{const U=Math.exp(-P*_*$);return a-U*((k+P*_*T)/z*Math.sin(z*$)+T*Math.cos(z*$))}}else if(P===1)D=z=>a-Math.exp(-_*z)*(T+(k+_*T)*z);else{const z=_*Math.sqrt(P*P-1);D=$=>{const U=Math.exp(-P*_*$),Z=Math.min(z*$,300);return a-U*((k+P*_*T)*Math.sinh(Z)+z*T*Math.cosh(Z))/z}}const F={calculatedDuration:x&&g||null,next:z=>{const $=D(z);if(x)c.done=z>=g;else{let U=z===0?k:0;P<1&&(U=z===0?os(k):PP(D,z,$));const Z=Math.abs(U)<=r,ae=Math.abs(a-$)<=i;c.done=Z&&ae}return c.value=c.done?a:$,c},toString:()=>{const z=Math.min(Lx(F),Hg),$=EP(U=>F.next(z*U).value,z,30);return z+"ms "+$},toTransition:()=>{}};return F}Gg.applyToOptions=e=>{const t=RD(e,100,Gg);return e.ease=t.ease,e.duration=os(t.duration),e.type="keyframes",e};function ib({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:c,max:d,restDelta:h=.5,restSpeed:m}){const g=e[0],b={done:!1,value:g},x=Z=>c!==void 0&&Zd,k=Z=>c===void 0?d:d===void 0||Math.abs(c-Z)-P*Math.exp(-Z/r),D=Z=>_+R(Z),F=Z=>{const ae=R(Z),B=D(Z);b.done=Math.abs(ae)<=h,b.value=b.done?_:B};let z,$;const U=Z=>{x(b.value)&&(z=Z,$=Gg({keyframes:[b.value,k(b.value)],velocity:PP(D,Z,b.value),damping:i,stiffness:s,restDelta:h,restSpeed:m}))};return U(0),{calculatedDuration:null,next:Z=>{let ae=!1;return!$&&z===void 0&&(ae=!0,F(Z),U(Z)),z!==void 0&&Z>=z?$.next(Z-z):(!ae&&F(Z),b)}}}function OD(e,t,n){const r=[],i=n||us.mix||CP,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=OD(t,r,i),d=c.length,h=m=>{if(a&&m1)for(;gh(Qs(e[0],e[s-1],m)):h}function jD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Jp(0,t,r);e.push(ln(n,1,i))}}function BD(e){const t=[0];return jD(t,e.length-1),t}function VD(e,t){return e.map(n=>n*t)}function UD(e,t){return e.map(()=>t||hP).splice(0,e.length-1)}function Fp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=eD(r)?r.map(R1):R1(r),s={done:!1,value:t[0]},a=VD(n&&n.length===t.length?n:BD(t),e),c=zD(a,t,{ease:Array.isArray(i)?i:UD(t,i)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const WD=e=>e!==null;function Mx(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(WD),c=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||r===void 0?s[c]:r}const KD={decay:ib,inertia:ib,tween:Fp,keyframes:Fp,spring:Gg};function TP(e){typeof e.type=="string"&&(e.type=KD[e.type])}class Dx{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const HD=e=>e/100;class Nx extends Dx{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==ci.now()&&this.tick(ci.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;TP(t);const{type:n=Fp,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:c}=t;const d=n||Fp;d!==Fp&&typeof c[0]!="number"&&(this.mixKeyframes=yh(HD,CP(c[0],c[1])),c=[0,100]);const h=d({...t,keyframes:c});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=Lx(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:h=0,keyframes:m,repeat:g,repeatType:b,repeatDelay:x,type:k,onUpdate:P,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-h*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?_<0:_>i;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let D=this.currentTime,F=r;if(g){const Z=Math.min(this.currentTime,i)/c;let ae=Math.floor(Z),B=Z%1;!B&&Z>=1&&(B=1),B===1&&ae--,ae=Math.min(ae,g+1),ae%2&&(b==="reverse"?(B=1-B,x&&(B-=x/c)):b==="mirror"&&(F=a)),D=Qs(0,1,B)*c}const z=R?{done:!1,value:m[0]}:F.next(D);s&&(z.value=s(z.value));let{done:$}=z;!R&&d!==null&&($=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return U&&k!==ib&&(z.value=Mx(m,this.options,T,this.speed)),P&&P(z.value),U&&this.finish(),z}then(t,n){return this.finished.then(t,n)}get duration(){return ss(this.calculatedDuration)}get time(){return ss(this.currentTime)}set time(t){t=os(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ci.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ss(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ID,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ci.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function GD(e){for(let t=1;te*180/Math.PI,ob=e=>{const t=wu(Math.atan2(e[1],e[0]));return sb(t)},qD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ob,rotateZ:ob,skewX:e=>wu(Math.atan(e[1])),skewY:e=>wu(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},sb=e=>(e=e%360,e<0&&(e+=360),e),N1=ob,F1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),O1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),YD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:F1,scaleY:O1,scale:e=>(F1(e)+O1(e))/2,rotateX:e=>sb(wu(Math.atan2(e[6],e[5]))),rotateY:e=>sb(wu(Math.atan2(-e[2],e[0]))),rotateZ:N1,rotate:N1,skewX:e=>wu(Math.atan(e[4])),skewY:e=>wu(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ab(e){return e.includes("scale")?1:0}function lb(e,t){if(!e||e==="none")return ab(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=YD,i=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qD,i=c}if(!i)return ab(t);const s=r[t],a=i[1].split(",").map(QD);return typeof s=="function"?s(a):a[s]}const XD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return lb(n,t)};function QD(e){return parseFloat(e.trim())}const Vf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fu=new Set(Vf),z1=e=>e===Bf||e===it,JD=new Set(["x","y","z"]),ZD=Vf.filter(e=>!JD.has(e));function e3(e){const t=[];return ZD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Cu={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>lb(t,"x"),y:(e,{transform:t})=>lb(t,"y")};Cu.translateX=Cu.x;Cu.translateY=Cu.y;const Eu=new Set;let ub=!1,cb=!1,fb=!1;function _P(){if(cb){const e=Array.from(Eu).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=e3(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{r.getValue(s)?.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}cb=!1,ub=!1,Eu.forEach(e=>e.complete(fb)),Eu.clear()}function IP(){Eu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(cb=!0)})}function t3(){fb=!0,IP(),_P(),fb=!1}class Fx{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Eu.add(this),ub||(ub=!0,tn.read(IP),tn.resolveKeyframes(_P))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i?.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}GD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Eu.delete(this)}cancel(){this.state==="scheduled"&&(Eu.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const n3=e=>e.startsWith("--");function r3(e,t,n){n3(t)?e.style.setProperty(t,n):e.style[t]=n}const i3=Cx(()=>window.ScrollTimeline!==void 0),o3={};function s3(e,t){const n=Cx(e);return()=>o3[t]??n()}const RP=s3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$p=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,j1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$p([0,.65,.55,1]),circOut:$p([.55,0,1,.45]),backIn:$p([.31,.01,.66,-.59]),backOut:$p([.33,1.53,.69,.99])};function $P(e,t){if(e)return typeof e=="function"?RP()?EP(e,t):"ease-out":mP(e)?$p(e):Array.isArray(e)?e.map(n=>$P(n,t)||j1.easeOut):j1[e]}function a3(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:c="easeOut",times:d}={},h=void 0){const m={[t]:n};d&&(m.offset=d);const g=$P(c,i);Array.isArray(g)&&(m.easing=g);const b={delay:r,duration:i,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return h&&(b.pseudoElement=h),e.animate(m,b)}function AP(e){return typeof e=="function"&&"applyToOptions"in e}function l3({type:e,...t}){return AP(e)&&RP()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class u3 extends Dx{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,kx(typeof t.type!="string");const h=l3(t);this.animation=a3(n,r,i,h,s),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=Mx(i,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):r3(n,r,m),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ss(Number(t))}get time(){return ss(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=os(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&i3()?(this.animation.timeline=t,qi):n(this)}}const LP={anticipate:fP,backInOut:cP,circInOut:pP};function c3(e){return e in LP}function f3(e){typeof e.ease=="string"&&c3(e.ease)&&(e.ease=LP[e.ease])}const B1=10;class d3 extends u3{constructor(t){f3(t),TP(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Nx({...a,autoplay:!1}),d=os(this.finishedTime??this.time);n.setWithVelocity(c.sample(d-B1).value,c.sample(d).value,B1),c.stop()}}const V1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(tl.test(e)||e==="0")&&!e.startsWith("url("));function p3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function v3(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:h}=t.owner.getProps();return g3()&&n&&m3.has(n)&&(n!=="transform"||!h)&&!d&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const y3=40;class b3 extends Dx{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:c,name:d,motionValue:h,element:m,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ci.now();const b={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:d,motionValue:h,element:m,...g},x=m?.KeyframeResolver||Fx;this.keyframeResolver=new x(c,(k,P,T)=>this.onKeyframesResolved(k,P,b,!T),d,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:s,type:a,velocity:c,delay:d,isHandoff:h,onUpdate:m}=r;this.resolvedAt=ci.now(),h3(t,s,a,c)||((us.instantAnimations||!d)&&m?.(Mx(t,r,n)),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const b={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>y3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=!h&&v3(b)?new d3({...b,element:b.motionValue.owner.current}):new Nx(b);x.finished.then(()=>this.notifyFinished()).catch(qi),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),t3()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const x3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function w3(e){const t=x3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function MP(e,t,n=1){const[r,i]=w3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return nP(a)?parseFloat(a):a}return Ix(i)?MP(i,t,n+1):i}function Ox(e,t){return e?.[t]??e?.default??e}const DP=new Set(["width","height","top","left","right","bottom",...Vf]),S3={test:e=>e==="auto",parse:e=>e},NP=e=>t=>t.test(e),FP=[Bf,it,as,Ga,pD,dD,S3],U1=e=>FP.find(NP(e));function k3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||iP(e):!0}const C3=new Set(["brightness","contrast","saturate","opacity"]);function E3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Rx)||[];if(!r)return e;const i=n.replace(r,"");let s=C3.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const P3=/\b([a-z-]*)\(.*?\)/gu,db={...tl,getAnimatableNone:e=>{const t=e.match(P3);return t?t.map(E3).join(" "):e}},W1={...Bf,transform:Math.round},T3={rotate:Ga,rotateX:Ga,rotateY:Ga,rotateZ:Ga,scale:dg,scaleX:dg,scaleY:dg,scaleZ:dg,skew:Ga,skewX:Ga,skewY:Ga,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:Zp,originX:$1,originY:$1,originZ:it},zx={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,backgroundPositionX:it,backgroundPositionY:it,...T3,zIndex:W1,fillOpacity:Zp,strokeOpacity:Zp,numOctaves:W1},_3={...zx,color:Ln,backgroundColor:Ln,outlineColor:Ln,fill:Ln,stroke:Ln,borderColor:Ln,borderTopColor:Ln,borderRightColor:Ln,borderBottomColor:Ln,borderLeftColor:Ln,filter:db,WebkitFilter:db},OP=e=>_3[e];function zP(e,t){let n=OP(e);return n!==db&&(n=tl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const I3=new Set(["auto","none","0"]);function R3(e,t,n){let r=0,i;for(;r{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const A3=new Set(["opacity","clipPath","filter","transform"]);function L3(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const jP=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function BP(e){return rP(e)&&"offsetHeight"in e}const K1=30,M3=e=>!isNaN(parseFloat(e));class VP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=ci.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty();i&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ci.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=M3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ex);const r=this.events[t].add(n);return t==="change"?()=>{r(),tn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ci.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>K1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,K1);return oP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lf(e,t){return new VP(e,t)}const{schedule:jx}=gP(queueMicrotask,!1),ho={x:!1,y:!1};function UP(){return ho.x||ho.y}function D3(e){return e==="x"||e==="y"?ho[e]?null:(ho[e]=!0,()=>{ho[e]=!1}):ho.x||ho.y?null:(ho.x=ho.y=!0,()=>{ho.x=ho.y=!1})}function WP(e,t){const n=L3(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function H1(e){return!(e.pointerType==="touch"||UP())}function N3(e,t,n={}){const[r,i,s]=WP(e,n),a=c=>{if(!H1(c))return;const{target:d}=c,h=t(d,c);if(typeof h!="function"||!d)return;const m=g=>{H1(g)&&(h(g),d.removeEventListener("pointerleave",m))};d.addEventListener("pointerleave",m,i)};return r.forEach(c=>{c.addEventListener("pointerenter",a,i)}),s}const KP=(e,t)=>t?e===t?!0:KP(e,t.parentElement):!1,Bx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,F3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function O3(e){return F3.has(e.tagName)||e.tabIndex!==-1}const Ag=new WeakSet;function G1(e){return t=>{t.key==="Enter"&&e(t)}}function i0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const z3=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=G1(()=>{if(Ag.has(n))return;i0(n,"down");const i=G1(()=>{i0(n,"up")}),s=()=>i0(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function q1(e){return Bx(e)&&!UP()}function j3(e,t,n={}){const[r,i,s]=WP(e,n),a=c=>{const d=c.currentTarget;if(!q1(c))return;Ag.add(d);const h=t(d,c),m=(x,k)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",b),Ag.has(d)&&Ag.delete(d),q1(x)&&typeof h=="function"&&h(x,{success:k})},g=x=>{m(x,d===window||d===document||n.useGlobalTarget||KP(d,x.target))},b=x=>{m(x,!1)};window.addEventListener("pointerup",g,i),window.addEventListener("pointercancel",b,i)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,i),BP(c)&&(c.addEventListener("focus",h=>z3(h,i)),!O3(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function HP(e){return rP(e)&&"ownerSVGElement"in e}function B3(e){return HP(e)&&e.tagName==="svg"}const Pr=e=>!!(e&&e.getVelocity),V3=[...FP,Ln,tl],U3=e=>V3.find(NP(e)),th=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class W3 extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=BP(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function K3({children:e,isPresent:t,anchorX:n,root:r}){const i=S.useId(),s=S.useRef(null),a=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=S.useContext(th);return S.useInsertionEffect(()=>{const{width:d,height:h,top:m,left:g,right:b}=a.current;if(t||!s.current||!d||!h)return;const x=n==="left"?`left: ${g}`:`right: ${b}`;s.current.dataset.motionPopId=i;const k=document.createElement("style");c&&(k.nonce=c);const P=r??document.head;return P.appendChild(k),k.sheet&&k.sheet.insertRule(` - [data-motion-pop-id="${i}"] { - position: absolute !important; - width: ${d}px !important; - height: ${h}px !important; - ${x}px !important; - top: ${m}px !important; - } - `),()=>{P.removeChild(k),P.contains(k)&&P.removeChild(k)}},[t]),A.jsx(W3,{isPresent:t,childRef:s,sizeRef:a,children:S.cloneElement(e,{ref:s})})}const H3=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:c,root:d})=>{const h=vh(G3),m=S.useId();let g=!0,b=S.useMemo(()=>(g=!1,{id:m,initial:t,isPresent:n,custom:i,onExitComplete:x=>{h.set(x,!0);for(const k of h.values())if(!k)return;r&&r()},register:x=>(h.set(x,!1),()=>h.delete(x))}),[n,h,r]);return s&&g&&(b={...b}),S.useMemo(()=>{h.forEach((x,k)=>h.set(k,!1))},[n]),S.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),a==="popLayout"&&(e=A.jsx(K3,{isPresent:n,anchorX:c,root:d,children:e})),A.jsx(wv.Provider,{value:b,children:e})};function G3(){return new Map}function GP(e=!0){const t=S.useContext(wv);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=S.useId();S.useEffect(()=>{if(e)return i(s)},[e]);const a=S.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const pg=e=>e.key||"";function Y1(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const rl=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:c="left",root:d})=>{const[h,m]=GP(a),g=S.useMemo(()=>Y1(e),[e]),b=a&&!h?[]:g.map(pg),x=S.useRef(!0),k=S.useRef(g),P=vh(()=>new Map),[T,_]=S.useState(g),[R,D]=S.useState(g);xx(()=>{x.current=!1,k.current=g;for(let $=0;${const U=pg($),Z=a&&!h?!1:g===R||b.includes(U),ae=()=>{if(P.has(U))P.set(U,!0);else return;let B=!0;P.forEach(G=>{G||(B=!1)}),B&&(z?.(),D(k.current),a&&m?.(),r&&r())};return A.jsx(H3,{isPresent:Z,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:d,onExitComplete:Z?void 0:ae,anchorX:c,children:$},U)})})},q3=S.createContext(null);function Y3(){const e=S.useRef(!1);return xx(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function X3(){const e=Y3(),[t,n]=S.useState(0),r=S.useCallback(()=>{e.current&&n(t+1)},[t]);return[S.useCallback(()=>tn.postRender(r),[r]),t]}const Q3=e=>!e.isLayoutDirty&&e.willUpdate(!1);function X1(){const e=new Set,t=new WeakMap,n=()=>e.forEach(Q3);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}const qP=e=>e===!0,J3=e=>qP(e===!0)||e==="id",Z3=({children:e,id:t,inherit:n=!0})=>{const r=S.useContext(Qp),i=S.useContext(q3),[s,a]=X3(),c=S.useRef(null),d=r.id||i;c.current===null&&(J3(n)&&d&&(t=t?d+"-"+t:d),c.current={id:t,group:qP(n)&&r.group||X1()});const h=S.useMemo(()=>({...c.current,forceRender:s}),[a]);return A.jsx(Qp.Provider,{value:h,children:e})},Vx=S.createContext({strict:!1}),Q1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Mf={};for(const e in Q1)Mf[e]={isEnabled:t=>Q1[e].some(n=>!!t[n])};function pb(e){for(const t in e)Mf[t]={...Mf[t],...e[t]}}function Df({children:e,features:t,strict:n=!1}){const[,r]=S.useState(!o0(t)),i=S.useRef(void 0);if(!o0(t)){const{renderer:s,...a}=t;i.current=s,pb(a)}return S.useEffect(()=>{o0(t)&&t().then(({renderer:s,...a})=>{pb(a),i.current=s,r(!0)})},[]),A.jsx(Vx.Provider,{value:{renderer:i.current,strict:n},children:e})}function o0(e){return typeof e=="function"}const e4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||e4.has(e)}let YP=e=>!qg(e);function XP(e){typeof e=="function"&&(YP=t=>t.startsWith("on")?!qg(t):e(t))}try{XP(require("@emotion/is-prop-valid").default)}catch{}function t4(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(YP(i)||n===!0&&qg(i)||!t&&!qg(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function n4({children:e,isValidProp:t,...n}){t&&XP(t),n={...S.useContext(th),...n},n.isStatic=vh(()=>n.isStatic);const r=S.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return A.jsx(th.Provider,{value:r,children:e})}const Sv=S.createContext({});function kv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function nh(e){return typeof e=="string"||Array.isArray(e)}const Ux=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wx=["initial",...Ux];function Cv(e){return kv(e.animate)||Wx.some(t=>nh(e[t]))}function QP(e){return!!(Cv(e)||e.variants)}function r4(e,t){if(Cv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||nh(n)?n:void 0,animate:nh(r)?r:void 0}}return e.inherit!==!1?t:{}}function i4(e){const{initial:t,animate:n}=r4(e,S.useContext(Sv));return S.useMemo(()=>({initial:t,animate:n}),[J1(t),J1(n)])}function J1(e){return Array.isArray(e)?e.join(" "):e}const rh={};function o4(e){for(const t in e)rh[t]=e[t],_x(t)&&(rh[t].isCSSVariable=!0)}function JP(e,{layout:t,layoutId:n}){return Fu.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!rh[e]||e==="opacity")}const s4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},a4=Vf.length;function l4(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}});function ZP(e,t,n){for(const r in t)!Pr(t[r])&&!JP(r,n)&&(e[r]=t[r])}function u4({transformTemplate:e},t){return S.useMemo(()=>{const n=Hx();return Kx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function c4(e,t){const n=e.style||{},r={};return ZP(r,n,e),Object.assign(r,u4(e,t)),r}function f4(e,t){const n={},r=c4(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const d4={offset:"stroke-dashoffset",array:"stroke-dasharray"},p4={offset:"strokeDashoffset",array:"strokeDasharray"};function h4(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?d4:p4;e[s.offset]=it.transform(-r);const a=it.transform(t),c=it.transform(n);e[s.array]=`${a} ${c}`}function eT(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...c},d,h,m){if(Kx(e,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;g.transform&&(b.transform=g.transform,delete g.transform),(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=m?.transformBox??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),i!==void 0&&h4(g,i,s,a,!1)}const tT=()=>({...Hx(),attrs:{}}),nT=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m4(e,t,n,r){const i=S.useMemo(()=>{const s=tT();return eT(s,t,nT(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ZP(s,e.style,e),i.style={...s,...i.style}}return i}const g4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Gx(e){return typeof e!="string"||e.includes("-")?!1:!!(g4.indexOf(e)>-1||/[A-Z]/u.test(e))}function v4(e,t,n,{latestValues:r},i,s=!1){const c=(Gx(e)?m4:f4)(t,r,i,e),d=t4(t,typeof e=="string",s),h=e!==S.Fragment?{...d,...c,ref:n}:{},{children:m}=t,g=S.useMemo(()=>Pr(m)?m.get():m,[m]);return S.createElement(e,{...h,children:g})}function Z1(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function qx(e,t,n,r){if(typeof t=="function"){const[i,s]=Z1(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Z1(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function Lg(e){return Pr(e)?e.get():e}function y4({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:b4(n,r,i,e),renderState:t()}}function b4(e,t,n,r){const i={},s=r(e,{});for(const b in s)i[b]=Lg(s[b]);let{initial:a,animate:c}=e;const d=Cv(e),h=QP(e);t&&h&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const g=m?c:a;if(g&&typeof g!="boolean"&&!kv(g)){const b=Array.isArray(g)?g:[g];for(let x=0;x(t,n)=>{const r=S.useContext(Sv),i=S.useContext(wv),s=()=>y4(e,t,r,i);return n?s():vh(s)};function Yx(e,t,n){const{style:r}=e,i={};for(const s in r)(Pr(r[s])||t.style&&Pr(t.style[s])||JP(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(i[s]=r[s]);return i}const x4=rT({scrapeMotionValuesFromProps:Yx,createRenderState:Hx});function iT(e,t,n){const r=Yx(e,t,n);for(const i in e)if(Pr(e[i])||Pr(t[i])){const s=Vf.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const w4=rT({scrapeMotionValuesFromProps:iT,createRenderState:tT}),S4=Symbol.for("motionComponentSymbol");function xf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k4(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):xf(n)&&(n.current=r))},[t])}const Xx=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),C4="framerAppearId",oT="data-"+Xx(C4),sT=S.createContext({});function E4(e,t,n,r,i){const{visualElement:s}=S.useContext(Sv),a=S.useContext(Vx),c=S.useContext(wv),d=S.useContext(th).reducedMotion,h=S.useRef(null);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const m=h.current,g=S.useContext(sT);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&P4(h.current,n,i,g);const b=S.useRef(!1);S.useInsertionEffect(()=>{m&&b.current&&m.update(n,c)});const x=n[oT],k=S.useRef(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return xx(()=>{m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),k.current&&m.animationState&&m.animationState.animateChanges())}),S.useEffect(()=>{m&&(!k.current&&m.animationState&&m.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),k.current=!1))}),m}function P4(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:c,layoutScroll:d,layoutRoot:h,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:aT(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||c&&xf(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:d,layoutRoot:h})}function aT(e){if(e)return e.options.allowProjection!==!1?e.projection:aT(e.parent)}function s0(e,{forwardMotionProps:t=!1}={},n,r){n&&pb(n);const i=Gx(e)?w4:x4;function s(c,d){let h;const m={...S.useContext(th),...c,layoutId:T4(c)},{isStatic:g}=m,b=i4(c),x=i(c,g);if(!g&&bx){_4();const k=I4(m);h=k.MeasureLayout,b.visualElement=E4(e,x,m,r,k.ProjectionNode)}return A.jsxs(Sv.Provider,{value:b,children:[h&&b.visualElement?A.jsx(h,{visualElement:b.visualElement,...m}):null,v4(e,c,k4(x,b.visualElement,d),x,g,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=S.forwardRef(s);return a[S4]=e,a}function T4({layoutId:e}){const t=S.useContext(Qp).id;return t&&e!==void 0?t+"-"+e:e}function _4(e,t){S.useContext(Vx).strict}function I4(e){const{drag:t,layout:n}=Mf;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function lT(e,t){if(typeof Proxy>"u")return s0;const n=new Map,r=(s,a)=>s0(s,a,e,t),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,s0(a,void 0,e,t)),n.get(a))})}const Nf=lT();function uT({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function R4({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $4(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function a0(e){return e===void 0||e===1}function hb({scale:e,scaleX:t,scaleY:n}){return!a0(e)||!a0(t)||!a0(n)}function yu(e){return hb(e)||cT(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function cT(e){return eS(e.x)||eS(e.y)}function eS(e){return e&&e!=="0%"}function Yg(e,t,n){const r=e-n,i=t*r;return n+i}function tS(e,t,n,r,i){return i!==void 0&&(e=Yg(e,i,r)),Yg(e,n,r)+t}function mb(e,t=0,n=1,r,i){e.min=tS(e.min,t,n,r,i),e.max=tS(e.max,t,n,r,i)}function fT(e,{x:t,y:n}){mb(e.x,t.translate,t.scale,t.originPoint),mb(e.y,n.translate,n.scale,n.originPoint)}const nS=.999999999999,rS=1.0000000000001;function A4(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let c=0;cnS&&(t.x=1),t.ynS&&(t.y=1)}function wf(e,t){e.min=e.min+t,e.max=e.max+t}function iS(e,t,n,r,i=.5){const s=ln(e.min,e.max,i);mb(e,t,n,s,r)}function Sf(e,t){iS(e.x,t.x,t.scaleX,t.scale,t.originX),iS(e.y,t.y,t.scaleY,t.scale,t.originY)}function dT(e,t){return uT($4(e.getBoundingClientRect(),t))}function L4(e,t,n){const r=dT(e,n),{scroll:i}=t;return i&&(wf(r.x,i.offset.x),wf(r.y,i.offset.y)),r}const oS=()=>({translate:0,scale:1,origin:0,originPoint:0}),kf=()=>({x:oS(),y:oS()}),sS=()=>({min:0,max:0}),En=()=>({x:sS(),y:sS()}),gb={current:null},pT={current:!1};function M4(){if(pT.current=!0,!!bx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gb.current=e.matches;e.addEventListener("change",t),t()}else gb.current=!1}const D4=new WeakMap;function N4(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Pr(i))e.addValue(r,i);else if(Pr(s))e.addValue(r,Lf(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,Lf(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const aS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class F4{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=ci.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),pT.current||M4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gb.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),el(this.notifyUpdate),el(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Fu.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&tn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Mf){const n=Mf[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):En()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Lf(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(nP(r)||iP(r))?r=parseFloat(r):!U3(r)&&tl.test(n)&&(r=zP(t,n)),this.setBaseTarget(t,Pr(r)?r.get():r)),Pr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=qx(this.props,n,this.presenceContext?.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Pr(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ex),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){jx.render(this.render)}}class hT extends F4{constructor(){super(...arguments),this.KeyframeResolver=$3}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function mT(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i?.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function O4(e){return window.getComputedStyle(e)}class z4 extends hT{constructor(){super(...arguments),this.type="html",this.renderInstance=mT}readValueFromInstance(t,n){if(Fu.has(n))return this.projection?.isProjecting?ab(n):XD(t,n);{const r=O4(t),i=(_x(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return dT(t,n)}build(t,n,r){Kx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Yx(t,n,r)}}const gT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function j4(e,t,n,r){mT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(gT.has(i)?i:Xx(i),t.attrs[i])}class B4 extends hT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=En}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Fu.has(n)){const r=OP(n);return r&&r.default||0}return n=gT.has(n)?n:Xx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iT(t,n,r)}build(t,n,r){eT(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){j4(t,n,r,i)}mount(t){this.isSVGTag=nT(t.tagName),super.mount(t)}}const V4=(e,t)=>Gx(e)?new B4(t):new z4(t,{allowProjection:e!==S.Fragment});function ih(e,t,n){const r=e.getProps();return qx(r,t,n!==void 0?n:r.custom,e)}const vb=e=>Array.isArray(e);function U4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Lf(n))}function W4(e){return vb(e)?e[e.length-1]||0:e}function K4(e,t){const n=ih(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const c=W4(s[a]);U4(e,a,c)}}function H4(e){return!!(Pr(e)&&e.add)}function yb(e,t){const n=e.getValue("willChange");if(H4(n))return n.add(t);if(!n&&us.WillChange){const r=new us.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function vT(e){return e.props[oT]}const G4=e=>e!==null;function q4(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(G4),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[s]}const Y4={type:"spring",stiffness:500,damping:25,restSpeed:10},X4=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Q4={type:"keyframes",duration:.8},J4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Z4=(e,{keyframes:t})=>t.length>2?Q4:Fu.has(e)?e.startsWith("scale")?X4(t[1]):Y4:J4;function eN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:c,from:d,elapsed:h,...m}){return!!Object.keys(m).length}const Qx=(e,t,n,r={},i,s)=>a=>{const c=Ox(r,e)||{},d=c.delay||r.delay||0;let{elapsed:h=0}=r;h=h-os(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:b=>{t.set(b),c.onUpdate&&c.onUpdate(b)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:i};eN(c)||Object.assign(m,Z4(e,m)),m.duration&&(m.duration=os(m.duration)),m.repeatDelay&&(m.repeatDelay=os(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let g=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(g=!0)),(us.instantAnimations||us.skipAnimations)&&(g=!0,m.duration=0,m.delay=0),m.allowFlatten=!c.type&&!c.ease,g&&!s&&t.get()!==void 0){const b=q4(m.keyframes,c);if(b!==void 0){tn.update(()=>{m.onUpdate(b),m.onComplete()});return}}return c.isSync?new Nx(m):new b3(m)};function tN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function yT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...c}=t;r&&(s=r);const d=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in c){const g=e.getValue(m,e.latestValues[m]??null),b=c[m];if(b===void 0||h&&tN(h,m))continue;const x={delay:n,...Ox(s||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating&&!Array.isArray(b)&&b===k&&!x.velocity)continue;let P=!1;if(window.MotionHandoffAnimation){const _=vT(e);if(_){const R=window.MotionHandoffAnimation(_,m,tn);R!==null&&(x.startTime=R,P=!0)}}yb(e,m),g.start(Qx(m,g,b,e.shouldReduceMotion&&DP.has(m)?{type:!1}:x,e,P));const T=g.animation;T&&d.push(T)}return a&&Promise.all(d).then(()=>{tn.update(()=>{a&&K4(e,a)})}),d}function bb(e,t,n={}){const r=ih(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(yT(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:g}=i;return nN(e,t,d,h,m,g,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[d,h]=c==="beforeChildren"?[s,a]:[a,s];return d().then(()=>h())}else return Promise.all([s(),a(n.delay)])}function nN(e,t,n=0,r=0,i=0,s=1,a){const c=[],d=e.variantChildren.size,h=(d-1)*i,m=typeof r=="function",g=m?b=>r(b,d):s===1?(b=0)=>b*i:(b=0)=>h-b*i;return Array.from(e.variantChildren).sort(rN).forEach((b,x)=>{b.notify("AnimationStart",t),c.push(bb(b,t,{...a,delay:n+(m?0:r)+g(x)}).then(()=>b.notify("AnimationComplete",t)))}),Promise.all(c)}function rN(e,t){return e.sortNodePosition(t)}function iN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>bb(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=bb(e,t,n);else{const i=typeof t=="function"?ih(e,t,n.custom):t;r=Promise.all(yT(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function bT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:n,options:r})=>iN(e,n,r)))}function uN(e){let t=lN(e),n=lS(),r=!0;const i=d=>(h,m)=>{const g=ih(e,m,d==="exit"?e.presenceContext?.custom:void 0);if(g){const{transition:b,transitionEnd:x,...k}=g;h={...h,...k,...x}}return h};function s(d){t=d(e)}function a(d){const{props:h}=e,m=xT(e.parent)||{},g=[],b=new Set;let x={},k=1/0;for(let T=0;Tk&&F,ae=!1;const B=Array.isArray(D)?D:[D];let G=B.reduce(i(_),{});z===!1&&(G={});const{prevResolvedValues:q={}}=R,te={...q,...G},K=X=>{Z=!0,b.has(X)&&(ae=!0,b.delete(X)),R.needsAnimating[X]=!0;const V=e.getValue(X);V&&(V.liveStyle=!1)};for(const X in te){const V=G[X],se=q[X];if(x.hasOwnProperty(X))continue;let M=!1;vb(V)&&vb(se)?M=!bT(V,se):M=V!==se,M?V!=null?K(X):b.add(X):V!==void 0&&b.has(X)?K(X):R.protectedKeys[X]=!0}R.prevProp=D,R.prevResolvedValues=G,R.isActive&&(x={...x,...G}),r&&e.blockInitialAnimation&&(Z=!1),Z&&(!($&&U)||ae)&&g.push(...B.map(X=>({animation:X,options:{type:_}})))}if(b.size){const T={};if(typeof h.initial!="boolean"){const _=ih(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(T.transition=_.transition)}b.forEach(_=>{const R=e.getBaseTarget(_),D=e.getValue(_);D&&(D.liveStyle=!0),T[_]=R??null}),g.push({animation:T})}let P=!!g.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(P=!1),r=!1,P?t(g):Promise.resolve()}function c(d,h){if(n[d].isActive===h)return Promise.resolve();e.variantChildren?.forEach(g=>g.animationState?.setActive(d,h)),n[d].isActive=h;const m=a(d);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:a,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=lS(),r=!0}}}function cN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bT(t,e):!1}function fu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lS(){return{animate:fu(!0),whileInView:fu(),whileHover:fu(),whileTap:fu(),whileDrag:fu(),whileFocus:fu(),exit:fu()}}class il{constructor(t){this.isMounted=!1,this.node=t}update(){}}class fN extends il{constructor(t){super(t),t.animationState||(t.animationState=uN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();kv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let dN=0;class pN extends il{constructor(){super(...arguments),this.id=dN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const hN={animation:{Feature:fN},exit:{Feature:pN}};function oh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wh(e){return{point:{x:e.pageX,y:e.pageY}}}const mN=e=>t=>Bx(t)&&e(t,wh(t));function Op(e,t,n,r){return oh(e,t,mN(n),r)}const wT=1e-4,gN=1-wT,vN=1+wT,ST=.01,yN=0-ST,bN=0+ST;function jr(e){return e.max-e.min}function xN(e,t,n){return Math.abs(e-t)<=n}function uS(e,t,n,r=.5){e.origin=r,e.originPoint=ln(t.min,t.max,e.origin),e.scale=jr(n)/jr(t),e.translate=ln(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gN&&e.scale<=vN||isNaN(e.scale))&&(e.scale=1),(e.translate>=yN&&e.translate<=bN||isNaN(e.translate))&&(e.translate=0)}function zp(e,t,n,r){uS(e.x,t.x,n.x,r?r.originX:void 0),uS(e.y,t.y,n.y,r?r.originY:void 0)}function cS(e,t,n){e.min=n.min+t.min,e.max=e.min+jr(t)}function wN(e,t,n){cS(e.x,t.x,n.x),cS(e.y,t.y,n.y)}function fS(e,t,n){e.min=t.min-n.min,e.max=e.min+jr(t)}function jp(e,t,n){fS(e.x,t.x,n.x),fS(e.y,t.y,n.y)}function Wi(e){return[e("x"),e("y")]}const kT=({current:e})=>e?e.ownerDocument.defaultView:null,dS=(e,t)=>Math.abs(e-t);function SN(e,t){const n=dS(e.x,t.x),r=dS(e.y,t.y);return Math.sqrt(n**2+r**2)}class CT{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=u0(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,k=SN(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!k)return;const{point:P}=b,{timestamp:T}=pr;this.history.push({...P,timestamp:T});const{onStart:_,onMove:R}=this.handlers;x||(_&&_(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=l0(x,this.transformPagePoint),tn.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:k,onSessionEnd:P,resumeAnimation:T}=this.handlers;if(this.dragSnapToOrigin&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=u0(b.type==="pointercancel"?this.lastMoveEventInfo:l0(x,this.transformPagePoint),this.history);this.startEvent&&k&&k(b,_),P&&P(b,_)},!Bx(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const c=wh(t),d=l0(c,this.transformPagePoint),{point:h}=d,{timestamp:m}=pr;this.history=[{...h,timestamp:m}];const{onSessionStart:g}=n;g&&g(t,u0(d,this.history)),this.removeListeners=yh(Op(this.contextWindow,"pointermove",this.handlePointerMove),Op(this.contextWindow,"pointerup",this.handlePointerUp),Op(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),el(this.updatePoint)}}function l0(e,t){return t?{point:t(e.point)}:e}function pS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function u0({point:e},t){return{point:e,delta:pS(e,ET(t)),offset:pS(e,kN(t)),velocity:CN(t,.1)}}function kN(e){return e[0]}function ET(e){return e[e.length-1]}function CN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=ET(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>os(t)));)n--;if(!r)return{x:0,y:0};const s=ss(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function EN(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?ln(n,e,r.max):Math.min(e,n)),e}function hS(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function PN(e,{top:t,left:n,bottom:r,right:i}){return{x:hS(e.x,n,i),y:hS(e.y,t,r)}}function mS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Jp(t.min,t.max-r,e.min):r>i&&(n=Jp(e.min,e.max-i,t.min)),Qs(0,1,n)}function IN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const xb=.35;function RN(e=xb){return e===!1?e=0:e===!0&&(e=xb),{x:gS(e,"left","right"),y:gS(e,"top","bottom")}}function gS(e,t,n){return{min:vS(e,t),max:vS(e,n)}}function vS(e,t){return typeof e=="number"?e:e[t]||0}const $N=new WeakMap;class AN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=En(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(wh(g).point)},a=(g,b)=>{const{drag:x,dragPropagation:k,onDragStart:P}=this.getProps();if(x&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=D3(x),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wi(_=>{let R=this.getAxisMotionValue(_).get()||0;if(as.test(R)){const{projection:D}=this.visualElement;if(D&&D.layout){const F=D.layout.layoutBox[_];F&&(R=jr(F)*(parseFloat(R)/100))}}this.originPoint[_]=R}),P&&tn.postRender(()=>P(g,b)),yb(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:x,dragDirectionLock:k,onDirectionLock:P,onDrag:T}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:_}=b;if(k&&this.currentDirection===null){this.currentDirection=LN(_),this.currentDirection!==null&&P&&P(this.currentDirection);return}this.updateAxis("x",b.point,_),this.updateAxis("y",b.point,_),this.visualElement.render(),T&&T(g,b)},d=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>Wi(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:m}=this.getProps();this.panSession=new CT(t,{onSessionStart:s,onStart:a,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:kT(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&tn.postRender(()=>c(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!hg(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=EN(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&xf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=PN(r.layoutBox,t):this.constraints=!1,this.elastic=RN(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Wi(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=IN(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=L4(r,i.root,this.visualElement.getTransformPagePoint());let a=TN(i.layout.layoutBox,s);if(n){const c=n(R4(a));this.hasMutatedConstraints=!!c,c&&(a=uT(c))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},h=Wi(m=>{if(!hg(m,n,this.currentDirection))return;let g=d&&d[m]||{};a&&(g={min:0,max:0});const b=i?200:1e6,x=i?40:1e7,k={type:"inertia",velocity:r?t[m]:0,bounceStiffness:b,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...s,...g};return this.startAxisValueAnimation(m,k)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return yb(this.visualElement,t),r.start(Qx(t,r,0,n,this.visualElement,!1))}stopAnimation(){Wi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Wi(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Wi(n=>{const{drag:r}=this.getProps();if(!hg(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:c}=i.layout.layoutBox[n];s.set(t[n]-ln(a,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Wi(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const d=c.get();i[a]=_N({min:d,max:d},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Wi(a=>{if(!hg(a,t,null))return;const c=this.getAxisMotionValue(a),{min:d,max:h}=this.constraints[a];c.set(ln(d,h,i[a]))})}addListeners(){if(!this.visualElement.current)return;$N.set(this.visualElement,this);const t=this.visualElement.current,n=Op(t,"pointerdown",d=>{const{drag:h,dragListener:m=!0}=this.getProps();h&&m&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();xf(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),tn.read(r);const a=oh(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Wi(m=>{const g=this.getAxisMotionValue(m);g&&(this.originPoint[m]+=d[m].translate,g.set(g.get()+d[m].translate))}),this.visualElement.render())}));return()=>{a(),n(),s(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=xb,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:c}}}function hg(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function LN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class MN extends il{constructor(t){super(t),this.removeGroupControls=qi,this.removeListeners=qi,this.controls=new AN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qi}unmount(){this.removeGroupControls(),this.removeListeners()}}const yS=e=>(t,n)=>{e&&tn.postRender(()=>e(t,n))};class DN extends il{constructor(){super(...arguments),this.removePointerDownListener=qi}onPointerDown(t){this.session=new CT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kT(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:yS(t),onStart:yS(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&tn.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Op(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Mg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function bS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(it.test(e))e=parseFloat(e);else return e;const n=bS(e,t.target.x),r=bS(e,t.target.y);return`${n}% ${r}%`}},NN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=tl.parse(e);if(i.length>5)return r;const s=tl.createTransformer(e),a=typeof i[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;i[0+a]/=c,i[1+a]/=d;const h=ln(c,d,.5);return typeof i[2+a]=="number"&&(i[2+a]/=h),typeof i[3+a]=="number"&&(i[3+a]/=h),s(i)}};let xS=!1;class FN extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;o4(ON),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),xS&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Mg.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,xS=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||tn.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),jx.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function PT(e){const[t,n]=GP(),r=S.useContext(Qp);return A.jsx(FN,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(sT),isPresent:t,safeToRemove:n})}const ON={borderRadius:{...gp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gp,borderTopRightRadius:gp,borderBottomLeftRadius:gp,borderBottomRightRadius:gp,boxShadow:NN};function zN(e,t,n){const r=Pr(e)?e:Lf(e);return r.start(Qx("",r,t,n)),r.animation}const jN=(e,t)=>e.depth-t.depth;class BN{constructor(){this.children=[],this.isDirty=!1}add(t){wx(this.children,t),this.isDirty=!0}remove(t){Sx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jN),this.isDirty=!1,this.children.forEach(t)}}function VN(e,t){const n=ci.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(el(r),e(s-t))};return tn.setup(r,!0),()=>el(r)}const TT=["TopLeft","TopRight","BottomLeft","BottomRight"],UN=TT.length,wS=e=>typeof e=="string"?parseFloat(e):e,SS=e=>typeof e=="number"||it.test(e);function WN(e,t,n,r,i,s){i?(e.opacity=ln(0,n.opacity??1,KN(r)),e.opacityExit=ln(t.opacity??1,0,HN(r))):s&&(e.opacity=ln(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(Jp(e,t,r))}function CS(e,t){e.min=t.min,e.max=t.max}function Vi(e,t){CS(e.x,t.x),CS(e.y,t.y)}function ES(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function PS(e,t,n,r,i){return e-=t,e=Yg(e,1/n,r),i!==void 0&&(e=Yg(e,1/i,r)),e}function GN(e,t=0,n=1,r=.5,i,s=e,a=e){if(as.test(t)&&(t=parseFloat(t),t=ln(a.min,a.max,t/100)-a.min),typeof t!="number")return;let c=ln(s.min,s.max,r);e===s&&(c-=t),e.min=PS(e.min,t,n,c,i),e.max=PS(e.max,t,n,c,i)}function TS(e,t,[n,r,i],s,a){GN(e,t[n],t[r],t[i],t.scale,s,a)}const qN=["x","scaleX","originX"],YN=["y","scaleY","originY"];function _S(e,t,n,r){TS(e.x,t,qN,n?n.x:void 0,r?r.x:void 0),TS(e.y,t,YN,n?n.y:void 0,r?r.y:void 0)}function IS(e){return e.translate===0&&e.scale===1}function IT(e){return IS(e.x)&&IS(e.y)}function RS(e,t){return e.min===t.min&&e.max===t.max}function XN(e,t){return RS(e.x,t.x)&&RS(e.y,t.y)}function $S(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function RT(e,t){return $S(e.x,t.x)&&$S(e.y,t.y)}function AS(e){return jr(e.x)/jr(e.y)}function LS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class QN{constructor(){this.members=[]}add(t){wx(this.members,t),t.scheduleRender()}remove(t){if(Sx(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function JN(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=n?.z||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,rotateX:g,rotateY:b,skewX:x,skewY:k}=n;h&&(r=`perspective(${h}px) ${r}`),m&&(r+=`rotate(${m}deg) `),g&&(r+=`rotateX(${g}deg) `),b&&(r+=`rotateY(${b}deg) `),x&&(r+=`skewX(${x}deg) `),k&&(r+=`skewY(${k}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const c0=["","X","Y","Z"],ZN=1e3;let e5=0;function f0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function $T(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",tn,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&$T(r)}function AT({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},c=t?.()){this.id=e5++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(r5),this.nodes.forEach(a5),this.nodes.forEach(l5),this.nodes.forEach(i5)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;dthis.root.updateBlockedByResize=!1;tn.read(()=>{g=window.innerWidth}),e(a,()=>{const x=window.innerWidth;x!==g&&(g=x,this.root.updateBlockedByResize=!0,m&&m(),m=VN(b,250),Mg.hasAnimatedSinceResize&&(Mg.hasAnimatedSinceResize=!1,this.nodes.forEach(NS)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||h.getDefaultTransition()||p5,{onLayoutAnimationStart:P,onLayoutAnimationComplete:T}=h.getProps(),_=!this.targetLayout||!RT(this.targetLayout,x),R=!g&&b;if(this.options.layoutRoot||this.resumeFrom||R||g&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const D={...Ox(k,"layout"),onPlay:P,onComplete:T};(h.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D),this.setAnimationOrigin(m,R)}else g||NS(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),el(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(u5),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$T(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!jr(this.snapshot.measuredBox.x)&&!jr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d{const z=F/1e3;FS(g.x,a.x,z),FS(g.y,a.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jp(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f5(this.relativeTarget,this.relativeTargetOrigin,b,z),D&&XN(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=En()),Vi(D,this.relativeTarget)),P&&(this.animationValues=m,WN(m,h,this.latestValues,z,R,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(el(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tn.update(()=>{Mg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Lf(0)),this.currentAnimation=zN(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ZN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:d,layout:h,latestValues:m}=a;if(!(!c||!d||!h)){if(this!==a&&this.layout&&h&<(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||En();const g=jr(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+g;const b=jr(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+b}Vi(c,d),Sf(c,m),zp(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new QN),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const h={};d.z&&f0("z",a,h,this.animationValues);for(let m=0;ma.currentAnimation?.stop()),this.root.nodes.forEach(MS),this.root.sharedNodes.clear()}}}function t5(e){e.updateLayout()}function n5(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;i==="size"?Wi(m=>{const g=s?t.measuredBox[m]:t.layoutBox[m],b=jr(g);g.min=n[m].min,g.max=g.min+b}):LT(i,t.layoutBox,n)&&Wi(m=>{const g=s?t.measuredBox[m]:t.layoutBox[m],b=jr(n[m]);g.max=g.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+b)});const a=kf();zp(a,n,t.layoutBox);const c=kf();s?zp(c,e.applyTransform(r,!0),t.measuredBox):zp(c,n,t.layoutBox);const d=!IT(a);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:b}=m;if(g&&b){const x=En();jp(x,t.layoutBox,g.layoutBox);const k=En();jp(k,n,b.layoutBox),RT(x,k)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=k,e.relativeTargetOrigin=x,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function r5(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function i5(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function o5(e){e.clearSnapshot()}function MS(e){e.clearMeasurements()}function DS(e){e.isLayoutDirty=!1}function s5(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function NS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function a5(e){e.resolveTargetDelta()}function l5(e){e.calcProjection()}function u5(e){e.resetSkewAndRotation()}function c5(e){e.removeLeadSnapshot()}function FS(e,t,n){e.translate=ln(t.translate,0,n),e.scale=ln(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function OS(e,t,n,r){e.min=ln(t.min,n.min,r),e.max=ln(t.max,n.max,r)}function f5(e,t,n,r){OS(e.x,t.x,n.x,r),OS(e.y,t.y,n.y,r)}function d5(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const p5={duration:.45,ease:[.4,0,.1,1]},zS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jS=zS("applewebkit/")&&!zS("chrome/")?Math.round:qi;function BS(e){e.min=jS(e.min),e.max=jS(e.max)}function h5(e){BS(e.x),BS(e.y)}function LT(e,t,n){return e==="position"||e==="preserve-aspect"&&!xN(AS(t),AS(n),.2)}function m5(e){return e!==e.root&&e.scroll?.wasRoot}const g5=AT({attachResizeListener:(e,t)=>oh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),d0={current:void 0},MT=AT({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!d0.current){const e=new g5({});e.mount(window),e.setOptions({layoutScroll:!0}),d0.current=e}return d0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),v5={pan:{Feature:DN},drag:{Feature:MN,ProjectionNode:MT,MeasureLayout:PT}};function VS(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&tn.postRender(()=>s(t,wh(t)))}class y5 extends il{mount(){const{current:t}=this.node;t&&(this.unmount=N3(t,(n,r)=>(VS(this.node,r,"Start"),i=>VS(this.node,i,"End"))))}unmount(){}}class b5 extends il{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yh(oh(this.node.current,"focus",()=>this.onFocus()),oh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function US(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&tn.postRender(()=>s(t,wh(t)))}class x5 extends il{mount(){const{current:t}=this.node;t&&(this.unmount=j3(t,(n,r)=>(US(this.node,r,"Start"),(i,{success:s})=>US(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wb=new WeakMap,p0=new WeakMap,w5=e=>{const t=wb.get(e.target);t&&t(e)},S5=e=>{e.forEach(w5)};function k5({root:e,...t}){const n=e||document;p0.has(n)||p0.set(n,{});const r=p0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(S5,{root:e,...t})),r[i]}function C5(e,t,n){const r=k5(t);return wb.set(e,n),r.observe(e),()=>{wb.delete(e),r.unobserve(e)}}const E5={some:0,all:1};class P5 extends il{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:E5[i]},c=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:g}=this.node.getProps(),b=h?m:g;b&&b(d)};return C5(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(T5(t,n))&&this.startObserver()}unmount(){}}function T5({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _5={inView:{Feature:P5},tap:{Feature:x5},focus:{Feature:b5},hover:{Feature:y5}},I5={layout:{ProjectionNode:MT,MeasureLayout:PT}},R5={...hN,..._5,...v5,...I5},Xs=lT(R5,V4);class $5 extends VP{constructor(){super(...arguments),this.isEnabled=!1}add(t){(Fu.has(t)||A3.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function A5(){return vh(()=>new $5("auto"))}const is={top:"top",bottom:"top",left:"left",right:"left"},Xg={top:"bottom",bottom:"top",left:"right",right:"left"},L5={top:"left",left:"top"},Sb={top:"height",left:"width"},DT={width:"totalWidth",height:"totalHeight"},mg={};let rr=typeof document<"u"?window.visualViewport:null;function WS(e){let t=0,n=0,r=0,i=0,s=0,a=0,c={};var d;let h=((d=rr?.scale)!==null&&d!==void 0?d:1)>1;if(e.tagName==="BODY"){let k=document.documentElement;r=k.clientWidth,i=k.clientHeight;var m;t=(m=rr?.width)!==null&&m!==void 0?m:r;var g;n=(g=rr?.height)!==null&&g!==void 0?g:i,c.top=k.scrollTop||e.scrollTop,c.left=k.scrollLeft||e.scrollLeft,rr&&(s=rr.offsetTop,a=rr.offsetLeft)}else({width:t,height:n,top:s,left:a}=Pf(e)),c.top=e.scrollTop,c.left=e.scrollLeft,r=t,i=n;if(BE()&&(e.tagName==="BODY"||e.tagName==="HTML")&&h){c.top=0,c.left=0;var b;s=(b=rr?.pageTop)!==null&&b!==void 0?b:0;var x;a=(x=rr?.pageLeft)!==null&&x!==void 0?x:0}return{width:t,height:n,totalWidth:r,totalHeight:i,scroll:c,top:s,left:a}}function M5(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function KS(e,t,n,r,i,s,a){var c;let d=(c=i.scroll[e])!==null&&c!==void 0?c:0,h=r[Sb[e]],m=r.scroll[is[e]]+s,g=h+r.scroll[is[e]]-s,b=t-d+a[e]-r[is[e]],x=t-d+n+a[e]-r[is[e]];return bg?Math.max(g-x,m-b):0}function D5(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function HS(e){if(mg[e])return mg[e];let[t,n]=e.split(" "),r=is[t]||"right",i=L5[r];is[n]||(n="center");let s=Sb[r],a=Sb[i];return mg[e]={placement:t,crossPlacement:n,axis:r,crossAxis:i,size:s,crossSize:a},mg[e]}function h0(e,t,n,r,i,s,a,c,d,h){let{placement:m,crossPlacement:g,axis:b,crossAxis:x,size:k,crossSize:P}=r,T={};var _;T[x]=(_=e[x])!==null&&_!==void 0?_:0;var R,D,F,z;g==="center"?T[x]+=(((R=e[P])!==null&&R!==void 0?R:0)-((D=n[P])!==null&&D!==void 0?D:0))/2:g!==x&&(T[x]+=((F=e[P])!==null&&F!==void 0?F:0)-((z=n[P])!==null&&z!==void 0?z:0)),T[x]+=s;const $=e[x]-n[P]+d+h,U=e[x]+e[P]-d-h;if(T[x]=Ug(T[x],$,U),m===b){const Z=c?a[k]:t[DT[k]];T[Xg[b]]=Math.floor(Z-e[b]+i)}else T[b]=Math.floor(e[b]+e[k]+i);return T}function N5(e,t,n,r,i,s,a,c){const d=r?n.height:t[DT.height];var h;let m=e.top!=null?n.top+e.top:n.top+(d-((h=e.bottom)!==null&&h!==void 0?h:0)-a);var g,b,x,k,P,T;let _=c!=="top"?Math.max(0,t.height+t.top+((g=t.scroll.top)!==null&&g!==void 0?g:0)-m-(((b=i.top)!==null&&b!==void 0?b:0)+((x=i.bottom)!==null&&x!==void 0?x:0)+s)):Math.max(0,m+a-(t.top+((k=t.scroll.top)!==null&&k!==void 0?k:0))-(((P=i.top)!==null&&P!==void 0?P:0)+((T=i.bottom)!==null&&T!==void 0?T:0)+s));return Math.min(t.height-s*2,_)}function GS(e,t,n,r,i,s){let{placement:a,axis:c,size:d}=s;var h,m;if(a===c)return Math.max(0,n[c]-e[c]-((h=e.scroll[c])!==null&&h!==void 0?h:0)+t[c]-((m=r[c])!==null&&m!==void 0?m:0)-r[Xg[c]]-i);var g;return Math.max(0,e[d]+e[c]+e.scroll[c]-t[c]-n[c]-n[d]-((g=r[c])!==null&&g!==void 0?g:0)-r[Xg[c]]-i)}function F5(e,t,n,r,i,s,a,c,d,h,m,g,b,x,k,P){let T=HS(e),{size:_,crossAxis:R,crossSize:D,placement:F,crossPlacement:z}=T,$=h0(t,c,n,T,m,g,h,b,k,P),U=m,Z=GS(c,h,t,i,s+m,T);if(a&&r[_]>Z){let me=HS(`${Xg[F]} ${z}`),Ee=h0(t,c,n,me,m,g,h,b,k,P);GS(c,h,t,i,s+m,me)>Z&&(T=me,$=Ee,U=m)}let ae="bottom";T.axis==="top"?T.placement==="top"?ae="top":T.placement==="bottom"&&(ae="bottom"):T.crossAxis==="top"&&(T.crossPlacement==="top"?ae="bottom":T.crossPlacement==="bottom"&&(ae="top"));let B=KS(R,$[R],n[D],c,d,s,h);$[R]+=B;let G=N5($,c,h,b,i,s,n.height,ae);x&&x{if(!n||r===null)return;let i=s=>{let a=s.target;if(!t.current||a instanceof Node&&!a.contains(t.current)||s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement)return;let c=r||j5.get(t.current);c&&c()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[n,r,t])}let Cn=typeof document<"u"?window.visualViewport:null;function V5(e){let{direction:t}=gh(),{arrowSize:n=0,targetRef:r,overlayRef:i,scrollRef:s=i,placement:a="bottom",containerPadding:c=12,shouldFlip:d=!0,boundaryElement:h=typeof document<"u"?document.body:null,offset:m=0,crossOffset:g=0,shouldUpdatePosition:b=!0,isOpen:x=!0,onClose:k,maxHeight:P,arrowBoundaryOffset:T=0}=e,[_,R]=S.useState(null),D=[b,a,i.current,r.current,s.current,c,d,h,m,g,x,t,P,T,n],F=S.useRef(Cn?.scale);S.useEffect(()=>{x&&(F.current=Cn?.scale)},[x]);let z=S.useCallback(()=>{if(b===!1||!x||!i.current||!r.current||!h||Cn?.scale!==F.current)return;let B=null;if(s.current&&s.current.contains(document.activeElement)){var G;let V=(G=document.activeElement)===null||G===void 0?void 0:G.getBoundingClientRect(),se=s.current.getBoundingClientRect();var q;if(B={type:"top",offset:((q=V?.top)!==null&&q!==void 0?q:0)-se.top},B.offset>se.height/2){B.type="bottom";var te;B.offset=((te=V?.bottom)!==null&&te!==void 0?te:0)-se.bottom}}let K=i.current;if(!P&&i.current){var oe;K.style.top="0px",K.style.bottom="";var J;K.style.maxHeight=((J=(oe=window.visualViewport)===null||oe===void 0?void 0:oe.height)!==null&&J!==void 0?J:window.innerHeight)+"px"}let X=O5({placement:W5(a,t),overlayNode:i.current,targetNode:r.current,scrollNode:s.current||i.current,padding:c,shouldFlip:d,boundaryElement:h,offset:m,crossOffset:g,maxHeight:P,arrowSize:n,arrowBoundaryOffset:T});if(X.position){if(K.style.top="",K.style.bottom="",K.style.left="",K.style.right="",Object.keys(X.position).forEach(V=>K.style[V]=X.position[V]+"px"),K.style.maxHeight=X.maxHeight!=null?X.maxHeight+"px":"",B&&document.activeElement&&s.current){let V=document.activeElement.getBoundingClientRect(),se=s.current.getBoundingClientRect(),M=V[B.type]-se[B.type];s.current.scrollTop+=M-B.offset}R(X)}},D);rn(z,D),U5(z),T1({ref:i,onResize:z}),T1({ref:r,onResize:z});let $=S.useRef(!1);rn(()=>{let B,G=()=>{$.current=!0,clearTimeout(B),B=setTimeout(()=>{$.current=!1},500),z()},q=()=>{$.current&&G()};return Cn?.addEventListener("resize",G),Cn?.addEventListener("scroll",q),()=>{Cn?.removeEventListener("resize",G),Cn?.removeEventListener("scroll",q)}},[z]);let U=S.useCallback(()=>{$.current||k?.()},[k,$]);B5({triggerRef:r,isOpen:x,onClose:k&&U});var Z,ae;return{overlayProps:{style:{position:"absolute",zIndex:1e5,..._?.position,maxHeight:(Z=_?.maxHeight)!==null&&Z!==void 0?Z:"100vh"}},placement:(ae=_?.placement)!==null&&ae!==void 0?ae:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:_?.arrowOffsetLeft,top:_?.arrowOffsetTop}},updatePosition:z}}function U5(e){rn(()=>(window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e,!1)}),[e])}function W5(e,t){return t==="rtl"?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")}function K5(e){const t=Gi(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:s}=e.ownerDocument.defaultView;let{display:a,visibility:c}=s(e);i=a!=="none"&&c!=="hidden"&&c!=="collapse"}return i}function H5(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function NT(e,t){return e.nodeName!=="#comment"&&K5(e)&&H5(e,t)&&(!e.parentElement||NT(e.parentElement,e))}function Jx(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function FT(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function OT(e){let t=S.useRef({isFocused:!1,observer:null});rn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Vn(r=>{e?.(r)});return S.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,s=a=>{if(t.current.isFocused=!1,i.disabled){let c=Jx(a);n(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var a;(a=t.current.observer)===null||a===void 0||a.disconnect();let c=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Qg=!1;function G5(e){for(;e&&!eP(e);)e=e.parentElement;let t=Gi(e),n=t.document.activeElement;if(!n||n===e)return;Qg=!0;let r=!1,i=m=>{(m.target===n||r)&&m.stopImmediatePropagation()},s=m=>{(m.target===n||r)&&(m.stopImmediatePropagation(),!e&&!r&&(r=!0,Za(n),d()))},a=m=>{(m.target===e||r)&&m.stopImmediatePropagation()},c=m=>{(m.target===e||r)&&(m.stopImmediatePropagation(),r||(r=!0,Za(n),d()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",c,!0),t.addEventListener("focus",a,!0);let d=()=>{cancelAnimationFrame(h),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",c,!0),t.removeEventListener("focus",a,!0),Qg=!1,r=!1},h=requestAnimationFrame(d);return d}let Cf="default",kb="",Dg=new WeakMap;function q5(e){if(xv()){if(Cf==="default"){const t=Nt(e);kb=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Cf="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Dg.set(e,e.style[t]),e.style[t]="none"}}function XS(e){if(xv()){if(Cf!=="disabled")return;Cf="restoring",setTimeout(()=>{KE(()=>{if(Cf==="restoring"){const t=Nt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=kb||""),kb="",Cf="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Dg.has(e)){let t=Dg.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Dg.delete(e)}}const Zx=He.createContext({register:()=>{}});Zx.displayName="PressResponderContext";function Y5(e,t){return t.get?t.get.call(e):t.value}function zT(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function X5(e,t){var n=zT(e,t,"get");return Y5(e,n)}function Q5(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function QS(e,t,n){var r=zT(e,t,"set");return Q5(e,r,n),n}function J5(e){let t=S.useContext(Zx);if(t){let{register:n,...r}=t;e=Tn(r,e),n()}return GE(t,e.ref),e}var gg=new WeakMap;class vg{continuePropagation(){QS(this,gg,!1)}get shouldStopPropagation(){return X5(this,gg)}constructor(t,n,r,i){cM(this,gg,{writable:!0,value:void 0}),QS(this,gg,!0);var s;let a=(s=i?.target)!==null&&s!==void 0?s:r.currentTarget;const c=a?.getBoundingClientRect();let d,h=0,m,g=null;r.clientX!=null&&r.clientY!=null&&(m=r.clientX,g=r.clientY),c&&(m!=null&&g!=null?(d=m-c.left,h=g-c.top):(d=c.width/2,h=c.height/2)),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=d,this.y=h}}const JS=Symbol("linkClicked"),ZS="react-aria-pressable-style",ek="data-react-aria-pressable";function nl(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:s,onClick:a,isDisabled:c,isPressed:d,preventFocusOnPress:h,shouldCancelOnPointerExit:m,allowTextSelectionOnPress:g,ref:b,...x}=J5(e),[k,P]=S.useState(!1),T=S.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:_,removeAllGlobalListeners:R}=vx(),D=Vn((G,q)=>{let te=T.current;if(c||te.didFirePressStart)return!1;let K=!0;if(te.isTriggeringEvent=!0,r){let oe=new vg("pressstart",q,G);r(oe),K=oe.shouldStopPropagation}return n&&n(!0),te.isTriggeringEvent=!1,te.didFirePressStart=!0,P(!0),K}),F=Vn((G,q,te=!0)=>{let K=T.current;if(!K.didFirePressStart)return!1;K.didFirePressStart=!1,K.isTriggeringEvent=!0;let oe=!0;if(i){let J=new vg("pressend",q,G);i(J),oe=J.shouldStopPropagation}if(n&&n(!1),P(!1),t&&te&&!c){let J=new vg("press",q,G);t(J),oe&&(oe=J.shouldStopPropagation)}return K.isTriggeringEvent=!1,oe}),z=Vn((G,q)=>{let te=T.current;if(c)return!1;if(s){te.isTriggeringEvent=!0;let K=new vg("pressup",q,G);return s(K),te.isTriggeringEvent=!1,K.shouldStopPropagation}return!0}),$=Vn(G=>{let q=T.current;if(q.isPressed&&q.target){q.didFirePressStart&&q.pointerType!=null&&F(du(q.target,G),q.pointerType,!1),q.isPressed=!1,q.isOverTarget=!1,q.activePointerId=null,q.pointerType=null,R(),g||XS(q.target);for(let te of q.disposables)te();q.disposables=[]}}),U=Vn(G=>{m&&$(G)}),Z=Vn(G=>{a?.(G)}),ae=Vn((G,q)=>{if(a){let te=new MouseEvent("click",G);FT(te,q),a(Jx(te))}}),B=S.useMemo(()=>{let G=T.current,q={onKeyDown(K){if(m0(K.nativeEvent,K.currentTarget)&&ui(K.currentTarget,Pn(K.nativeEvent))){var oe;tk(Pn(K.nativeEvent),K.key)&&K.preventDefault();let J=!0;if(!G.isPressed&&!K.repeat){G.target=K.currentTarget,G.isPressed=!0,G.pointerType="keyboard",J=D(K,"keyboard");let X=K.currentTarget,V=se=>{m0(se,X)&&!se.repeat&&ui(X,Pn(se))&&G.target&&z(du(G.target,se),"keyboard")};_(Nt(K.currentTarget),"keyup",Af(V,te),!0)}J&&K.stopPropagation(),K.metaKey&&Pu()&&((oe=G.metaKeyEvents)===null||oe===void 0||oe.set(K.key,K.nativeEvent))}else K.key==="Meta"&&(G.metaKeyEvents=new Map)},onClick(K){if(!(K&&!ui(K.currentTarget,Pn(K.nativeEvent)))&&K&&K.button===0&&!G.isTriggeringEvent&&!Tu.isOpening){let oe=!0;if(c&&K.preventDefault(),!G.ignoreEmulatedMouseEvents&&!G.isPressed&&(G.pointerType==="virtual"||XE(K.nativeEvent))){let J=D(K,"virtual"),X=z(K,"virtual"),V=F(K,"virtual");Z(K),oe=J&&X&&V}else if(G.isPressed&&G.pointerType!=="keyboard"){let J=G.pointerType||K.nativeEvent.pointerType||"virtual",X=z(du(K.currentTarget,K),J),V=F(du(K.currentTarget,K),J,!0);oe=X&&V,G.isOverTarget=!1,Z(K),$(K)}G.ignoreEmulatedMouseEvents=!1,oe&&K.stopPropagation()}}},te=K=>{var oe;if(G.isPressed&&G.target&&m0(K,G.target)){var J;tk(Pn(K),K.key)&&K.preventDefault();let V=Pn(K),se=ui(G.target,Pn(K));F(du(G.target,K),"keyboard",se),se&&ae(K,G.target),R(),K.key!=="Enter"&&ew(G.target)&&ui(G.target,V)&&!K[JS]&&(K[JS]=!0,Tu(G.target,K,!1)),G.isPressed=!1,(J=G.metaKeyEvents)===null||J===void 0||J.delete(K.key)}else if(K.key==="Meta"&&(!((oe=G.metaKeyEvents)===null||oe===void 0)&&oe.size)){var X;let V=G.metaKeyEvents;G.metaKeyEvents=void 0;for(let se of V.values())(X=G.target)===null||X===void 0||X.dispatchEvent(new KeyboardEvent("keyup",se))}};if(typeof PointerEvent<"u"){q.onPointerDown=J=>{if(J.button!==0||!ui(J.currentTarget,Pn(J.nativeEvent)))return;if(FM(J.nativeEvent)){G.pointerType="virtual";return}G.pointerType=J.pointerType;let X=!0;if(!G.isPressed){G.isPressed=!0,G.isOverTarget=!0,G.activePointerId=J.pointerId,G.target=J.currentTarget,g||q5(G.target),X=D(J,G.pointerType);let V=Pn(J.nativeEvent);"releasePointerCapture"in V&&V.releasePointerCapture(J.pointerId),_(Nt(J.currentTarget),"pointerup",K,!1),_(Nt(J.currentTarget),"pointercancel",oe,!1)}X&&J.stopPropagation()},q.onMouseDown=J=>{if(ui(J.currentTarget,Pn(J.nativeEvent))&&J.button===0){if(h){let X=G5(J.target);X&&G.disposables.push(X)}J.stopPropagation()}},q.onPointerUp=J=>{!ui(J.currentTarget,Pn(J.nativeEvent))||G.pointerType==="virtual"||J.button===0&&!G.isPressed&&z(J,G.pointerType||J.pointerType)},q.onPointerEnter=J=>{J.pointerId===G.activePointerId&&G.target&&!G.isOverTarget&&G.pointerType!=null&&(G.isOverTarget=!0,D(du(G.target,J),G.pointerType))},q.onPointerLeave=J=>{J.pointerId===G.activePointerId&&G.target&&G.isOverTarget&&G.pointerType!=null&&(G.isOverTarget=!1,F(du(G.target,J),G.pointerType,!1),U(J))};let K=J=>{if(J.pointerId===G.activePointerId&&G.isPressed&&J.button===0&&G.target){if(ui(G.target,Pn(J))&&G.pointerType!=null){let X=!1,V=setTimeout(()=>{G.isPressed&&G.target instanceof HTMLElement&&(X?$(J):(Za(G.target),G.target.click()))},80);_(J.currentTarget,"click",()=>X=!0,!0),G.disposables.push(()=>clearTimeout(V))}else $(J);G.isOverTarget=!1}},oe=J=>{$(J)};q.onDragStart=J=>{ui(J.currentTarget,Pn(J.nativeEvent))&&$(J)}}return q},[_,c,h,R,g,$,U,F,D,z,Z,ae]);return S.useEffect(()=>{if(!b)return;const G=Nt(b.current);if(!G||!G.head||G.getElementById(ZS))return;const q=G.createElement("style");q.id=ZS,q.textContent=` -@layer { - [${ek}] { - touch-action: pan-x pan-y pinch-zoom; - } -} - `.trim(),G.head.prepend(q)},[b]),S.useEffect(()=>{let G=T.current;return()=>{var q;g||XS((q=G.target)!==null&&q!==void 0?q:void 0);for(let te of G.disposables)te();G.disposables=[]}},[g]),{isPressed:d||k,pressProps:Tn(x,B,{[ek]:!0})}}function ew(e){return e.tagName==="A"&&e.hasAttribute("href")}function m0(e,t){const{key:n,code:r}=e,i=t,s=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof Gi(i).HTMLInputElement&&!jT(i,n)||i instanceof Gi(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&ew(i))&&n!=="Enter")}function du(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function Z5(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!ew(e)}function tk(e,t){return e instanceof HTMLInputElement?!jT(e,t):Z5(e)}const eF=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function jT(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":eF.has(e.type)}let Js=null,sh=new Set,Bp=new Map,_u=!1,Cb=!1;const tF={Tab:!0,Escape:!0};function Ev(e,t){for(let n of sh)n(e,t)}function nF(e){return!(e.metaKey||!Pu()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Jg(e){_u=!0,nF(e)&&(Js="keyboard",Ev("keyboard",e))}function Tf(e){Js="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(_u=!0,Ev("pointer",e))}function BT(e){XE(e)&&(_u=!0,Js="virtual")}function VT(e){e.target===window||e.target===document||Qg||!e.isTrusted||(!_u&&!Cb&&(Js="virtual",Ev("virtual",e)),_u=!1,Cb=!1)}function UT(){Qg||(_u=!1,Cb=!0)}function Zg(e){if(typeof window>"u"||typeof document>"u"||Bp.get(Gi(e)))return;const t=Gi(e),n=Nt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){_u=!0,r.apply(this,arguments)},n.addEventListener("keydown",Jg,!0),n.addEventListener("keyup",Jg,!0),n.addEventListener("click",BT,!0),t.addEventListener("focus",VT,!0),t.addEventListener("blur",UT,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Tf,!0),n.addEventListener("pointermove",Tf,!0),n.addEventListener("pointerup",Tf,!0)),t.addEventListener("beforeunload",()=>{WT(e)},{once:!0}),Bp.set(t,{focus:r})}const WT=(e,t)=>{const n=Gi(e),r=Nt(e);t&&r.removeEventListener("DOMContentLoaded",t),Bp.has(n)&&(n.HTMLElement.prototype.focus=Bp.get(n).focus,r.removeEventListener("keydown",Jg,!0),r.removeEventListener("keyup",Jg,!0),r.removeEventListener("click",BT,!0),n.removeEventListener("focus",VT,!0),n.removeEventListener("blur",UT,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Tf,!0),r.removeEventListener("pointermove",Tf,!0),r.removeEventListener("pointerup",Tf,!0)),Bp.delete(n))};function rF(e){const t=Nt(e);let n;return t.readyState!=="loading"?Zg(e):(n=()=>{Zg(e)},t.addEventListener("DOMContentLoaded",n)),()=>WT(e,n)}typeof document<"u"&&rF();function tw(){return Js!=="pointer"}function ah(){return Js}function iF(e){Js=e,Ev(e,null)}function Iq(){Zg();let[e,t]=S.useState(Js);return S.useEffect(()=>{let n=()=>{t(Js)};return sh.add(n),()=>{sh.delete(n)}},[]),mh()?null:e}const oF=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function sF(e,t,n){let r=Nt(n?.target);const i=typeof window<"u"?Gi(n?.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Gi(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?Gi(n?.target).HTMLElement:HTMLElement,c=typeof window<"u"?Gi(n?.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof i&&!oF.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof a&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!tF[n.key])}function aF(e,t,n){Zg(),S.useEffect(()=>{let r=(i,s)=>{sF(!!n?.isTextInput,i,s)&&e(tw())};return sh.add(r),()=>{sh.delete(r)}},t)}function Iu(e){const t=Nt(e),n=Br(t);if(ah()==="virtual"){let r=n;KE(()=>{Br(t)===r&&e.isConnected&&Za(e)})}else Za(e)}function KT(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const s=S.useCallback(d=>{if(d.target===d.currentTarget)return r&&r(d),i&&i(!1),!0},[r,i]),a=OT(s),c=S.useCallback(d=>{const h=Nt(d.target),m=h?Br(h):Br();d.target===d.currentTarget&&m===Pn(d.nativeEvent)&&(n&&n(d),i&&i(!0),a(d))},[i,n,a]);return{focusProps:{onFocus:!t&&(n||i||r)?c:void 0,onBlur:!t&&(r||i)?s:void 0}}}function nk(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(r),t&&n.stopPropagation()}}function lF(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:nk(e.onKeyDown),onKeyUp:nk(e.onKeyUp)}}}let uF=He.createContext(null);function cF(e){let t=S.useContext(uF)||{};GE(t,e);let{ref:n,...r}=t;return r}function Sh(e,t){let{focusProps:n}=KT(e),{keyboardProps:r}=lF(e),i=Tn(n,r),s=cF(t),a=e.isDisabled?{}:s,c=S.useRef(e.autoFocus);S.useEffect(()=>{c.current&&t.current&&Iu(t.current),c.current=!1},[t]);let d=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(d=void 0),{focusableProps:Tn({...i,tabIndex:d},a)}}function fF({children:e}){let t=S.useMemo(()=>({register:()=>{}}),[]);return He.createElement(Zx.Provider,{value:t},e)}function Pv(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,s=S.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:c}=vx(),d=S.useCallback(g=>{g.currentTarget.contains(g.target)&&s.current.isFocusWithin&&!g.currentTarget.contains(g.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(g),i&&i(!1))},[n,i,s,c]),h=OT(d),m=S.useCallback(g=>{if(!g.currentTarget.contains(g.target))return;const b=Nt(g.target),x=Br(b);if(!s.current.isFocusWithin&&x===Pn(g.nativeEvent)){r&&r(g),i&&i(!0),s.current.isFocusWithin=!0,h(g);let k=g.currentTarget;a(b,"focus",P=>{if(s.current.isFocusWithin&&!ui(k,P.target)){let T=new b.defaultView.FocusEvent("blur",{relatedTarget:P.target});FT(T,k);let _=Jx(T);d(_)}},{capture:!0})}},[r,i,h,a,d]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:m,onBlur:d}}}let Eb=!1,g0=0;function dF(){Eb=!0,setTimeout(()=>{Eb=!1},50)}function rk(e){e.pointerType==="touch"&&dF()}function pF(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",rk),g0++,()=>{g0--,!(g0>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",rk)}}function Ru(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[s,a]=S.useState(!1),c=S.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;S.useEffect(pF,[]);let{addGlobalListener:d,removeAllGlobalListeners:h}=vx(),{hoverProps:m,triggerHoverEnd:g}=S.useMemo(()=>{let b=(P,T)=>{if(c.pointerType=T,i||T==="touch"||c.isHovered||!P.currentTarget.contains(P.target))return;c.isHovered=!0;let _=P.currentTarget;c.target=_,d(Nt(P.target),"pointerover",R=>{c.isHovered&&c.target&&!ui(c.target,R.target)&&x(R,R.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:_,pointerType:T}),n&&n(!0),a(!0)},x=(P,T)=>{let _=c.target;c.pointerType="",c.target=null,!(T==="touch"||!c.isHovered||!_)&&(c.isHovered=!1,h(),r&&r({type:"hoverend",target:_,pointerType:T}),n&&n(!1),a(!1))},k={};return typeof PointerEvent<"u"&&(k.onPointerEnter=P=>{Eb&&P.pointerType==="mouse"||b(P,P.pointerType)},k.onPointerLeave=P=>{!i&&P.currentTarget.contains(P.target)&&x(P,P.pointerType)}),{hoverProps:k,triggerHoverEnd:x}},[t,n,r,i,c,d,h]);return S.useEffect(()=>{i&&g({currentTarget:c.target},c.pointerType)},[i]),{hoverProps:m,isHovered:s}}function hF(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,s=S.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=Vn(d=>{n&&ik(d,t)&&(i&&i(d),s.current.isPointerDown=!0)}),c=Vn(d=>{n&&n(d)});S.useEffect(()=>{let d=s.current;if(r)return;const h=t.current,m=Nt(h);if(typeof PointerEvent<"u"){let g=b=>{d.isPointerDown&&ik(b,t)&&c(b),d.isPointerDown=!1};return m.addEventListener("pointerdown",a,!0),m.addEventListener("click",g,!0),()=>{m.removeEventListener("pointerdown",a,!0),m.removeEventListener("click",g,!0)}}},[t,r,a,c])}function ik(e,t){if(e.button>0)return!1;if(e.target){const n=e.target.ownerDocument;if(!n||!n.documentElement.contains(e.target)||e.target.closest("[data-react-aria-top-layer]"))return!1}return t.current?!e.composedPath().includes(t.current):!1}const ok=He.createContext(null),Pb="react-aria-focus-scope-restore";let Yt=null;function mF(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,s=S.useRef(null),a=S.useRef(null),c=S.useRef([]),{parentNode:d}=S.useContext(ok)||{},h=S.useMemo(()=>new _b({scopeRef:c}),[c]);rn(()=>{let b=d||Mn.root;if(Mn.getTreeNode(b.scopeRef)&&Yt&&!ev(Yt,b.scopeRef)){let x=Mn.getTreeNode(Yt);x&&(b=x)}b.addChild(h),Mn.addNode(h)},[h,d]),rn(()=>{let b=Mn.getTreeNode(c);b&&(b.contain=!!n)},[n]),rn(()=>{var b;let x=(b=s.current)===null||b===void 0?void 0:b.nextSibling,k=[],P=T=>T.stopPropagation();for(;x&&x!==a.current;)k.push(x),x.addEventListener(Pb,P),x=x.nextSibling;return c.current=k,()=>{for(let T of k)T.removeEventListener(Pb,P)}},[t]),xF(c,r,n),vF(c,n),wF(c,r,n),bF(c,i),S.useEffect(()=>{const b=Br(Nt(c.current?c.current[0]:void 0));let x=null;if(Yi(b,c.current)){for(let k of Mn.traverse())k.scopeRef&&Yi(b,k.scopeRef.current)&&(x=k);x===Mn.getTreeNode(c)&&(Yt=x.scopeRef)}},[c]),rn(()=>()=>{var b,x,k;let P=(k=(x=Mn.getTreeNode(c))===null||x===void 0||(b=x.parent)===null||b===void 0?void 0:b.scopeRef)!==null&&k!==void 0?k:null;(c===Yt||ev(c,Yt))&&(!P||Mn.getTreeNode(P))&&(Yt=P),Mn.removeTreeNode(c)},[c]);let m=S.useMemo(()=>gF(c),[]),g=S.useMemo(()=>({focusManager:m,parentNode:h}),[h,m]);return He.createElement(ok.Provider,{value:g},He.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:s}),t,He.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}function gF(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:s,accept:a}=t;var c;let d=r||Br(Nt((c=n[0])!==null&&c!==void 0?c:void 0)),h=n[0].previousElementSibling,m=Su(n),g=Ys(m,{tabbable:i,accept:a},n);g.currentNode=Yi(d,n)?d:h;let b=g.nextNode();return!b&&s&&(g.currentNode=h,b=g.nextNode()),b&&qs(b,!0),b},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:s,accept:a}=t;var c;let d=r||Br(Nt((c=n[0])!==null&&c!==void 0?c:void 0)),h=n[n.length-1].nextElementSibling,m=Su(n),g=Ys(m,{tabbable:i,accept:a},n);g.currentNode=Yi(d,n)?d:h;let b=g.previousNode();return!b&&s&&(g.currentNode=h,b=g.previousNode()),b&&qs(b,!0),b},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,s=Su(n),a=Ys(s,{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let c=a.nextNode();return c&&qs(c,!0),c},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,s=Su(n),a=Ys(s,{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let c=a.previousNode();return c&&qs(c,!0),c}}}function Su(e){return e[0].parentElement}function Ap(e){let t=Mn.getTreeNode(Yt);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function vF(e,t){let n=S.useRef(void 0),r=S.useRef(void 0);rn(()=>{let i=e.current;if(!t){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const s=Nt(i?i[0]:void 0);let a=h=>{if(h.key!=="Tab"||h.altKey||h.ctrlKey||h.metaKey||!Ap(e)||h.isComposing)return;let m=Br(s),g=e.current;if(!g||!Yi(m,g))return;let b=Su(g),x=Ys(b,{tabbable:!0},g);if(!m)return;x.currentNode=m;let k=h.shiftKey?x.previousNode():x.nextNode();k||(x.currentNode=h.shiftKey?g[g.length-1].nextElementSibling:g[0].previousElementSibling,k=h.shiftKey?x.previousNode():x.nextNode()),h.preventDefault(),k&&qs(k,!0)},c=h=>{(!Yt||ev(Yt,e))&&Yi(Pn(h),e.current)?(Yt=e,n.current=Pn(h)):Ap(e)&&!Ya(Pn(h),e)?n.current?n.current.focus():Yt&&Yt.current&&Tb(Yt.current):Ap(e)&&(n.current=Pn(h))},d=h=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let m=ah(),g=(m==="virtual"||m===null)&&mx()&&VE(),b=Br(s);if(!g&&b&&Ap(e)&&!Ya(b,e)){Yt=e;let k=Pn(h);if(k&&k.isConnected){var x;n.current=k,(x=n.current)===null||x===void 0||x.focus()}else Yt.current&&Tb(Yt.current)}})};return s.addEventListener("keydown",a,!1),s.addEventListener("focusin",c,!1),i?.forEach(h=>h.addEventListener("focusin",c,!1)),i?.forEach(h=>h.addEventListener("focusout",d,!1)),()=>{s.removeEventListener("keydown",a,!1),s.removeEventListener("focusin",c,!1),i?.forEach(h=>h.removeEventListener("focusin",c,!1)),i?.forEach(h=>h.removeEventListener("focusout",d,!1))}},[e,t]),rn(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function HT(e){return Ya(e)}function Yi(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function Ya(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of Mn.traverse(Mn.getTreeNode(t)))if(n&&Yi(e,n.current))return!0;return!1}function yF(e){return Ya(e,Yt)}function ev(e,t){var n;let r=(n=Mn.getTreeNode(t))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function qs(e,t=!1){if(e!=null&&!t)try{Iu(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function GT(e,t=!0){let n=e[0].previousElementSibling,r=Su(e),i=Ys(r,{tabbable:t},e);i.currentNode=n;let s=i.nextNode();return t&&!s&&(r=Su(e),i=Ys(r,{tabbable:!1},e),i.currentNode=n,s=i.nextNode()),s}function Tb(e,t=!0){qs(GT(e,t))}function bF(e,t){const n=He.useRef(t);S.useEffect(()=>{if(n.current){Yt=e;const r=Nt(e.current?e.current[0]:void 0);!Yi(Br(r),Yt.current)&&e.current&&Tb(e.current)}n.current=!1},[e])}function xF(e,t,n){rn(()=>{if(t||n)return;let r=e.current;const i=Nt(r?r[0]:void 0);let s=a=>{let c=Pn(a);Yi(c,e.current)?Yt=e:HT(c)||(Yt=null)};return i.addEventListener("focusin",s,!1),r?.forEach(a=>a.addEventListener("focusin",s,!1)),()=>{i.removeEventListener("focusin",s,!1),r?.forEach(a=>a.removeEventListener("focusin",s,!1))}},[e,t,n])}function sk(e){let t=Mn.getTreeNode(Yt);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function wF(e,t,n){const r=S.useRef(typeof document<"u"?Br(Nt(e.current?e.current[0]:void 0)):null);rn(()=>{let i=e.current;const s=Nt(i?i[0]:void 0);if(!t||n)return;let a=()=>{(!Yt||ev(Yt,e))&&Yi(Br(s),e.current)&&(Yt=e)};return s.addEventListener("focusin",a,!1),i?.forEach(c=>c.addEventListener("focusin",a,!1)),()=>{s.removeEventListener("focusin",a,!1),i?.forEach(c=>c.removeEventListener("focusin",a,!1))}},[e,n]),rn(()=>{const i=Nt(e.current?e.current[0]:void 0);if(!t)return;let s=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||!Ap(e)||a.isComposing)return;let c=i.activeElement;if(!Ya(c,e)||!sk(e))return;let d=Mn.getTreeNode(e);if(!d)return;let h=d.nodeToRestore,m=Ys(i.body,{tabbable:!0});m.currentNode=c;let g=a.shiftKey?m.previousNode():m.nextNode();if((!h||!h.isConnected||h===i.body)&&(h=void 0,d.nodeToRestore=void 0),(!g||!Ya(g,e))&&h){m.currentNode=h;do g=a.shiftKey?m.previousNode():m.nextNode();while(Ya(g,e));a.preventDefault(),a.stopPropagation(),g?qs(g,!0):HT(h)?qs(h,!0):c.blur()}};return n||i.addEventListener("keydown",s,!0),()=>{n||i.removeEventListener("keydown",s,!0)}},[e,t,n]),rn(()=>{const i=Nt(e.current?e.current[0]:void 0);if(!t)return;let s=Mn.getTreeNode(e);if(s){var a;return s.nodeToRestore=(a=r.current)!==null&&a!==void 0?a:void 0,()=>{let c=Mn.getTreeNode(e);if(!c)return;let d=c.nodeToRestore,h=Br(i);if(t&&d&&(h&&Ya(h,e)||h===i.body&&sk(e))){let m=Mn.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let g=m.getTreeNode(e);for(;g;){if(g.nodeToRestore&&g.nodeToRestore.isConnected){ak(g.nodeToRestore);return}g=g.parent}for(g=m.getTreeNode(e);g;){if(g.scopeRef&&g.scopeRef.current&&Mn.getTreeNode(g.scopeRef)){let b=GT(g.scopeRef.current,!0);ak(b);return}g=g.parent}}})}}}},[e,t])}function ak(e){e.dispatchEvent(new CustomEvent(Pb,{bubbles:!0,cancelable:!0}))&&qs(e)}function Ys(e,t,n){let r=t?.tabbable?VM:eP,i=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Nt(i),a=bM(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(c){var d;return!(t==null||(d=t.from)===null||d===void 0)&&d.contains(c)?NodeFilter.FILTER_REJECT:r(c)&&NT(c)&&(!n||Yi(c,n))&&(!t?.accept||t.accept(c))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}class nw{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let s=new _b({scopeRef:t});i.addChild(s),s.parent=i,this.fastMap.set(t,s),r&&(s.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Yi(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(s=>r&&r.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new nw;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new _b({scopeRef:null}),this.fastMap.set(null,this.root)}}class _b{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}let Mn=new nw;function $u(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=S.useRef({isFocused:!1,isFocusVisible:t||tw()}),[s,a]=S.useState(!1),[c,d]=S.useState(()=>i.current.isFocused&&i.current.isFocusVisible),h=S.useCallback(()=>d(i.current.isFocused&&i.current.isFocusVisible),[]),m=S.useCallback(x=>{i.current.isFocused=x,a(x),h()},[h]);aF(x=>{i.current.isFocusVisible=x,h()},[],{isTextInput:n});let{focusProps:g}=KT({isDisabled:r,onFocusChange:m}),{focusWithinProps:b}=Pv({isDisabled:!r,onFocusWithinChange:m});return{isFocused:s,isFocusVisible:c,focusProps:r?b:g}}function SF(e){let t=EF(Nt(e));t!==e&&(t&&kF(t,e),e&&CF(e,t))}function kF(e,t){e.dispatchEvent(new FocusEvent("blur",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:t}))}function CF(e,t){e.dispatchEvent(new FocusEvent("focus",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:t}))}function EF(e){let t=Br(e),n=t?.getAttribute("aria-activedescendant");return n&&e.getElementById(n)||t}const v0=typeof document<"u"&&window.visualViewport,PF=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let yg=0,y0;function TF(e={}){let{isDisabled:t}=e;rn(()=>{if(!t)return yg++,yg===1&&(xv()?y0=IF():y0=_F()),()=>{yg--,yg===0&&y0()}},[t])}function _F(){let e=window.innerWidth-document.documentElement.clientWidth;return Af(e>0&&("scrollbarGutter"in document.documentElement.style?ku(document.documentElement,"scrollbarGutter","stable"):ku(document.documentElement,"paddingRight",`${e}px`)),ku(document.documentElement,"overflow","hidden"))}function IF(){let e,t,n=h=>{e=qE(h.target,!0),!(e===document.documentElement&&e===document.body)&&e instanceof HTMLElement&&window.getComputedStyle(e).overscrollBehavior==="auto"&&(t=ku(e,"overscrollBehavior","contain"))},r=h=>{if(!e||e===document.documentElement||e===document.body){h.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&h.preventDefault()},i=()=>{t&&t()},s=h=>{let m=h.target;RF(m)&&(c(),m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",v0&&(v0.height{lk(m)}):v0.addEventListener("resize",()=>lk(m),{once:!0}))}))},a=null,c=()=>{if(a)return;let h=()=>{window.scrollTo(0,0)},m=window.pageXOffset,g=window.pageYOffset;a=Af(vp(window,"scroll",h),ku(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),ku(document.documentElement,"overflow","hidden"),ku(document.body,"marginTop",`-${g}px`),()=>{window.scrollTo(m,g)}),window.scrollTo(0,0)},d=Af(vp(document,"touchstart",n,{passive:!1,capture:!0}),vp(document,"touchmove",r,{passive:!1,capture:!0}),vp(document,"touchend",i,{passive:!1,capture:!0}),vp(document,"focus",s,!0));return()=>{t?.(),a?.(),d()}}function ku(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function vp(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function lk(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let r=qE(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect().top,s=n.getBoundingClientRect().top;s>i+n.clientHeight&&(r.scrollTop+=s-i)}n=r.parentElement}}function RF(e){return e instanceof HTMLInputElement&&!PF.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}const $F=S.createContext({});function qT(){var e;return(e=S.useContext($F))!==null&&e!==void 0?e:{}}const Ib=He.createContext(null);function AF(e){let{children:t}=e,n=S.useContext(Ib),[r,i]=S.useState(0),s=S.useMemo(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return He.createElement(Ib.Provider,{value:s},t)}function LF(){let e=S.useContext(Ib);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function MF(e){let{modalProviderProps:t}=LF();return He.createElement("div",{"data-overlay-container":!0,...e,...t})}function YT(e){return He.createElement(AF,null,He.createElement(MF,e))}function uk(e){let t=mh(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=qT();if(!e.portalContainer&&i&&(n=i()),He.useEffect(()=>{if(n?.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[n]),!n)return null;let s=He.createElement(YT,r);return ZE.createPortal(s,n)}var XT={};XT={dismiss:"تجاهل"};var QT={};QT={dismiss:"Отхвърляне"};var JT={};JT={dismiss:"Odstranit"};var ZT={};ZT={dismiss:"Luk"};var e_={};e_={dismiss:"Schließen"};var t_={};t_={dismiss:"Απόρριψη"};var n_={};n_={dismiss:"Dismiss"};var r_={};r_={dismiss:"Descartar"};var i_={};i_={dismiss:"Lõpeta"};var o_={};o_={dismiss:"Hylkää"};var s_={};s_={dismiss:"Rejeter"};var a_={};a_={dismiss:"התעלם"};var l_={};l_={dismiss:"Odbaci"};var u_={};u_={dismiss:"Elutasítás"};var c_={};c_={dismiss:"Ignora"};var f_={};f_={dismiss:"閉じる"};var d_={};d_={dismiss:"무시"};var p_={};p_={dismiss:"Atmesti"};var h_={};h_={dismiss:"Nerādīt"};var m_={};m_={dismiss:"Lukk"};var g_={};g_={dismiss:"Negeren"};var v_={};v_={dismiss:"Zignoruj"};var y_={};y_={dismiss:"Descartar"};var b_={};b_={dismiss:"Dispensar"};var x_={};x_={dismiss:"Revocare"};var w_={};w_={dismiss:"Пропустить"};var S_={};S_={dismiss:"Zrušiť"};var k_={};k_={dismiss:"Opusti"};var C_={};C_={dismiss:"Odbaci"};var E_={};E_={dismiss:"Avvisa"};var P_={};P_={dismiss:"Kapat"};var T_={};T_={dismiss:"Скасувати"};var __={};__={dismiss:"取消"};var I_={};I_={dismiss:"關閉"};var R_={};R_={"ar-AE":XT,"bg-BG":QT,"cs-CZ":JT,"da-DK":ZT,"de-DE":e_,"el-GR":t_,"en-US":n_,"es-ES":r_,"et-EE":i_,"fi-FI":o_,"fr-FR":s_,"he-IL":a_,"hr-HR":l_,"hu-HU":u_,"it-IT":c_,"ja-JP":f_,"ko-KR":d_,"lt-LT":p_,"lv-LV":h_,"nb-NO":m_,"nl-NL":g_,"pl-PL":v_,"pt-BR":y_,"pt-PT":b_,"ro-RO":x_,"ru-RU":w_,"sk-SK":S_,"sl-SI":k_,"sr-SP":C_,"sv-SE":E_,"tr-TR":P_,"uk-UA":T_,"zh-CN":__,"zh-TW":I_};const ck={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function DF(e={}){let{style:t,isFocusable:n}=e,[r,i]=S.useState(!1),{focusWithinProps:s}=Pv({isDisabled:!n,onFocusWithinChange:c=>i(c)}),a=S.useMemo(()=>r?t:t?{...ck,...t}:ck,[r]);return{visuallyHiddenProps:{...s,style:a}}}function NF(e){let{children:t,elementType:n="div",isFocusable:r,style:i,...s}=e,{visuallyHiddenProps:a}=DF(e);return He.createElement(n,Tn(s,a),t)}function FF(e){return e&&e.__esModule?e.default:e}function fk(e){let{onDismiss:t,...n}=e,r=lM(FF(R_),"@react-aria/overlays"),i=HE(n,r.format("dismiss")),s=()=>{t&&t()};return He.createElement(NF,null,He.createElement("button",{...i,tabIndex:-1,onClick:s,style:{width:1,height:1}}))}let yp=new WeakMap,Ui=[];function OF(e,t=document.body){let n=new Set(e),r=new Set,i=d=>{for(let b of d.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(b);let h=b=>{if(n.has(b)||b.parentElement&&r.has(b.parentElement)&&b.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let x of n)if(b.contains(x))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},m=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,{acceptNode:h}),g=h(d);if(g===NodeFilter.FILTER_ACCEPT&&s(d),g!==NodeFilter.FILTER_REJECT){let b=m.nextNode();for(;b!=null;)s(b),b=m.nextNode()}},s=d=>{var h;let m=(h=yp.get(d))!==null&&h!==void 0?h:0;d.getAttribute("aria-hidden")==="true"&&m===0||(m===0&&d.setAttribute("aria-hidden","true"),r.add(d),yp.set(d,m+1))};Ui.length&&Ui[Ui.length-1].disconnect(),i(t);let a=new MutationObserver(d=>{for(let h of d)if(!(h.type!=="childList"||h.addedNodes.length===0)&&![...n,...r].some(m=>m.contains(h.target))){for(let m of h.removedNodes)m instanceof Element&&(n.delete(m),r.delete(m));for(let m of h.addedNodes)(m instanceof HTMLElement||m instanceof SVGElement)&&(m.dataset.liveAnnouncer==="true"||m.dataset.reactAriaTopLayer==="true")?n.add(m):m instanceof Element&&i(m)}});a.observe(t,{childList:!0,subtree:!0});let c={visibleNodes:n,hiddenNodes:r,observe(){a.observe(t,{childList:!0,subtree:!0})},disconnect(){a.disconnect()}};return Ui.push(c),()=>{a.disconnect();for(let d of r){let h=yp.get(d);h!=null&&(h===1?(d.removeAttribute("aria-hidden"),yp.delete(d)):yp.set(d,h-1))}c===Ui[Ui.length-1]?(Ui.pop(),Ui.length&&Ui[Ui.length-1].observe()):Ui.splice(Ui.indexOf(c),1)}}const $_=He.createContext(null);function zF(e){let t=mh(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,s]=S.useState(!1),a=S.useMemo(()=>({contain:i,setContain:s}),[i,s]),{getContainer:c}=qT();if(!e.portalContainer&&c&&(n=c()),!n)return null;let d=e.children;return e.disableFocusManagement||(d=He.createElement(mF,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},d)),d=He.createElement($_.Provider,{value:a},He.createElement(fF,null,d)),ZE.createPortal(d,n)}function A_(){let e=S.useContext($_),t=e?.setContain;rn(()=>{t?.(!0)},[t])}var jF=({children:e,navigate:t,disableAnimation:n,useHref:r,disableRipple:i=!1,skipFramerMotionAnimations:s=n,reducedMotion:a="never",validationBehavior:c,locale:d="en-US",labelPlacement:h,defaultDates:m,createCalendar:g,spinnerVariant:b,...x})=>{let k=e;t&&(k=A.jsx($M,{navigate:t,useHref:r,children:k}));const P=S.useMemo(()=>(n&&s&&(us.skipAnimations=!0),{createCalendar:g,defaultDates:m,disableAnimation:n,disableRipple:i,validationBehavior:c,labelPlacement:h,spinnerVariant:b}),[g,m?.maxDate,m?.minDate,n,i,c,h,b]);return A.jsx(VL,{value:P,children:A.jsx(eM,{locale:d,children:A.jsx(n4,{reducedMotion:a,children:A.jsx(YT,{...x,children:k})})})})};function Rq(e){const t=di(),n=t?.labelPlacement;return S.useMemo(()=>{var r,i;const s=(i=(r=e.labelPlacement)!=null?r:n)!=null?i:"inside";return s==="inside"&&!e.label?"outside":s},[e.labelPlacement,n,e.label])}function BF(e){const t=di(),n=t?.labelPlacement;return S.useMemo(()=>{var r,i;const s=(i=(r=e.labelPlacement)!=null?r:n)!=null?i:"inside";return s==="inside"&&!e.label?"outside":s},[e.labelPlacement,n,e.label])}function Vr(e){return S.forwardRef(e)}var ta=(e,t,n=!0)=>{if(!t)return[e,{}];const r=t.reduce((i,s)=>s in e?{...i,[s]:e[s]}:i,{});return n?[Object.keys(e).filter(s=>!t.includes(s)).reduce((s,a)=>({...s,[a]:e[a]}),{}),r]:[e,r]},VF={default:"bg-default text-default-foreground",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",danger:"bg-danger text-danger-foreground",foreground:"bg-foreground text-background"},UF={default:"shadow-lg shadow-default/50 bg-default text-default-foreground",primary:"shadow-lg shadow-primary/40 bg-primary text-primary-foreground",secondary:"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",success:"shadow-lg shadow-success/40 bg-success text-success-foreground",warning:"shadow-lg shadow-warning/40 bg-warning text-warning-foreground",danger:"shadow-lg shadow-danger/40 bg-danger text-danger-foreground"},WF={default:"bg-transparent border-default text-foreground",primary:"bg-transparent border-primary text-primary",secondary:"bg-transparent border-secondary text-secondary",success:"bg-transparent border-success text-success",warning:"bg-transparent border-warning text-warning",danger:"bg-transparent border-danger text-danger"},KF={default:"bg-default/40 text-default-700",primary:"bg-primary/20 text-primary-600",secondary:"bg-secondary/20 text-secondary-600",success:"bg-success/20 text-success-700 dark:text-success",warning:"bg-warning/20 text-warning-700 dark:text-warning",danger:"bg-danger/20 text-danger-600 dark:text-danger-500"},HF={default:"border-default bg-default-100 text-default-foreground",primary:"border-default bg-default-100 text-primary",secondary:"border-default bg-default-100 text-secondary",success:"border-default bg-default-100 text-success",warning:"border-default bg-default-100 text-warning",danger:"border-default bg-default-100 text-danger"},GF={default:"bg-transparent text-default-foreground",primary:"bg-transparent text-primary",secondary:"bg-transparent text-secondary",success:"bg-transparent text-success",warning:"bg-transparent text-warning",danger:"bg-transparent text-danger"},qF={default:"border-default text-default-foreground",primary:"border-primary text-primary",secondary:"border-secondary text-secondary",success:"border-success text-success",warning:"border-warning text-warning",danger:"border-danger text-danger"},Te={solid:VF,shadow:UF,bordered:WF,flat:KF,faded:HF,light:GF,ghost:qF},YF={".spinner-bar-animation":{"animation-delay":"calc(-1.2s + (0.1s * var(--bar-index)))",transform:"rotate(calc(30deg * var(--bar-index)))translate(140%)"},".spinner-dot-animation":{"animation-delay":"calc(250ms * var(--dot-index))"},".spinner-dot-blink-animation":{"animation-delay":"calc(200ms * var(--dot-index))"}},XF={".leading-inherit":{"line-height":"inherit"},".bg-img-inherit":{"background-image":"inherit"},".bg-clip-inherit":{"background-clip":"inherit"},".text-fill-inherit":{"-webkit-text-fill-color":"inherit"},".tap-highlight-transparent":{"-webkit-tap-highlight-color":"transparent"},".input-search-cancel-button-none":{"&::-webkit-search-cancel-button":{"-webkit-appearance":"none"}}},QF={".scrollbar-hide":{"-ms-overflow-style":"none","scrollbar-width":"none","&::-webkit-scrollbar":{display:"none"}},".scrollbar-default":{"-ms-overflow-style":"auto","scrollbar-width":"auto","&::-webkit-scrollbar":{display:"block"}}},JF={".text-tiny":{"font-size":"var(--heroui-font-size-tiny)","line-height":"var(--heroui-line-height-tiny)"},".text-small":{"font-size":"var(--heroui-font-size-small)","line-height":"var(--heroui-line-height-small)"},".text-medium":{"font-size":"var(--heroui-font-size-medium)","line-height":"var(--heroui-line-height-medium)"},".text-large":{"font-size":"var(--heroui-font-size-large)","line-height":"var(--heroui-line-height-large)"}},ts="250ms",ZF={".transition-background":{"transition-property":"background","transition-timing-function":"ease","transition-duration":ts},".transition-colors-opacity":{"transition-property":"color, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":ts},".transition-width":{"transition-property":"width","transition-timing-function":"ease","transition-duration":ts},".transition-height":{"transition-property":"height","transition-timing-function":"ease","transition-duration":ts},".transition-size":{"transition-property":"width, height","transition-timing-function":"ease","transition-duration":ts},".transition-left":{"transition-property":"left","transition-timing-function":"ease","transition-duration":ts},".transition-transform-opacity":{"transition-property":"transform, scale, opacity rotate","transition-timing-function":"ease","transition-duration":ts},".transition-transform-background":{"transition-property":"transform, scale, background","transition-timing-function":"ease","transition-duration":ts},".transition-transform-colors":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke","transition-timing-function":"ease","transition-duration":ts},".transition-transform-colors-opacity":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":ts}},eO={...XF,...ZF,...QF,...JF,...YF},bg=["small","medium","large"],Rb={theme:{spacing:["divider"],radius:bg},classGroups:{shadow:[{shadow:bg}],opacity:[{opacity:["disabled"]}],"font-size":[{text:["tiny",...bg]}],"border-w":[{border:bg}],"bg-image":["bg-stripe-gradient-default","bg-stripe-gradient-primary","bg-stripe-gradient-secondary","bg-stripe-gradient-success","bg-stripe-gradient-warning","bg-stripe-gradient-danger"],transition:Object.keys(eO).filter(e=>e.includes(".transition")).map(e=>e.replace(".",""))}},dk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ai=e=>!e||typeof e!="object"||Object.keys(e).length===0,tO=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function L_(e,t){e.forEach(function(n){Array.isArray(n)?L_(n,t):t.push(n)})}function M_(e){let t=[];return L_(e,t),t}var D_=(...e)=>M_(e).filter(Boolean),N_=(e,t)=>{let n={},r=Object.keys(e),i=Object.keys(t);for(let s of r)if(i.includes(s)){let a=e[s],c=t[s];Array.isArray(a)||Array.isArray(c)?n[s]=D_(c,a):typeof a=="object"&&typeof c=="object"?n[s]=N_(a,c):n[s]=c+" "+a}else n[s]=e[s];for(let s of i)r.includes(s)||(n[s]=t[s]);return n},pk=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();const rw="-",nO=e=>{const t=iO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(rw);return c[0]===""&&c.length!==1&&c.shift(),F_(c,t)||rO(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&r[a]?[...d,...r[a]]:d}}},F_=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?F_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(rw);return t.validators.find(({validator:a})=>a(s))?.classGroupId},hk=/^\[(.+)\]$/,rO=e=>{if(hk.test(e)){const t=hk.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},iO=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)$b(n[i],r,i,t);return r},$b=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:mk(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(oO(i)){$b(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{$b(a,mk(t,s),n,r)})})},mk=(e,t)=>{let n=e;return t.split(rw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},oO=e=>e.isThemeGetter,sO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},Ab="!",Lb=":",aO=Lb.length,lO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let a=0,c=0,d=0,h;for(let k=0;kd?h-d:void 0;return{modifiers:s,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:x}};if(t){const i=t+Lb,s=r;r=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},uO=e=>e.endsWith(Ab)?e.substring(0,e.length-1):e.startsWith(Ab)?e.substring(1):e,cO=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},fO=e=>({cache:sO(e.cacheSize),parseClassName:lO(e),sortModifiers:cO(e),...nO(e)}),dO=/\s+/,pO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],c=e.trim().split(dO);let d="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:g,modifiers:b,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:P}=n(m);if(g){d=m+(d.length>0?" "+d:d);continue}let T=!!P,_=r(T?k.substring(0,P):k);if(!_){if(!T){d=m+(d.length>0?" "+d:d);continue}if(_=r(k),!_){d=m+(d.length>0?" "+d:d);continue}T=!1}const R=s(b).join(":"),D=x?R+Ab:R,F=D+_;if(a.includes(F))continue;a.push(F);const z=i(_,T);for(let $=0;$0?" "+d:d)}return d};function hO(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(m),e());return n=fO(h),r=n.cache.get,i=n.cache.set,s=c,c(d)}function c(d){const h=r(d);if(h)return h;const m=pO(d,n);return i(d,m),m}return function(){return s(hO.apply(null,arguments))}}const ir=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},z_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,j_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mO=/^\d+\/\d+$/,gO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,df=e=>mO.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),pu=e=>!!e&&Number.isInteger(Number(e)),gk=e=>e.endsWith("%")&&vt(e.slice(0,-1)),Ka=e=>gO.test(e),wO=()=>!0,SO=e=>vO.test(e)&&!yO.test(e),iw=()=>!1,kO=e=>bO.test(e),CO=e=>xO.test(e),EO=e=>!je(e)&&!Be(e),PO=e=>Uf(e,U_,iw),je=e=>z_.test(e),hu=e=>Uf(e,W_,SO),b0=e=>Uf(e,FO,vt),TO=e=>Uf(e,B_,iw),_O=e=>Uf(e,V_,CO),IO=e=>Uf(e,iw,kO),Be=e=>j_.test(e),xg=e=>Wf(e,W_),RO=e=>Wf(e,OO),$O=e=>Wf(e,B_),AO=e=>Wf(e,U_),LO=e=>Wf(e,V_),MO=e=>Wf(e,zO,!0),Uf=(e,t,n)=>{const r=z_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Wf=(e,t,n=!1)=>{const r=j_.exec(e);return r?r[1]?t(r[1]):n:!1},B_=e=>e==="position",DO=new Set(["image","url"]),V_=e=>DO.has(e),NO=new Set(["length","size","percentage"]),U_=e=>NO.has(e),W_=e=>e==="length",FO=e=>e==="number",OO=e=>e==="family-name",zO=e=>e==="shadow",Db=()=>{const e=ir("color"),t=ir("font"),n=ir("text"),r=ir("font-weight"),i=ir("tracking"),s=ir("leading"),a=ir("breakpoint"),c=ir("container"),d=ir("spacing"),h=ir("radius"),m=ir("shadow"),g=ir("inset-shadow"),b=ir("drop-shadow"),x=ir("blur"),k=ir("perspective"),P=ir("aspect"),T=ir("ease"),_=ir("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],$=()=>[Be,je,d],U=()=>[df,"full","auto",...$()],Z=()=>[pu,"none","subgrid",Be,je],ae=()=>["auto",{span:["full",pu,Be,je]},Be,je],B=()=>[pu,"auto",Be,je],G=()=>["auto","min","max","fr",Be,je],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],te=()=>["start","end","center","stretch"],K=()=>["auto",...$()],oe=()=>[df,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],J=()=>[e,Be,je],X=()=>[gk,hu],V=()=>["","none","full",h,Be,je],se=()=>["",vt,xg,hu],M=()=>["solid","dashed","dotted","double"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>["","none",x,Be,je],j=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be,je],me=()=>["none",vt,Be,je],Ee=()=>["none",vt,Be,je],ye=()=>[vt,Be,je],De=()=>[df,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ka],breakpoint:[Ka],color:[wO],container:[Ka],"drop-shadow":[Ka],ease:["in","out","in-out"],font:[EO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ka],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ka],shadow:[Ka],spacing:["px",vt],text:[Ka],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",df,je,Be,P]}],container:["container"],columns:[{columns:[vt,je,Be,c]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...D(),je,Be]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[pu,"auto",Be,je]}],basis:[{basis:[df,"full","auto",c,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,df,"auto","initial","none",je]}],grow:[{grow:["",vt,Be,je]}],shrink:[{shrink:["",vt,Be,je]}],order:[{order:[pu,"first","last","none",Be,je]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...te(),"baseline"]}],"align-self":[{self:["auto",...te(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],w:[{w:[c,"screen",...oe()]}],"min-w":[{"min-w":[c,"screen","none",...oe()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...oe()]}],h:[{h:["screen",...oe()]}],"min-h":[{"min-h":["screen","none",...oe()]}],"max-h":[{"max-h":["screen",...oe()]}],"font-size":[{text:["base",n,xg,hu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Be,b0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gk,je]}],"font-family":[{font:[RO,je,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Be,je]}],"line-clamp":[{"line-clamp":[vt,"none",Be,b0]}],leading:[{leading:[s,...$()]}],"list-image":[{"list-image":["none",Be,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Be,hu]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[vt,"auto",Be,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),$O,TO]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",AO,PO]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pu,Be,je],radial:["",Be,je],conic:[pu,Be,je]},LO,_O]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...M(),"hidden","none"]}],"divide-style":[{divide:[...M(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...M(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Be,je]}],"outline-w":[{outline:["",vt,xg,hu]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,MO,IO]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",Be,je,g]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[vt,hu]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":J()}],opacity:[{opacity:[vt,Be,je]}],"mix-blend":[{"mix-blend":[...W(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none",Be,je]}],blur:[{blur:re()}],brightness:[{brightness:[vt,Be,je]}],contrast:[{contrast:[vt,Be,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Be,je]}],grayscale:[{grayscale:["",vt,Be,je]}],"hue-rotate":[{"hue-rotate":[vt,Be,je]}],invert:[{invert:["",vt,Be,je]}],saturate:[{saturate:[vt,Be,je]}],sepia:[{sepia:["",vt,Be,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,je]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Be,je]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Be,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Be,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Be,je]}],"backdrop-invert":[{"backdrop-invert":["",vt,Be,je]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Be,je]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Be,je]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Be,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",Be,je]}],ease:[{ease:["linear","initial",T,Be,je]}],delay:[{delay:[vt,Be,je]}],animate:[{animate:["none",_,Be,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Be,je]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Be,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,je]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[vt,xg,hu,b0]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},jO=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:s={}})=>(Lp(e,"cacheSize",t),Lp(e,"prefix",n),Lp(e,"experimentalParseClassName",r),wg(e.theme,s.theme),wg(e.classGroups,s.classGroups),wg(e.conflictingClassGroups,s.conflictingClassGroups),wg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Lp(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),Sg(e.theme,i.theme),Sg(e.classGroups,i.classGroups),Sg(e.conflictingClassGroups,i.conflictingClassGroups),Sg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),K_(e,i,"orderSensitiveModifiers"),e),Lp=(e,t,n)=>{n!==void 0&&(e[t]=n)},wg=(e,t)=>{if(t)for(const n in t)Lp(e,n,t[n])},Sg=(e,t)=>{if(t)for(const n in t)K_(e,t,n)},K_=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},H_=(e,...t)=>typeof e=="function"?Mb(Db,e,...t):Mb(()=>jO(Db(),e),...t),BO=Mb(Db);var VO={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},G_=e=>e||void 0,lh=(...e)=>G_(M_(e).filter(Boolean).join(" ")),x0=null,Gs={},Nb=!1,bp=(...e)=>t=>t.twMerge?((!x0||Nb)&&(Nb=!1,x0=ai(Gs)?BO:H_({...Gs,extend:{theme:Gs.theme,classGroups:Gs.classGroups,conflictingClassGroupModifiers:Gs.conflictingClassGroupModifiers,conflictingClassGroups:Gs.conflictingClassGroups,...Gs.extend}})),G_(x0(lh(e)))):lh(e),vk=(e,t)=>{for(let n in t)e.hasOwnProperty(n)?e[n]=lh(e[n],t[n]):e[n]=t[n];return e},UO=(e,t)=>{let{extend:n=null,slots:r={},variants:i={},compoundVariants:s=[],compoundSlots:a=[],defaultVariants:c={}}=e,d={...VO,...t},h=n!=null&&n.base?lh(n.base,e?.base):e?.base,m=n!=null&&n.variants&&!ai(n.variants)?N_(i,n.variants):i,g=n!=null&&n.defaultVariants&&!ai(n.defaultVariants)?{...n.defaultVariants,...c}:c;!ai(d.twMergeConfig)&&!tO(d.twMergeConfig,Gs)&&(Nb=!0,Gs=d.twMergeConfig);let b=ai(n?.slots),x=ai(r)?{}:{base:lh(e?.base,b&&n?.base),...r},k=b?x:vk({...n?.slots},ai(x)?{base:e?.base}:x),P=ai(n?.compoundVariants)?s:D_(n?.compoundVariants,s),T=R=>{if(ai(m)&&ai(r)&&b)return bp(h,R?.class,R?.className)(d);if(P&&!Array.isArray(P))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof P}`);if(a&&!Array.isArray(a))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof a}`);let D=(q,te,K=[],oe)=>{let J=K;if(typeof te=="string")J=J.concat(pk(te).split(" ").map(X=>`${q}:${X}`));else if(Array.isArray(te))J=J.concat(te.reduce((X,V)=>X.concat(`${q}:${V}`),[]));else if(typeof te=="object"&&typeof oe=="string"){for(let X in te)if(te.hasOwnProperty(X)&&X===oe){let V=te[X];if(V&&typeof V=="string"){let se=pk(V);J[oe]?J[oe]=J[oe].concat(se.split(" ").map(M=>`${q}:${M}`)):J[oe]=se.split(" ").map(M=>`${q}:${M}`)}else Array.isArray(V)&&V.length>0&&(J[oe]=V.reduce((se,M)=>se.concat(`${q}:${M}`),[]))}}return J},F=(q,te=m,K=null,oe=null)=>{var J;let X=te[q];if(!X||ai(X))return null;let V=(J=oe?.[q])!=null?J:R?.[q];if(V===null)return null;let se=dk(V),M=Array.isArray(d.responsiveVariants)&&d.responsiveVariants.length>0||d.responsiveVariants===!0,W=g?.[q],re=[];if(typeof se=="object"&&M)for(let[Ee,ye]of Object.entries(se)){let De=X[ye];if(Ee==="initial"){W=ye;continue}Array.isArray(d.responsiveVariants)&&!d.responsiveVariants.includes(Ee)||(re=D(Ee,De,re,K))}let j=se!=null&&typeof se!="object"?se:dk(W),me=X[j||"false"];return typeof re=="object"&&typeof K=="string"&&re[K]?vk(re,me):re.length>0?(re.push(me),K==="base"?re.join(" "):re):me},z=()=>m?Object.keys(m).map(q=>F(q,m)):null,$=(q,te)=>{if(!m||typeof m!="object")return null;let K=new Array;for(let oe in m){let J=F(oe,m,q,te),X=q==="base"&&typeof J=="string"?J:J&&J[q];X&&(K[K.length]=X)}return K},U={};for(let q in R)R[q]!==void 0&&(U[q]=R[q]);let Z=(q,te)=>{var K;let oe=typeof R?.[q]=="object"?{[q]:(K=R[q])==null?void 0:K.initial}:{};return{...g,...U,...oe,...te}},ae=(q=[],te)=>{let K=[];for(let{class:oe,className:J,...X}of q){let V=!0;for(let[se,M]of Object.entries(X)){let W=Z(se,te)[se];if(Array.isArray(M)){if(!M.includes(W)){V=!1;break}}else{let re=j=>j==null||j===!1;if(re(M)&&re(W))continue;if(W!==M){V=!1;break}}}V&&(oe&&K.push(oe),J&&K.push(J))}return K},B=q=>{let te=ae(P,q);if(!Array.isArray(te))return te;let K={};for(let oe of te)if(typeof oe=="string"&&(K.base=bp(K.base,oe)(d)),typeof oe=="object")for(let[J,X]of Object.entries(oe))K[J]=bp(K[J],X)(d);return K},G=q=>{if(a.length<1)return null;let te={};for(let{slots:K=[],class:oe,className:J,...X}of a){if(!ai(X)){let V=!0;for(let se of Object.keys(X)){let M=Z(se,q)[se];if(M===void 0||(Array.isArray(X[se])?!X[se].includes(M):X[se]!==M)){V=!1;break}}if(!V)continue}for(let V of K)te[V]=te[V]||[],te[V].push([oe,J])}return te};if(!ai(r)||!b){let q={};if(typeof k=="object"&&!ai(k))for(let te of Object.keys(k))q[te]=K=>{var oe,J;return bp(k[te],$(te,K),((oe=B(K))!=null?oe:[])[te],((J=G(K))!=null?J:[])[te],K?.class,K?.className)(d)};return q}return bp(h,z(),ae(P),R?.class,R?.className)(d)},_=()=>{if(!(!m||typeof m!="object"))return Object.keys(m)};return T.variantKeys=_(),T.extend=n,T.base=h,T.slots=k,T.variants=m,T.defaultVariants=g,T.compoundSlots=a,T.compoundVariants=P,T},or=(e,t)=>{var n,r,i;return UO(e,{...t,twMerge:(n=t?.twMerge)!=null?n:!0,twMergeConfig:{...t?.twMergeConfig,theme:{...(r=t?.twMergeConfig)==null?void 0:r.theme,...Rb.theme},classGroups:{...(i=t?.twMergeConfig)==null?void 0:i.classGroups,...Rb.classGroups}}})},yk=or({slots:{base:"relative inline-flex flex-col gap-2 items-center justify-center",wrapper:"relative flex",label:"text-foreground dark:text-foreground-dark font-regular",circle1:"absolute w-full h-full rounded-full",circle2:"absolute w-full h-full rounded-full",dots:"relative rounded-full mx-auto",spinnerBars:["absolute","animate-fade-out","rounded-full","w-[25%]","h-[8%]","left-[calc(37.5%)]","top-[calc(46%)]","spinner-bar-animation"]},variants:{size:{sm:{wrapper:"w-5 h-5",circle1:"border-2",circle2:"border-2",dots:"size-1",label:"text-small"},md:{wrapper:"w-8 h-8",circle1:"border-3",circle2:"border-3",dots:"size-1.5",label:"text-medium"},lg:{wrapper:"w-10 h-10",circle1:"border-3",circle2:"border-3",dots:"size-2",label:"text-large"}},color:{current:{circle1:"border-b-current",circle2:"border-b-current",dots:"bg-current",spinnerBars:"bg-current"},white:{circle1:"border-b-white",circle2:"border-b-white",dots:"bg-white",spinnerBars:"bg-white"},default:{circle1:"border-b-default",circle2:"border-b-default",dots:"bg-default",spinnerBars:"bg-default"},primary:{circle1:"border-b-primary",circle2:"border-b-primary",dots:"bg-primary",spinnerBars:"bg-primary"},secondary:{circle1:"border-b-secondary",circle2:"border-b-secondary",dots:"bg-secondary",spinnerBars:"bg-secondary"},success:{circle1:"border-b-success",circle2:"border-b-success",dots:"bg-success",spinnerBars:"bg-success"},warning:{circle1:"border-b-warning",circle2:"border-b-warning",dots:"bg-warning",spinnerBars:"bg-warning"},danger:{circle1:"border-b-danger",circle2:"border-b-danger",dots:"bg-danger",spinnerBars:"bg-danger"}},labelColor:{foreground:{label:"text-foreground"},primary:{label:"text-primary"},secondary:{label:"text-secondary"},success:{label:"text-success"},warning:{label:"text-warning"},danger:{label:"text-danger"}},variant:{default:{circle1:["animate-spinner-ease-spin","border-solid","border-t-transparent","border-l-transparent","border-r-transparent"],circle2:["opacity-75","animate-spinner-linear-spin","border-dotted","border-t-transparent","border-l-transparent","border-r-transparent"]},gradient:{circle1:["border-0","bg-gradient-to-b","from-transparent","via-transparent","to-primary","animate-spinner-linear-spin","[animation-duration:1s]","[-webkit-mask:radial-gradient(closest-side,rgba(0,0,0,0.0)calc(100%-3px),rgba(0,0,0,1)calc(100%-3px))]"],circle2:["hidden"]},wave:{wrapper:"translate-y-3/4",dots:["animate-sway","spinner-dot-animation"]},dots:{wrapper:"translate-y-2/4",dots:["animate-blink","spinner-dot-blink-animation"]},spinner:{},simple:{wrapper:"text-foreground h-5 w-5 animate-spin",circle1:"opacity-25",circle2:"opacity-75"}}},defaultVariants:{size:"md",color:"primary",labelColor:"foreground",variant:"default"},compoundVariants:[{variant:"gradient",color:"current",class:{circle1:"to-current"}},{variant:"gradient",color:"white",class:{circle1:"to-white"}},{variant:"gradient",color:"default",class:{circle1:"to-default"}},{variant:"gradient",color:"primary",class:{circle1:"to-primary"}},{variant:"gradient",color:"secondary",class:{circle1:"to-secondary"}},{variant:"gradient",color:"success",class:{circle1:"to-success"}},{variant:"gradient",color:"warning",class:{circle1:"to-warning"}},{variant:"gradient",color:"danger",class:{circle1:"to-danger"}},{variant:"wave",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"wave",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"wave",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"dots",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"dots",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"dots",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"simple",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"simple",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",color:"current",class:{wrapper:"text-current"}},{variant:"simple",color:"white",class:{wrapper:"text-white"}},{variant:"simple",color:"default",class:{wrapper:"text-default"}},{variant:"simple",color:"primary",class:{wrapper:"text-primary"}},{variant:"simple",color:"secondary",class:{wrapper:"text-secondary"}},{variant:"simple",color:"success",class:{wrapper:"text-success"}},{variant:"simple",color:"warning",class:{wrapper:"text-warning"}},{variant:"simple",color:"danger",class:{wrapper:"text-danger"}}]}),kh=["outline-hidden","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],q_=["outline-hidden","group-data-[focus-visible=true]:z-10","group-data-[focus-visible=true]:ring-2","group-data-[focus-visible=true]:ring-focus","group-data-[focus-visible=true]:ring-offset-2","group-data-[focus-visible=true]:ring-offset-background"],WO=["outline-hidden","ring-2","ring-focus","ring-offset-2","ring-offset-background"],pf={default:["[&+.border-medium.border-default]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],primary:["[&+.border-medium.border-primary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],secondary:["[&+.border-medium.border-secondary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],success:["[&+.border-medium.border-success]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],warning:["[&+.border-medium.border-warning]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],danger:["[&+.border-medium.border-danger]:ms-[calc(var(--heroui-border-width-medium)*-1)]"]},KO=["font-inherit","text-[100%]","leading-[1.15]","m-0","p-0","overflow-visible","box-border","absolute","top-0","w-full","h-full","opacity-[0.0001]","z-[1]","cursor-pointer","disabled:cursor-default"],bk=or({slots:{base:["z-0","relative","bg-transparent","before:content-['']","before:hidden","before:z-[-1]","before:absolute","before:rotate-45","before:w-2.5","before:h-2.5","before:rounded-sm","data-[arrow=true]:before:block","data-[placement=top]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top]:before:left-1/2","data-[placement=top]:before:-translate-x-1/2","data-[placement=top-start]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-start]:before:left-3","data-[placement=top-end]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-end]:before:right-3","data-[placement=bottom]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom]:before:left-1/2","data-[placement=bottom]:before:-translate-x-1/2","data-[placement=bottom-start]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-start]:before:left-3","data-[placement=bottom-end]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-end]:before:right-3","data-[placement=left]:before:-right-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=left]:before:top-1/2","data-[placement=left]:before:-translate-y-1/2","data-[placement=left-start]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-start]:before:top-1/4","data-[placement=left-end]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-end]:before:bottom-1/4","data-[placement=right]:before:-left-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=right]:before:top-1/2","data-[placement=right]:before:-translate-y-1/2","data-[placement=right-start]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-start]:before:top-1/4","data-[placement=right-end]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-end]:before:bottom-1/4",...kh],content:["z-10","px-2.5","py-1","w-full","inline-flex","flex-col","items-center","justify-center","box-border","subpixel-antialiased","outline-hidden","box-border"],trigger:["z-10"],backdrop:["hidden"],arrow:[]},variants:{size:{sm:{content:"text-tiny"},md:{content:"text-small"},lg:{content:"text-medium"}},color:{default:{base:"before:bg-content1 before:shadow-small",content:"bg-content1"},foreground:{base:"before:bg-foreground",content:Te.solid.foreground},primary:{base:"before:bg-primary",content:Te.solid.primary},secondary:{base:"before:bg-secondary",content:Te.solid.secondary},success:{base:"before:bg-success",content:Te.solid.success},warning:{base:"before:bg-warning",content:Te.solid.warning},danger:{base:"before:bg-danger",content:Te.solid.danger}},radius:{none:{content:"rounded-none"},sm:{content:"rounded-small"},md:{content:"rounded-medium"},lg:{content:"rounded-large"},full:{content:"rounded-full"}},shadow:{none:{content:"shadow-none"},sm:{content:"shadow-small"},md:{content:"shadow-medium"},lg:{content:"shadow-large"}},backdrop:{transparent:{},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-sm backdrop-saturate-150 bg-overlay/30"}},triggerScaleOnOpen:{true:{trigger:["aria-expanded:scale-[0.97]","aria-expanded:opacity-70","subpixel-antialiased"]},false:{}},disableAnimation:{true:{base:"animate-none"}},isTriggerDisabled:{true:{trigger:"opacity-disabled pointer-events-none"},false:{}}},defaultVariants:{color:"default",radius:"lg",size:"md",shadow:"md",backdrop:"transparent",triggerScaleOnOpen:!0},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"block w-full h-full fixed inset-0 -z-30"}}]});or({slots:{base:"flex flex-col gap-2 w-full",label:"",labelWrapper:"flex justify-between",value:"",track:"z-0 relative bg-default-300/50 overflow-hidden rtl:rotate-180",indicator:"h-full"},variants:{color:{default:{indicator:"bg-default-400"},primary:{indicator:"bg-primary"},secondary:{indicator:"bg-secondary"},success:{indicator:"bg-success"},warning:{indicator:"bg-warning"},danger:{indicator:"bg-danger"}},size:{sm:{label:"text-small",value:"text-small",track:"h-1"},md:{label:"text-medium",value:"text-medium",track:"h-3"},lg:{label:"text-large",value:"text-large",track:"h-5"}},radius:{none:{track:"rounded-none",indicator:"rounded-none"},sm:{track:"rounded-small",indicator:"rounded-small"},md:{track:"rounded-medium",indicator:"rounded-medium"},lg:{track:"rounded-large",indicator:"rounded-large"},full:{track:"rounded-full",indicator:"rounded-full"}},isStriped:{true:{indicator:"bg-stripe-gradient-default bg-stripe-size"}},isIndeterminate:{true:{indicator:["absolute","w-full","origin-left","animate-indeterminate-bar"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:{},false:{indicator:"transition-transform !duration-500"}}},defaultVariants:{color:"primary",size:"md",radius:"full",isStriped:!1,isIndeterminate:!1,isDisabled:!1},compoundVariants:[{disableAnimation:!0,isIndeterminate:!1,class:{indicator:"!transition-none motion-reduce:transition-none"}},{color:"primary",isStriped:!0,class:{indicator:"bg-stripe-gradient-primary bg-stripe-size"}},{color:"secondary",isStriped:!0,class:{indicator:"bg-stripe-gradient-secondary bg-stripe-size"}},{color:"success",isStriped:!0,class:{indicator:"bg-stripe-gradient-success bg-stripe-size"}},{color:"warning",isStriped:!0,class:{indicator:"bg-stripe-gradient-warning bg-stripe-size"}},{color:"danger",isStriped:!0,class:{indicator:"bg-stripe-gradient-danger bg-stripe-size"}}]},{twMerge:!0});var xk=or({slots:{base:"flex flex-col justify-center gap-1 max-w-fit items-center",label:"",svgWrapper:"relative block",svg:"z-0 relative overflow-hidden",track:"h-full stroke-default-300/50",indicator:"h-full stroke-current",value:"absolute font-normal inset-0 flex items-center justify-center"},variants:{color:{default:{svg:"text-default-400"},primary:{svg:"text-primary"},secondary:{svg:"text-secondary"},success:{svg:"text-success"},warning:{svg:"text-warning"},danger:{svg:"text-danger"}},size:{sm:{svg:"w-8 h-8",label:"text-small",value:"text-[0.5rem]"},md:{svg:"w-10 h-10",label:"text-small",value:"text-[0.55rem]"},lg:{svg:"w-12 h-12",label:"text-medium",value:"text-[0.6rem]"}},isIndeterminate:{true:{svg:"animate-spinner-ease-spin"}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:{},false:{indicator:"transition-all !duration-500"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1},compoundVariants:[{disableAnimation:!0,isIndeterminate:!1,class:{svg:"!transition-none motion-reduce:transition-none"}}]}),HO=["data-[top-scroll=true]:[mask-image:linear-gradient(0deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[bottom-scroll=true]:[mask-image:linear-gradient(180deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[top-bottom-scroll=true]:[mask-image:linear-gradient(#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],GO=["data-[left-scroll=true]:[mask-image:linear-gradient(270deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[right-scroll=true]:[mask-image:linear-gradient(90deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[left-right-scroll=true]:[mask-image:linear-gradient(to_right,#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],wk=or({base:[],variants:{orientation:{vertical:["overflow-y-auto",...HO],horizontal:["overflow-x-auto",...GO]},hideScrollBar:{true:"scrollbar-hide",false:""}},defaultVariants:{orientation:"vertical",hideScrollBar:!1}}),Sk=or({slots:{base:["group","relative","overflow-hidden","bg-content3 dark:bg-content2","pointer-events-none","before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2","data-[loaded=true]:pointer-events-auto","data-[loaded=true]:overflow-visible","data-[loaded=true]:!bg-transparent","data-[loaded=true]:before:opacity-0 data-[loaded=true]:before:-z-10 data-[loaded=true]:before:animate-none","data-[loaded=true]:after:opacity-0"],content:["opacity-0","group-data-[loaded=true]:opacity-100"]},variants:{disableAnimation:{true:{base:"before:animate-none before:transition-none after:transition-none",content:"transition-none"},false:{base:"transition-background !duration-300",content:"transition-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{}}),kk=or({slots:{base:"group flex flex-col data-[hidden=true]:hidden",label:["absolute","z-10","pointer-events-none","origin-top-left","shrink-0","rtl:origin-top-right","subpixel-antialiased","block","text-small","text-foreground-500"],mainWrapper:"h-full",inputWrapper:"relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-xs px-3 gap-3",innerWrapper:"inline-flex w-full items-center h-full box-border",input:["w-full font-normal bg-transparent !outline-hidden placeholder:text-foreground-500 focus-visible:outline-hidden","data-[has-start-content=true]:ps-1.5","data-[has-end-content=true]:pe-1.5","data-[type=color]:rounded-none","file:cursor-pointer file:bg-transparent file:border-0","autofill:bg-transparent bg-clip-text"],clearButton:["p-2","-m-2","z-10","absolute","end-3","start-auto","pointer-events-none","appearance-none","outline-hidden","select-none","opacity-0","cursor-pointer","active:!opacity-70","rounded-full",...kh],helperWrapper:"hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger"},variants:{variant:{flat:{inputWrapper:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-100"]},faded:{inputWrapper:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 focus-within:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground"},bordered:{inputWrapper:["border-medium","border-default-200","data-[hover=true]:border-default-400","group-data-[focus=true]:border-default-foreground"]},underlined:{inputWrapper:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","group-data-[focus=true]:after:w-full"],innerWrapper:"pb-1",label:"group-data-[filled-within=true]:text-foreground"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{label:"text-tiny",inputWrapper:"h-8 min-h-8 px-2 rounded-small",input:"text-small",clearButton:"text-medium"},md:{inputWrapper:"h-10 min-h-10 rounded-medium",input:"text-small",clearButton:"text-large hover:!opacity-100"},lg:{label:"text-medium",inputWrapper:"h-12 min-h-12 rounded-large",input:"text-medium",clearButton:"text-large hover:!opacity-100"}},radius:{none:{inputWrapper:"rounded-none"},sm:{inputWrapper:"rounded-small"},md:{inputWrapper:"rounded-medium"},lg:{inputWrapper:"rounded-large"},full:{inputWrapper:"rounded-full"}},labelPlacement:{outside:{mainWrapper:"flex flex-col"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",inputWrapper:"flex-1",mainWrapper:"flex flex-col",label:"relative text-foreground pe-2 ps-2 pointer-events-auto"},"outside-top":{mainWrapper:"flex flex-col",label:"relative text-foreground pb-2 pointer-events-auto"},inside:{label:"cursor-text",inputWrapper:"flex-col items-start justify-center gap-0",innerWrapper:"group-data-[has-label=true]:items-end"}},fullWidth:{true:{base:"w-full"},false:{}},isClearable:{true:{input:"peer pe-6 input-search-cancel-button-none",clearButton:["peer-data-[filled=true]:pointer-events-auto","peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block","peer-data-[filled=true]:scale-100"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",inputWrapper:"pointer-events-none",label:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",input:"!placeholder:text-danger !text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",inputWrapper:"!h-auto",innerWrapper:"items-start group-data-[has-label=true]:items-start",input:"resize-none data-[hide-scroll=true]:scrollbar-hide",clearButton:"absolute top-2 right-2 rtl:right-auto rtl:left-2 z-10"}},disableAnimation:{true:{input:"transition-none",inputWrapper:"transition-none",label:"transition-none"},false:{inputWrapper:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","!duration-200","!ease-out","motion-reduce:transition-none","transition-[transform,color,left,opacity,translate,scale]"],clearButton:["scale-90","ease-out","duration-150","transition-[opacity,transform]","motion-reduce:transition-none","motion-reduce:scale-100"]}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1},compoundVariants:[{variant:"flat",color:"default",class:{input:"group-data-[has-value=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{inputWrapper:["bg-primary-100","data-[hover=true]:bg-primary-50","text-primary","group-data-[focus=true]:bg-primary-50","placeholder:text-primary"],input:"placeholder:text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{inputWrapper:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50","placeholder:text-secondary"],input:"placeholder:text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{inputWrapper:["bg-success-100","text-success-600","dark:text-success","placeholder:text-success-600","dark:placeholder:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],input:"placeholder:text-success-600 dark:placeholder:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{inputWrapper:["bg-warning-100","text-warning-600","dark:text-warning","placeholder:text-warning-600","dark:placeholder:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],input:"placeholder:text-warning-600 dark:placeholder:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{inputWrapper:["bg-danger-100","text-danger","dark:text-danger-500","placeholder:text-danger","dark:placeholder:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],input:"placeholder:text-danger dark:placeholder:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{label:"text-primary",inputWrapper:"data-[hover=true]:border-primary focus-within:border-primary"}},{variant:"faded",color:"secondary",class:{label:"text-secondary",inputWrapper:"data-[hover=true]:border-secondary focus-within:border-secondary"}},{variant:"faded",color:"success",class:{label:"text-success",inputWrapper:"data-[hover=true]:border-success focus-within:border-success"}},{variant:"faded",color:"warning",class:{label:"text-warning",inputWrapper:"data-[hover=true]:border-warning focus-within:border-warning"}},{variant:"faded",color:"danger",class:{label:"text-danger",inputWrapper:"data-[hover=true]:border-danger focus-within:border-danger"}},{variant:"underlined",color:"default",class:{input:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{inputWrapper:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{inputWrapper:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{inputWrapper:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{inputWrapper:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{inputWrapper:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{inputWrapper:"group-data-[focus=true]:border-primary",label:"text-primary"}},{variant:"bordered",color:"secondary",class:{inputWrapper:"group-data-[focus=true]:border-secondary",label:"text-secondary"}},{variant:"bordered",color:"success",class:{inputWrapper:"group-data-[focus=true]:border-success",label:"text-success"}},{variant:"bordered",color:"warning",class:{inputWrapper:"group-data-[focus=true]:border-warning",label:"text-warning"}},{variant:"bordered",color:"danger",class:{inputWrapper:"group-data-[focus=true]:border-danger",label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled-within=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled-within=true]:text-foreground"}},{radius:"full",size:["sm"],class:{inputWrapper:"px-3"}},{radius:"full",size:"md",class:{inputWrapper:"px-4"}},{radius:"full",size:"lg",class:{inputWrapper:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{inputWrapper:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{inputWrapper:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{inputWrapper:[...q_]}},{isInvalid:!0,variant:"flat",class:{inputWrapper:["!bg-danger-50","data-[hover=true]:!bg-danger-100","group-data-[focus=true]:!bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{inputWrapper:"!border-danger group-data-[focus=true]:!border-danger"}},{isInvalid:!0,variant:"underlined",class:{inputWrapper:"after:!bg-danger"}},{labelPlacement:"inside",size:"sm",class:{inputWrapper:"h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{inputWrapper:"h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{inputWrapper:"h-16 py-2.5 gap-0"}},{labelPlacement:"inside",size:"sm",variant:["bordered","faded"],class:{inputWrapper:"py-1"}},{labelPlacement:["inside","outside"],class:{label:["group-data-[filled-within=true]:pointer-events-auto"]}},{labelPlacement:"outside",isMultiline:!1,class:{base:"relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled-within=true]:start-0"]}},{labelPlacement:["inside"],class:{label:["group-data-[filled-within=true]:scale-85"]}},{labelPlacement:["inside"],variant:"flat",class:{innerWrapper:"pb-0.5"}},{variant:"underlined",size:"sm",class:{innerWrapper:"pb-1"}},{variant:"underlined",size:["md","lg"],class:{innerWrapper:"pb-1.5"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",size:"lg",isMultiline:!1,class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-tiny)/2_+_16px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",size:"md",isMultiline:!1,class:{label:["start-3","end-auto","text-small","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",size:"lg",isMultiline:!1,class:{label:["start-3","end-auto","text-medium","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:["outside","outside-left"],isMultiline:!0,class:{inputWrapper:"py-2"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:"inside",isMultiline:!0,class:{label:"pb-0.5",input:"pt-0"}},{isMultiline:!0,disableAnimation:!1,class:{input:"transition-height !duration-100 motion-reduce:transition-none"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{isMultiline:!0,radius:"full",class:{inputWrapper:"data-[has-multiple-rows=true]:rounded-large"}},{isClearable:!0,isMultiline:!0,class:{clearButton:["group-data-[has-value=true]:opacity-70 group-data-[has-value=true]:block","group-data-[has-value=true]:scale-100","group-data-[has-value=true]:pointer-events-auto"]}}]}),Ck=or({slots:{wrapper:["flex","w-screen","h-[100dvh]","fixed","inset-0","z-50","overflow-x-auto","justify-center","h-[--visual-viewport-height]"],base:["flex","flex-col","relative","bg-white","z-50","w-full","box-border","bg-content1","outline-hidden","mx-1","my-1","sm:mx-6","sm:my-16"],backdrop:"z-50",header:"flex py-4 px-6 flex-initial text-large font-semibold",body:"flex flex-1 flex-col gap-3 px-6 py-2",footer:"flex flex-row gap-2 px-6 py-4 justify-end",closeButton:["absolute","appearance-none","outline-hidden","select-none","top-1","end-1","p-2","text-foreground-500","rounded-full","hover:bg-default-100","active:bg-default-200","tap-highlight-transparent",...kh]},variants:{size:{xs:{base:"max-w-xs"},sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"},"3xl":{base:"max-w-3xl"},"4xl":{base:"max-w-4xl"},"5xl":{base:"max-w-5xl"},full:{base:"my-0 mx-0 sm:mx-0 sm:my-0 max-w-full h-[100dvh] min-h-[100dvh] !rounded-none"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"}},placement:{auto:{wrapper:"items-end sm:items-center"},center:{wrapper:"items-center sm:items-center"},top:{wrapper:"items-start sm:items-start"},"top-center":{wrapper:"items-start sm:items-center"},bottom:{wrapper:"items-end sm:items-end"},"bottom-center":{wrapper:"items-end sm:items-center"}},shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},backdrop:{transparent:{backdrop:"hidden"},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-md backdrop-saturate-150 bg-overlay/30"}},scrollBehavior:{normal:{base:"overflow-y-hidden"},inside:{base:"max-h-[calc(100%_-_8rem)]",body:"overflow-y-auto"},outside:{wrapper:"items-start sm:items-start overflow-y-auto",base:"my-16"}},disableAnimation:{false:{wrapper:["[--scale-enter:100%]","[--scale-exit:100%]","[--slide-enter:0px]","[--slide-exit:80px]","sm:[--scale-enter:100%]","sm:[--scale-exit:103%]","sm:[--slide-enter:0px]","sm:[--slide-exit:0px]"]}}},defaultVariants:{size:"md",radius:"lg",shadow:"sm",placement:"auto",backdrop:"opaque",scrollBehavior:"normal"},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"w-screen h-screen fixed inset-0"}}]}),qO=or({base:"shrink-0 bg-divider border-none",variants:{orientation:{horizontal:"w-full h-divider",vertical:"h-full w-divider"}},defaultVariants:{orientation:"horizontal"}}),YO=or({base:"flex flex-col gap-2 items-start"}),Ek=or({slots:{wrapper:"relative shadow-black/5",zoomedWrapper:"relative overflow-hidden rounded-inherit",img:"relative z-10 opacity-0 shadow-black/5 data-[loaded=true]:opacity-100",blurredImg:["absolute","z-0","inset-0","w-full","h-full","object-cover","filter","blur-lg","scale-105","saturate-150","opacity-30","translate-y-1"]},variants:{radius:{none:{},sm:{},md:{},lg:{},full:{}},shadow:{none:{wrapper:"shadow-none",img:"shadow-none"},sm:{wrapper:"shadow-small",img:"shadow-small"},md:{wrapper:"shadow-medium",img:"shadow-medium"},lg:{wrapper:"shadow-large",img:"shadow-large"}},isZoomed:{true:{img:["object-cover","transform","hover:scale-125"]}},showSkeleton:{true:{wrapper:["group","relative","overflow-hidden","bg-content3 dark:bg-content2"],img:"opacity-0"}},disableAnimation:{true:{img:"transition-none"},false:{img:"transition-transform-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{radius:"lg",shadow:"none",isZoomed:!1,isBlurred:!1,showSkeleton:!1},compoundVariants:[{showSkeleton:!0,disableAnimation:!1,class:{wrapper:["before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2"]}}],compoundSlots:[{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"none",class:"rounded-none"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"full",class:"rounded-full"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"sm",class:"rounded-small"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"md",class:"rounded-md"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"lg",class:"rounded-large"}]}),XO=or({base:["z-0","group","relative","inline-flex","items-center","justify-center","box-border","appearance-none","outline-hidden","select-none","whitespace-nowrap","min-w-max","font-normal","subpixel-antialiased","overflow-hidden","tap-highlight-transparent","transform-gpu data-[pressed=true]:scale-[0.97]","cursor-pointer",...kh],variants:{variant:{solid:"",bordered:"border-medium bg-transparent",light:"bg-transparent",flat:"",faded:"border-medium",shadow:"",ghost:"border-medium bg-transparent"},size:{sm:"px-3 min-w-16 h-8 text-tiny gap-2 rounded-small",md:"px-4 min-w-20 h-10 text-small gap-2 rounded-medium",lg:"px-6 min-w-24 h-12 text-medium gap-3 rounded-large"},color:{default:"",primary:"",secondary:"",success:"",warning:"",danger:""},radius:{none:"rounded-none",sm:"rounded-small",md:"rounded-medium",lg:"rounded-large",full:"rounded-full"},fullWidth:{true:"w-full"},isDisabled:{true:"opacity-disabled pointer-events-none"},isInGroup:{true:"[&:not(:first-child):not(:last-child)]:rounded-none"},isIconOnly:{true:"px-0 !gap-0",false:"[&>svg]:max-w-[theme(spacing.8)]"},disableAnimation:{true:"!transition-none data-[pressed=true]:scale-100",false:"transition-transform-colors-opacity motion-reduce:transition-none"}},defaultVariants:{size:"md",variant:"solid",color:"default",fullWidth:!1,isDisabled:!1,isInGroup:!1},compoundVariants:[{variant:"solid",color:"default",class:Te.solid.default},{variant:"solid",color:"primary",class:Te.solid.primary},{variant:"solid",color:"secondary",class:Te.solid.secondary},{variant:"solid",color:"success",class:Te.solid.success},{variant:"solid",color:"warning",class:Te.solid.warning},{variant:"solid",color:"danger",class:Te.solid.danger},{variant:"shadow",color:"default",class:Te.shadow.default},{variant:"shadow",color:"primary",class:Te.shadow.primary},{variant:"shadow",color:"secondary",class:Te.shadow.secondary},{variant:"shadow",color:"success",class:Te.shadow.success},{variant:"shadow",color:"warning",class:Te.shadow.warning},{variant:"shadow",color:"danger",class:Te.shadow.danger},{variant:"bordered",color:"default",class:Te.bordered.default},{variant:"bordered",color:"primary",class:Te.bordered.primary},{variant:"bordered",color:"secondary",class:Te.bordered.secondary},{variant:"bordered",color:"success",class:Te.bordered.success},{variant:"bordered",color:"warning",class:Te.bordered.warning},{variant:"bordered",color:"danger",class:Te.bordered.danger},{variant:"flat",color:"default",class:Te.flat.default},{variant:"flat",color:"primary",class:Te.flat.primary},{variant:"flat",color:"secondary",class:Te.flat.secondary},{variant:"flat",color:"success",class:Te.flat.success},{variant:"flat",color:"warning",class:Te.flat.warning},{variant:"flat",color:"danger",class:Te.flat.danger},{variant:"faded",color:"default",class:Te.faded.default},{variant:"faded",color:"primary",class:Te.faded.primary},{variant:"faded",color:"secondary",class:Te.faded.secondary},{variant:"faded",color:"success",class:Te.faded.success},{variant:"faded",color:"warning",class:Te.faded.warning},{variant:"faded",color:"danger",class:Te.faded.danger},{variant:"light",color:"default",class:[Te.light.default,"data-[hover=true]:bg-default/40"]},{variant:"light",color:"primary",class:[Te.light.primary,"data-[hover=true]:bg-primary/20"]},{variant:"light",color:"secondary",class:[Te.light.secondary,"data-[hover=true]:bg-secondary/20"]},{variant:"light",color:"success",class:[Te.light.success,"data-[hover=true]:bg-success/20"]},{variant:"light",color:"warning",class:[Te.light.warning,"data-[hover=true]:bg-warning/20"]},{variant:"light",color:"danger",class:[Te.light.danger,"data-[hover=true]:bg-danger/20"]},{variant:"ghost",color:"default",class:[Te.ghost.default,"data-[hover=true]:!bg-default"]},{variant:"ghost",color:"primary",class:[Te.ghost.primary,"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground"]},{variant:"ghost",color:"secondary",class:[Te.ghost.secondary,"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground"]},{variant:"ghost",color:"success",class:[Te.ghost.success,"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground"]},{variant:"ghost",color:"warning",class:[Te.ghost.warning,"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground"]},{variant:"ghost",color:"danger",class:[Te.ghost.danger,"data-[hover=true]:!bg-danger data-[hover=true]:!text-danger-foreground"]},{isInGroup:!0,class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,size:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,isRounded:!0,class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,radius:"none",class:"rounded-none first:rounded-s-none last:rounded-e-none"},{isInGroup:!0,radius:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,radius:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,radius:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,radius:"full",class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,variant:["ghost","bordered"],color:"default",className:pf.default},{isInGroup:!0,variant:["ghost","bordered"],color:"primary",className:pf.primary},{isInGroup:!0,variant:["ghost","bordered"],color:"secondary",className:pf.secondary},{isInGroup:!0,variant:["ghost","bordered"],color:"success",className:pf.success},{isInGroup:!0,variant:["ghost","bordered"],color:"warning",className:pf.warning},{isInGroup:!0,variant:["ghost","bordered"],color:"danger",className:pf.danger},{isIconOnly:!0,size:"sm",class:"min-w-8 w-8 h-8"},{isIconOnly:!0,size:"md",class:"min-w-10 w-10 h-10"},{isIconOnly:!0,size:"lg",class:"min-w-12 w-12 h-12"},{variant:["solid","faded","flat","bordered","shadow"],class:"data-[hover=true]:opacity-hover"}]});or({base:"inline-flex items-center justify-center h-auto",variants:{fullWidth:{true:"w-full"}},defaultVariants:{fullWidth:!1}});var QO=or({slots:{base:"group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2 select-none",wrapper:["relative","inline-flex","items-center","justify-center","shrink-0","overflow-hidden","before:content-['']","before:absolute","before:inset-0","before:border-solid","before:border-2","before:box-border","before:border-default","after:content-['']","after:absolute","after:inset-0","after:scale-50","after:opacity-0","after:origin-center","group-data-[selected=true]:after:scale-100","group-data-[selected=true]:after:opacity-100","group-data-[hover=true]:before:bg-default-100",...q_],hiddenInput:KO,icon:"z-10 w-4 h-3 opacity-0 group-data-[selected=true]:opacity-100 pointer-events-none",label:"relative text-foreground select-none"},variants:{color:{default:{wrapper:"after:bg-default after:text-default-foreground text-default-foreground"},primary:{wrapper:"after:bg-primary after:text-primary-foreground text-primary-foreground"},secondary:{wrapper:"after:bg-secondary after:text-secondary-foreground text-secondary-foreground"},success:{wrapper:"after:bg-success after:text-success-foreground text-success-foreground"},warning:{wrapper:"after:bg-warning after:text-warning-foreground text-warning-foreground"},danger:{wrapper:"after:bg-danger after:text-danger-foreground text-danger-foreground"}},size:{sm:{wrapper:["w-4 h-4 me-2","rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"],label:"text-small",icon:"w-3 h-2"},md:{wrapper:["w-5 h-5 me-2","rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"],label:"text-medium",icon:"w-4 h-3"},lg:{wrapper:["w-6 h-6 me-2","rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"],label:"text-large",icon:"w-5 h-4"}},radius:{none:{wrapper:"rounded-none before:rounded-none after:rounded-none"},sm:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"]},md:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"]},lg:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"]},full:{wrapper:"rounded-full before:rounded-full after:rounded-full"}},lineThrough:{true:{label:["inline-flex","items-center","justify-center","before:content-['']","before:absolute","before:bg-foreground","before:w-0","before:h-0.5","group-data-[selected=true]:opacity-60","group-data-[selected=true]:before:w-full"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isInvalid:{true:{wrapper:"before:border-danger",label:"text-danger"}},disableAnimation:{true:{wrapper:"transition-none",icon:"transition-none",label:"transition-none"},false:{wrapper:["before:transition-colors","group-data-[pressed=true]:scale-95","transition-transform","after:transition-transform-opacity","after:!ease-linear","after:!duration-200","motion-reduce:transition-none"],icon:"transition-opacity motion-reduce:transition-none",label:"transition-colors-opacity before:transition-width motion-reduce:transition-none"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1,lineThrough:!1}});or({slots:{base:"relative flex flex-col gap-2",label:"relative text-medium text-foreground-500",wrapper:"flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row",description:"text-small text-foreground-400",errorMessage:"text-small text-danger"},variants:{isRequired:{true:{label:"after:content-['*'] after:text-danger after:ml-0.5"}},isInvalid:{true:{description:"text-danger"}},disableAnimation:{true:{},false:{description:"transition-colors !duration-150 motion-reduce:transition-none"}}},defaultVariants:{isInvalid:!1,isRequired:!1}});var Pk=or({slots:{base:["relative","max-w-fit","min-w-min","inline-flex","items-center","justify-between","box-border","whitespace-nowrap"],content:"flex-1 text-inherit font-normal",dot:["w-2","h-2","ml-1","rounded-full"],avatar:"shrink-0",closeButton:["z-10","appearance-none","outline-hidden","select-none","transition-opacity","opacity-70","hover:opacity-100","cursor-pointer","active:opacity-disabled","tap-highlight-transparent"]},variants:{variant:{solid:{},bordered:{base:"border-medium bg-transparent"},light:{base:"bg-transparent"},flat:{},faded:{base:"border-medium"},shadow:{},dot:{base:"border-medium border-default text-foreground bg-transparent"}},color:{default:{dot:"bg-default-400"},primary:{dot:"bg-primary"},secondary:{dot:"bg-secondary"},success:{dot:"bg-success"},warning:{dot:"bg-warning"},danger:{dot:"bg-danger"}},size:{sm:{base:"px-1 h-6 text-tiny",content:"px-1",closeButton:"text-medium",avatar:"w-4 h-4"},md:{base:"px-1 h-7 text-small",content:"px-2",closeButton:"text-large",avatar:"w-5 h-5"},lg:{base:"px-2 h-8 text-medium",content:"px-2",closeButton:"text-xl",avatar:"w-6 h-6"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"},full:{base:"rounded-full"}},isOneChar:{true:{},false:{}},isCloseable:{true:{},false:{}},hasStartContent:{true:{}},hasEndContent:{true:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isCloseButtonFocusVisible:{true:{closeButton:[...WO,"ring-1","rounded-full"]}}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"full",isDisabled:!1},compoundVariants:[{variant:"solid",color:"default",class:{base:Te.solid.default}},{variant:"solid",color:"primary",class:{base:Te.solid.primary}},{variant:"solid",color:"secondary",class:{base:Te.solid.secondary}},{variant:"solid",color:"success",class:{base:Te.solid.success}},{variant:"solid",color:"warning",class:{base:Te.solid.warning}},{variant:"solid",color:"danger",class:{base:Te.solid.danger}},{variant:"shadow",color:"default",class:{base:Te.shadow.default}},{variant:"shadow",color:"primary",class:{base:Te.shadow.primary}},{variant:"shadow",color:"secondary",class:{base:Te.shadow.secondary}},{variant:"shadow",color:"success",class:{base:Te.shadow.success}},{variant:"shadow",color:"warning",class:{base:Te.shadow.warning}},{variant:"shadow",color:"danger",class:{base:Te.shadow.danger}},{variant:"bordered",color:"default",class:{base:Te.bordered.default}},{variant:"bordered",color:"primary",class:{base:Te.bordered.primary}},{variant:"bordered",color:"secondary",class:{base:Te.bordered.secondary}},{variant:"bordered",color:"success",class:{base:Te.bordered.success}},{variant:"bordered",color:"warning",class:{base:Te.bordered.warning}},{variant:"bordered",color:"danger",class:{base:Te.bordered.danger}},{variant:"flat",color:"default",class:{base:Te.flat.default}},{variant:"flat",color:"primary",class:{base:Te.flat.primary}},{variant:"flat",color:"secondary",class:{base:Te.flat.secondary}},{variant:"flat",color:"success",class:{base:Te.flat.success}},{variant:"flat",color:"warning",class:{base:Te.flat.warning}},{variant:"flat",color:"danger",class:{base:Te.flat.danger}},{variant:"faded",color:"default",class:{base:Te.faded.default}},{variant:"faded",color:"primary",class:{base:Te.faded.primary}},{variant:"faded",color:"secondary",class:{base:Te.faded.secondary}},{variant:"faded",color:"success",class:{base:Te.faded.success}},{variant:"faded",color:"warning",class:{base:Te.faded.warning}},{variant:"faded",color:"danger",class:{base:Te.faded.danger}},{variant:"light",color:"default",class:{base:Te.light.default}},{variant:"light",color:"primary",class:{base:Te.light.primary}},{variant:"light",color:"secondary",class:{base:Te.light.secondary}},{variant:"light",color:"success",class:{base:Te.light.success}},{variant:"light",color:"warning",class:{base:Te.light.warning}},{variant:"light",color:"danger",class:{base:Te.light.danger}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"sm",class:{base:"w-5 h-5 min-w-5 min-h-5"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"md",class:{base:"w-6 h-6 min-w-6 min-h-6"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"lg",class:{base:"w-7 h-7 min-w-7 min-h-7"}},{isOneChar:!0,isCloseable:!1,hasStartContent:!1,hasEndContent:!1,class:{base:"px-0 justify-center",content:"px-0 flex-none"}},{isOneChar:!0,isCloseable:!0,hasStartContent:!1,hasEndContent:!1,class:{base:"w-auto"}},{isOneChar:!0,variant:"dot",class:{base:"w-auto h-7 px-1 items-center",content:"px-2"}},{hasStartContent:!0,size:"sm",class:{content:"pl-0.5"}},{hasStartContent:!0,size:["md","lg"],class:{content:"pl-1"}},{hasEndContent:!0,size:"sm",class:{content:"pr-0.5"}},{hasEndContent:!0,size:["md","lg"],class:{content:"pr-1"}}]}),JO=or({base:"px-2",variants:{variant:{light:"",shadow:"px-4 shadow-medium rounded-medium bg-content1",bordered:"px-4 border-medium border-divider rounded-medium",splitted:"flex flex-col gap-2"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"light",fullWidth:!0}}),ZO=or({slots:{base:"",heading:"",trigger:["flex py-4 w-full h-full gap-3 outline-hidden items-center tap-highlight-transparent",...kh],startContent:"shrink-0",indicator:"text-default-400",titleWrapper:"flex-1 flex flex-col text-start",title:"text-foreground text-medium",subtitle:"text-small text-foreground-500 font-normal",content:"py-2"},variants:{variant:{splitted:{base:"px-4 bg-content1 shadow-medium rounded-medium"}},isCompact:{true:{trigger:"py-2",title:"text-medium",subtitle:"text-small",indicator:"text-medium",content:"py-1"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},hideIndicator:{true:{indicator:"hidden"}},disableAnimation:{true:{content:"hidden data-[open=true]:block"},false:{indicator:"transition-transform",trigger:"transition-opacity"}},disableIndicatorAnimation:{true:{indicator:"transition-none"},false:{indicator:"rotate-0 data-[open=true]:-rotate-90 rtl:-rotate-180 rtl:data-[open=true]:-rotate-90"}}},defaultVariants:{size:"md",radius:"lg",isDisabled:!1,hideIndicator:!1,disableIndicatorAnimation:!1}});function Y_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0){let d=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(h=>{if(h=r6(h),h in Tk)return;Tk[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":n6,m||(b.as="script"),b.crossOrigin="",b.href=h,c&&b.setAttribute("nonce",c),document.head.appendChild(b),m)return new Promise((x,k)=>{b.addEventListener("load",x),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};function i6(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,preventFocusOnPress:h,allowFocusWhenDisabled:m,onClick:g,href:b,target:x,rel:k,type:P="button"}=e,T;n==="button"?T={type:P,disabled:r}:T={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?x:void 0,type:n==="input"?P:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?k:void 0};let{pressProps:_,isPressed:R}=nl({onPressStart:s,onPressEnd:a,onPressChange:d,onPress:i,onPressUp:c,onClick:g,isDisabled:r,preventFocusOnPress:h,ref:t}),{focusableProps:D}=Sh(e,t);m&&(D.tabIndex=r?-1:D.tabIndex);let F=Tn(D,_,Du(e,{labelable:!0}));return{isPressed:R,buttonProps:Tn(T,F,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}function o6(e,t,n){let{item:r,isDisabled:i}=e,s=r.key,a=t.selectionManager,c=S.useId(),d=S.useId(),h=t.disabledKeys.has(r.key)||i;S.useEffect(()=>{s===t.focusedKey&&document.activeElement!==n.current&&n.current&&Iu(n.current)},[n,s,t.focusedKey]);let m=S.useCallback(P=>{a.canSelectItem(s)&&(a.select(s,P),t.toggleKey(s))},[s,a]);const g=S.useCallback(P=>{a.selectionBehavior==="replace"&&a.extendSelection(P),a.setFocusedKey(P)},[a]),b=S.useCallback(P=>{const _={ArrowDown:()=>{const R=t.collection.getKeyAfter(s);if(R&&t.disabledKeys.has(R)){const D=t.collection.getKeyAfter(R);D&&g(D)}else R&&g(R)},ArrowUp:()=>{const R=t.collection.getKeyBefore(s);if(R&&t.disabledKeys.has(R)){const D=t.collection.getKeyBefore(R);D&&g(D)}else R&&g(R)},Home:()=>{const R=t.collection.getFirstKey();R&&g(R)},End:()=>{const R=t.collection.getLastKey();R&&g(R)}}[P.key];_&&(P.preventDefault(),a.canSelectItem(s)&&_(P))},[s,a]);let{buttonProps:x}=i6({id:c,elementType:"button",isDisabled:h,onKeyDown:b,onPress:m},n),k=t.selectionManager.isSelected(r.key);return{buttonProps:{...x,"aria-expanded":k,"aria-controls":k?d:void 0},regionProps:{id:d,role:"region","aria-labelledby":c}}}function _k(e){return IM()?e.altKey:e.ctrlKey}function Ng(e,t){var n,r;let i=`[data-key="${CSS.escape(String(t))}"]`,s=(n=e.current)===null||n===void 0?void 0:n.dataset.collection;return s&&(i=`[data-collection="${CSS.escape(s)}"]${i}`),(r=e.current)===null||r===void 0?void 0:r.querySelector(i)}const X_=new WeakMap;function s6(e){let t=$f();return X_.set(e,t),t}function $q(e){return X_.get(e)}const a6=1e3;function l6(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=S.useRef({search:"",timeout:void 0}).current,s=a=>{let c=u6(a.key);if(!(!c||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target))){if(c===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=c,t.getKeyForSearch!=null){let d=t.getKeyForSearch(i.search,n.focusedKey);d==null&&(d=t.getKeyForSearch(i.search)),d!=null&&(n.setFocusedKey(d),r&&r(d))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},a6)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function u6(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function c6(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:s=!1,disallowEmptySelection:a=!1,disallowSelectAll:c=!1,escapeKeyBehavior:d="clearSelection",selectOnFocus:h=t.selectionBehavior==="replace",disallowTypeAhead:m=!1,shouldUseVirtualFocus:g,allowsTabNavigation:b=!1,isVirtualized:x,scrollRef:k=r,linkBehavior:P="action"}=e,{direction:T}=gh(),_=gx(),R=X=>{var V;if(X.altKey&&X.key==="Tab"&&X.preventDefault(),!(!((V=r.current)===null||V===void 0)&&V.contains(X.target)))return;const se=(Re,dt)=>{if(Re!=null){if(t.isLink(Re)&&P==="selection"&&h&&!_k(X)){JE.flushSync(()=>{t.setFocusedKey(Re,dt)});let Mt=Ng(r,Re),It=t.getItemProps(Re);Mt&&_.open(Mt,X,It.href,It.routerOptions);return}if(t.setFocusedKey(Re,dt),t.isLink(Re)&&P==="override")return;X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Re):h&&!_k(X)&&t.replaceSelection(Re)}};switch(X.key){case"ArrowDown":if(n.getKeyBelow){var M,W,re;let Re=t.focusedKey!=null?(M=n.getKeyBelow)===null||M===void 0?void 0:M.call(n,t.focusedKey):(W=n.getFirstKey)===null||W===void 0?void 0:W.call(n);Re==null&&s&&(Re=(re=n.getFirstKey)===null||re===void 0?void 0:re.call(n,t.focusedKey)),Re!=null&&(X.preventDefault(),se(Re))}break;case"ArrowUp":if(n.getKeyAbove){var j,me,Ee;let Re=t.focusedKey!=null?(j=n.getKeyAbove)===null||j===void 0?void 0:j.call(n,t.focusedKey):(me=n.getLastKey)===null||me===void 0?void 0:me.call(n);Re==null&&s&&(Re=(Ee=n.getLastKey)===null||Ee===void 0?void 0:Ee.call(n,t.focusedKey)),Re!=null&&(X.preventDefault(),se(Re))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ye,De,Ve;let Re=t.focusedKey!=null?(ye=n.getKeyLeftOf)===null||ye===void 0?void 0:ye.call(n,t.focusedKey):null;Re==null&&s&&(Re=T==="rtl"?(De=n.getFirstKey)===null||De===void 0?void 0:De.call(n,t.focusedKey):(Ve=n.getLastKey)===null||Ve===void 0?void 0:Ve.call(n,t.focusedKey)),Re!=null&&(X.preventDefault(),se(Re,T==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var _e,Ge,ft;let Re=t.focusedKey!=null?(_e=n.getKeyRightOf)===null||_e===void 0?void 0:_e.call(n,t.focusedKey):null;Re==null&&s&&(Re=T==="rtl"?(Ge=n.getLastKey)===null||Ge===void 0?void 0:Ge.call(n,t.focusedKey):(ft=n.getFirstKey)===null||ft===void 0?void 0:ft.call(n,t.focusedKey)),Re!=null&&(X.preventDefault(),se(Re,T==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&X.shiftKey)return;X.preventDefault();let Re=n.getFirstKey(t.focusedKey,mp(X));t.setFocusedKey(Re),Re!=null&&(mp(X)&&X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Re):h&&t.replaceSelection(Re))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&X.shiftKey)return;X.preventDefault();let Re=n.getLastKey(t.focusedKey,mp(X));t.setFocusedKey(Re),Re!=null&&(mp(X)&&X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Re):h&&t.replaceSelection(Re))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let Re=n.getKeyPageBelow(t.focusedKey);Re!=null&&(X.preventDefault(),se(Re))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let Re=n.getKeyPageAbove(t.focusedKey);Re!=null&&(X.preventDefault(),se(Re))}break;case"a":mp(X)&&t.selectionMode==="multiple"&&c!==!0&&(X.preventDefault(),t.selectAll());break;case"Escape":d==="clearSelection"&&!a&&t.selectedKeys.size!==0&&(X.stopPropagation(),X.preventDefault(),t.clearSelection());break;case"Tab":if(!b){if(X.shiftKey)r.current.focus();else{let Re=Ys(r.current,{tabbable:!0}),dt,Mt;do Mt=Re.lastChild(),Mt&&(dt=Mt);while(Mt);dt&&!dt.contains(document.activeElement)&&Za(dt)}break}}},D=S.useRef({top:0,left:0});cg(k,"scroll",x?void 0:()=>{var X,V,se,M;D.current={top:(se=(X=k.current)===null||X===void 0?void 0:X.scrollTop)!==null&&se!==void 0?se:0,left:(M=(V=k.current)===null||V===void 0?void 0:V.scrollLeft)!==null&&M!==void 0?M:0}});let F=X=>{if(t.isFocused){X.currentTarget.contains(X.target)||t.setFocused(!1);return}if(X.currentTarget.contains(X.target)){if(t.setFocused(!0),t.focusedKey==null){var V,se;let re=me=>{me!=null&&(t.setFocusedKey(me),h&&!t.isSelected(me)&&t.replaceSelection(me))},j=X.relatedTarget;var M,W;j&&X.currentTarget.compareDocumentPosition(j)&Node.DOCUMENT_POSITION_FOLLOWING?re((M=t.lastSelectedKey)!==null&&M!==void 0?M:(V=n.getLastKey)===null||V===void 0?void 0:V.call(n)):re((W=t.firstSelectedKey)!==null&&W!==void 0?W:(se=n.getFirstKey)===null||se===void 0?void 0:se.call(n))}else!x&&k.current&&(k.current.scrollTop=D.current.top,k.current.scrollLeft=D.current.left);if(t.focusedKey!=null&&k.current){let re=Ng(r,t.focusedKey);re instanceof HTMLElement&&(!re.contains(document.activeElement)&&!g&&Za(re),ah()==="keyboard"&&I1(re,{containingElement:r.current}))}}},z=X=>{X.currentTarget.contains(X.relatedTarget)||t.setFocused(!1)},$=S.useRef(!1);cg(r,zM,g?X=>{let{detail:V}=X;X.stopPropagation(),t.setFocused(!0),V?.focusStrategy==="first"&&($.current=!0)}:void 0);let U=Vn(()=>{var X,V;let se=(V=(X=n.getFirstKey)===null||X===void 0?void 0:X.call(n))!==null&&V!==void 0?V:null;se==null?(SF(r.current),t.collection.size>0&&($.current=!1)):(t.setFocusedKey(se),$.current=!1)});P1(()=>{$.current&&U()},[t.collection,U]);let Z=Vn(()=>{t.collection.size>0&&($.current=!1)});P1(()=>{Z()},[t.focusedKey,Z]),cg(r,OM,g?X=>{var V;X.stopPropagation(),t.setFocused(!1),!((V=X.detail)===null||V===void 0)&&V.clearFocusKey&&t.setFocusedKey(null)}:void 0);const ae=S.useRef(i),B=S.useRef(!1);S.useEffect(()=>{if(ae.current){var X,V;let W=null;var se;i==="first"&&(W=(se=(X=n.getFirstKey)===null||X===void 0?void 0:X.call(n))!==null&&se!==void 0?se:null);var M;i==="last"&&(W=(M=(V=n.getLastKey)===null||V===void 0?void 0:V.call(n))!==null&&M!==void 0?M:null);let re=t.selectedKeys;if(re.size){for(let j of re)if(t.canSelectItem(j)){W=j;break}}t.setFocused(!0),t.setFocusedKey(W),W==null&&!g&&r.current&&Iu(r.current),t.collection.size>0&&(ae.current=!1,B.current=!0)}});let G=S.useRef(t.focusedKey),q=S.useRef(null);S.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==G.current||B.current)&&k.current&&r.current){let X=ah(),V=Ng(r,t.focusedKey);if(!(V instanceof HTMLElement))return;(X==="keyboard"||B.current)&&(q.current&&cancelAnimationFrame(q.current),q.current=requestAnimationFrame(()=>{k.current&&(YE(k.current,V),X!=="virtual"&&I1(V,{containingElement:r.current}))}))}!g&&t.isFocused&&t.focusedKey==null&&G.current!=null&&r.current&&Iu(r.current),G.current=t.focusedKey,B.current=!1}),S.useEffect(()=>()=>{q.current&&cancelAnimationFrame(q.current)},[]),cg(r,"react-aria-focus-scope-restore",X=>{X.preventDefault(),t.setFocused(!0)});let te={onKeyDown:R,onFocus:F,onBlur:z,onMouseDown(X){k.current===X.target&&X.preventDefault()}},{typeSelectProps:K}=l6({keyboardDelegate:n,selectionManager:t});m||(te=Tn(K,te));let oe;g||(oe=t.focusedKey==null?0:-1);let J=s6(t.collection);return{collectionProps:Tn(te,{tabIndex:oe,"data-collection":J})}}class Ik{getItemRect(t){let n=this.ref.current;if(!n)return null;let r=t!=null?Ng(this.ref,t):null;if(!r)return null;let i=n.getBoundingClientRect(),s=r.getBoundingClientRect();return{x:s.left-i.left+n.scrollLeft,y:s.top-i.top+n.scrollTop,width:s.width,height:s.height}}getContentSize(){let t=this.ref.current;var n,r;return{width:(n=t?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=t?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let t=this.ref.current;var n,r,i,s;return{x:(n=t?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=t?.scrollTop)!==null&&r!==void 0?r:0,width:(i=t?.offsetWidth)!==null&&i!==void 0?i:0,height:(s=t?.offsetHeight)!==null&&s!==void 0?s:0}}constructor(t){this.ref=t}}class f6{isDisabled(t){var n;return this.disabledBehavior==="all"&&(((n=t.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,n){let r=t;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(t){let n=t;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(t){let n=t;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(t,n,r){let i=t,s=this.layoutDelegate.getItemRect(i);if(!s||i==null)return null;let a=s;do{if(i=n(i),i==null)break;s=this.layoutDelegate.getItemRect(i)}while(s&&r(a,s)&&i!=null);return i}isSameRow(t,n){return t.y===n.y||t.x!==n.x}isSameColumn(t,n){return t.x===n.x||t.y!==n.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,n){return n?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(t=this.layoutDelegate[n](t),this.findNextNonDisabled(t,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(t=this.layoutDelegate[n](t),this.findNextNonDisabled(t,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,n=>this.collection.getKeyAfter(n))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(t){let n=this.ref.current,r=this.layoutDelegate.getItemRect(t);if(!r)return null;if(n&&!Xp(n))return this.getFirstKey();let i=t;if(this.orientation==="horizontal"){let s=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(t){let n=this.ref.current,r=this.layoutDelegate.getItemRect(t);if(!r)return null;if(n&&!Xp(n))return this.getLastKey();let i=t;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xs||new f6({collection:n,disabledKeys:r,disabledBehavior:d,ref:i,collator:c,layoutDelegate:a}),[s,a,n,r,i,c,d]),{collectionProps:m}=c6({...e,ref:i,selectionManager:t,keyboardDelegate:h});return{listProps:m}}function p6(e,t,n){let{listProps:r}=d6({...e,...t,allowsTabNavigation:!0,disallowSelectAll:!0,ref:n});return delete r.onKeyDownCapture,{accordionProps:{...r,tabIndex:void 0}}}function h6(e){var t,n;const r=di(),{ref:i,as:s,item:a,onFocusChange:c}=e,{state:d,className:h,indicator:m,children:g,title:b,subtitle:x,startContent:k,motionProps:P,focusedKey:T,variant:_,isCompact:R=!1,classNames:D={},isDisabled:F=!1,hideIndicator:z=!1,disableAnimation:$=(t=r?.disableAnimation)!=null?t:!1,keepContentMounted:U=!1,disableIndicatorAnimation:Z=!1,HeadingComponent:ae=s||"h2",onPress:B,onPressStart:G,onPressEnd:q,onPressChange:te,onPressUp:K,onClick:oe,...J}=e,X=s||"div",V=typeof X=="string",se=Pi(i),M=d.disabledKeys.has(a.key)||F,W=d.selectionManager.isSelected(a.key),{buttonProps:re,regionProps:j}=o6({item:a,isDisabled:M},{...d,focusedKey:T},se),{onFocus:me,onBlur:Ee,...ye}=re,{isFocused:De,isFocusVisible:Ve,focusProps:_e}=$u({autoFocus:(n=a.props)==null?void 0:n.autoFocus}),{isHovered:Ge,hoverProps:ft}=Ru({isDisabled:M}),{pressProps:Re,isPressed:dt}=nl({ref:se,isDisabled:M,onPress:B,onPressStart:G,onPressEnd:q,onPressChange:te,onPressUp:K}),Mt=S.useCallback(()=>{c?.(!0,a.key)},[]),It=S.useCallback(()=>{c?.(!1,a.key)},[]),Fe=S.useMemo(()=>({...D}),[cs(D)]),yt=S.useMemo(()=>ZO({isCompact:R,isDisabled:M,hideIndicator:z,disableAnimation:$,disableIndicatorAnimation:Z,variant:_}),[R,M,z,$,Z,_]),Et=jt(Fe?.base,h),Un=S.useCallback((pe={})=>({"data-open":Ae(W),"data-disabled":Ae(M),"data-slot":"base",className:yt.base({class:Et}),...en(Rf(J,{enabled:V}),pe)}),[Et,V,J,yt,a.props,W,M]),Nn=(pe={})=>{var ke,Ue;return{ref:se,"data-open":Ae(W),"data-focus":Ae(De),"data-focus-visible":Ae(Ve),"data-disabled":Ae(M),"data-hover":Ae(Ge),"data-pressed":Ae(dt),"data-slot":"trigger",className:yt.trigger({class:Fe?.trigger}),onFocus:g1(Mt,me,_e.onFocus,J.onFocus,(ke=a.props)==null?void 0:ke.onFocus),onBlur:g1(It,Ee,_e.onBlur,J.onBlur,(Ue=a.props)==null?void 0:Ue.onBlur),...en(ye,ft,Re,pe,{onClick:Ja(Re.onClick,oe)})}},Xt=S.useCallback((pe={})=>({"data-open":Ae(W),"data-disabled":Ae(M),"data-slot":"content",className:yt.content({class:Fe?.content}),...en(j,pe)}),[yt,Fe,j,W,M,Fe?.content]),bt=S.useCallback((pe={})=>({"aria-hidden":Ae(!0),"data-open":Ae(W),"data-disabled":Ae(M),"data-slot":"indicator",className:yt.indicator({class:Fe?.indicator}),...pe}),[yt,Fe?.indicator,W,M,Fe?.indicator]),gn=S.useCallback((pe={})=>({"data-open":Ae(W),"data-disabled":Ae(M),"data-slot":"heading",className:yt.heading({class:Fe?.heading}),...pe}),[yt,Fe?.heading,W,M,Fe?.heading]),Wn=S.useCallback((pe={})=>({"data-open":Ae(W),"data-disabled":Ae(M),"data-slot":"title",className:yt.title({class:Fe?.title}),...pe}),[yt,Fe?.title,W,M,Fe?.title]),on=S.useCallback((pe={})=>({"data-open":Ae(W),"data-disabled":Ae(M),"data-slot":"subtitle",className:yt.subtitle({class:Fe?.subtitle}),...pe}),[yt,Fe,W,M,Fe?.subtitle]);return{Component:X,HeadingComponent:ae,item:a,slots:yt,classNames:Fe,domRef:se,indicator:m,children:g,title:b,subtitle:x,startContent:k,isOpen:W,isDisabled:M,hideIndicator:z,keepContentMounted:U,disableAnimation:$,motionProps:P,getBaseProps:Un,getHeadingProps:gn,getButtonProps:Nn,getContentProps:Xt,getIndicatorProps:bt,getTitleProps:Wn,getSubtitleProps:on}}var Rk=e=>A.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...e,children:A.jsx("path",{d:"M15.5 19l-7-7 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),Q_=e=>A.jsx("svg",{"aria-hidden":"true",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...e,children:A.jsx("path",{d:"M12 2a10 10 0 1010 10A10.016 10.016 0 0012 2zm3.36 12.3a.754.754 0 010 1.06.748.748 0 01-1.06 0l-2.3-2.3-2.3 2.3a.748.748 0 01-1.06 0 .754.754 0 010-1.06l2.3-2.3-2.3-2.3A.75.75 0 019.7 8.64l2.3 2.3 2.3-2.3a.75.75 0 011.06 1.06l-2.3 2.3z",fill:"currentColor"})}),m6=e=>{const{isSelected:t,isIndeterminate:n,disableAnimation:r,...i}=e;return A.jsx("svg",{"aria-hidden":"true",className:"fill-current",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...i,children:A.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})},Vp={ease:[.36,.66,.4,1]},tv={scaleSpring:{enter:{transform:"scale(1)",opacity:1,transition:{type:"spring",bounce:0,duration:.2}},exit:{transform:"scale(0.85)",opacity:0,transition:{type:"easeOut",duration:.15}}},scaleSpringOpacity:{initial:{opacity:0,transform:"scale(0.8)"},enter:{opacity:1,transform:"scale(1)",transition:{type:"spring",bounce:0,duration:.3}},exit:{opacity:0,transform:"scale(0.96)",transition:{type:"easeOut",bounce:0,duration:.15}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:Vp.ease}},exit:{opacity:0,transition:{duration:.3,ease:Vp.ease}}},collapse:{enter:{opacity:1,height:"auto",transition:{height:{type:"spring",bounce:0,duration:.3},opacity:{easings:"ease",duration:.4}}},exit:{opacity:0,height:0,transition:{easings:"ease",duration:.3}}}},$k=()=>Ur(()=>import("./index-CQEJd7fb.js"),[]).then(e=>e.default),J_=Vr((e,t)=>{const{Component:n,HeadingComponent:r,classNames:i,slots:s,indicator:a,children:c,title:d,subtitle:h,startContent:m,isOpen:g,isDisabled:b,hideIndicator:x,keepContentMounted:k,disableAnimation:P,motionProps:T,getBaseProps:_,getHeadingProps:R,getButtonProps:D,getTitleProps:F,getSubtitleProps:z,getContentProps:$,getIndicatorProps:U}=h6({...e,ref:t}),Z=A5(),B=S.useMemo(()=>typeof a=="function"?a({indicator:A.jsx(Rk,{}),isOpen:g,isDisabled:b}):a||null,[a,g,b])||A.jsx(Rk,{}),G=S.useMemo(()=>{if(P)return k?A.jsx("div",{...$(),children:c}):g&&A.jsx("div",{...$(),children:c});const q={exit:{...tv.collapse.exit,overflowY:"hidden"},enter:{...tv.collapse.enter,overflowY:"unset"}};return k?A.jsx(Df,{features:$k,children:A.jsx(Nf.section,{animate:g?"enter":"exit",exit:"exit",initial:"exit",style:{willChange:Z},variants:q,onKeyDown:te=>{te.stopPropagation()},...T,children:A.jsx("div",{...$(),children:c})},"accordion-content")}):A.jsx(rl,{initial:!1,children:g&&A.jsx(Df,{features:$k,children:A.jsx(Nf.section,{animate:"enter",exit:"exit",initial:"exit",style:{willChange:Z},variants:q,onKeyDown:te=>{te.stopPropagation()},...T,children:A.jsx("div",{...$(),children:c})},"accordion-content")})})},[g,P,k,c,T]);return A.jsxs(n,{..._(),children:[A.jsx(r,{...R(),children:A.jsxs("button",{...D(),children:[m&&A.jsx("div",{className:s.startContent({class:i?.startContent}),children:m}),A.jsxs("div",{className:s.titleWrapper({class:i?.titleWrapper}),children:[d&&A.jsx("span",{...F(),children:d}),h&&A.jsx("span",{...z(),children:h})]}),!x&&B&&A.jsx("span",{...U(),children:B})]})}),G]})});J_.displayName="HeroUI.AccordionItem";var g6=J_;class v6{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(t){let n=this.keyMap.get(t);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){var n;return(n=this.keyMap.get(t))!==null&&n!==void 0?n:null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}constructor(t,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,n=n||new Set;let r=c=>{if(this.keyMap.set(c.key,c),c.childNodes&&(c.type==="section"||n.has(c.key)))for(let d of c.childNodes)r(d)};for(let c of t)r(c);let i=null,s=0;for(let[c,d]of this.keyMap)i?(i.nextKey=c,d.prevKey=i.key):(this.firstKey=c,d.prevKey=void 0),d.type==="item"&&(d.index=s++),i=d,i.nextKey=void 0;var a;this.lastKey=(a=i?.key)!==null&&a!==void 0?a:null}}class mo extends Set{constructor(t,n,r){super(t),t instanceof mo?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function y6(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function b6(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:s="all"}=e,a=S.useRef(!1),[,c]=S.useState(!1),d=S.useRef(null),h=S.useRef(null),[,m]=S.useState(null),g=S.useMemo(()=>Ak(e.selectedKeys),[e.selectedKeys]),b=S.useMemo(()=>Ak(e.defaultSelectedKeys,new mo),[e.defaultSelectedKeys]),[x,k]=Nu(g,b,e.onSelectionChange),P=S.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[T,_]=S.useState(i);i==="replace"&&T==="toggle"&&typeof x=="object"&&x.size===0&&_("replace");let R=S.useRef(i);return S.useEffect(()=>{i!==R.current&&(_(i),R.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:T,setSelectionBehavior:_,get isFocused(){return a.current},setFocused(D){a.current=D,c(D)},get focusedKey(){return d.current},get childFocusStrategy(){return h.current},setFocusedKey(D,F="first"){d.current=D,h.current=F,m(D)},selectedKeys:x,setSelectedKeys(D){(r||!y6(D,x))&&k(D)},disabledKeys:P,disabledBehavior:s}}function Ak(e,t){return e?e==="all"?"all":new mo(e):t}function Z_(e){return null}Z_.getCollectionNode=function*(t,n){let{childItems:r,title:i,children:s}=t,a=t.title||t.children,c=t.textValue||(typeof a=="string"?a:"")||t["aria-label"]||"";!c&&n?.suppressTextValueWarning,yield{type:"item",props:t,rendered:a,textValue:c,"aria-label":t["aria-label"],hasChildNodes:x6(t),*childNodes(){if(r)for(let d of r)yield{type:"item",value:d};else if(i){let d=[];He.Children.forEach(s,h=>{d.push({type:"item",element:h})}),yield*d}}}};function x6(e){return e.hasChildItems!=null?e.hasChildItems:!!(e.childItems||e.title&&He.Children.count(e.children)>0)}let w6=Z_;class S6{build(t,n){return this.context=n,Lk(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:r}=t;if(He.isValidElement(n)&&n.type===He.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let s of r)yield*this.getFullNode({value:s,index:i},{renderer:n}),i++}else{let i=[];He.Children.forEach(n,a=>{a&&i.push(a)});let s=0;for(let a of i){let c=this.getFullNode({element:a,index:s},{});for(let d of c)s++,yield d}}}getKey(t,n,r,i){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let s=n.value;if(s!=null){var a;let c=(a=s.key)!==null&&a!==void 0?a:s.id;if(c==null)throw new Error("No key found for item");return c}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,r,i){if(He.isValidElement(t.element)&&t.element.type===He.Fragment){let T=[];He.Children.forEach(t.element.props.children,R=>{T.push(R)});var s;let _=(s=t.index)!==null&&s!==void 0?s:0;for(const R of T)yield*this.getFullNode({element:R,index:_++},n,r,i);return}let a=t.element;if(!a&&t.value&&n&&n.renderer){let T=this.cache.get(t.value);if(T&&(!T.shouldInvalidate||!T.shouldInvalidate(this.context))){T.index=t.index,T.parentKey=i?i.key:null,yield T;return}a=n.renderer(t.value)}if(He.isValidElement(a)){let T=a.type;if(typeof T!="function"&&typeof T.getCollectionNode!="function"){let F=a.type;throw new Error(`Unknown element <${F}> in collection.`)}let _=T.getCollectionNode(a.props,this.context);var c;let R=(c=t.index)!==null&&c!==void 0?c:0,D=_.next();for(;!D.done&&D.value;){let F=D.value;t.index=R;var d;let z=(d=F.key)!==null&&d!==void 0?d:null;z==null&&(z=F.element?null:this.getKey(a,t,n,r));let U=[...this.getFullNode({...F,key:z,index:R,wrapper:k6(t.wrapper,F.wrapper)},this.getChildState(n,F),r?`${r}${a.key}`:a.key,i)];for(let Z of U){var h,m;Z.value=(m=(h=F.value)!==null&&h!==void 0?h:t.value)!==null&&m!==void 0?m:null,Z.value&&this.cache.set(Z.value,Z);var g;if(t.type&&Z.type!==t.type)throw new Error(`Unsupported type <${w0(Z.type)}> in <${w0((g=i?.type)!==null&&g!==void 0?g:"unknown parent type")}>. Only <${w0(t.type)}> is supported.`);R++,yield Z}D=_.next(U)}return}if(t.key==null||t.type==null)return;let b=this;var x,k;let P={type:t.type,props:t.props,key:t.key,parentKey:i?i.key:null,value:(x=t.value)!==null&&x!==void 0?x:null,level:i?i.level+1:0,index:t.index,rendered:t.rendered,textValue:(k=t.textValue)!==null&&k!==void 0?k:"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:Lk(function*(){if(!t.hasChildNodes||!t.childNodes)return;let T=0;for(let _ of t.childNodes()){_.key!=null&&(_.key=`${P.key}${_.key}`);let R=b.getFullNode({..._,index:T},b.getChildState(n,_),P.key,P);for(let D of R)T++,yield D}})};yield P}constructor(){this.cache=new WeakMap}}function Lk(e){let t=[],n=null;return{*[Symbol.iterator](){for(let r of t)yield r;n||(n=e());for(let r of n)t.push(r),yield r}}}function k6(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function w0(e){return e[0].toUpperCase()+e.slice(1)}function C6(e,t,n){let r=S.useMemo(()=>new S6,[]),{children:i,items:s,collection:a}=e;return S.useMemo(()=>{if(a)return a;let d=r.build({children:i,items:s},n);return t(d)},[r,i,s,a,n,t])}function E6(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function P6(e){return T6(e,0)}function T6(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function Aq(e){let t;for(let n of e)t=n;return t}function S0(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...Mk(e,t),t],i=[...Mk(e,n),n],s=r.slice(0,i.length).findIndex((a,c)=>a!==i[c]);return s!==-1?(t=r[s],n=i[s],t.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===t)>=0,-1)}function Mk(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}class ow{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!t||i&&S0(this.collection,i,t)<0)&&(t=i)}var n;return(n=t?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!t||i&&S0(this.collection,i,t)>0)&&(t=i)}var n;return(n=t?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new mo([n],n,n);else{let a=this.state.selectedKeys;var i;let c=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new mo(a,c,n);var s;for(let d of this.getKeyRange(c,(s=a.currentKey)!==null&&s!==void 0?s:n))r.delete(d);for(let d of this.getKeyRange(n,c))this.canSelectItem(d)&&r.add(d)}this.state.setSelectedKeys(r)}getKeyRange(t,n){let r=this.collection.getItem(t),i=this.collection.getItem(n);return r&&i?S0(this.collection,r,i)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let i=[],s=t;for(;s!=null;){let a=this.collection.getItem(s);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(s),s===n)return i;s=this.collection.getKeyAfter(s)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let r=new mo(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let r=this.canSelectItem(n)?new mo([n],n,n):new mo;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new mo;for(let r of t){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=[],n=r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&t.push(r);var s;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((s=(i=P6(E6(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&s!==void 0?s:null)}r=this.collection.getKeyAfter(r)}};return n(this.collection.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new mo)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let r of t)if(!n.has(r))return!1;for(let r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let r=this.collection.getItem(t);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!(!((r=this.collection.getItem(t))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(t){var n,r;return!!(!((r=this.collection.getItem(t))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(t){var n;return(n=this.collection.getItem(t))===null||n===void 0?void 0:n.props}withCollection(t){return new ow(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(t,n,r){this.collection=t,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}}function _6(e){let{onExpandedChange:t}=e,[n,r]=Nu(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=b6(e),s=S.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=C6(e,S.useCallback(d=>new v6(d,{expandedKeys:n}),[n]),null);return S.useEffect(()=>{i.focusedKey!=null&&!a.getItem(i.focusedKey)&&i.setFocusedKey(null)},[a,i.focusedKey]),{collection:a,expandedKeys:n,disabledKeys:s,toggleKey:d=>{r(I6(n,d))},setExpandedKeys:r,selectionManager:new ow(a,i)}}function I6(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function R6(e){var t;const n=di(),{ref:r,as:i,className:s,items:a,variant:c,motionProps:d,expandedKeys:h,disabledKeys:m,selectedKeys:g,children:b,defaultExpandedKeys:x,selectionMode:k="single",selectionBehavior:P="toggle",keepContentMounted:T=!1,disallowEmptySelection:_,defaultSelectedKeys:R,onExpandedChange:D,onSelectionChange:F,dividerProps:z={},isCompact:$=!1,isDisabled:U=!1,showDivider:Z=!0,hideIndicator:ae=!1,disableAnimation:B=(t=n?.disableAnimation)!=null?t:!1,disableIndicatorAnimation:G=!1,itemClasses:q,...te}=e,[K,oe]=S.useState(null),J=i||"div",X=typeof J=="string",V=Pi(r),se=S.useMemo(()=>JO({variant:c,className:s}),[c,s]),W={children:S.useMemo(()=>{let _e=[];return He.Children.map(b,Ge=>{var ft;if(He.isValidElement(Ge)&&typeof((ft=Ge.props)==null?void 0:ft.children)!="string"){const Re=He.cloneElement(Ge,{hasChildItems:!1});_e.push(Re)}else _e.push(Ge)}),_e},[b]),items:a},re={expandedKeys:h,defaultExpandedKeys:x,onExpandedChange:D},j={disabledKeys:m,selectedKeys:g,selectionMode:k,selectionBehavior:P,disallowEmptySelection:_,defaultSelectedKeys:R??x,onSelectionChange:F,...W,...re},me=_6(j);me.selectionManager.setFocusedKey=_e=>{oe(_e)};const{accordionProps:Ee}=p6({...W,...re},me,V),ye=S.useMemo(()=>({state:me,focusedKey:K,motionProps:d,isCompact:$,isDisabled:U,hideIndicator:ae,disableAnimation:B,keepContentMounted:T,disableIndicatorAnimation:G}),[K,$,U,ae,g,B,T,me?.expandedKeys.values,G,me.expandedKeys.size,me.disabledKeys.size,d]),De=S.useCallback((_e={})=>({ref:V,className:se,"data-orientation":"vertical",...en(Ee,Rf(te,{enabled:X}),_e)}),[]),Ve=S.useCallback((_e,Ge)=>{_e&&oe(Ge)},[]);return{Component:J,values:ye,state:me,focusedKey:K,getBaseProps:De,isSplitted:c==="splitted",classNames:se,showDivider:Z,dividerProps:z,disableAnimation:B,handleFocusChanged:Ve,itemClasses:q}}function $6(e){let t=Rf(e,{enabled:typeof e.elementType=="string"}),n;return e.orientation==="vertical"&&(n="vertical"),e.elementType!=="hr"?{separatorProps:{...t,role:"separator","aria-orientation":n}}:{separatorProps:t}}function A6(e){const{as:t,className:n,orientation:r,...i}=e;let s=t||"hr";s==="hr"&&r==="vertical"&&(s="div");const{separatorProps:a}=$6({elementType:typeof s=="string"?s:"hr",orientation:r}),c=S.useMemo(()=>qO({orientation:r,className:n}),[r,n]),d=S.useCallback((h={})=>({className:c,role:"separator","data-orientation":r,...a,...i,...h}),[c,r,a,i]);return{Component:s,getDividerProps:d}}var e2=Vr((e,t)=>{const{Component:n,getDividerProps:r}=A6({...e});return A.jsx(n,{ref:t,...r()})});e2.displayName="HeroUI.Divider";var L6=e2,t2=Vr((e,t)=>{const{Component:n,values:r,state:i,isSplitted:s,showDivider:a,getBaseProps:c,disableAnimation:d,handleFocusChanged:h,itemClasses:m,dividerProps:g}=R6({...e,ref:t}),b=S.useCallback((k,P)=>h(k,P),[h]),x=S.useMemo(()=>[...i.collection].map((k,P)=>{const T={...m,...k.props.classNames||{}};return A.jsxs(S.Fragment,{children:[A.jsx(g6,{item:k,variant:e.variant,onFocusChange:b,...r,...k.props,classNames:T}),!k.props.hidden&&!s&&a&&P{const t={top:{originY:1},bottom:{originY:0},left:{originX:1},right:{originX:0},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}};return t?.[e]||{}},D6=e=>({top:"top",bottom:"bottom",left:"left",right:"right","top-start":"top start","top-end":"top end","bottom-start":"bottom start","bottom-end":"bottom end","left-start":"left top","left-end":"left bottom","right-start":"right top","right-end":"right bottom"})[e],Lq=(e,t)=>{if(t.includes("-")){const[n]=t.split("-");if(n.includes(e))return!1}return!0},Nk=(e,t)=>{if(t.includes("-")){const[,n]=t.split("-");return`${e}-${n}`}return e},N6=w6,xp=N6,Ch=globalThis?.document?S.useLayoutEffect:S.useEffect;function F6(e={}){const{onLoad:t,onError:n,ignoreFallback:r,src:i,crossOrigin:s,srcSet:a,sizes:c,loading:d,shouldBypassImageLoad:h=!1}=e,m=OL(),g=S.useRef(m?new Image:null),[b,x]=S.useState("pending");S.useEffect(()=>{g.current&&(g.current.onload=T=>{k(),x("loaded"),t?.(T)},g.current.onerror=T=>{k(),x("failed"),n?.(T)})},[g.current]);const k=()=>{g.current&&(g.current.onload=null,g.current.onerror=null,g.current=null)},P=S.useCallback(()=>{if(!i)return"pending";if(r||h)return"loaded";const T=new Image;return T.src=i,s&&(T.crossOrigin=s),a&&(T.srcset=a),c&&(T.sizes=c),d&&(T.loading=d),g.current=T,T.complete&&T.naturalWidth?"loaded":"loading"},[i,s,a,c,t,n,d,h]);return Ch(()=>{m&&x(P())},[m,P]),r?"loaded":b}var[Mq,O6]=gv({name:"ButtonGroupContext",strict:!1});function n2(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,preventFocusOnPress:h,allowFocusWhenDisabled:m,onClick:g,href:b,target:x,rel:k,type:P="button",allowTextSelectionOnPress:T}=e,_;n==="button"?_={type:P,disabled:r}:_={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?x:void 0,type:n==="input"?P:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?k:void 0};let{pressProps:R,isPressed:D}=nl({onClick:g,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,onPress:i,isDisabled:r,preventFocusOnPress:h,allowTextSelectionOnPress:T,ref:t}),{focusableProps:F}=Sh(e,t);m&&(F.tabIndex=r?-1:F.tabIndex);let z=Tn(F,R,Du(e,{labelable:!0}));return{isPressed:D,buttonProps:Tn(_,z,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}var z6=()=>Ur(()=>import("./index-CQEJd7fb.js"),[]).then(e=>e.default),r2=e=>{const{ripples:t=[],motionProps:n,color:r="currentColor",style:i,onClear:s}=e;return A.jsx(A.Fragment,{children:t.map(a=>{const c=LL(.01*a.size,.2,a.size>100?.75:.5);return A.jsx(Df,{features:z6,children:A.jsx(rl,{mode:"popLayout",children:A.jsx(Nf.span,{animate:{transform:"scale(2)",opacity:0},className:"heroui-ripple",exit:{opacity:0},initial:{transform:"scale(0)",opacity:.35},style:{position:"absolute",backgroundColor:r,borderRadius:"100%",transformOrigin:"center",pointerEvents:"none",overflow:"hidden",inset:0,zIndex:0,top:a.y,left:a.x,width:`${a.size}px`,height:`${a.size}px`,...i},transition:{duration:c},onAnimationComplete:()=>{s(a.key)},...n})})},a.key)})})};r2.displayName="HeroUI.Ripple";var j6=r2;function B6(e={}){const[t,n]=S.useState([]),r=S.useCallback(s=>{const a=s.target,c=Math.max(a.clientWidth,a.clientHeight);n(d=>[...d,{key:AL(d.length.toString()),size:c,x:s.x-c/2,y:s.y-c/2}])},[]),i=S.useCallback(s=>{n(a=>a.filter(c=>c.key!==s))},[]);return{ripples:t,onClear:i,onPress:r,...e}}function V6(e){var t,n,r,i,s,a,c,d,h;const m=O6(),g=di(),b=!!m,{ref:x,as:k,children:P,startContent:T,endContent:_,autoFocus:R,className:D,spinner:F,isLoading:z=!1,disableRipple:$=!1,fullWidth:U=(t=m?.fullWidth)!=null?t:!1,radius:Z=m?.radius,size:ae=(n=m?.size)!=null?n:"md",color:B=(r=m?.color)!=null?r:"default",variant:G=(i=m?.variant)!=null?i:"solid",disableAnimation:q=(a=(s=m?.disableAnimation)!=null?s:g?.disableAnimation)!=null?a:!1,isDisabled:te=(c=m?.isDisabled)!=null?c:!1,isIconOnly:K=(d=m?.isIconOnly)!=null?d:!1,spinnerPlacement:oe="start",onPress:J,onClick:X,...V}=e,se=k||"button",M=typeof se=="string",W=Pi(x),re=(h=$||g?.disableRipple)!=null?h:q,{isFocusVisible:j,isFocused:me,focusProps:Ee}=$u({autoFocus:R}),ye=te||z,De=S.useMemo(()=>XO({size:ae,color:B,variant:G,radius:Z,fullWidth:U,isDisabled:ye,isInGroup:b,disableAnimation:q,isIconOnly:K,className:D}),[ae,B,G,Z,U,ye,b,K,q,D]),{onPress:Ve,onClear:_e,ripples:Ge}=B6(),ft=S.useCallback(bt=>{re||ye||q||W.current&&Ve(bt)},[re,ye,q,W,Ve]),{buttonProps:Re,isPressed:dt}=n2({elementType:k,isDisabled:ye,onPress:Ja(J,ft),onClick:X,...V},W),{isHovered:Mt,hoverProps:It}=Ru({isDisabled:ye}),Fe=S.useCallback((bt={})=>({"data-disabled":Ae(ye),"data-focus":Ae(me),"data-pressed":Ae(dt),"data-focus-visible":Ae(j),"data-hover":Ae(Mt),"data-loading":Ae(z),...en(Re,Ee,It,Rf(V,{enabled:M}),Rf(bt)),className:De}),[z,ye,me,dt,M,j,Mt,Re,Ee,It,V,De]),yt=bt=>S.isValidElement(bt)?S.cloneElement(bt,{"aria-hidden":!0,focusable:!1}):null,Et=yt(T),Un=yt(_),Nn=S.useMemo(()=>({sm:"sm",md:"sm",lg:"md"})[ae],[ae]),Xt=S.useCallback(()=>({ripples:Ge,onClear:_e}),[Ge,_e]);return{Component:se,children:P,domRef:W,spinner:F,styles:De,startContent:Et,endContent:Un,isLoading:z,spinnerPlacement:oe,spinnerSize:Nn,disableRipple:re,getButtonProps:Fe,getRippleProps:Xt,isIconOnly:K}}function U6(e){var t,n;const[r,i]=ta(e,yk.variantKeys),s=di(),a=(n=(t=e?.variant)!=null?t:s?.spinnerVariant)!=null?n:"default",{children:c,className:d,classNames:h,label:m,...g}=r,b=S.useMemo(()=>yk({...i}),[cs(i)]),x=jt(h?.base,d),k=m||c,P=S.useMemo(()=>k&&typeof k=="string"?k:g["aria-label"]?"":"Loading",[c,k,g["aria-label"]]),T=S.useCallback(()=>({"aria-label":P,className:b.base({class:x}),...g}),[P,b,x,g]);return{label:k,slots:b,classNames:h,variant:a,getSpinnerProps:T}}var i2=Vr((e,t)=>{const{slots:n,classNames:r,label:i,variant:s,getSpinnerProps:a}=U6({...e});return s==="wave"||s==="dots"?A.jsxs("div",{ref:t,...a(),children:[A.jsx("div",{className:n.wrapper({class:r?.wrapper}),children:[...new Array(3)].map((c,d)=>A.jsx("i",{className:n.dots({class:r?.dots}),style:{"--dot-index":d}},`dot-${d}`))}),i&&A.jsx("span",{className:n.label({class:r?.label}),children:i})]}):s==="simple"?A.jsxs("div",{ref:t,...a(),children:[A.jsxs("svg",{className:n.wrapper({class:r?.wrapper}),fill:"none",viewBox:"0 0 24 24",children:[A.jsx("circle",{className:n.circle1({class:r?.circle1}),cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),A.jsx("path",{className:n.circle2({class:r?.circle2}),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})]}),i&&A.jsx("span",{className:n.label({class:r?.label}),children:i})]}):s==="spinner"?A.jsxs("div",{ref:t,...a(),children:[A.jsx("div",{className:n.wrapper({class:r?.wrapper}),children:[...new Array(12)].map((c,d)=>A.jsx("i",{className:n.spinnerBars({class:r?.spinnerBars}),style:{"--bar-index":d}},`star-${d}`))}),i&&A.jsx("span",{className:n.label({class:r?.label}),children:i})]}):A.jsxs("div",{ref:t,...a(),children:[A.jsxs("div",{className:n.wrapper({class:r?.wrapper}),children:[A.jsx("i",{className:n.circle1({class:r?.circle1})}),A.jsx("i",{className:n.circle2({class:r?.circle2})})]}),i&&A.jsx("span",{className:n.label({class:r?.label}),children:i})]})});i2.displayName="HeroUI.Spinner";var W6=i2,o2=Vr((e,t)=>{const{Component:n,domRef:r,children:i,spinnerSize:s,spinner:a=A.jsx(W6,{color:"current",size:s}),spinnerPlacement:c,startContent:d,endContent:h,isLoading:m,disableRipple:g,getButtonProps:b,getRippleProps:x,isIconOnly:k}=V6({...e,ref:t});return A.jsxs(n,{ref:r,...b(),children:[d,m&&c==="start"&&a,m&&k?null:i,m&&c==="end"&&a,h,!g&&A.jsx(j6,{...x()})]})});o2.displayName="HeroUI.Button";var hr=o2;function K6(e){const[t,n]=ta(e,Pk.variantKeys),{ref:r,as:i,children:s,avatar:a,startContent:c,endContent:d,onClose:h,classNames:m,className:g,...b}=t,x=i||"div",k=Pi(r),P=jt(m?.base,g),T=!!h,_=e.variant==="dot",{focusProps:R,isFocusVisible:D}=$u(),F=S.useMemo(()=>typeof s=="string"&&s?.length===1,[s]),z=S.useMemo(()=>!!a||!!c,[a,c]),$=S.useMemo(()=>!!d||T,[d,T]),U=S.useMemo(()=>Pk({...n,hasStartContent:z,hasEndContent:$,isOneChar:F,isCloseable:T,isCloseButtonFocusVisible:D}),[cs(n),D,z,$,F,T]),{pressProps:Z}=nl({isDisabled:!!e?.isDisabled,onPress:h}),ae=()=>({ref:k,className:U.base({class:P}),...b}),B=()=>({role:"button",tabIndex:0,className:U.closeButton({class:m?.closeButton}),"aria-label":"close chip",...en(Z,R)}),G=te=>S.isValidElement(te)?S.cloneElement(te,{className:U.avatar({class:m?.avatar})}):null,q=te=>S.isValidElement(te)?S.cloneElement(te,{className:jt("max-h-[80%]",te.props.className)}):null;return{Component:x,children:s,slots:U,classNames:m,isDot:_,isCloseable:T,startContent:G(a)||q(c),endContent:q(d),getCloseButtonProps:B,getChipProps:ae}}var s2=Vr((e,t)=>{const{Component:n,children:r,slots:i,classNames:s,isDot:a,isCloseable:c,startContent:d,endContent:h,getCloseButtonProps:m,getChipProps:g}=K6({...e,ref:t}),b=S.useMemo(()=>a&&!d?A.jsx("span",{className:i.dot({class:s?.dot})}):d,[i,d,a]),x=S.useMemo(()=>c?A.jsx("span",{...m(),children:h||A.jsx(Q_,{})}):h,[h,c,m]);return A.jsxs(n,{...g(),children:[b,A.jsx("span",{className:i.content({class:s?.content}),children:r}),x]})});s2.displayName="HeroUI.Chip";var kg=s2;const a2={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},l2={...a2,customError:!0,valid:!1},vf={isInvalid:!1,validationDetails:a2,validationErrors:[]},u2=S.createContext({}),nv="__formValidationState"+Date.now();function sw(e){if(e[nv]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:s}=e[nv];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:s}}return H6(e)}function H6(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:s,validate:a,validationBehavior:c="aria"}=e;n&&(t||(t=n==="invalid"));let d=t!==void 0?{isInvalid:t,validationErrors:[],validationDetails:l2}:null,h=S.useMemo(()=>{if(!a||i==null)return null;let B=G6(a,i);return Fk(B)},[a,i]);s?.validationDetails.valid&&(s=void 0);let m=S.useContext(u2),g=S.useMemo(()=>r?Array.isArray(r)?r.flatMap(B=>Fb(m[B])):Fb(m[r]):[],[m,r]),[b,x]=S.useState(m),[k,P]=S.useState(!1);m!==b&&(x(m),P(!1));let T=S.useMemo(()=>Fk(k?[]:g),[k,g]),_=S.useRef(vf),[R,D]=S.useState(vf),F=S.useRef(vf),z=()=>{if(!$)return;U(!1);let B=h||s||_.current;k0(B,F.current)||(F.current=B,D(B))},[$,U]=S.useState(!1);return S.useEffect(z),{realtimeValidation:d||T||h||s||vf,displayValidation:c==="native"?d||T||R:d||T||h||s||R,updateValidation(B){c==="aria"&&!k0(R,B)?D(B):_.current=B},resetValidation(){let B=vf;k0(B,F.current)||(F.current=B,D(B)),c==="native"&&U(!1),P(!0)},commitValidation(){c==="native"&&U(!0),P(!0)}}}function Fb(e){return e?Array.isArray(e)?e:[e]:[]}function G6(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return Fb(n)}return[]}function Fk(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:l2}:null}function k0(e,t){return e===t?!0:!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function c2(e,t,n){let{validationBehavior:r,focus:i}=e;rn(()=>{if(r==="native"&&n?.current&&!n.current.disabled){let d=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(d),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation(Y6(n.current))}});let s=Vn(()=>{t.resetValidation()}),a=Vn(d=>{var h;t.displayValidation.isInvalid||t.commitValidation();let m=n==null||(h=n.current)===null||h===void 0?void 0:h.form;if(!d.defaultPrevented&&n&&m&&X6(m)===n.current){var g;i?i():(g=n.current)===null||g===void 0||g.focus(),iF("keyboard")}d.preventDefault()}),c=Vn(()=>{t.commitValidation()});S.useEffect(()=>{let d=n?.current;if(!d)return;let h=d.form;return d.addEventListener("invalid",a),d.addEventListener("change",c),h?.addEventListener("reset",s),()=>{d.removeEventListener("invalid",a),d.removeEventListener("change",c),h?.removeEventListener("reset",s)}},[n,a,c,s,r])}function q6(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function Y6(e){return{isInvalid:!e.validity.valid,validationDetails:q6(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function X6(e){for(let t=0;t{F.stopPropagation(),t.setSelected(F.target.checked)},{pressProps:x,isPressed:k}=nl({isDisabled:r}),{pressProps:P,isPressed:T}=nl({onPress(){var F;t.toggle(),(F=n.current)===null||F===void 0||F.focus()},isDisabled:r||i}),{focusableProps:_}=Sh(e,n),R=Tn(x,_),D=Du(e,{labelable:!0});return QE(n,t.isSelected,t.setSelected),{labelProps:Tn(P,{onClick:F=>F.preventDefault()}),inputProps:Tn(D,{"aria-invalid":g||m==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],"aria-controls":e["aria-controls"],"aria-readonly":i||void 0,onChange:b,disabled:r,...s==null?{}:{value:s},name:a,type:"checkbox",...R}),isSelected:t.isSelected,isPressed:k||T,isDisabled:r,isReadOnly:i,isInvalid:g||m==="invalid"}}function f2(e,t,n){let r=sw({...e,value:t.isSelected}),{isInvalid:i,validationErrors:s,validationDetails:a}=r.displayValidation,{labelProps:c,inputProps:d,isSelected:h,isPressed:m,isDisabled:g,isReadOnly:b}=Q6({...e,isInvalid:i},t,n);c2(e,r,n);let{isIndeterminate:x,isRequired:k,validationBehavior:P="aria"}=e;S.useEffect(()=>{n.current&&(n.current.indeterminate=!!x)});let{pressProps:T}=nl({isDisabled:g||b,onPress(){let{[nv]:_}=e,{commitValidation:R}=_||r;R()}});return{labelProps:Tn(c,T),inputProps:{...d,checked:h,"aria-required":k&&P==="aria"||void 0,required:k&&P==="native"},isSelected:h,isPressed:m,isDisabled:g,isReadOnly:b,isInvalid:i,validationErrors:s,validationDetails:a}}const J6=new WeakMap;function d2(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:s="label"}=e;t=$f(t);let a=$f(),c={};n&&(r=r?`${a} ${r}`:a,c={id:a,htmlFor:s==="label"?t:void 0});let d=HE({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:c,fieldProps:d}}function Z6(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:s,fieldProps:a}=d2(e),c=J0([!!t,!!n,r,i]),d=J0([!!t,!!n,r,i]);return a=Tn(a,{"aria-describedby":[c,d,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:s,fieldProps:a,descriptionProps:{id:c},errorMessageProps:{id:d}}}function p2(e={}){let{isReadOnly:t}=e,[n,r]=Nu(e.isSelected,e.defaultSelected||!1,e.onChange);function i(a){t||r(a)}function s(){t||r(!n)}return{isSelected:n,setSelected:i,toggle:s}}function ez(e,t,n){const r=p2({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),onChange(T){T?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(T)}});let{name:i,descriptionId:s,errorMessageId:a,validationBehavior:c}=J6.get(t);var d;c=(d=e.validationBehavior)!==null&&d!==void 0?d:c;let{realtimeValidation:h}=sw({...e,value:r.isSelected,name:void 0,validationBehavior:"aria"}),m=S.useRef(vf),g=()=>{t.setInvalid(e.value,h.isInvalid?h:m.current)};S.useEffect(g);let b=t.realtimeValidation.isInvalid?t.realtimeValidation:h,x=c==="native"?t.displayValidation:b;var k;let P=f2({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,isRequired:(k=e.isRequired)!==null&&k!==void 0?k:t.isRequired,validationBehavior:c,[nv]:{realtimeValidation:b,displayValidation:x,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(T){m.current=T,g()}}},r,n);return{...P,inputProps:{...P.inputProps,"aria-describedby":[e["aria-describedby"],t.isInvalid?a:null,s].filter(Boolean).join(" ")||void 0}}}var Ok=Symbol("default");function tz(e){const t=S.useRef(null),n=S.useRef(void 0),r=S.useCallback(i=>{if(typeof e=="function"){const s=e,a=s(i);return()=>{typeof a=="function"?a():s(null)}}else if(e)return e.current=i,()=>{e.current=null}},[e]);return S.useMemo(()=>({get current(){return t.current},set current(i){t.current=i,n.current&&(n.current(),n.current=void 0),i!=null&&(n.current=r(i))}}),[r])}function aw(e,t){let n=S.useContext(e);if(t===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`));if(!t&&!n.slots[Ok])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=t||Ok;if(!n.slots[i])throw new Error(`Invalid slot "${t}". Valid slot names are ${r}.`);return n.slots[i]}return n}function nz(e,t,n){let r=aw(n,e.slot)||{},{ref:i,...s}=r,a=tz(S.useMemo(()=>$E(t,i),[t,i])),c=en(s,e);return"style"in s&&s.style&&"style"in e&&e.style&&(typeof s.style=="function"||typeof e.style=="function"?c.style=d=>{let h=typeof s.style=="function"?s.style(d):s.style,m={...d.defaultStyle,...h},g=typeof e.style=="function"?e.style({...d,defaultStyle:m}):e.style;return{...m,...g}}:c.style={...s.style,...e.style}),[c,a]}var rv=S.createContext(null),rz=S.forwardRef(function(t,n){[t,n]=nz(t,n,rv);let{validationErrors:r,validationBehavior:i="native",children:s,className:a,...c}=t;const d=S.useMemo(()=>YO({className:a}),[a]);return A.jsx("form",{noValidate:i!=="native",...c,ref:n,className:d,children:A.jsx(rv.Provider,{value:{...t,validationBehavior:i},children:A.jsx(u2.Provider,{value:r??{},children:s})})})}),iz=S.forwardRef(function(t,n){var r,i;const s=di(),a=(i=(r=t.validationBehavior)!=null?r:s?.validationBehavior)!=null?i:"native";return A.jsx(rz,{...t,ref:n,validationBehavior:a})}),[Dq,oz]=gv({name:"CheckboxGroupContext",strict:!1});function sz(e){const{isSelected:t,disableAnimation:n,...r}=e;return A.jsx("svg",{"aria-hidden":"true",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:t?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,style:!n&&t?{transition:"stroke-dashoffset 250ms linear 0.2s"}:{},viewBox:"0 0 17 18",...r,children:A.jsx("polyline",{points:"1 9 7 14 15 4"})})}function az(e){const{isSelected:t,disableAnimation:n,...r}=e;return A.jsx("svg",{stroke:"currentColor",strokeWidth:3,viewBox:"0 0 24 24",...r,children:A.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function lz(e){const{isIndeterminate:t,...n}=e,r=t?az:sz;return A.jsx(r,{...n})}function Ob(e,t=[]){const n=S.useRef(e);return Ch(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function uz(e={}){var t,n,r,i,s,a,c,d;const h=di(),m=oz(),{validationBehavior:g}=aw(rv)||{},b=!!m,{as:x,ref:k,value:P="",children:T,icon:_,name:R,isRequired:D,isReadOnly:F=!1,autoFocus:z=!1,isSelected:$,size:U=(t=m?.size)!=null?t:"md",color:Z=(n=m?.color)!=null?n:"primary",radius:ae=m?.radius,lineThrough:B=(r=m?.lineThrough)!=null?r:!1,isDisabled:G=(i=m?.isDisabled)!=null?i:!1,disableAnimation:q=(a=(s=m?.disableAnimation)!=null?s:h?.disableAnimation)!=null?a:!1,validationState:te,isInvalid:K=te?te==="invalid":(c=m?.isInvalid)!=null?c:!1,isIndeterminate:oe=!1,validationBehavior:J=b?m.validationBehavior:(d=g??h?.validationBehavior)!=null?d:"native",defaultSelected:X,classNames:V,className:se,onValueChange:M,validate:W,...re}=e,j=x||"label",me=S.useRef(null),Ee=S.useRef(null);let ye=e.onChange;b&&(ye=Ja(()=>{m.groupState.resetValidation()},ye));const De=S.useId(),Ve=S.useMemo(()=>({name:R,value:P,children:T,autoFocus:z,defaultSelected:X,isIndeterminate:oe,isRequired:D,isInvalid:K,isSelected:$,isDisabled:G,isReadOnly:F,"aria-label":RE(re["aria-label"],T),"aria-labelledby":re["aria-labelledby"]||De,onChange:M}),[R,P,T,z,X,oe,D,K,$,G,F,re["aria-label"],re["aria-labelledby"],De,M]),_e=p2(Ve),Ge={isInvalid:K,isRequired:D,validate:W,validationState:te,validationBehavior:J},{inputProps:ft,isSelected:Re,isDisabled:dt,isReadOnly:Mt,isPressed:It,isInvalid:Fe}=b?ez({...Ve,...Ge},m.groupState,Ee):f2({...Ve,...Ge},_e,Ee),yt=dt||Mt,Et=te==="invalid"||K||Fe,Un=yt?!1:It,{hoverProps:Nn,isHovered:Xt}=Ru({isDisabled:ft.disabled}),{focusProps:bt,isFocused:gn,isFocusVisible:Wn}=$u({autoFocus:ft.autoFocus}),on=S.useMemo(()=>QO({color:Z,size:U,radius:ae,isInvalid:Et,lineThrough:B,isDisabled:dt,disableAnimation:q}),[Z,U,ae,Et,B,dt,q]);Ch(()=>{if(!Ee.current)return;const Rt=!!Ee.current.checked;_e.setSelected(Rt)},[Ee.current]);const pe=Ob(ye),ke=S.useCallback(Rt=>{if(Mt||dt){Rt.preventDefault();return}pe?.(Rt)},[Mt,dt,pe]),Ue=jt(V?.base,se),tt=S.useCallback(()=>({ref:me,className:on.base({class:Ue}),"data-disabled":Ae(dt),"data-selected":Ae(Re||oe),"data-invalid":Ae(Et),"data-hover":Ae(Xt),"data-focus":Ae(gn),"data-pressed":Ae(Un),"data-readonly":Ae(ft.readOnly),"data-focus-visible":Ae(Wn),"data-indeterminate":Ae(oe),...en(Nn,re)}),[on,Ue,dt,Re,oe,Et,Xt,gn,Un,ft.readOnly,Wn,Nn,re]),st=S.useCallback((Rt={})=>({...Rt,"aria-hidden":!0,className:jt(on.wrapper({class:jt(V?.wrapper,Rt?.className)}))}),[on,V?.wrapper]),Vt=S.useCallback(()=>({ref:AE(Ee,k),...en(ft,bt),className:on.hiddenInput({class:V?.hiddenInput}),onChange:Ja(ft.onChange,ke)}),[ft,bt,ke,V?.hiddenInput]),Kn=S.useCallback(()=>({id:De,className:on.label({class:V?.label})}),[on,V?.label,dt,Re,Et]),Qt=S.useCallback(()=>({isSelected:Re,isIndeterminate:oe,disableAnimation:q,className:on.icon({class:V?.icon})}),[on,V?.icon,Re,oe,q]);return{Component:j,icon:_,children:T,isSelected:Re,isDisabled:dt,isInvalid:Et,isFocused:gn,isHovered:Xt,isFocusVisible:Wn,getBaseProps:tt,getWrapperProps:st,getInputProps:Vt,getLabelProps:Kn,getIconProps:Qt}}var h2=Vr((e,t)=>{const{Component:n,children:r,icon:i=A.jsx(lz,{}),getBaseProps:s,getWrapperProps:a,getInputProps:c,getIconProps:d,getLabelProps:h}=uz({...e,ref:t}),m=typeof i=="function"?i(d()):S.cloneElement(i,d());return A.jsxs(n,{...s(),children:[A.jsx("input",{...c()}),A.jsx("span",{...a(),children:m}),r&&A.jsx("span",{...h(),children:r})]})});h2.displayName="HeroUI.Checkbox";var m2=h2;function g2(e){let[t,n]=Nu(e.isOpen,e.defaultOpen||!1,e.onOpenChange);const r=S.useCallback(()=>{n(!0)},[n]),i=S.useCallback(()=>{n(!1)},[n]),s=S.useCallback(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:i,toggle:s}}const cz=1500,zk=500;let mu={},fz=0,wp=!1,Ks=null,gu=null;function dz(e={}){let{delay:t=cz,closeDelay:n=zk}=e,{isOpen:r,open:i,close:s}=g2(e),a=S.useMemo(()=>`${++fz}`,[]),c=S.useRef(null),d=S.useRef(s),h=()=>{mu[a]=b},m=()=>{for(let k in mu)k!==a&&(mu[k](!0),delete mu[k])},g=()=>{c.current&&clearTimeout(c.current),c.current=null,m(),h(),wp=!0,i(),Ks&&(clearTimeout(Ks),Ks=null),gu&&(clearTimeout(gu),gu=null)},b=k=>{k||n<=0?(c.current&&clearTimeout(c.current),c.current=null,d.current()):c.current||(c.current=setTimeout(()=>{c.current=null,d.current()},n)),Ks&&(clearTimeout(Ks),Ks=null),wp&&(gu&&clearTimeout(gu),gu=setTimeout(()=>{delete mu[a],gu=null,wp=!1},Math.max(zk,n)))},x=()=>{m(),h(),!r&&!Ks&&!wp?Ks=setTimeout(()=>{Ks=null,wp=!0,g()},t):r||g()};return S.useEffect(()=>{d.current=s},[s]),S.useEffect(()=>()=>{c.current&&clearTimeout(c.current),mu[a]&&delete mu[a]},[a]),{isOpen:r,open:k=>{!k&&t>0&&!c.current?x():g()},close:b}}function pz(e,t){let n=Du(e,{labelable:!0}),{hoverProps:r}=Ru({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:Tn(n,r,{role:"tooltip"})}}function hz(e,t,n){let{isDisabled:r,trigger:i}=e,s=$f(),a=S.useRef(!1),c=S.useRef(!1),d=()=>{(a.current||c.current)&&t.open(c.current)},h=_=>{!a.current&&!c.current&&t.close(_)};S.useEffect(()=>{let _=R=>{n&&n.current&&R.key==="Escape"&&(R.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0)}},[n,t]);let m=()=>{i!=="focus"&&(ah()==="pointer"?a.current=!0:a.current=!1,d())},g=()=>{i!=="focus"&&(c.current=!1,a.current=!1,h())},b=()=>{c.current=!1,a.current=!1,h(!0)},x=()=>{tw()&&(c.current=!0,d())},k=()=>{c.current=!1,a.current=!1,h(!0)},{hoverProps:P}=Ru({isDisabled:r,onHoverStart:m,onHoverEnd:g}),{focusableProps:T}=Sh({isDisabled:r,onFocus:x,onBlur:k},n);return{triggerProps:{"aria-describedby":t.isOpen?s:void 0,...Tn(T,P,{onPointerDown:b,onKeyDown:b,tabIndex:void 0})},tooltipProps:{id:s}}}var Hs=[];function v2(e,t){const{disableOutsideEvents:n=!0,isDismissable:r=!1,isKeyboardDismissDisabled:i=!1,isOpen:s,onClose:a,shouldCloseOnBlur:c,shouldCloseOnInteractOutside:d}=e;S.useEffect(()=>(s&&Hs.push(t),()=>{const P=Hs.indexOf(t);P>=0&&Hs.splice(P,1)}),[s,t]);const h=()=>{Hs[Hs.length-1]===t&&a&&a()},m=P=>{(!d||d(P.target))&&(Hs[Hs.length-1]===t&&n&&(P.stopPropagation(),P.preventDefault()),P.pointerType!=="touch"&&h())},g=P=>{P.pointerType==="touch"&&(!d||d(P.target))&&(Hs[Hs.length-1]===t&&n&&(P.stopPropagation(),P.preventDefault()),h())},b=P=>{P.key==="Escape"&&!i&&!P.nativeEvent.isComposing&&(P.stopPropagation(),P.preventDefault(),h())};hF({isDisabled:!(r&&s),onInteractOutside:r&&s?g:void 0,onInteractOutsideStart:m,ref:t});const{focusWithinProps:x}=Pv({isDisabled:!c,onBlurWithin:P=>{!P.relatedTarget||yF(P.relatedTarget)||(!d||d(P.relatedTarget))&&h()}}),k=P=>{P.target===P.currentTarget&&P.preventDefault()};return{overlayProps:{onKeyDown:b,...x},underlayProps:{onPointerDown:k}}}function mz(e){var t,n;const r=di(),[i,s]=ta(e,bk.variantKeys),{ref:a,as:c,isOpen:d,content:h,children:m,defaultOpen:g,onOpenChange:b,isDisabled:x,trigger:k,shouldFlip:P=!0,containerPadding:T=12,placement:_="top",delay:R=0,closeDelay:D=500,showArrow:F=!1,offset:z=7,crossOffset:$=0,isDismissable:U,shouldCloseOnBlur:Z=!0,portalContainer:ae,isKeyboardDismissDisabled:B=!1,updatePositionDeps:G=[],shouldCloseOnInteractOutside:q,className:te,onClose:K,motionProps:oe,classNames:J,...X}=i,V=c||"div",se=(n=(t=e?.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,M=dz({delay:R,closeDelay:D,isDisabled:x,defaultOpen:g,isOpen:d,onOpenChange:Fe=>{b?.(Fe),Fe||K?.()}}),W=S.useRef(null),re=S.useRef(null),j=S.useId(),me=M.isOpen&&!x;S.useImperativeHandle(a,()=>PL(re));const{triggerProps:Ee,tooltipProps:ye}=hz({isDisabled:x,trigger:k},M,W),{tooltipProps:De}=pz({isOpen:me,...en(i,ye)},M),{overlayProps:Ve,placement:_e,updatePosition:Ge}=V5({isOpen:me,targetRef:W,placement:D6(_),overlayRef:re,offset:F?z+3:z,crossOffset:$,shouldFlip:P,containerPadding:T});Ch(()=>{G.length&&Ge()},G);const{overlayProps:ft}=v2({isOpen:me,onClose:M.close,isDismissable:U,shouldCloseOnBlur:Z,isKeyboardDismissDisabled:B,shouldCloseOnInteractOutside:q},re),Re=S.useMemo(()=>{var Fe,yt,Et;return bk({...s,disableAnimation:se,radius:(Fe=e?.radius)!=null?Fe:"md",size:(yt=e?.size)!=null?yt:"md",shadow:(Et=e?.shadow)!=null?Et:"sm"})},[cs(s),se,e?.radius,e?.size,e?.shadow]),dt=S.useCallback((Fe={},yt=null)=>({...en(Ee,Fe),ref:AE(yt,W),"aria-describedby":me?j:void 0}),[Ee,me,j,M]),Mt=S.useCallback(()=>({ref:re,"data-slot":"base","data-open":Ae(me),"data-arrow":Ae(F),"data-disabled":Ae(x),"data-placement":Nk(_e||"top",_),...en(De,ft,X),style:en(Ve.style,X.style,i.style),className:Re.base({class:J?.base}),id:j}),[Re,me,F,x,_e,_,De,ft,X,Ve,i,j]),It=S.useCallback(()=>({"data-slot":"content","data-open":Ae(me),"data-arrow":Ae(F),"data-disabled":Ae(x),"data-placement":Nk(_e||"top",_),className:Re.content({class:jt(J?.content,te)})}),[Re,me,F,x,_e,_,J]);return{Component:V,content:h,children:m,isOpen:me,triggerRef:W,showArrow:F,portalContainer:ae,placement:_,disableAnimation:se,isDisabled:x,motionProps:oe,getTooltipContentProps:It,getTriggerProps:dt,getTooltipProps:Mt}}var gz=()=>Ur(()=>import("./index-CQEJd7fb.js"),[]).then(e=>e.default),y2=Vr((e,t)=>{var n;const{Component:r,children:i,content:s,isOpen:a,portalContainer:c,placement:d,disableAnimation:h,motionProps:m,getTriggerProps:g,getTooltipProps:b,getTooltipContentProps:x}=mz({...e,ref:t});let k;try{if(S.Children.count(i)!==1)throw new Error;if(!S.isValidElement(i))k=A.jsx("p",{...g(),children:i});else{const z=i,$=(n=z.props.ref)!=null?n:z.ref;k=S.cloneElement(z,g(z.props,$))}}catch{k=A.jsx("span",{}),DL("Tooltip must have only one child node. Please, check your code.")}const{ref:P,id:T,style:_,...R}=b(),D=A.jsx("div",{ref:P,id:T,style:_,children:A.jsx(Nf.div,{animate:"enter",exit:"exit",initial:"exit",variants:tv.scaleSpring,...en(m,R),style:{...M6(d)},children:A.jsx(r,{...x(),children:s})},`${T}-tooltip-inner`)},`${T}-tooltip-content`);return A.jsxs(A.Fragment,{children:[k,h?a&&A.jsx(uk,{portalContainer:c,children:A.jsx("div",{ref:P,id:T,style:_,...R,children:A.jsx(r,{...x(),children:s})})}):A.jsx(Df,{features:gz,children:A.jsx(rl,{children:a&&A.jsx(uk,{portalContainer:c,children:D})})})]})});y2.displayName="HeroUI.Tooltip";var vz=y2;function yz(e={}){const{rerender:t=!1,delay:n=0}=e,r=S.useRef(!1),[i,s]=S.useState(!1);return S.useEffect(()=>{r.current=!0;let a=null;return t&&(n>0?a=setTimeout(()=>{s(!0)},n):s(!0)),()=>{r.current=!1,t&&s(!1),a&&clearTimeout(a)}},[t]),[S.useCallback(()=>r.current,[]),i]}function bz(e){let{value:t=0,minValue:n=0,maxValue:r=100,valueLabel:i,isIndeterminate:s,formatOptions:a={style:"percent"}}=e,c=Du(e,{labelable:!0}),{labelProps:d,fieldProps:h}=d2({...e,labelElementType:"span"});t=Ug(t,n,r);let m=(t-n)/(r-n),g=HM(a);if(!s&&!i){let b=a.style==="percent"?m:t;i=g.format(b)}return{progressBarProps:Tn(c,{...h,"aria-valuenow":s?void 0:t,"aria-valuemin":n,"aria-valuemax":r,"aria-valuetext":s?void 0:i,role:"progressbar"}),labelProps:d}}function xz(e){var t,n,r;const i=di(),[s,a]=ta(e,xk.variantKeys),{ref:c,as:d,id:h,className:m,classNames:g,label:b,valueLabel:x,value:k=void 0,minValue:P=0,maxValue:T=100,strokeWidth:_,showValueLabel:R=!1,formatOptions:D={style:"percent"},...F}=s,z=d||"div",$=Pi(c),U=jt(g?.base,m),[,Z]=yz({rerender:!0,delay:100}),ae=((t=e.isIndeterminate)!=null?t:!0)&&k===void 0,B=(r=(n=e.disableAnimation)!=null?n:i?.disableAnimation)!=null?r:!1,{progressBarProps:G,labelProps:q}=bz({id:h,label:b,value:k,minValue:P,maxValue:T,valueLabel:x,formatOptions:D,isIndeterminate:ae,"aria-labelledby":e["aria-labelledby"],"aria-label":e["aria-label"]}),te=S.useMemo(()=>xk({...a,disableAnimation:B,isIndeterminate:ae}),[cs(a),B,ae]),K=B?!0:Z,oe=16,J=_||(e.size==="sm"?2:3),X=16-J,V=2*X*Math.PI,se=S.useMemo(()=>K?ae?.25:k?ML((k-P)/(T-P),1):0:0,[K,k,P,T,ae]),M=V-se*V,W=S.useCallback((ye={})=>({ref:$,"data-indeterminate":Ae(ae),"data-disabled":Ae(e.isDisabled),className:te.base({class:U}),...en(G,F,ye)}),[$,te,ae,e.isDisabled,U,G,F]),re=S.useCallback((ye={})=>({className:te.label({class:g?.label}),...en(q,ye)}),[te,g,q]),j=S.useCallback((ye={})=>({viewBox:"0 0 32 32",fill:"none",strokeWidth:J,className:te.svg({class:g?.svg}),...ye}),[J,te,g]),me=S.useCallback((ye={})=>({cx:oe,cy:oe,r:X,role:"presentation",strokeDasharray:`${V} ${V}`,strokeDashoffset:M,transform:"rotate(-90 16 16)",strokeLinecap:"round",className:te.indicator({class:g?.indicator}),...ye}),[te,g,M,V,X]),Ee=S.useCallback((ye={})=>({cx:oe,cy:oe,r:X,role:"presentation",strokeDasharray:`${V} ${V}`,strokeDashoffset:0,transform:"rotate(-90 16 16)",strokeLinecap:"round",className:te.track({class:g?.track}),...ye}),[te,g,V,X]);return{Component:z,domRef:$,slots:te,classNames:g,label:b,showValueLabel:R,getProgressBarProps:W,getLabelProps:re,getSvgProps:j,getIndicatorProps:me,getTrackProps:Ee}}var b2=Vr((e,t)=>{const{Component:n,slots:r,classNames:i,label:s,showValueLabel:a,getProgressBarProps:c,getLabelProps:d,getSvgProps:h,getIndicatorProps:m,getTrackProps:g}=xz({ref:t,...e}),b=c();return A.jsxs(n,{...b,children:[A.jsxs("div",{className:r.svgWrapper({class:i?.svgWrapper}),children:[A.jsxs("svg",{...h(),children:[A.jsx("circle",{...g()}),A.jsx("circle",{...m()})]}),a&&A.jsx("span",{className:r.value({class:i?.value}),children:b["aria-valuetext"]})]}),s&&A.jsx("span",{...d(),children:s})]})});b2.displayName="HeroUI.CircularProgress";var x2=b2;function wz(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:i=!1,isReadOnly:s=!1,type:a="text",validationBehavior:c="aria"}=e,[d,h]=Nu(e.value,e.defaultValue||"",e.onChange),{focusableProps:m}=Sh(e,t),g=sw({...e,value:d}),{isInvalid:b,validationErrors:x,validationDetails:k}=g.displayValidation,{labelProps:P,fieldProps:T,descriptionProps:_,errorMessageProps:R}=Z6({...e,isInvalid:b,errorMessage:e.errorMessage||x}),D=Du(e,{labelable:!0});const F={type:a,pattern:e.pattern};return QE(t,d,h),c2(e,g,t),S.useEffect(()=>{if(t.current instanceof Gi(t.current).HTMLTextAreaElement){let z=t.current;Object.defineProperty(z,"defaultValue",{get:()=>z.value,set:()=>{},configurable:!0})}},[t]),{labelProps:P,inputProps:Tn(D,n==="input"?F:void 0,{disabled:r,readOnly:s,required:i&&c==="native","aria-required":i&&c==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:d,onChange:z=>h(z.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(He.version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...m,...T}),descriptionProps:_,errorMessageProps:R,isInvalid:b,validationErrors:x,validationDetails:k}}function Sz(e){var t,n,r,i,s,a,c;const d=di(),{validationBehavior:h}=aw(rv)||{},[m,g]=ta(e,kk.variantKeys),{ref:b,as:x,type:k,label:P,baseRef:T,wrapperRef:_,description:R,className:D,classNames:F,autoFocus:z,startContent:$,endContent:U,onClear:Z,onChange:ae,validationState:B,validationBehavior:G=(t=h??d?.validationBehavior)!=null?t:"native",innerWrapperRef:q,onValueChange:te=()=>{},...K}=m,oe=S.useCallback(Ze=>{te(Ze??"")},[te]),[J,X]=S.useState(!1),V=x||"div",se=(r=(n=e.disableAnimation)!=null?n:d?.disableAnimation)!=null?r:!1,M=Pi(b),W=Pi(T),re=Pi(_),j=Pi(q),[me,Ee]=Nu(m.value,(i=m.defaultValue)!=null?i:"",oe),ye=k==="file",De=((c=(a=(s=M?.current)==null?void 0:s.files)==null?void 0:a.length)!=null?c:0)>0,Ve=["date","time","month","week","range"].includes(k),_e=!IL(me)||Ve||De,Ge=_e||J,ft=k==="hidden",Re=e.isMultiline,dt=jt(F?.base,D,_e?"is-filled":""),Mt=S.useCallback(()=>{var Ze;ye?M.current.value="":Ee(""),Z?.(),(Ze=M.current)==null||Ze.focus()},[Ee,Z,ye]);Ch(()=>{M.current&&Ee(M.current.value)},[M.current]);const{labelProps:It,inputProps:Fe,isInvalid:yt,validationErrors:Et,validationDetails:Un,descriptionProps:Nn,errorMessageProps:Xt}=wz({...e,validationBehavior:G,autoCapitalize:e.autoCapitalize,value:me,"aria-label":e.label?e["aria-label"]:RE(e["aria-label"],e.placeholder),inputElementType:Re?"textarea":"input",onChange:Ee},M);ye&&(delete Fe.value,delete Fe.onChange);const{isFocusVisible:bt,isFocused:gn,focusProps:Wn}=$u({autoFocus:z,isTextInput:!0}),{isHovered:on,hoverProps:pe}=Ru({isDisabled:!!e?.isDisabled}),{isHovered:ke,hoverProps:Ue}=Ru({isDisabled:!!e?.isDisabled}),{focusProps:tt,isFocusVisible:st}=$u(),{focusWithinProps:Vt}=Pv({onFocusWithinChange:X}),{pressProps:Kn}=nl({isDisabled:!!e?.isDisabled||!!e?.isReadOnly,onPress:Mt}),Qt=B==="invalid"||yt,Rt=BF({labelPlacement:e.labelPlacement,label:P}),Ir=typeof m.errorMessage=="function"?m.errorMessage({isInvalid:Qt,validationErrors:Et,validationDetails:Un}):m.errorMessage||Et?.join(" "),Ft=!!Z||e.isClearable,sr=!!P||!!R||!!Ir,Jt=!!m.placeholder,oa=!!P,ds=!!R||!!Ir,$i=Rt==="outside-left",hi=Rt==="outside-top",sa=Rt==="outside"||$i||hi,ju=Rt==="inside",ps=M.current?(!M.current.value||M.current.value===""||!me||me==="")&&Jt:!1,Kr=!!$,Bu=sa?$i||hi||Jt||Rt==="outside"&&Kr:!1,aa=Rt==="outside"&&!Jt&&!Kr,Zt=S.useMemo(()=>kk({...g,isInvalid:Qt,labelPlacement:Rt,isClearable:Ft,disableAnimation:se}),[cs(g),Qt,Rt,Ft,Kr,se]),hs=S.useCallback((Ze={})=>({ref:W,className:Zt.base({class:dt}),"data-slot":"base","data-filled":Ae(_e||Jt||Kr||ps||ye),"data-filled-within":Ae(Ge||Jt||Kr||ps||ye),"data-focus-within":Ae(J),"data-focus-visible":Ae(bt),"data-readonly":Ae(e.isReadOnly),"data-focus":Ae(gn),"data-hover":Ae(on||ke),"data-required":Ae(e.isRequired),"data-invalid":Ae(Qt),"data-disabled":Ae(e.isDisabled),"data-has-elements":Ae(sr),"data-has-helper":Ae(ds),"data-has-label":Ae(oa),"data-has-value":Ae(!ps),"data-hidden":Ae(ft),...Vt,...Ze}),[Zt,dt,_e,gn,on,ke,Qt,ds,oa,sr,ps,Kr,J,bt,Ge,Jt,Vt,ft,e.isReadOnly,e.isRequired,e.isDisabled]),sl=S.useCallback((Ze={})=>({"data-slot":"label",className:Zt.label({class:F?.label}),...en(It,Ue,Ze)}),[Zt,ke,It,F?.label]),Ai=S.useCallback(Ze=>{Ze.key==="Escape"&&me&&(Ft||Z)&&!e.isReadOnly&&(Ee(""),Z?.())},[me,Ee,Z,Ft,e.isReadOnly]),Yf=S.useCallback((Ze={})=>({"data-slot":"input","data-filled":Ae(_e),"data-filled-within":Ae(Ge),"data-has-start-content":Ae(Kr),"data-has-end-content":Ae(!!U),"data-type":k,className:Zt.input({class:jt(F?.input,_e?"is-filled":"",Re?"pe-0":"",k==="password"?"[&::-ms-reveal]:hidden":"")}),...en(Wn,Fe,Rf(K,{enabled:!0,labelable:!0,omitEventNames:new Set(Object.keys(Fe))}),Ze),"aria-readonly":Ae(e.isReadOnly),onChange:Ja(Fe.onChange,ae),onKeyDown:Ja(Fe.onKeyDown,Ze.onKeyDown,Ai),ref:M}),[Zt,me,Wn,Fe,K,_e,Ge,Kr,U,F?.input,e.isReadOnly,e.isRequired,ae,Ai]),Qi=S.useCallback((Ze={})=>({ref:re,"data-slot":"input-wrapper","data-hover":Ae(on||ke),"data-focus-visible":Ae(bt),"data-focus":Ae(gn),className:Zt.inputWrapper({class:jt(F?.inputWrapper,_e?"is-filled":"")}),...en(Ze,pe),onClick:xo=>{M.current&&xo.currentTarget===xo.target&&M.current.focus()},style:{cursor:"text",...Ze.style}}),[Zt,on,ke,bt,gn,me,F?.inputWrapper]),la=S.useCallback((Ze={})=>({...Ze,ref:j,"data-slot":"inner-wrapper",onClick:xo=>{M.current&&xo.currentTarget===xo.target&&M.current.focus()},className:Zt.innerWrapper({class:jt(F?.innerWrapper,Ze?.className)})}),[Zt,F?.innerWrapper]),ua=S.useCallback((Ze={})=>({...Ze,"data-slot":"main-wrapper",className:Zt.mainWrapper({class:jt(F?.mainWrapper,Ze?.className)})}),[Zt,F?.mainWrapper]),al=S.useCallback((Ze={})=>({...Ze,"data-slot":"helper-wrapper",className:Zt.helperWrapper({class:jt(F?.helperWrapper,Ze?.className)})}),[Zt,F?.helperWrapper]),Xf=S.useCallback((Ze={})=>({...Ze,...Nn,"data-slot":"description",className:Zt.description({class:jt(F?.description,Ze?.className)})}),[Zt,F?.description]),Qf=S.useCallback((Ze={})=>({...Ze,...Xt,"data-slot":"error-message",className:Zt.errorMessage({class:jt(F?.errorMessage,Ze?.className)})}),[Zt,Xt,F?.errorMessage]),Vu=S.useCallback((Ze={})=>({...Ze,type:"button",tabIndex:-1,disabled:e.isDisabled,"aria-label":"clear input","data-slot":"clear-button","data-focus-visible":Ae(st),className:Zt.clearButton({class:jt(F?.clearButton,Ze?.className)}),...en(Kn,tt)}),[Zt,st,Kn,tt,F?.clearButton]);return{Component:V,classNames:F,domRef:M,label:P,description:R,startContent:$,endContent:U,labelPlacement:Rt,isClearable:Ft,hasHelper:ds,hasStartContent:Kr,isLabelOutside:Bu,isOutsideLeft:$i,isOutsideTop:hi,isLabelOutsideAsPlaceholder:aa,shouldLabelBeOutside:sa,shouldLabelBeInside:ju,hasPlaceholder:Jt,isInvalid:Qt,errorMessage:Ir,getBaseProps:hs,getLabelProps:sl,getInputProps:Yf,getMainWrapperProps:ua,getInputWrapperProps:Qi,getInnerWrapperProps:la,getHelperWrapperProps:al,getDescriptionProps:Xf,getErrorMessageProps:Qf,getClearButtonProps:Vu}}function zb(){return zb=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{Component:d,label:h,description:m,startContent:g,endContent:b,hasHelper:x,shouldLabelBeOutside:k,shouldLabelBeInside:P,isInvalid:T,errorMessage:_,getBaseProps:R,getLabelProps:D,getInputProps:F,getInnerWrapperProps:z,getInputWrapperProps:$,getHelperWrapperProps:U,getDescriptionProps:Z,getErrorMessageProps:ae,isClearable:B,getClearButtonProps:G}=Sz({...a,ref:c,isMultiline:!0}),[q,te]=S.useState(t>1),[K,oe]=S.useState(!1),J=h?A.jsx("label",{...D(),children:h}):null,X=F(),V=(me,Ee)=>{if(t===1&&te(me>=Ee.rowHeight*2),n>t){const ye=me>=n*Ee.rowHeight;oe(ye)}s?.(me,Ee)},se=i?A.jsx("textarea",{...X,style:en(X.style,e??{})}):A.jsx(zz,{...X,cacheMeasurements:r,"data-hide-scroll":Ae(!K),maxRows:n,minRows:t,style:en(X.style,e??{}),onHeightChange:V}),M=S.useMemo(()=>B?A.jsx("button",{...G(),children:A.jsx(Q_,{})}):null,[B,G]),W=S.useMemo(()=>g||b?A.jsxs("div",{...z(),children:[g,se,b]}):A.jsx("div",{...z(),children:se}),[g,X,b,z]),re=T&&_,j=re||m;return A.jsxs(d,{...R(),children:[k?J:null,A.jsxs("div",{...$(),"data-has-multiple-rows":Ae(q),children:[P?J:null,W,M]}),x&&j?A.jsx("div",{...U(),children:re?A.jsx("div",{...ae(),children:_}):A.jsx("div",{...Z(),children:m})}):null]})});w2.displayName="HeroUI.Textarea";var jz=w2;function Bz(e,t){let{role:n="dialog"}=e,r=J0();r=e["aria-label"]?void 0:r;let i=S.useRef(!1);return S.useEffect(()=>{if(t.current&&!t.current.contains(document.activeElement)){Iu(t.current);let s=setTimeout(()=>{document.activeElement===t.current&&(i.current=!0,t.current&&(t.current.blur(),Iu(t.current)),i.current=!1)},500);return()=>{clearTimeout(s)}}},[t]),A_(),{dialogProps:{...Du(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||r,onBlur:s=>{i.current&&s.stopPropagation()}},titleProps:{id:r}}}function Vz(e){var t,n;const r=di(),[i,s]=ta(e,Ek.variantKeys),{ref:a,as:c,src:d,className:h,classNames:m,loading:g,isBlurred:b,fallbackSrc:x,isLoading:k,disableSkeleton:P=!!x,removeWrapper:T=!1,onError:_,onLoad:R,srcSet:D,sizes:F,crossOrigin:z,...$}=i,U=F6({src:d,loading:g,onError:_,onLoad:R,ignoreFallback:!1,srcSet:D,sizes:F,crossOrigin:z,shouldBypassImageLoad:c!==void 0}),Z=(n=(t=e.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,ae=U==="loaded"&&!k,B=U==="loading"||k,G=e.isZoomed,q=c||"img",te=Pi(a),{w:K,h:oe}=S.useMemo(()=>({w:i.width?typeof i.width=="number"?`${i.width}px`:i.width:"fit-content",h:i.height?typeof i.height=="number"?`${i.height}px`:i.height:"auto"}),[i?.width,i?.height]),J=(!d||!ae)&&!!x,X=B&&!P,V=S.useMemo(()=>Ek({...s,disableAnimation:Z,showSkeleton:X}),[cs(s),Z,X]),se=jt(h,m?.img),M=(j={})=>{const me=jt(se,j?.className);return{src:d,ref:te,"data-loaded":Ae(ae),className:V.img({class:me}),loading:g,srcSet:D,sizes:F,crossOrigin:z,...$,style:{...$?.height&&{height:oe},...j.style,...$.style}}},W=S.useCallback(()=>{const j=J?{backgroundImage:`url(${x})`}:{};return{className:V.wrapper({class:m?.wrapper}),style:{...j,maxWidth:K}}},[V,J,x,m?.wrapper,K]),re=S.useCallback(()=>({src:d,"aria-hidden":Ae(!0),className:V.blurredImg({class:m?.blurredImg})}),[V,d,m?.blurredImg]);return{Component:q,domRef:te,slots:V,classNames:m,isBlurred:b,disableSkeleton:P,fallbackSrc:x,removeWrapper:T,isZoomed:G,isLoading:B,getImgProps:M,getWrapperProps:W,getBlurredImgProps:re}}var S2=Vr((e,t)=>{const{Component:n,domRef:r,slots:i,classNames:s,isBlurred:a,isZoomed:c,fallbackSrc:d,removeWrapper:h,disableSkeleton:m,getImgProps:g,getWrapperProps:b,getBlurredImgProps:x}=Vz({...e,ref:t}),k=A.jsx(n,{ref:r,...g()});if(h)return k;const P=A.jsx("div",{className:i.zoomedWrapper({class:s?.zoomedWrapper}),children:k});return a?A.jsxs("div",{...b(),children:[c?P:k,S.cloneElement(k,x())]}):c||!m||d?A.jsxs("div",{...b(),children:[" ",c?P:k]}):k});S2.displayName="HeroUI.Image";var C0=S2,[Uz,k2]=gv({name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),C2=Vr((e,t)=>{const{as:n,children:r,className:i,...s}=e,{slots:a,classNames:c,bodyId:d,setBodyMounted:h}=k2(),m=Pi(t),g=n||"div";return S.useEffect(()=>(h(!0),()=>h(!1)),[h]),A.jsx(g,{ref:m,className:a.body({class:jt(c?.body,i)}),id:d,...s,children:r})});C2.displayName="HeroUI.ModalBody";var Wz=C2,Kz={enter:{scale:"var(--scale-enter)",y:"var(--slide-enter)",opacity:1,willChange:"auto",transition:{scale:{duration:.4,ease:Vp.ease},opacity:{duration:.4,ease:Vp.ease},y:{type:"spring",bounce:0,duration:.6}}},exit:{scale:"var(--scale-exit)",y:"var(--slide-exit)",opacity:0,willChange:"transform",transition:{duration:.3,ease:Vp.ease}}},rs=typeof document<"u"&&window.visualViewport,Hz=He.createContext(!1);function Gz(){return!1}function qz(){return!0}function Yz(e){return()=>{}}function Xz(){return typeof He.useSyncExternalStore=="function"?He.useSyncExternalStore(Yz,Gz,qz):S.useContext(Hz)}function Qz(){let e=Xz(),[t,n]=S.useState(()=>e?{width:0,height:0}:Kk());return S.useEffect(()=>{let r=()=>{n(i=>{let s=Kk();return s.width===i.width&&s.height===i.height?i:s})};return rs?rs.addEventListener("resize",r):window.addEventListener("resize",r),()=>{rs?rs.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),t}function Kk(){return{width:rs&&rs?.width||window.innerWidth,height:rs&&rs?.height||window.innerHeight}}var Hk=()=>Ur(()=>import("./index-CQEJd7fb.js"),[]).then(e=>e.default),E2=e=>{const{as:t,children:n,role:r="dialog",...i}=e,{Component:s,domRef:a,slots:c,classNames:d,motionProps:h,backdrop:m,closeButton:g,hideCloseButton:b,disableAnimation:x,getDialogProps:k,getBackdropProps:P,getCloseButtonProps:T,onClose:_}=k2(),R=t||s||"div",D=Qz(),{dialogProps:F}=Bz({role:r},a),z=S.isValidElement(g)?S.cloneElement(g,T()):A.jsx("button",{...T(),children:A.jsx(m6,{})}),$=S.useCallback(q=>{q.key==="Tab"&&q.nativeEvent.isComposing&&(q.stopPropagation(),q.preventDefault())},[]),U=k(en(F,i)),Z=A.jsxs(R,{...U,onKeyDown:Ja(U.onKeyDown,$),children:[A.jsx(fk,{onDismiss:_}),!b&&z,typeof n=="function"?n(_):n,A.jsx(fk,{onDismiss:_})]}),ae=S.useMemo(()=>m==="transparent"?null:x?A.jsx("div",{...P()}):A.jsx(Df,{features:Hk,children:A.jsx(Nf.div,{animate:"enter",exit:"exit",initial:"exit",variants:tv.fade,...P()})}),[m,x,P]),B={"--visual-viewport-height":D.height+"px"},G=x?A.jsx("div",{className:c.wrapper({class:d?.wrapper}),"data-slot":"wrapper",style:B,children:Z}):A.jsx(Df,{features:Hk,children:A.jsx(Nf.div,{animate:"enter",className:c.wrapper({class:d?.wrapper}),"data-slot":"wrapper",exit:"exit",initial:"exit",variants:Kz,...h,style:B,children:Z})});return A.jsxs("div",{tabIndex:-1,children:[ae,G]})};E2.displayName="HeroUI.ModalContent";var Jz=E2;function Zz(e={shouldBlockScroll:!0},t,n){let{overlayProps:r,underlayProps:i}=v2({...e,isOpen:t.isOpen,onClose:t.close},n);return TF({isDisabled:!t.isOpen||!e.shouldBlockScroll}),A_(),S.useEffect(()=>{if(t.isOpen&&n.current)return OF([n.current])},[t.isOpen,n]),{modalProps:Tn(r),underlayProps:i}}function e8(e){var t,n,r;const i=di(),[s,a]=ta(e,Ck.variantKeys),{ref:c,as:d,className:h,classNames:m,isOpen:g,defaultOpen:b,onOpenChange:x,motionProps:k,closeButton:P,isDismissable:T=!0,hideCloseButton:_=!1,shouldBlockScroll:R=!0,portalContainer:D,isKeyboardDismissDisabled:F=!1,onClose:z,...$}=s,U=d||"section",Z=Pi(c),ae=S.useRef(null),[B,G]=S.useState(!1),[q,te]=S.useState(!1),K=(n=(t=e.disableAnimation)!=null?t:i?.disableAnimation)!=null?n:!1,oe=S.useId(),J=S.useId(),X=S.useId(),V=g2({isOpen:g,defaultOpen:b,onOpenChange:_e=>{x?.(_e),_e||z?.()}}),{modalProps:se,underlayProps:M}=Zz({isDismissable:T,shouldBlockScroll:R,isKeyboardDismissDisabled:F},V,Z),{buttonProps:W}=n2({onPress:V.close},ae),{isFocusVisible:re,focusProps:j}=$u(),me=jt(m?.base,h),Ee=S.useMemo(()=>Ck({...a,disableAnimation:K}),[cs(a),K]),ye=(_e={},Ge=null)=>{var ft;return{ref:$E(Ge,Z),...en(se,$,_e),className:Ee.base({class:jt(me,_e.className)}),id:oe,"data-open":Ae(V.isOpen),"data-dismissable":Ae(T),"aria-modal":Ae(!0),"data-placement":(ft=e?.placement)!=null?ft:"right","aria-labelledby":B?J:void 0,"aria-describedby":q?X:void 0}},De=S.useCallback((_e={})=>({className:Ee.backdrop({class:m?.backdrop}),...M,..._e}),[Ee,m,M]),Ve=()=>({role:"button",tabIndex:0,"aria-label":"Close","data-focus-visible":Ae(re),className:Ee.closeButton({class:m?.closeButton}),...en(W,j)});return{Component:U,slots:Ee,domRef:Z,headerId:J,bodyId:X,motionProps:k,classNames:m,isDismissable:T,closeButton:P,hideCloseButton:_,portalContainer:D,shouldBlockScroll:R,backdrop:(r=e.backdrop)!=null?r:"opaque",isOpen:V.isOpen,onClose:V.close,disableAnimation:K,setBodyMounted:te,setHeaderMounted:G,getDialogProps:ye,getBackdropProps:De,getCloseButtonProps:Ve}}var P2=Vr((e,t)=>{const{children:n,...r}=e,i=e8({...r,ref:t}),s=A.jsx(zF,{portalContainer:i.portalContainer,children:n});return A.jsx(Uz,{value:i,children:i.disableAnimation&&i.isOpen?s:A.jsx(rl,{children:i.isOpen?s:null})})});P2.displayName="HeroUI.Modal";var t8=P2;function n8(e={}){const{id:t,defaultOpen:n,isOpen:r,onClose:i,onOpen:s,onChange:a=()=>{}}=e,c=Ob(s),d=Ob(i),[h,m]=Nu(r,n||!1,a),g=S.useId(),b=t||g,x=r!==void 0,k=S.useCallback(()=>{x||m(!1),d?.()},[x,d]),P=S.useCallback(()=>{x||m(!0),c?.()},[x,c]),T=S.useCallback(()=>{(h?k:P)()},[h,P,k]);return{isOpen:!!h,onOpen:P,onClose:k,onOpenChange:T,isControlled:x,getButtonProps:(_={})=>({..._,"aria-expanded":h,"aria-controls":b,onClick:Af(_.onClick,T)}),getDisclosureProps:(_={})=>({..._,hidden:!h,id:b})}}function r8(e){var t,n;const r=di(),[i,s]=ta(e,Sk.variantKeys),{as:a,children:c,isLoaded:d=!1,className:h,classNames:m,...g}=i,b=a||"div",x=(n=(t=e.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,k=S.useMemo(()=>Sk({...s,disableAnimation:x}),[cs(s),x,c]),P=jt(m?.base,h);return{Component:b,children:c,slots:k,classNames:m,getSkeletonProps:(R={})=>({"data-loaded":Ae(d),className:k.base({class:jt(P,R?.className)}),...g}),getContentProps:(R={})=>({className:k.content({class:jt(m?.content,R?.className)})})}}var T2=Vr((e,t)=>{const{Component:n,children:r,getSkeletonProps:i,getContentProps:s}=r8({...e});return A.jsx(n,{ref:t,...i(),children:A.jsx("div",{...s(),children:r})})});T2.displayName="HeroUI.Skeleton";var _2=T2;function i8(e={}){const{domRef:t,isEnabled:n=!0,overflowCheck:r="vertical",visibility:i="auto",offset:s=0,onVisibilityChange:a,updateDeps:c=[]}=e,d=S.useRef(i);S.useEffect(()=>{const h=t?.current;if(!h||!n)return;const m=(x,k,P,T,_)=>{if(i==="auto"){const R=`${T}${$L(_)}Scroll`;k&&P?(h.dataset[R]="true",h.removeAttribute(`data-${T}-scroll`),h.removeAttribute(`data-${_}-scroll`)):(h.dataset[`${T}Scroll`]=k.toString(),h.dataset[`${_}Scroll`]=P.toString(),h.removeAttribute(`data-${T}-${_}-scroll`))}else{const R=k&&P?"both":k?T:P?_:"none";R!==d.current&&(a?.(R),d.current=R)}},g=()=>{var x,k;const P=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],T=h.querySelector('ul[data-slot="list"]'),_=+((x=T?.getAttribute("data-virtual-scroll-height"))!=null?x:h.scrollHeight),R=+((k=T?.getAttribute("data-virtual-scroll-top"))!=null?k:h.scrollTop);for(const{type:D,prefix:F,suffix:z}of P)if(r===D||r==="both"){const $=D==="vertical"?R>s:h.scrollLeft>s,U=D==="vertical"?R+h.clientHeight+s<_:h.scrollLeft+h.clientWidth+s{["top","bottom","top-bottom","left","right","left-right"].forEach(x=>{h.removeAttribute(`data-${x}-scroll`)})};return g(),h.addEventListener("scroll",g,!0),i!=="auto"&&(b(),i==="both"?(h.dataset.topBottomScroll=String(r==="vertical"),h.dataset.leftRightScroll=String(r==="horizontal")):(h.dataset.topBottomScroll="false",h.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(x=>{h.dataset[`${x}Scroll`]=String(i===x)}))),()=>{h.removeEventListener("scroll",g,!0),b()}},[...c,n,i,r,a,t])}function o8(e){var t;const[n,r]=ta(e,wk.variantKeys),{ref:i,as:s,children:a,className:c,style:d,size:h=40,offset:m=0,visibility:g="auto",isEnabled:b=!0,onVisibilityChange:x,...k}=n,P=s||"div",T=Pi(i);i8({domRef:T,offset:m,visibility:g,isEnabled:b,onVisibilityChange:x,updateDeps:[a],overflowCheck:(t=e.orientation)!=null?t:"vertical"});const _=S.useMemo(()=>wk({...r,className:c}),[cs(r),c]);return{Component:P,styles:_,domRef:T,children:a,getBaseProps:(D={})=>{var F;return{ref:T,className:_,"data-orientation":(F=e.orientation)!=null?F:"vertical",style:{"--scroll-shadow-size":`${h}px`,...d,...D.style},...k,...D}}}}var I2=Vr((e,t)=>{const{Component:n,children:r,getBaseProps:i}=o8({...e,ref:t});return A.jsx(n,{...i(),children:r})});I2.displayName="HeroUI.ScrollShadow";var R2=I2,go=(e=>(e.LIGHT="light",e.DARK="dark",e))(go||{});const $2=S.createContext(null),Nq={Like:"like",Dislike:"dislike"},s8={Start:"START"},_f={User:"user",Assistant:"assistant"},hf={Pending:"pending",InProgress:"in_progress",Completed:"completed"};class a8{baseUrl;auth;chunkQueue=new Map;constructor(t={}){if(this.baseUrl=t.baseUrl??"",this.auth=t.auth,this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.slice(0,-1)),!!this.baseUrl)try{new URL(this.baseUrl)}catch{throw new Error(`Invalid base URL: ${this.baseUrl}. Please provide a valid URL.`)}}getBaseUrl(){return this.baseUrl}_buildApiUrl(t){return`${this.baseUrl}${t}`}async _makeRequest(t,n={}){const r={"Content-Type":"application/json"};n.body instanceof FormData&&delete r["Content-Type"];const i={...r,...this.normalizeHeaders(n.headers)};this.auth?.getToken&&(i.Authorization=`Bearer ${this.auth.getToken()}`);const s=await fetch(t,{...n,headers:i,...this.auth?.credentials?{credentials:this.auth?.credentials}:{}});if(s.status===401&&this.auth?.onUnauthorized?.(),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}async makeRequest(t,...n){const r=n[0],{method:i="GET",body:s,pathParams:a,queryParams:c,headers:d={},...h}=r||{},m={method:i,headers:d,...h};s&&i!=="GET"&&(s instanceof FormData?(m.body=s,m.headers&&"Content-Type"in m.headers&&delete m.headers["Content-Type"]):m.body=typeof s=="string"?s:JSON.stringify(s));let g=t.toString();if(a&&typeof a=="object"&&(g=g.replace(/:([^/]+)/g,(x,k)=>{if(k in a){const P=a[k];return encodeURIComponent(String(P))}else throw new Error(`Path parameter ${k} is required`)})),c&&Object.keys(c).length>0){const x=new URLSearchParams;for(const[k,P]of Object.entries(c))P!=null&&x.append(k,String(P));g+=`?${x.toString()}`}return g=this._buildApiUrl(g),(await this._makeRequest(g,m)).json()}makeStreamRequest(t,n,r,i,s){let a=!1;const c=async h=>{const m=h.body?.pipeThrough(new TextDecoderStream).getReader();if(!m)throw new Error("Response body is null");let g="";for(;!a&&!i?.aborted;)try{const{value:b,done:x}=await m.read();if(x){r.onClose?.();break}g+=b;const k=g.split(` -`);g=k.pop()??"";for(const P of k)if(P.startsWith("data: "))try{const T=P.replace("data: ","").trim(),_=JSON.parse(T);if(!this.isChatResponse(_)){console.warn("Received response that isn't ChatResponse, skipping.",_);continue}if(_.type==="chunked_content"){this.handleChunkedContent(_,r);continue}await r.onMessage(_),await new Promise(R=>setTimeout(R,0))}catch(T){console.error("Error parsing JSON:",T),await r.onError(new Error("Error processing server response"))}}catch(b){if(i?.aborted)return;console.error("Stream error:",b),await r.onError(new Error("Error reading stream"));break}},d=async()=>{try{const m={...{"Content-Type":"application/json",Accept:"text/event-stream"},...s};this.auth?.getToken&&(m.Authorization=`Bearer ${this.auth.getToken()}`);const g=await fetch(this._buildApiUrl(t.toString()),{method:"POST",headers:m,body:JSON.stringify(n),signal:i,...this.auth?.credentials?{credentials:this.auth?.credentials}:{}});if(g.status===401&&this.auth?.onUnauthorized?.(),!g.ok)throw new Error(`HTTP error! status: ${g.status}`);await c(g)}catch(h){if(i?.aborted)return;console.error("Request error:",h);const m=h instanceof Error?h.message:"Error connecting to server";await r.onError(new Error(m))}};try{d()}catch(h){const m=h instanceof Error?h.message:"Failed to start stream";r.onError(new Error(m))}return()=>{a=!0}}isChatResponse(t){return t!==null&&typeof t=="object"&&"type"in t&&"content"in t}normalizeHeaders(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):t:{}}async handleChunkedContent(t,n){const i=t.content,{content_type:s,id:a,chunk_index:c,total_chunks:d,mime_type:h,data:m}=i;this.chunkQueue.has(a)||this.chunkQueue.set(a,{chunks:new Map,totalChunks:d,mimeType:h});const g=this.chunkQueue.get(a);if(g.chunks.set(c,m),g.chunks.size!==d)return;const x=Array.from({length:d},(k,P)=>g.chunks.get(P)).join("");try{atob(x)}catch(k){this.chunkQueue.delete(a),console.error("❌ Invalid base64 data: ",k),await n.onError(new Error("Error reading stream"))}if(s==="image"){const k={type:"image",content:{id:a,url:`${g.mimeType},${x}`}};await n.onMessage(k)}this.chunkQueue.delete(a)}}const A2=S.createContext(null);function l8({children:e,...t}){const n=S.useMemo(()=>new a8(t),[t]),r=S.useMemo(()=>({client:n}),[n]);return A.jsx(A2.Provider,{value:r,children:e})}function Tv(){const e=S.useContext(A2);if(!e)throw new Error("useRagbitsContext must be used within a RagbitsProvider");return e}function u8(e,t){const{client:n}=Tv(),[r,i]=S.useState(null),[s,a]=S.useState(null),[c,d]=S.useState(!1),h=S.useRef(null),m=S.useCallback(()=>{if(!h.current)return null;h.current.abort(),h.current=null,d(!1)},[]),g=S.useCallback(async(...x)=>{const k=x[0];h.current&&c&&h.current.abort();const P=new AbortController;h.current=P,d(!0),a(null);try{const _={...{...t,...k||{},headers:{...t?.headers,...k?.headers||{}}},signal:P.signal},R=await n.makeRequest(e,_);return P.signal.aborted||(i(R),h.current=null),R}catch(T){if(!P.signal.aborted){const _=T instanceof Error?T:new Error("API call failed");throw a(_),h.current=null,_}throw T}finally{P.signal.aborted||d(!1)}},[n,e,t,c]),b=S.useCallback(()=>{m(),i(null),a(null),d(!1)},[m]);return{data:r,error:s,isLoading:c,call:g,reset:b,abort:m}}function c8(){return window.matchMedia("(prefers-color-scheme: dark)").matches?go.DARK:go.LIGHT}function Gk(){const e=window.localStorage.getItem("theme");return e===go.DARK||e===go.LIGHT?e:c8()}function f8(e){return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}const d8=({children:e})=>{const t=S.useSyncExternalStore(f8,Gk,Gk),n=S.useRef(!1),{client:r}=Tv();S.useEffect(()=>{if(n.current)return;(async()=>{try{const c=r.getBaseUrl(),d=await fetch(`${c}/api/theme`);if(d.ok){const h=await d.text(),m=document.getElementById("heroui-custom-theme");m&&m.remove();const g=document.createElement("style");g.id="heroui-custom-theme",g.textContent=h,document.head.appendChild(g),console.log("Custom HeroUI theme loaded successfully"),n.current=!0}}catch(c){console.warn("No custom theme available:",c),n.current=!0}})()},[]),S.useEffect(()=>{document.documentElement.classList.toggle("dark",t===go.DARK)},[t]);const i=S.useCallback(a=>{window.localStorage.setItem("theme",a),window.dispatchEvent(new Event("storage"))},[]),s=S.useMemo(()=>({theme:t,setTheme:i}),[t,i]);return A.jsx($2.Provider,{value:s,children:e})},L2=Object.freeze({left:0,top:0,width:16,height:16}),iv=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),uw=Object.freeze({...L2,...iv}),jb=Object.freeze({...uw,body:"",hidden:!1});function p8(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function qk(e,t){const n=p8(e,t);for(const r in jb)r in iv?r in e&&!(r in n)&&(n[r]=iv[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function h8(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,d=c&&s(c);d&&(i[a]=[c].concat(d))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function m8(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=qk(r[c]||i[c],s)}return a(t),n.forEach(a),qk(e,s)}function M2(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=h8(e);for(const i in r){const s=r[i];s&&(t(i,m8(e,i,s)),n.push(i))}return n}const g8={provider:"",aliases:{},not_found:{},...L2};function E0(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function D2(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!E0(e,g8))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i||typeof s.body!="string"||!E0(s,jb))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!E0(s,jb))return null}return t}const N2=/^[a-z0-9]+(-[a-z0-9]+)*$/,_v=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),d=i.pop(),h={provider:i.length>0?i[0]:r,prefix:d,name:c};return t&&!Fg(h)?null:h}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Fg(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Fg(c,n)?null:c}return null},Fg=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Yk=Object.create(null);function v8(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ff(e,t){const n=Yk[e]||(Yk[e]=Object.create(null));return n[t]||(n[t]=v8(e,t))}function F2(e,t){return D2(t)?M2(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function y8(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let uh=!1;function O2(e){return typeof e=="boolean"&&(uh=e),uh}function Xk(e){const t=typeof e=="string"?_v(e,!0,uh):e;if(t){const n=Ff(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function b8(e,t){const n=_v(e,!0,uh);if(!n)return!1;const r=Ff(n.provider,n.prefix);return t?y8(r,n.name,t):(r.missing.add(n.name),!0)}function x8(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),uh&&!t&&!e.prefix){let i=!1;return D2(e)&&(e.prefix="",M2(e,(s,a)=>{b8(s,a)&&(i=!0)})),i}const n=e.prefix;if(!Fg({prefix:n,name:"a"}))return!1;const r=Ff(t,n);return!!F2(r,e)}const z2=Object.freeze({width:null,height:null}),j2=Object.freeze({...z2,...iv}),w8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,S8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Qk(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(w8);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=S8.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}function k8(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),s=e.indexOf("",s);if(a===-1)break;n+=e.slice(i+1,s).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function C8(e,t){return e?""+e+""+t:t}function E8(e,t,n){const r=k8(e);return C8(r.defs,t+r.content+n)}const P8=e=>e==="unset"||e==="undefined"||e==="none";function T8(e,t){const n={...uw,...e},r={...j2,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(P=>{const T=[],_=P.hFlip,R=P.vFlip;let D=P.rotate;_?R?D+=2:(T.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),T.push("scale(-1 1)"),i.top=i.left=0):R&&(T.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),T.push("scale(1 -1)"),i.top=i.left=0);let F;switch(D<0&&(D-=Math.floor(D/4)*4),D=D%4,D){case 1:F=i.height/2+i.top,T.unshift("rotate(90 "+F.toString()+" "+F.toString()+")");break;case 2:T.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:F=i.width/2+i.left,T.unshift("rotate(-90 "+F.toString()+" "+F.toString()+")");break}D%2===1&&(i.left!==i.top&&(F=i.left,i.left=i.top,i.top=F),i.width!==i.height&&(F=i.width,i.width=i.height,i.height=F)),T.length&&(s=E8(s,'',""))});const a=r.width,c=r.height,d=i.width,h=i.height;let m,g;a===null?(g=c===null?"1em":c==="auto"?h:c,m=Qk(g,d/h)):(m=a==="auto"?d:a,g=c===null?Qk(m,h/d):c==="auto"?h:c);const b={},x=(P,T)=>{P8(T)||(b[P]=T.toString())};x("width",m),x("height",g);const k=[i.left,i.top,d,h];return b.viewBox=k.join(" "),{attributes:b,viewBox:k,body:s}}const _8=/\sid="(\S+)"/g,I8="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let R8=0;function $8(e,t=I8){const n=[];let r;for(;r=_8.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(R8++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const Bb=Object.create(null);function A8(e,t){Bb[e]=t}function Vb(e){return Bb[e]||Bb[""]}function cw(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const fw=Object.create(null),Sp=["https://api.simplesvg.com","https://api.unisvg.com"],Og=[];for(;Sp.length>0;)Sp.length===1||Math.random()>.5?Og.push(Sp.shift()):Og.push(Sp.pop());fw[""]=cw({resources:["https://api.iconify.design"].concat(Og)});function L8(e,t){const n=cw(t);return n===null?!1:(fw[e]=n,!0)}function dw(e){return fw[e]}const M8=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Jk=M8();function D8(e,t){const n=dw(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function N8(e){return e===404}const F8=(e,t,n)=>{const r=[],i=D8(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((d,h)=>{c+=d.length+1,c>=i&&h>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=d.length),a.icons.push(d)}),r.push(a),r};function O8(e){if(typeof e=="string"){const t=dw(e);if(t)return t.path}return"/"}const z8=(e,t,n)=>{if(!Jk){n("abort",424);return}let r=O8(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),d=new URLSearchParams({icons:c});r+=s+".json?"+d.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;Jk(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(N8(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},j8={prepare:F8,send:z8};function B8(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,d=n[s]||(n[s]=Object.create(null)),h=d[a]||(d[a]=Ff(s,a));let m;c in h.icons?m=t.loaded:a===""||h.missing.has(c)?m=t.missing:m=t.pending;const g={provider:s,prefix:a,name:c};m.push(g)}),t}function B2(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function V8(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const h=d.name;if(e.icons[h])a.loaded.push({provider:r,prefix:i,name:h});else if(e.missing.has(h))a.missing.push({provider:r,prefix:i,name:h});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||B2([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let U8=0;function W8(e,t,n){const r=U8++,i=B2.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function K8(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_v(i,t,n):i;s&&r.push(s)}),r}var H8={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function G8(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let $=e.resources.slice(0);for(a=[];$.length>1;){const U=Math.floor(Math.random()*$.length);a.push($[U]),$=$.slice(0,U).concat($.slice(U+1))}a=a.concat($)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let d="pending",h=0,m,g=null,b=[],x=[];typeof r=="function"&&x.push(r);function k(){g&&(clearTimeout(g),g=null)}function P(){d==="pending"&&(d="aborted"),k(),b.forEach($=>{$.status==="pending"&&($.status="aborted")}),b=[]}function T($,U){U&&(x=[]),typeof $=="function"&&x.push($)}function _(){return{startTime:c,payload:t,status:d,queriesSent:h,queriesPending:b.length,subscribe:T,abort:P}}function R(){d="failed",x.forEach($=>{$(void 0,m)})}function D(){b.forEach($=>{$.status==="pending"&&($.status="aborted")}),b=[]}function F($,U,Z){const ae=U!=="success";switch(b=b.filter(B=>B!==$),d){case"pending":break;case"failed":if(ae||!e.dataAfterTimeout)return;break;default:return}if(U==="abort"){m=Z,R();return}if(ae){m=Z,b.length||(a.length?z():R());return}if(k(),D(),!e.random){const B=e.resources.indexOf($.resource);B!==-1&&B!==e.index&&(e.index=B)}d="completed",x.forEach(B=>{B(Z)})}function z(){if(d!=="pending")return;k();const $=a.shift();if($===void 0){if(b.length){g=setTimeout(()=>{k(),d==="pending"&&(D(),R())},e.timeout);return}R();return}const U={status:"pending",resource:$,callback:(Z,ae)=>{F(U,Z,ae)}};b.push(U),h++,g=setTimeout(z,e.rotate),n($,t,U.callback)}return setTimeout(z),_}function V2(e){const t={...H8,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,d,h){const m=G8(t,c,d,(g,b)=>{r(),h&&h(g,b)});return n.push(m),m}function s(c){return n.find(d=>c(d))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Zk(){}const P0=Object.create(null);function q8(e){if(!P0[e]){const t=dw(e);if(!t)return;const n=V2(t),r={config:t,redundancy:n};P0[e]=r}return P0[e]}function Y8(e,t,n){let r,i;if(typeof e=="string"){const s=Vb(e);if(!s)return n(void 0,424),Zk;i=s.send;const a=q8(e);a&&(r=a.redundancy)}else{const s=cw(e);if(s){r=V2(s);const a=e.resources?e.resources[0]:"",c=Vb(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),Zk):r.query(t,i,n)().abort}function eC(){}function X8(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,V8(e)}))}function Q8(e){const t=[],n=[];return e.forEach(r=>{(r.match(N2)?t:n).push(r)}),{valid:t,invalid:n}}function kp(e,t,n){function r(){const i=e.pendingIcons;t.forEach(s=>{i&&i.delete(s),e.icons[s]||e.missing.add(s)})}if(n&&typeof n=="object")try{if(!F2(e,n).length){r();return}}catch(i){console.error(i)}r(),X8(e)}function tC(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function J8(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const s=e.loadIcon;if(e.loadIcons&&(i.length>1||!s)){tC(e.loadIcons(i,r,n),m=>{kp(e,i,m)});return}if(s){i.forEach(m=>{const g=s(m,r,n);tC(g,b=>{const x=b?{prefix:r,icons:{[m]:b}}:null;kp(e,[m],x)})});return}const{valid:a,invalid:c}=Q8(i);if(c.length&&kp(e,c,null),!a.length)return;const d=r.match(N2)?Vb(n):null;if(!d){kp(e,a,null);return}d.prepare(n,r,a).forEach(m=>{Y8(n,m,g=>{kp(e,m.icons,g)})})}))}const U2=(e,t)=>{const n=K8(e,!0,O2()),r=B8(n);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,eC)}),()=>{d=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(d=>{const{provider:h,prefix:m}=d;if(m===c&&h===a)return;a=h,c=m,s.push(Ff(h,m));const g=i[h]||(i[h]=Object.create(null));g[m]||(g[m]=[])}),r.pending.forEach(d=>{const{provider:h,prefix:m,name:g}=d,b=Ff(h,m),x=b.pendingIcons||(b.pendingIcons=new Set);x.has(g)||(x.add(g),i[h][m].push(g))}),s.forEach(d=>{const h=i[d.provider][d.prefix];h.length&&J8(d,h)}),t?W8(t,r,s):eC};function Z8(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in z2?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const ej=/[\s,]+/;function tj(e,t){t.split(ej).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function nj(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function rj(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function ij(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function oj(e){return"data:image/svg+xml,"+ij(e)}function sj(e){return'url("'+oj(e)+'")'}let Up;function aj(){try{Up=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Up=null}}function lj(e){return Up===void 0&&aj(),Up?Up.createHTML(e):e}const W2={...j2,inline:!1},uj={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},cj={display:"inline-block"},Ub={backgroundColor:"currentColor"},K2={backgroundColor:"transparent"},nC={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},rC={WebkitMask:Ub,mask:Ub,background:K2};for(const e in rC){const t=rC[e];for(const n in nC)t[e+n]=nC[n]}const fj={...W2,inline:!0};function iC(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const dj=(e,t,n)=>{const r=t.inline?fj:W2,i=Z8(r,t),s=t.mode||"svg",a={},c=t.style||{},d={...s==="svg"?uj:{}};if(n){const T=_v(n,!1,!0);if(T){const _=["iconify"],R=["provider","prefix"];for(const D of R)T[D]&&_.push("iconify--"+T[D]);d.className=_.join(" ")}}for(let T in t){const _=t[T];if(_!==void 0)switch(T){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":d.ref=_;break;case"className":d[T]=(d[T]?d[T]+" ":"")+_;break;case"inline":case"hFlip":case"vFlip":i[T]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&tj(i,_);break;case"color":a.color=_;break;case"rotate":typeof _=="string"?i[T]=nj(_):typeof _=="number"&&(i[T]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete d["aria-hidden"];break;default:r[T]===void 0&&(d[T]=_)}}const h=T8(e,i),m=h.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),s==="svg"){d.style={...a,...c},Object.assign(d,m);let T=0,_=t.id;return typeof _=="string"&&(_=_.replace(/-/g,"_")),d.dangerouslySetInnerHTML={__html:lj($8(h.body,_?()=>_+"ID"+T++:"iconifyReact"))},S.createElement("svg",d)}const{body:g,width:b,height:x}=e,k=s==="mask"||(s==="bg"?!1:g.indexOf("currentColor")!==-1),P=rj(g,{...m,width:b+"",height:x+""});return d.style={...a,"--svg":sj(P),width:iC(m.width),height:iC(m.height),...cj,...k?Ub:K2,...c},S.createElement("span",d)};O2(!0);A8("",j8);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!x8(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;L8(n,i)||console.error(r)}catch{console.error(r)}}}}function H2(e){const[t,n]=S.useState(!!e.ssr),[r,i]=S.useState({});function s(x){if(x){const k=e.icon;if(typeof k=="object")return{name:"",data:k};const P=Xk(k);if(P)return{name:k,data:P}}return{name:""}}const[a,c]=S.useState(s(!!e.ssr));function d(){const x=r.callback;x&&(x(),i({}))}function h(x){if(JSON.stringify(a)!==JSON.stringify(x))return d(),c(x),!0}function m(){var x;const k=e.icon;if(typeof k=="object"){h({name:"",data:k});return}const P=Xk(k);if(h({name:k,data:P}))if(P===void 0){const T=U2([k],m);i({callback:T})}else P&&((x=e.onLoad)===null||x===void 0||x.call(e,k))}S.useEffect(()=>(n(!0),d),[]),S.useEffect(()=>{t&&m()},[e.icon,t]);const{name:g,data:b}=a;return b?dj({...uw,...b},e,g):e.children?e.children:e.fallback?e.fallback:S.createElement("span",{})}const fi=S.forwardRef((e,t)=>H2({...e,_ref:t}));S.forwardRef((e,t)=>H2({inline:!0,...e,_ref:t}));var Mp={exports:{}};var pj=Mp.exports,oC;function hj(){return oC||(oC=1,(function(e,t){(function(){var n,r="4.18.1",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",d="Invalid `imports` option passed into `_.template`",h="__lodash_hash_undefined__",m=500,g="__lodash_placeholder__",b=1,x=2,k=4,P=1,T=2,_=1,R=2,D=4,F=8,z=16,$=32,U=64,Z=128,ae=256,B=512,G=30,q="...",te=800,K=16,oe=1,J=2,X=3,V=1/0,se=9007199254740991,M=17976931348623157e292,W=NaN,re=4294967295,j=re-1,me=re>>>1,Ee=[["ary",Z],["bind",_],["bindKey",R],["curry",F],["curryRight",z],["flip",B],["partial",$],["partialRight",U],["rearg",ae]],ye="[object Arguments]",De="[object Array]",Ve="[object AsyncFunction]",_e="[object Boolean]",Ge="[object Date]",ft="[object DOMException]",Re="[object Error]",dt="[object Function]",Mt="[object GeneratorFunction]",It="[object Map]",Fe="[object Number]",yt="[object Null]",Et="[object Object]",Un="[object Promise]",Nn="[object Proxy]",Xt="[object RegExp]",bt="[object Set]",gn="[object String]",Wn="[object Symbol]",on="[object Undefined]",pe="[object WeakMap]",ke="[object WeakSet]",Ue="[object ArrayBuffer]",tt="[object DataView]",st="[object Float32Array]",Vt="[object Float64Array]",Kn="[object Int8Array]",Qt="[object Int16Array]",Rt="[object Int32Array]",Ir="[object Uint8Array]",Ft="[object Uint8ClampedArray]",sr="[object Uint16Array]",Jt="[object Uint32Array]",oa=/\b__p \+= '';/g,ds=/\b(__p \+=) '' \+/g,$i=/(__e\(.*?\)|\b__t\)) \+\n'';/g,hi=/&(?:amp|lt|gt|quot|#39);/g,sa=/[&<>"']/g,ju=RegExp(hi.source),ps=RegExp(sa.source),Kr=/<%-([\s\S]+?)%>/g,Bu=/<%([\s\S]+?)%>/g,aa=/<%=([\s\S]+?)%>/g,Zt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hs=/^\w*$/,sl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ai=/[\\^$.*+?()[\]{}|]/g,Yf=RegExp(Ai.source),Qi=/^\s+/,la=/\s/,ua=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,Xf=/,? & /,Qf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vu=/[()=,{}\[\]\/\s]/,Ze=/\\(\\)?/g,xo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Jf=/\w*$/,Wv=/^[-+]0x[0-9a-f]+$/i,Lh=/^0b[01]+$/i,Mh=/^\[object .+?Constructor\]$/,Dh=/^0o[0-7]+$/i,Nh=/^(?:0|[1-9]\d*)$/,Kv=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Uu=/($^)/,sn=/['\n\r\u2028\u2029\\]/g,Wu="\\ud800-\\udfff",Zf="\\u0300-\\u036f",Fh="\\ufe20-\\ufe2f",Ku="\\u20d0-\\u20ff",Oh=Zf+Fh+Ku,ed="\\u2700-\\u27bf",ll="a-z\\xdf-\\xf6\\xf8-\\xff",Li="\\xac\\xb1\\xd7\\xf7",Hv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",mi="\\u2000-\\u206f",Gv=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zh="A-Z\\xc0-\\xd6\\xd8-\\xde",jh="\\ufe0e\\ufe0f",ul=Li+Hv+mi+Gv,ca="['’]",cl="["+Wu+"]",fl="["+ul+"]",Hu="["+Oh+"]",Bh="\\d+",td="["+ed+"]",nd="["+ll+"]",Gu="[^"+Wu+ul+Bh+ed+ll+zh+"]",ms="\\ud83c[\\udffb-\\udfff]",qv="(?:"+Hu+"|"+ms+")",qu="[^"+Wu+"]",Pt="(?:\\ud83c[\\udde6-\\uddff]){2}",Yu="[\\ud800-\\udbff][\\udc00-\\udfff]",gs="["+zh+"]",Xu="\\u200d",rd="(?:"+nd+"|"+Gu+")",Vh="(?:"+gs+"|"+Gu+")",id="(?:"+ca+"(?:d|ll|m|re|s|t|ve))?",Qu="(?:"+ca+"(?:D|LL|M|RE|S|T|VE))?",dl=qv+"?",Ji="["+jh+"]?",wo="(?:"+Xu+"(?:"+[qu,Pt,Yu].join("|")+")"+Ji+dl+")*",So="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fa=Ji+dl+wo,ko="(?:"+[td,Pt,Yu].join("|")+")"+fa,Yv="(?:"+[qu+Hu+"?",Hu,Pt,Yu,cl].join("|")+")",Uh=RegExp(ca,"g"),hl=RegExp(Hu,"g"),od=RegExp(ms+"(?="+ms+")|"+Yv+fa,"g"),Wh=RegExp([gs+"?"+nd+"+"+id+"(?="+[fl,gs,"$"].join("|")+")",Vh+"+"+Qu+"(?="+[fl,gs+rd,"$"].join("|")+")",gs+"?"+rd+"+"+id,gs+"+"+Qu,pl,So,Bh,ko].join("|"),"g"),Ju=RegExp("["+Xu+Wu+Oh+jh+"]"),Kh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ml=-1,$t={};$t[st]=$t[Vt]=$t[Kn]=$t[Qt]=$t[Rt]=$t[Ir]=$t[Ft]=$t[sr]=$t[Jt]=!0,$t[ye]=$t[De]=$t[Ue]=$t[_e]=$t[tt]=$t[Ge]=$t[Re]=$t[dt]=$t[It]=$t[Fe]=$t[Et]=$t[Xt]=$t[bt]=$t[gn]=$t[pe]=!1;var Tt={};Tt[ye]=Tt[De]=Tt[Ue]=Tt[tt]=Tt[_e]=Tt[Ge]=Tt[st]=Tt[Vt]=Tt[Kn]=Tt[Qt]=Tt[Rt]=Tt[It]=Tt[Fe]=Tt[Et]=Tt[Xt]=Tt[bt]=Tt[gn]=Tt[Wn]=Tt[Ir]=Tt[Ft]=Tt[sr]=Tt[Jt]=!0,Tt[Re]=Tt[dt]=Tt[pe]=!1;var Zu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Qv={"&":"&","<":"<",">":">",'"':""","'":"'"},Jv={"&":"&","<":"<",">":">",""":'"',"'":"'"},sd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ec=parseFloat,ad=parseInt,ld=typeof sg=="object"&&sg&&sg.Object===Object&&sg,Co=typeof self=="object"&&self&&self.Object===Object&&self,vn=ld||Co||Function("return this")(),da=t&&!t.nodeType&&t,Eo=da&&!0&&e&&!e.nodeType&&e,gl=Eo&&Eo.exports===da,pa=gl&&ld.process,Rr=(function(){try{var ie=Eo&&Eo.require&&Eo.require("util").types;return ie||pa&&pa.binding&&pa.binding("util")}catch{}})(),mr=Rr&&Rr.isArrayBuffer,vs=Rr&&Rr.isDate,tc=Rr&&Rr.isMap,ha=Rr&&Rr.isRegExp,Hh=Rr&&Rr.isSet,nc=Rr&&Rr.isTypedArray;function ar(ie,he,de){switch(de.length){case 0:return ie.call(he);case 1:return ie.call(he,de[0]);case 2:return ie.call(he,de[0],de[1]);case 3:return ie.call(he,de[0],de[1],de[2])}return ie.apply(he,de)}function vl(ie,he,de,Me){for(var rt=-1,St=ie==null?0:ie.length;++rt-1}function yl(ie,he,de){for(var Me=-1,rt=ie==null?0:ie.length;++Me-1;);return de}function md(ie,he){for(var de=ie.length;de--&&_o(he,ie[de],0)>-1;);return de}function tm(ie,he){for(var de=ie.length,Me=0;de--;)ie[de]===he&&++Me;return Me}var nm=fd(Zu),rm=fd(Qv);function ma(ie){return"\\"+sd[ie]}function oy(ie,he){return ie==null?n:ie[he]}function ga(ie){return Ju.test(ie)}function sy(ie){return Kh.test(ie)}function im(ie){for(var he,de=[];!(he=ie.next()).done;)de.push(he.value);return de}function sc(ie){var he=-1,de=Array(ie.size);return ie.forEach(function(Me,rt){de[++he]=[rt,Me]}),de}function va(ie,he){return function(de){return ie(he(de))}}function Hr(ie,he){for(var de=-1,Me=ie.length,rt=0,St=[];++de-1}function mc(u,f){var y=this.__data__,C=Yn(y,u);return C<0?(++this.size,y.push([u,f])):y[C][1]=f,this}vr.prototype.clear=yr,vr.prototype.delete=hc,vr.prototype.get=gm,vr.prototype.has=vm,vr.prototype.set=mc;function Di(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f=f?u:f)),u}function Ar(u,f,y,C,I,O){var Y,ee=f&b,le=f&x,ge=f&k;if(y&&(Y=I?y(u,C,I,O):y(u)),Y!==n)return Y;if(!an(u))return u;var ve=ot(u);if(ve){if(Y=Jn(u),!ee)return cr(u,Y)}else{var we=In(u),$e=we==dt||we==Mt;if(Wa(u))return Ic(u,ee);if(we==Et||we==ye||$e&&!I){if(Y=le||$e?{}:Fm(u),!ee)return le?gy(u,xm(Y,u)):my(u,Qr(Y,u))}else{if(!Tt[we])return I?u:{};Y=vy(u,we,ee)}}O||(O=new xr);var We=O.get(u);if(We)return We;O.set(u,Y),Kw(u)?u.forEach(function(Qe){Y.add(Ar(Qe,f,y,Qe,u,O))}):Uw(u)&&u.forEach(function(Qe,mt){Y.set(mt,Ar(Qe,f,y,mt,u,O))});var nt=ge?le?jc:eu:le?ii:nr,ct=ve?n:nt(u);return Hn(ct||u,function(Qe,mt){ct&&(mt=Qe,Qe=u[mt]),zn(Y,mt,Ar(Qe,f,y,mt,u,O))}),Y}function yc(u){var f=nr(u);return function(y){return Ed(y,u,f)}}function Ed(u,f,y){var C=y.length;if(u==null)return!C;for(u=At(u);C--;){var I=y[C],O=f[I],Y=u[I];if(Y===n&&!(I in u)||!O(Y))return!1}return!0}function Es(u,f,y){if(typeof u!="function")throw new Fn(a);return fr(function(){u.apply(n,y)},f)}function Ps(u,f,y,C){var I=-1,O=rc,Y=!0,ee=u.length,le=[],ge=f.length;if(!ee)return le;y&&(f=Ut(f,lr(y))),C?(O=yl,Y=!1):f.length>=i&&(O=bl,Y=!1,f=new br(f));e:for(;++II?0:I+y),C=C===n||C>I?I:lt(C),C<0&&(C+=I),C=y>C?0:Gw(C);y0&&y(ee)?f>1?_n(ee,f-1,y,C,I):To(I,ee):C||(I[I.length]=ee)}return I}var Ra=Ql(),Ol=Ql(!0);function ur(u,f){return u&&Ra(u,f,nr)}function zl(u,f){return u&&Ol(u,f,nr)}function $a(u,f){return Po(f,function(y){return Vs(u[y])})}function io(u,f){f=ao(f,u);for(var y=0,C=f.length;u!=null&&yf}function _s(u,f){return u!=null&&ht.call(u,f)}function Pd(u,f){return u!=null&&f in At(u)}function Sm(u,f,y){return u>=Gn(f,y)&&u=120&&ve.length>=120)?new br(Y&&ve):n}ve=u[0];var we=-1,$e=ee[0];e:for(;++we-1;)ee!==u&&cc.call(ee,le,1),cc.call(u,le,1);return u}function Kl(u,f){for(var y=u?f.length:0,C=y-1;y--;){var I=f[y];if(y==C||I!==O){var O=I;co(I)?cc.call(u,I,1):Tc(u,I)}}return u}function $s(u,f){return u+Pl(Rl()*(f-u+1))}function Hl(u,f,y,C){for(var I=-1,O=yn(Ao((f-u)/(y||1)),0),Y=de(O);O--;)Y[C?O:++I]=u,u+=y;return Y}function Id(u,f){var y="";if(!u||f<1||f>se)return y;do f%2&&(y+=u),f=Pl(f/2),f&&(u+=u);while(f);return y}function Ke(u,f){return Hc(Rn(u,f,oi),u+"")}function Rd(u){return Oo(cf(u))}function $d(u,f){var y=cf(u);return ru(y,ro(f,0,y.length))}function As(u,f,y,C){if(!an(u))return u;f=ao(f,u);for(var I=-1,O=f.length,Y=O-1,ee=u;ee!=null&&++II?0:I+f),y=y>I?I:y,y<0&&(y+=I),I=f>y?0:y-f>>>0,f>>>=0;for(var O=de(I);++C>>1,Y=u[O];Y!==null&&!Si(Y)&&(y?Y<=f:Y=i){var ge=f?null:$m(u);if(ge)return ac(ge);Y=!1,I=bl,le=new br}else le=f?[]:ee;e:for(;++C=C?u:Sr(u,f,y)}var Fd=Ot||function(u){return vn.clearTimeout(u)};function Ic(u,f){if(f)return u.slice();var y=u.length,C=eo?eo(y):new u.constructor(y);return u.copy(C),C}function Rc(u){var f=new u.constructor(u.byteLength);return new kl(f).set(new kl(u)),f}function Em(u,f){var y=f?Rc(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function Pm(u){var f=new u.constructor(u.source,Jf.exec(u));return f.lastIndex=u.lastIndex,f}function py(u){return Ss?At(Ss.call(u)):{}}function Od(u,f){var y=f?Rc(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function Tm(u,f){if(u!==f){var y=u!==n,C=u===null,I=u===u,O=Si(u),Y=f!==n,ee=f===null,le=f===f,ge=Si(f);if(!ee&&!ge&&!O&&u>f||O&&Y&&le&&!ee&&!ge||C&&Y&&le||!y&&le||!I)return 1;if(!C&&!O&&!ge&&u=ee)return le;var ge=y[C];return le*(ge=="desc"?-1:1)}}return u.index-f.index}function zd(u,f,y,C){for(var I=-1,O=u.length,Y=y.length,ee=-1,le=f.length,ge=yn(O-Y,0),ve=de(le+ge),we=!C;++ee1?y[I-1]:n,Y=I>2?y[2]:n;for(O=u.length>3&&typeof O=="function"?(I--,O):n,Y&&Ie(y[0],y[1],Y)&&(O=I<3?n:O,I=1),f=At(f);++C-1?I[O?f[Y]:Y]:n}}function Mc(u){return bi(function(f){var y=f.length,C=y,I=On.prototype.thru;for(u&&f.reverse();C--;){var O=f[C];if(typeof O!="function")throw new Fn(a);if(I&&!Y&&Ds(O)=="wrapper")var Y=new On([],!0)}for(C=Y?C:y;++C1&&wt.reverse(),ve&&leee))return!1;var ge=O.get(u),ve=O.get(f);if(ge&&ve)return ge==f&&ve==u;var we=-1,$e=!0,We=y&T?new br:n;for(O.set(u,f),O.set(f,u);++we1?"& ":"")+f[C],f=f.join(y>2?", ":" "),u.replace(ua,`{ -/* [wrapped with `+f+`] */ -`)}function Zn(u){return ot(u)||cu(u)||!!(wa&&u&&u[wa])}function co(u,f){var y=typeof u;return f=f??se,!!f&&(y=="number"||y!="symbol"&&Nh.test(u))&&u>-1&&u%1==0&&u0){if(++f>=te)return arguments[0]}else f=0;return u.apply(n,arguments)}}function ru(u,f){var y=-1,C=u.length,I=C-1;for(f=f===n?C:f;++y1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,qm(u,y)});function Jm(u){var f=N(u);return f.__chain__=!0,f}function Zo(u,f){return f(u),u}function js(u,f){return f(u)}var Bs=bi(function(u){var f=u.length,y=f?u[0]:0,C=this.__wrapped__,I=function(O){return Nl(O,u)};return f>1||this.__actions__.length||!(C instanceof at)||!co(y)?this.thru(I):(C=C.slice(y,+y+(f?1:0)),C.__actions__.push({func:js,args:[I],thisArg:n}),new On(C,this.__chain__).thru(function(O){return f&&!O.length&&O.push(n),O}))});function ef(){return Jm(this)}function lp(){return new On(this.value(),this.__chain__)}function up(){this.__values__===n&&(this.__values__=Hw(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function Ty(){return this}function cp(u){for(var f,y=this;y instanceof Do;){var C=iu(y);C.__index__=0,C.__values__=n,f?I.__wrapped__=C:f=C;var I=C;y=y.__wrapped__}return I.__wrapped__=u,f}function _y(){var u=this.__wrapped__;if(u instanceof at){var f=u;return this.__actions__.length&&(f=new at(this)),f=f.reverse(),f.__actions__.push({func:js,args:[au],thisArg:n}),new On(f,this.__chain__)}return this.thru(au)}function Zm(){return Nd(this.__wrapped__,this.__actions__)}var eg=$c(function(u,f,y){ht.call(u,y)?++u[y]:gi(u,y,1)});function tf(u,f,y){var C=ot(u)?qh:bc;return y&&Ie(u,f,y)&&(f=n),C(u,qe(f,3))}function nf(u,f){var y=ot(u)?Po:Ts;return y(u,qe(f,3))}var tg=Lc(su),fp=Lc(Gc);function Iy(u,f){return _n(af(u,f),1)}function ng(u,f){return _n(af(u,f),V)}function dp(u,f,y){return y=y===n?1:lt(y),_n(af(u,f),y)}function lu(u,f){var y=ot(u)?Hn:zo;return y(u,qe(f,3))}function rf(u,f){var y=ot(u)?Gh:Ia;return y(u,qe(f,3))}var of=$c(function(u,f,y){ht.call(u,y)?u[y].push(f):gi(u,y,[f])});function rg(u,f,y,C){u=ri(u)?u:cf(u),y=y&&!C?lt(y):0;var I=u.length;return y<0&&(y=yn(I+y,0)),og(u)?y<=I&&u.indexOf(f,y)>-1:!!I&&_o(u,f,y)>-1}var Ry=Ke(function(u,f,y){var C=-1,I=typeof f=="function",O=ri(u)?de(u.length):[];return zo(u,function(Y){O[++C]=I?ar(f,Y,y):Is(Y,f,y)}),O}),sf=$c(function(u,f,y){gi(u,y,f)});function af(u,f){var y=ot(u)?Ut:Cc;return y(u,qe(f,3))}function uu(u,f,y,C){return u==null?[]:(ot(f)||(f=f==null?[]:[f]),y=C?n:y,ot(y)||(y=y==null?[]:[y]),Ec(u,f,y))}var $y=$c(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function lf(u,f,y){var C=ot(u)?ud:Zh,I=arguments.length<3;return C(u,qe(f,4),y,I,zo)}function o(u,f,y){var C=ot(u)?Zv:Zh,I=arguments.length<3;return C(u,qe(f,4),y,I,Ia)}function l(u,f){var y=ot(u)?Po:Ts;return y(u,ze(qe(f,3)))}function p(u){var f=ot(u)?Oo:Rd;return f(u)}function v(u,f,y){(y?Ie(u,f,y):f===n)?f=1:f=lt(f);var C=ot(u)?bm:$d;return C(u,f)}function w(u){var f=ot(u)?Cd:Gl;return f(u)}function E(u){if(u==null)return 0;if(ri(u))return og(u)?Io(u):u.length;var f=In(u);return f==It||f==bt?u.size:Vl(u).length}function L(u,f,y){var C=ot(u)?cd:Ad;return y&&Ie(u,f,y)&&(f=n),C(u,qe(f,3))}var H=Ke(function(u,f){if(u==null)return[];var y=f.length;return y>1&&Ie(u,f[0],f[1])?f=[]:y>2&&Ie(f[0],f[1],f[2])&&(f=[f[0]]),Ec(u,_n(f,1),[])}),Q=xd||function(){return vn.Date.now()};function fe(u,f){if(typeof f!="function")throw new Fn(a);return u=lt(u),function(){if(--u<1)return f.apply(this,arguments)}}function xe(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,Oi(u,Z,n,n,n,n,f)}function Se(u,f){var y;if(typeof f!="function")throw new Fn(a);return u=lt(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var be=Ke(function(u,f,y){var C=_;if(y.length){var I=Hr(y,Fa(be));C|=$}return Oi(u,C,f,y,I)}),Le=Ke(function(u,f,y){var C=_|R;if(y.length){var I=Hr(y,Fa(Le));C|=$}return Oi(f,C,u,y,I)});function Ne(u,f,y){f=y?n:f;var C=Oi(u,F,n,n,n,n,n,f);return C.placeholder=Ne.placeholder,C}function Oe(u,f,y){f=y?n:f;var C=Oi(u,z,n,n,n,n,n,f);return C.placeholder=Oe.placeholder,C}function nn(u,f,y){var C,I,O,Y,ee,le,ge=0,ve=!1,we=!1,$e=!0;if(typeof u!="function")throw new Fn(a);f=Bi(f)||0,an(y)&&(ve=!!y.leading,we="maxWait"in y,O=we?yn(Bi(y.maxWait)||0,f):O,$e="trailing"in y?!!y.trailing:$e);function We(kn){var po=C,Ws=I;return C=I=n,ge=kn,Y=u.apply(Ws,po),Y}function nt(kn){return ge=kn,ee=fr(mt,f),ve?We(kn):Y}function ct(kn){var po=kn-le,Ws=kn-ge,s1=f-po;return we?Gn(s1,O-Ws):s1}function Qe(kn){var po=kn-le,Ws=kn-ge;return le===n||po>=f||po<0||we&&Ws>=O}function mt(){var kn=Q();if(Qe(kn))return wt(kn);ee=fr(mt,ct(kn))}function wt(kn){return ee=n,$e&&C?We(kn):(C=I=n,Y)}function ki(){ee!==n&&Fd(ee),ge=0,C=le=I=ee=n}function Dr(){return ee===n?Y:wt(Q())}function Ci(){var kn=Q(),po=Qe(kn);if(C=arguments,I=this,le=kn,po){if(ee===n)return nt(le);if(we)return Fd(ee),ee=fr(mt,f),We(le)}return ee===n&&(ee=fr(mt,f)),Y}return Ci.cancel=ki,Ci.flush=Dr,Ci}var ue=Ke(function(u,f){return Es(u,1,f)}),ne=Ke(function(u,f,y){return Es(u,Bi(f)||0,y)});function ce(u){return Oi(u,B)}function Ce(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new Fn(a);var y=function(){var C=arguments,I=f?f.apply(this,C):C[0],O=y.cache;if(O.has(I))return O.get(I);var Y=u.apply(this,C);return y.cache=O.set(I,Y)||O,Y};return y.cache=new(Ce.Cache||Di),y}Ce.Cache=Di;function ze(u){if(typeof u!="function")throw new Fn(a);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function Ye(u){return Se(2,u)}var Xe=Cm(function(u,f){f=f.length==1&&ot(f[0])?Ut(f[0],lr(qe())):Ut(_n(f,1),lr(qe()));var y=f.length;return Ke(function(C){for(var I=-1,O=Gn(C.length,y);++I=f}),cu=Td((function(){return arguments})())?Td:function(u){return pn(u)&&ht.call(u,"callee")&&!fm.call(u,"callee")},ot=de.isArray,s$=mr?lr(mr):oo;function ri(u){return u!=null&&ig(u.length)&&!Vs(u)}function Sn(u){return pn(u)&&ri(u)}function a$(u){return u===!0||u===!1||pn(u)&&cn(u)==_e}var Wa=_l||Wy,l$=vs?lr(vs):Bo;function u$(u){return pn(u)&&u.nodeType===1&&!pp(u)}function c$(u){if(u==null)return!0;if(ri(u)&&(ot(u)||typeof u=="string"||typeof u.splice=="function"||Wa(u)||uf(u)||cu(u)))return!u.length;var f=In(u);if(f==It||f==bt)return!u.size;if(Ho(u))return!Vl(u).length;for(var y in u)if(ht.call(u,y))return!1;return!0}function f$(u,f){return Vo(u,f)}function d$(u,f,y){y=typeof y=="function"?y:n;var C=y?y(u,f):n;return C===n?Vo(u,f,n,y):!!C}function Ly(u){if(!pn(u))return!1;var f=cn(u);return f==Re||f==ft||typeof u.message=="string"&&typeof u.name=="string"&&!pp(u)}function p$(u){return typeof u=="number"&&Il(u)}function Vs(u){if(!an(u))return!1;var f=cn(u);return f==dt||f==Mt||f==Ve||f==Nn}function Vw(u){return typeof u=="number"&&u==lt(u)}function ig(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=se}function an(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function pn(u){return u!=null&&typeof u=="object"}var Uw=tc?lr(tc):wc;function h$(u,f){return u===f||Sc(u,f,Bc(f))}function m$(u,f,y){return y=typeof y=="function"?y:n,Sc(u,f,Bc(f),y)}function g$(u){return Ww(u)&&u!=+u}function v$(u){if(nu(u))throw new rt(s);return Aa(u)}function y$(u){return u===null}function b$(u){return u==null}function Ww(u){return typeof u=="number"||pn(u)&&cn(u)==Fe}function pp(u){if(!pn(u)||cn(u)!=Et)return!1;var f=xa(u);if(f===null)return!0;var y=ht.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&bs.call(y)==lm}var My=ha?lr(ha):Fi;function x$(u){return Vw(u)&&u>=-se&&u<=se}var Kw=Hh?lr(Hh):jl;function og(u){return typeof u=="string"||!ot(u)&&pn(u)&&cn(u)==gn}function Si(u){return typeof u=="symbol"||pn(u)&&cn(u)==Wn}var uf=nc?lr(nc):Bl;function w$(u){return u===n}function S$(u){return pn(u)&&In(u)==pe}function k$(u){return pn(u)&&cn(u)==ke}var C$=jn(kc),E$=jn(function(u,f){return u<=f});function Hw(u){if(!u)return[];if(ri(u))return og(u)?$r(u):cr(u);if(Cl&&u[Cl])return im(u[Cl]());var f=In(u),y=f==It?sc:f==bt?ac:cf;return y(u)}function Us(u){if(!u)return u===0?u:0;if(u=Bi(u),u===V||u===-V){var f=u<0?-1:1;return f*M}return u===u?u:0}function lt(u){var f=Us(u),y=f%1;return f===f?y?f-y:f:0}function Gw(u){return u?ro(lt(u),0,re):0}function Bi(u){if(typeof u=="number")return u;if(Si(u))return W;if(an(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=an(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=em(u);var y=Lh.test(u);return y||Dh.test(u)?ad(u.slice(2),y?2:8):Wv.test(u)?W:+u}function qw(u){return Lr(u,ii(u))}function P$(u){return u?ro(lt(u),-se,se):u===0?u:0}function Lt(u){return u==null?"":kr(u)}var T$=Xn(function(u,f){if(Ho(f)||ri(f)){Lr(f,nr(f),u);return}for(var y in f)ht.call(f,y)&&zn(u,y,f[y])}),Yw=Xn(function(u,f){Lr(f,ii(f),u)}),Xw=Xn(function(u,f,y,C){Lr(f,ii(f),u,C)}),Dy=Xn(function(u,f,y,C){Lr(f,nr(f),u,C)}),_$=bi(Nl);function I$(u,f){var y=qr(u);return f==null?y:Qr(y,f)}var R$=Ke(function(u,f){u=At(u);var y=-1,C=f.length,I=C>2?f[2]:n;for(I&&Ie(f[0],f[1],I)&&(C=1);++y1),O}),Lr(u,jc(u),y),C&&(y=Ar(y,b|x|k,Am));for(var I=f.length;I--;)Tc(y,f[I]);return y});function q$(u,f){return Jw(u,ze(qe(f)))}var Y$=bi(function(u,f){return u==null?{}:Rs(u,f)});function Jw(u,f){if(u==null)return{};var y=Ut(jc(u),function(C){return[C]});return f=qe(f),Ht(u,y,function(C,I){return f(C,I[0])})}function X$(u,f,y){f=ao(f,u);var C=-1,I=f.length;for(I||(I=1,u=n);++Cf){var C=u;u=f,f=C}if(y||u%1||f%1){var I=Rl();return Gn(u+I*(f-u+ec("1e-"+((I+"").length-1))),f)}return $s(u,f)}var aA=Ls(function(u,f,y){return f=f.toLowerCase(),u+(y?t1(f):f)});function t1(u){return Oy(Lt(u).toLowerCase())}function n1(u){return u=Lt(u),u&&u.replace(Kv,nm).replace(hl,"")}function lA(u,f,y){u=Lt(u),f=kr(f);var C=u.length;y=y===n?C:ro(lt(y),0,C);var I=y;return y-=f.length,y>=0&&u.slice(y,I)==f}function uA(u){return u=Lt(u),u&&ps.test(u)?u.replace(sa,rm):u}function cA(u){return u=Lt(u),u&&Yf.test(u)?u.replace(Ai,"\\$&"):u}var fA=Ls(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),dA=Ls(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),pA=Bd("toLowerCase");function hA(u,f,y){u=Lt(u),f=lt(f);var C=f?Io(u):0;if(!f||C>=f)return u;var I=(f-C)/2;return Zl(Pl(I),y)+u+Zl(Ao(I),y)}function mA(u,f,y){u=Lt(u),f=lt(f);var C=f?Io(u):0;return f&&C>>0,y?(u=Lt(u),u&&(typeof f=="string"||f!=null&&!My(f))&&(f=kr(f),!f&&ga(u))?lo($r(u),0,y):u.split(f,y)):[]}var SA=Ls(function(u,f,y){return u+(y?" ":"")+Oy(f)});function kA(u,f,y){return u=Lt(u),y=y==null?0:ro(lt(y),0,u.length),f=kr(f),u.slice(y,y+f.length)==f}function CA(u,f,y){var C=N.templateSettings;y&&Ie(u,f,y)&&(f=n),u=Lt(u),f=Dy({},f,C,Wd);var I=Dy({},f.imports,C.imports,Wd),O=nr(I),Y=ys(I,O);Hn(O,function(Qe){if(Vu.test(Qe))throw new rt(d)});var ee,le,ge=0,ve=f.interpolate||Uu,we="__p += '",$e=vd((f.escape||Uu).source+"|"+ve.source+"|"+(ve===aa?xo:Uu).source+"|"+(f.evaluate||Uu).source+"|$","g"),We="//# sourceURL="+(ht.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ml+"]")+` -`;u.replace($e,function(Qe,mt,wt,ki,Dr,Ci){return wt||(wt=ki),we+=u.slice(ge,Ci).replace(sn,ma),mt&&(ee=!0,we+=`' + -__e(`+mt+`) + -'`),Dr&&(le=!0,we+=`'; -`+Dr+`; -__p += '`),wt&&(we+=`' + -((__t = (`+wt+`)) == null ? '' : __t) + -'`),ge=Ci+Qe.length,Qe}),we+=`'; -`;var nt=ht.call(f,"variable")&&f.variable;if(!nt)we=`with (obj) { -`+we+` -} -`;else if(Vu.test(nt))throw new rt(c);we=(le?we.replace(oa,""):we).replace(ds,"$1").replace($i,"$1;"),we="function("+(nt||"obj")+`) { -`+(nt?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(ee?", __e = _.escape":"")+(le?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+we+`return __p -}`;var ct=i1(function(){return St(O,We+"return "+we).apply(n,Y)});if(ct.source=we,Ly(ct))throw ct;return ct}function EA(u){return Lt(u).toLowerCase()}function PA(u){return Lt(u).toUpperCase()}function TA(u,f,y){if(u=Lt(u),u&&(y||f===n))return em(u);if(!u||!(f=kr(f)))return u;var C=$r(u),I=$r(f),O=hd(C,I),Y=md(C,I)+1;return lo(C,O,Y).join("")}function _A(u,f,y){if(u=Lt(u),u&&(y||f===n))return u.slice(0,gd(u)+1);if(!u||!(f=kr(f)))return u;var C=$r(u),I=md(C,$r(f))+1;return lo(C,0,I).join("")}function IA(u,f,y){if(u=Lt(u),u&&(y||f===n))return u.replace(Qi,"");if(!u||!(f=kr(f)))return u;var C=$r(u),I=hd(C,$r(f));return lo(C,I).join("")}function RA(u,f){var y=G,C=q;if(an(f)){var I="separator"in f?f.separator:I;y="length"in f?lt(f.length):y,C="omission"in f?kr(f.omission):C}u=Lt(u);var O=u.length;if(ga(u)){var Y=$r(u);O=Y.length}if(y>=O)return u;var ee=y-Io(C);if(ee<1)return C;var le=Y?lo(Y,0,ee).join(""):u.slice(0,ee);if(I===n)return le+C;if(Y&&(ee+=le.length-ee),My(I)){if(u.slice(ee).search(I)){var ge,ve=le;for(I.global||(I=vd(I.source,Lt(Jf.exec(I))+"g")),I.lastIndex=0;ge=I.exec(ve);)var we=ge.index;le=le.slice(0,we===n?ee:we)}}else if(u.indexOf(kr(I),ee)!=ee){var $e=le.lastIndexOf(I);$e>-1&&(le=le.slice(0,$e))}return le+C}function $A(u){return u=Lt(u),u&&ju.test(u)?u.replace(hi,sm):u}var AA=Ls(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),Oy=Bd("toUpperCase");function r1(u,f,y){return u=Lt(u),f=y?n:f,f===n?sy(u)?uy(u):ty(u):u.match(f)||[]}var i1=Ke(function(u,f){try{return ar(u,n,f)}catch(y){return Ly(y)?y:new rt(y)}}),LA=bi(function(u,f){return Hn(f,function(y){y=ei(y),gi(u,y,be(u[y],u))}),u});function MA(u){var f=u==null?0:u.length,y=qe();return u=f?Ut(u,function(C){if(typeof C[1]!="function")throw new Fn(a);return[y(C[0]),C[1]]}):[],Ke(function(C){for(var I=-1;++Ise)return[];var y=re,C=Gn(u,re);f=qe(f),u-=re;for(var I=pd(C,f);++y0||f<0)?new at(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=lt(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},at.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},at.prototype.toArray=function(){return this.take(re)},ur(at.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),C=/^(?:head|last)$/.test(f),I=N[C?"take"+(f=="last"?"Right":""):f],O=C||/^find/.test(f);I&&(N.prototype[f]=function(){var Y=this.__wrapped__,ee=C?[1]:arguments,le=Y instanceof at,ge=ee[0],ve=le||ot(Y),we=function(mt){var wt=I.apply(N,To([mt],ee));return C&&$e?wt[0]:wt};ve&&y&&typeof ge=="function"&&ge.length!=1&&(le=ve=!1);var $e=this.__chain__,We=!!this.__actions__.length,nt=O&&!$e,ct=le&&!We;if(!O&&ve){Y=ct?Y:new at(this);var Qe=u.apply(Y,ee);return Qe.__actions__.push({func:js,args:[we],thisArg:n}),new On(Qe,$e)}return nt&&ct?u.apply(this,ee):(Qe=this.thru(we),nt?C?Qe.value()[0]:Qe.value():Qe)})}),Hn(["pop","push","shift","sort","splice","unshift"],function(u){var f=ba[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",C=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var I=arguments;if(C&&!this.__chain__){var O=this.value();return f.apply(ot(O)?O:[],I)}return this[y](function(Y){return f.apply(ot(Y)?Y:[],I)})}}),ur(at.prototype,function(u,f){var y=N[f];if(y){var C=y.name+"";ht.call(Lo,C)||(Lo[C]=[]),Lo[C].push({name:f,func:y})}}),Lo[Dc(n,R).name]=[{name:"wrapper",func:n}],at.prototype.clone=Sd,at.prototype.reverse=Pa,at.prototype.value=No,N.prototype.at=Bs,N.prototype.chain=ef,N.prototype.commit=lp,N.prototype.next=up,N.prototype.plant=cp,N.prototype.reverse=_y,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=Zm,N.prototype.first=N.prototype.head,Cl&&(N.prototype[Cl]=Ty),N}),ya=cy();Eo?((Eo.exports=ya)._=ya,da._=ya):vn._=ya}).call(pj)})(Mp,Mp.exports)),Mp.exports}var G2=hj();class mj{plugins={};activePlugins=[];slotFillers=new Map;listeners=new Set;slotFillersCache=new Map;hasSlotFillersCache=new Map;register(t){this.plugins[t.name]={isActivated:!1,config:t},this.notify()}activate(t){const n=this.plugins[t];if(!(!n||n.isActivated)){if(n.isActivated=!0,n.config.slots)for(const r of n.config.slots)this.registerSlot(t,r);n.config.onActivate&&n.config.onActivate(),this.produceActivePlugins(),this.notify()}}deactivate(t){const n=this.plugins[t];!n||!n.isActivated||(n.isActivated=!1,this.unregisterPluginSlots(t),n.config.onDeactivate&&n.config.onDeactivate(),this.produceActivePlugins(),this.notify())}isPluginActivated(t){const n=this.plugins[t];return!!n&&n.isActivated}getPlugin(t){const n=this.plugins[t];return!n||!n.isActivated?null:n}getActivePlugins(){return this.activePlugins}getSlotFillers(t){const n=this.slotFillers.get(t)??[],r=this.slotFillersCache.get(t);return r&&r.length===n.length&&r.every((i,s)=>i===n[s])?r:(this.slotFillersCache.set(t,n),n)}hasSlotFillers(t){const n=(this.slotFillers.get(t)?.length??0)>0,r=this.hasSlotFillersCache.get(t);return r===n?r:(this.hasSlotFillersCache.set(t,n),n)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}registerSlot(t,n){const r=this.slotFillers.get(n.slot)??[],i={slot:n.slot,component:n.component,priority:n.priority,condition:n.condition,pluginName:t};r.push(i),r.sort((s,a)=>(a.priority??0)-(s.priority??0)),this.slotFillers.set(n.slot,r)}unregisterPluginSlots(t){for(const[n,r]of this.slotFillers.entries()){const i=r.filter(s=>s.pluginName!==t);this.slotFillers.set(n,i)}}notify(){this.listeners.forEach(t=>t())}produceActivePlugins(){this.activePlugins=G2.transform(this.plugins,(t,n)=>{n.isActivated&&t.push(n.config)},[])}}const zt=new mj;function Ou(e,t,n,r){return{slot:e,component:t,priority:n,condition:r}}const sC=S.lazy(()=>Ur(()=>import("./FeedbackForm-4ocPbX4e.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),q2="FeedbackFormPlugin",gj={name:q2,components:{FeedbackForm:sC},slots:[Ou("message.actions",sC,5)]},aC=S.lazy(()=>Ur(()=>import("./ChatOptionsForm-DBuZluwC.js"),__vite__mapDeps([7,1,2,3,4,5,6]))),Y2="ChatOptionsPlugin",vj={name:Y2,components:{ChatOptionsForm:aC},slots:[Ou("prompt.beforeSend",aC,10)]},yj={config:{feedback:{like:{enabled:!1,form:null},dislike:{enabled:!1,form:null}},user_settings:{form:null},conversation_history:!1,authentication:{enabled:!1,auth_types:[],oauth2_providers:[]},show_usage:!1,debug_mode:!1,customization:null,supports_upload:!1}},Eh=()=>S.useContext(X2)??yj,X2=S.createContext(void 0),bj="🐰",xj="Ragbits Chat",wj="by deepsense.ai",Sj="Loading...",kj="";function Q2(){return A.jsx("div",{className:mn("bg-background flex h-screen w-screen items-start justify-center"),children:A.jsxs("div",{className:"text-default-900 m-auto flex flex-col items-center gap-4",children:[A.jsx(x2,{size:"lg","aria-label":"Progress indicator"}),A.jsx("p",{children:"Initializing..."})]})})}function Cj(){return A.jsx("div",{className:mn("bg-background flex h-screen w-screen items-start justify-center"),children:A.jsxs("div",{className:"text-default-900 m-auto flex flex-col items-center gap-4",children:[A.jsx("p",{className:"text-large",children:"Something went wrong during chat initialization."}),A.jsx("p",{className:"text-small text-default-500",children:"Try refreshing the page."})]})})}function Ej({children:e}){const{call:t,...n}=u8("/api/config"),r=S.useMemo(()=>n.data?{config:n.data}:null,[n.data]);return!n.data&&!n.error&&!n.isLoading&&t(),S.useEffect(()=>{document.title=Sj},[]),n.isLoading?A.jsx(Q2,{}):n.error||!r?A.jsx(Cj,{}):A.jsx(X2.Provider,{value:r,children:e})}const lC=S.lazy(()=>Ur(()=>import("./ShareButton-DpNPT4em.js"),__vite__mapDeps([8,6]))),J2="SharePluginName",Pj={name:J2,components:{ShareButton:lC},slots:[Ou("layout.headerActions",lC,5)]};var uC="popstate";function cC(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Tj(e={}){function t(r,i){let s=i.state?.masked,{pathname:a,search:c,hash:d}=s||r.location;return Wb("",{pathname:a,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:ch(i)}return Ij(t,n,null,e)}function Dn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function bo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _j(){return Math.random().toString(36).substring(2,10)}function fC(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Wb(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ph(t):t,state:n,key:t&&t.key||r||_j(),unstable_mask:i}}function ch({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ph(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ij(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,c="POP",d=null,h=m();h==null&&(h=0,a.replaceState({...a.state,idx:h},""));function m(){return(a.state||{idx:null}).idx}function g(){c="POP";let T=m(),_=T==null?null:T-h;h=T,d&&d({action:c,location:P.location,delta:_})}function b(T,_){c="PUSH";let R=cC(T)?T:Wb(P.location,T,_);h=m()+1;let D=fC(R,h),F=P.createHref(R.unstable_mask||R);try{a.pushState(D,"",F)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;i.location.assign(F)}s&&d&&d({action:c,location:P.location,delta:1})}function x(T,_){c="REPLACE";let R=cC(T)?T:Wb(P.location,T,_);h=m();let D=fC(R,h),F=P.createHref(R.unstable_mask||R);a.replaceState(D,"",F),s&&d&&d({action:c,location:P.location,delta:0})}function k(T){return Rj(T)}let P={get action(){return c},get location(){return e(i,a)},listen(T){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(uC,g),d=T,()=>{i.removeEventListener(uC,g),d=null}},createHref(T){return t(i,T)},createURL:k,encodeLocation(T){let _=k(T);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:b,replace:x,go(T){return a.go(T)}};return P}function Rj(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Dn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ch(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Z2(e,t,n="/"){return $j(e,t,n,!1)}function $j(e,t,n,r){let i=typeof t=="string"?Ph(t):t,s=Zs(i.pathname||"/",n);if(s==null)return null;let a=eI(e);Aj(a);let c=null;for(let d=0;c==null&&d{let m={relativePath:h===void 0?a.path||"":h,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&d)return;Dn(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=ls([r,m.relativePath]),b=n.concat(m);a.children&&a.children.length>0&&(Dn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),eI(a.children,t,b,g,d)),!(a.path==null&&!a.index)&&t.push({path:g,score:zj(g,a.index),routesMeta:b})};return e.forEach((a,c)=>{if(a.path===""||!a.path?.includes("?"))s(a,c);else for(let d of tI(a.path))s(a,c,!0,d)}),t}function tI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=tI(r.join("/")),c=[];return c.push(...a.map(d=>d===""?s:[s,d].join("/"))),i&&c.push(...a),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function Aj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Lj=/^:[\w-]+$/,Mj=3,Dj=2,Nj=1,Fj=10,Oj=-2,dC=e=>e==="*";function zj(e,t){let n=e.split("/"),r=n.length;return n.some(dC)&&(r+=Oj),t&&(r+=Dj),n.filter(i=>!dC(i)).reduce((i,s)=>i+(Lj.test(s)?Mj:s===""?Nj:Fj),r)}function jj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Bj(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",a=[];for(let c=0;c{if(m==="*"){let k=c[b]||"";a=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const x=c[b];return g&&!x?h[m]=void 0:h[m]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:a,pattern:e}}function Vj(e,t=!1,n=!0){bo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,d,h,m)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let g=m.charAt(h+a.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Uj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return bo(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Zs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Wj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Kj(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ph(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=pC(n.substring(1),"/"):s=pC(n,t)):s=t,{pathname:s,search:qj(r),hash:Yj(i)}}function pC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function T0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Hj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pw(e){let t=Hj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Iv(e,t,n,r=!1){let i;typeof e=="string"?i=Ph(e):(i={...e},Dn(!i.pathname||!i.pathname.includes("?"),T0("?","pathname","search",i)),Dn(!i.pathname||!i.pathname.includes("#"),T0("#","pathname","hash",i)),Dn(!i.search||!i.search.includes("#"),T0("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,c;if(a==null)c=n;else{let g=t.length-1;if(!r&&a.startsWith("..")){let b=a.split("/");for(;b[0]==="..";)b.shift(),g-=1;i.pathname=b.join("/")}c=g>=0?t[g]:"/"}let d=Kj(i,c),h=a&&a!=="/"&&a.endsWith("/"),m=(s||a===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||m)&&(d.pathname+="/"),d}var ls=e=>e.join("/").replace(/\/\/+/g,"/"),Gj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Yj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Xj=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Qj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Jj(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var nI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rI(e,t){let n=e;if(typeof n!="string"||!Wj.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(nI)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=Zs(a.pathname,t);a.origin===s.origin&&c!=null?n=c+a.search+a.hash:i=!0}catch{bo(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var iI=["POST","PUT","PATCH","DELETE"];new Set(iI);var Zj=["GET",...iI];new Set(Zj);var Kf=S.createContext(null);Kf.displayName="DataRouter";var Rv=S.createContext(null);Rv.displayName="DataRouterState";var e7=S.createContext(!1),oI=S.createContext({isTransitioning:!1});oI.displayName="ViewTransition";var t7=S.createContext(new Map);t7.displayName="Fetchers";var n7=S.createContext(null);n7.displayName="Await";var Ri=S.createContext(null);Ri.displayName="Navigation";var $v=S.createContext(null);$v.displayName="Location";var Xi=S.createContext({outlet:null,matches:[],isDataRoute:!1});Xi.displayName="Route";var hw=S.createContext(null);hw.displayName="RouteError";var sI="REACT_ROUTER_ERROR",r7="REDIRECT",i7="ROUTE_ERROR_RESPONSE";function o7(e){if(e.startsWith(`${sI}:${r7}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function s7(e){if(e.startsWith(`${sI}:${i7}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Xj(t.status,t.statusText,t.data)}catch{}}function a7(e,{relative:t}={}){Dn(Hf(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=S.useContext(Ri),{hash:i,pathname:s,search:a}=Th(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:ls([n,s])),r.createHref({pathname:c,search:a,hash:i})}function Hf(){return S.useContext($v)!=null}function na(){return Dn(Hf(),"useLocation() may be used only in the context of a component."),S.useContext($v).location}var aI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lI(e){S.useContext(Ri).static||S.useLayoutEffect(e)}function mw(){let{isDataRoute:e}=S.useContext(Xi);return e?S7():l7()}function l7(){Dn(Hf(),"useNavigate() may be used only in the context of a component.");let e=S.useContext(Kf),{basename:t,navigator:n}=S.useContext(Ri),{matches:r}=S.useContext(Xi),{pathname:i}=na(),s=JSON.stringify(pw(r)),a=S.useRef(!1);return lI(()=>{a.current=!0}),S.useCallback((d,h={})=>{if(bo(a.current,aI),!a.current)return;if(typeof d=="number"){n.go(d);return}let m=Iv(d,JSON.parse(s),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ls([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,i,e])}var u7=S.createContext(null);function c7(e){let t=S.useContext(Xi).outlet;return S.useMemo(()=>t&&S.createElement(u7.Provider,{value:e},t),[t,e])}function uI(){let{matches:e}=S.useContext(Xi),t=e[e.length-1];return t?t.params:{}}function Th(e,{relative:t}={}){let{matches:n}=S.useContext(Xi),{pathname:r}=na(),i=JSON.stringify(pw(n));return S.useMemo(()=>Iv(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function f7(e,t){return cI(e)}function cI(e,t,n){Dn(Hf(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=S.useContext(Ri),{matches:i}=S.useContext(Xi),s=i[i.length-1],a=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",h=s&&s.route;{let T=h&&h.path||"";dI(c,!h||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${c}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let m=na(),g;g=m;let b=g.pathname||"/",x=b;if(d!=="/"){let T=d.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let k=Z2(e,{pathname:x});return bo(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),bo(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),g7(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},a,T.params),pathname:ls([d,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?d:ls([d,r.encodeLocation?r.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),i,n)}function d7(){let e=w7(),t=Qj(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,a)}var p7=S.createElement(d7,null),fI=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=s7(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement(Xi.Provider,{value:this.props.routeContext},S.createElement(hw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(h7,{error:e},t):t}};fI.contextType=e7;var _0=new WeakMap;function h7({children:e,error:t}){let{basename:n}=S.useContext(Ri);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=o7(t.digest);if(r){let i=_0.get(t);if(i)throw i;let s=rI(r.location,n);if(nI&&!_0.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw _0.set(t,a),a}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function m7({routeContext:e,match:t,children:n}){let r=S.useContext(Kf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Xi.Provider,{value:e},n)}function g7(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,s=r?.errors;if(s!=null){let m=i.findIndex(g=>g.route.id&&s?.[g.route.id]!==void 0);Dn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let a=!1,c=-1;if(n&&r){a=r.renderFallback;for(let m=0;m=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let d=n?.onError,h=r&&d?(m,g)=>{d(m,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Jj(r.matches),errorInfo:g})}:void 0;return i.reduceRight((m,g,b)=>{let x,k=!1,P=null,T=null;r&&(x=s&&g.route.id?s[g.route.id]:void 0,P=g.route.errorElement||p7,a&&(c<0&&b===0?(dI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,T=null):c===b&&(k=!0,T=g.route.hydrateFallbackElement||null)));let _=t.concat(i.slice(0,b+1)),R=()=>{let D;return x?D=P:k?D=T:g.route.Component?D=S.createElement(g.route.Component,null):g.route.element?D=g.route.element:D=m,S.createElement(m7,{match:g,routeContext:{outlet:m,matches:_,isDataRoute:r!=null},children:D})};return r&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?S.createElement(fI,{location:r.location,revalidation:r.revalidation,component:P,error:x,children:R(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:h}):R()},null)}function gw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function v7(e){let t=S.useContext(Kf);return Dn(t,gw(e)),t}function y7(e){let t=S.useContext(Rv);return Dn(t,gw(e)),t}function b7(e){let t=S.useContext(Xi);return Dn(t,gw(e)),t}function vw(e){let t=b7(e),n=t.matches[t.matches.length-1];return Dn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function x7(){return vw("useRouteId")}function w7(){let e=S.useContext(hw),t=y7("useRouteError"),n=vw("useRouteError");return e!==void 0?e:t.errors?.[n]}function S7(){let{router:e}=v7("useNavigate"),t=vw("useNavigate"),n=S.useRef(!1);return lI(()=>{n.current=!0}),S.useCallback(async(i,s={})=>{bo(n.current,aI),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var hC={};function dI(e,t,n){!t&&!hC[e]&&(hC[e]=!0,bo(!1,n))}S.memo(k7);function k7({routes:e,future:t,state:n,isStatic:r,onError:i}){return cI(e,void 0,{state:n,isStatic:r,onError:i})}function Fq({to:e,replace:t,state:n,relative:r}){Dn(Hf()," may be used only in the context of a component.");let{static:i}=S.useContext(Ri);bo(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:s}=S.useContext(Xi),{pathname:a}=na(),c=mw(),d=Iv(e,pw(s),a,r==="path"),h=JSON.stringify(d);return S.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function C7(e){return c7(e.context)}function E7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){Dn(!Hf(),"You cannot render a inside another . You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=S.useMemo(()=>({basename:c,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[c,i,s,a]);typeof n=="string"&&(n=Ph(n));let{pathname:h="/",search:m="",hash:g="",state:b=null,key:x="default",unstable_mask:k}=n,P=S.useMemo(()=>{let T=Zs(h,c);return T==null?null:{location:{pathname:T,search:m,hash:g,state:b,key:x,unstable_mask:k},navigationType:r}},[c,h,m,g,b,x,r,k]);return bo(P!=null,` is not able to match the URL "${h}${m}${g}" because it does not start with the basename, so the won't render anything.`),P==null?null:S.createElement(Ri.Provider,{value:d},S.createElement($v.Provider,{children:t,value:P}))}var zg="get",jg="application/x-www-form-urlencoded";function Av(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function P7(e){return Av(e)&&e.tagName.toLowerCase()==="button"}function T7(e){return Av(e)&&e.tagName.toLowerCase()==="form"}function _7(e){return Av(e)&&e.tagName.toLowerCase()==="input"}function I7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R7(e,t){return e.button===0&&(!t||t==="_self")&&!I7(e)}var Cg=null;function $7(){if(Cg===null)try{new FormData(document.createElement("form"),0),Cg=!1}catch{Cg=!0}return Cg}var A7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function I0(e){return e!=null&&!A7.has(e)?(bo(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${jg}"`),null):e}function L7(e,t){let n,r,i,s,a;if(T7(e)){let c=e.getAttribute("action");r=c?Zs(c,t):null,n=e.getAttribute("method")||zg,i=I0(e.getAttribute("enctype"))||jg,s=new FormData(e)}else if(P7(e)||_7(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a - - + {!isShared && ( +
+ + +
+ )} ); } diff --git a/typescript/ui/src/core/contexts/ConfigContext/useConfigContext.ts b/typescript/ui/src/core/contexts/ConfigContext/useConfigContext.ts index e81c694d93..7cacb7d223 100644 --- a/typescript/ui/src/core/contexts/ConfigContext/useConfigContext.ts +++ b/typescript/ui/src/core/contexts/ConfigContext/useConfigContext.ts @@ -14,6 +14,7 @@ const DEFAULT_CONFIG: IConfigContext = { debug_mode: false, customization: null, supports_upload: false, + sharing: false, }, }; diff --git a/typescript/ui/src/core/stores/HistoryStore/HistoryStoreContextProvider.tsx b/typescript/ui/src/core/stores/HistoryStore/HistoryStoreContextProvider.tsx index 5892abdb21..dc0435b962 100644 --- a/typescript/ui/src/core/stores/HistoryStore/HistoryStoreContextProvider.tsx +++ b/typescript/ui/src/core/stores/HistoryStore/HistoryStoreContextProvider.tsx @@ -7,7 +7,6 @@ import { MessageRole } from "@ragbits/api-client-react"; import { v4 as uuidv4 } from "uuid"; import InitializationScreen from "../../components/InitializationScreen"; import { - getTemporaryConversationId, initialConversationValues, initialHistoryValues, isTemporaryConversation, @@ -56,9 +55,6 @@ const createMinimalHistoryStore = immer((set, get) => { }), ); }, - restore: () => { - return getTemporaryConversationId(); - }, stopAnswering: (conversationId) => { const conversation = get().conversations[conversationId]; @@ -175,6 +171,10 @@ const createMinimalHistoryStore = immer((set, get) => { mergeExtensions: () => {}, initializeChatOptions: () => {}, setConversationProperties: () => {}, + loadServerConversations: async () => { + /* no-op in minimal store */ + }, + loadSharedConversation: async () => false, }, computed: { diff --git a/typescript/ui/src/core/types/history.ts b/typescript/ui/src/core/types/history.ts index 555ff38d53..7260e58756 100644 --- a/typescript/ui/src/core/types/history.ts +++ b/typescript/ui/src/core/types/history.ts @@ -48,6 +48,12 @@ export interface Conversation { isLoading: boolean; abortController: AbortController | null; summary?: string; + /** True when this conversation was shared with the current user by someone else. */ + isShared?: boolean; + /** Identifier (user_id) of the user who shared this conversation. */ + sharedBy?: string; + /** True when this is a stub loaded from the server (messages not yet fetched). */ + isServerOnly?: boolean; } export interface HistoryStore { @@ -61,7 +67,10 @@ export interface HistoryStore { actions: { newConversation: () => string; selectConversation: (conversationId: string) => void; - deleteConversation: (conversationId: string) => void; + deleteConversation: ( + conversationId: string, + ragbitsClient?: RagbitsClient, + ) => void; sendMessage: ( text: string, ragbitsClient: RagbitsClient, @@ -86,6 +95,13 @@ export interface HistoryStore { conversationKey: string, properties: Partial, ) => void; + /** Fetch conversations from server (owned + shared) and merge into local store. */ + loadServerConversations: (ragbitsClient: RagbitsClient) => Promise; + /** Load a single shared conversation from the server by ID. Returns true on success. */ + loadSharedConversation: ( + conversationId: string, + ragbitsClient: RagbitsClient, + ) => Promise; }; primitives: { @@ -94,13 +110,6 @@ export interface HistoryStore { message: Omit, ) => string; deleteMessage: (conversationId: string, messageId: string) => void; - restore: ( - history: Conversation["history"], - followupMessages: Conversation["followupMessages"], - chatOptions: Conversation["chatOptions"], - serverState: Conversation["serverState"], - conversationId: Conversation["conversationId"], - ) => string; getCurrentConversation: () => Conversation; stopAnswering: (conversationId: string) => void; }; diff --git a/typescript/ui/src/core/types/slots.ts b/typescript/ui/src/core/types/slots.ts index 41bab923e4..f91570ab3e 100644 --- a/typescript/ui/src/core/types/slots.ts +++ b/typescript/ui/src/core/types/slots.ts @@ -5,7 +5,9 @@ export type SlotName = | "layout.sidebar" | "layout.headerActions" | "message.actions" - | "prompt.beforeSend"; + | "prompt.beforeSend" + | "chat.banner.top" + | "chatHistory.itemDecorator"; export interface SlotPropsMap { "layout.sidebar": Record; @@ -18,6 +20,10 @@ export interface SlotPropsMap { "prompt.beforeSend": { isInputDisabled: boolean; }; + "chat.banner.top": Record; + "chatHistory.itemDecorator": { + conversationId: string; + }; } // Type-safe slot definition for plugin authors diff --git a/typescript/ui/src/plugins/ChatHistoryPlugin/components/ChatHistory.tsx b/typescript/ui/src/plugins/ChatHistoryPlugin/components/ChatHistory.tsx index d294cc5b52..f17006ddf5 100644 --- a/typescript/ui/src/plugins/ChatHistoryPlugin/components/ChatHistory.tsx +++ b/typescript/ui/src/plugins/ChatHistoryPlugin/components/ChatHistory.tsx @@ -8,15 +8,15 @@ import { } from "@heroui/react"; import { Icon } from "@iconify/react"; import { motion, AnimatePresence } from "framer-motion"; -import { useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import DelayedTooltip from "../../../core/components/DelayedTooltip"; import { useHistoryActions } from "../../../core/stores/HistoryStore/selectors"; import { useHistoryStore } from "../../../core/stores/HistoryStore/useHistoryStore"; import { useNavigate } from "react-router"; import { getConversationRoute } from "../utils"; -import { useShallow } from "zustand/shallow"; -import { zip } from "lodash"; import { isTemporaryConversation } from "../../../core/stores/HistoryStore/utils"; +import { useRagbitsContext } from "@ragbits/api-client-react"; +import { Slot } from "../../../core/components/Slot"; export default function ChatHistory() { const { @@ -24,17 +24,25 @@ export default function ChatHistory() { deleteConversation, newConversation, setConversationProperties, + loadServerConversations, } = useHistoryActions(); const navigate = useNavigate(); - const conversations = useHistoryStore( - useShallow((s) => Object.keys(s.conversations).reverse()), - ); - const summaries = useHistoryStore( - useShallow((s) => - Object.values(s.conversations) + const { client: ragbitsClient } = useRagbitsContext(); + + useEffect(() => { + loadServerConversations(ragbitsClient); + }, [loadServerConversations, ragbitsClient]); + const conversations = useHistoryStore((s) => s.conversations); + const conversationEntries = useMemo( + () => + Object.entries(conversations) .reverse() - .map((entry) => entry.summary), - ), + .map(([id, entry]) => ({ + id, + summary: entry.summary, + isShared: entry.isShared ?? false, + })), + [conversations], ); const currentConversation = useHistoryStore((s) => s.currentConversation); const [isCollapsed, setCollapsed] = useState(false); @@ -165,97 +173,131 @@ export default function ChatHistory() { width: 0, }} > - {zip(conversations, summaries).map(([conversation, summary]) => { - if (!conversation || isTemporaryConversation(conversation)) { - return null; - } + {conversationEntries.map( + ({ id: conversation, summary, isShared: isConvShared }) => { + if (isTemporaryConversation(conversation)) { + return null; + } + + const isSelected = conversation === currentConversation; + const isEdited = conversation === editingKey; + const variant = isSelected ? "solid" : "light"; - const isSelected = conversation === currentConversation; - const isEdited = conversation === editingKey; - const variant = isSelected ? "solid" : "light"; - return ( -
- {isEdited ? ( - setEditValue(e.target.value)} - onBlur={() => { - if (ignoreBlur) return; - handleSaveEdit(conversation); - }} - onKeyDown={(e) => { - if (e.key === "Enter") handleSaveEdit(conversation); - if (e.key === "Escape") handleCancelEdit(); - }} - className="flex-1" - data-testid={`input-conversation-${conversation}`} - /> - ) : ( - - )} - - + const handleDismiss = () => { + deleteConversation(conversation, ragbitsClient); + }; + + return ( +
+ {isEdited && !isConvShared ? ( + setEditValue(e.target.value)} + onBlur={() => { + if (ignoreBlur) return; + handleSaveEdit(conversation); + }} + onKeyDown={(e) => { + if (e.key === "Enter") handleSaveEdit(conversation); + if (e.key === "Escape") handleCancelEdit(); + }} + className="flex-1" + data-testid={`input-conversation-${conversation}`} + /> + ) : ( - - - handleNavigate(conversation)} + title={summary ?? conversation} + data-testid={`select-conversation-${conversation}`} + className="flex-1 justify-start" startContent={ - } - onPress={() => - handleStartEdit(conversation, summary ?? conversation) - } - data-testid={`edit-conversation-${conversation}`} - > - Edit - - } - onPress={() => deleteConversation(conversation)} - data-testid={`delete-conversation-${conversation}`} > - Delete conversation - - - -
- ); - })} +
+ {summary ?? conversation} +
+ + )} + + + + + {isConvShared ? ( + + } + onPress={handleDismiss} + data-testid={`dismiss-conversation-${conversation}`} + > + Dismiss + + + ) : ( + + + } + onPress={() => + handleStartEdit( + conversation, + summary ?? conversation, + ) + } + data-testid={`edit-conversation-${conversation}`} + > + Edit + + } + onPress={() => + deleteConversation(conversation, ragbitsClient) + } + data-testid={`delete-conversation-${conversation}`} + > + Delete conversation + + + )} + +
+ ); + }, + )} )} diff --git a/typescript/ui/src/plugins/ChatHistoryPlugin/routes/ConversationGuard.tsx b/typescript/ui/src/plugins/ChatHistoryPlugin/routes/ConversationGuard.tsx index 44b717a3e2..8af4b450ce 100644 --- a/typescript/ui/src/plugins/ChatHistoryPlugin/routes/ConversationGuard.tsx +++ b/typescript/ui/src/plugins/ChatHistoryPlugin/routes/ConversationGuard.tsx @@ -1,41 +1,87 @@ -import { PropsWithChildren, useEffect } from "react"; +import { PropsWithChildren, useEffect, useState } from "react"; import { useHistoryStore } from "../../../core/stores/HistoryStore/useHistoryStore"; import { useNavigate, useParams } from "react-router"; import { useShallow } from "zustand/shallow"; import { useHistoryActions } from "../../../core/stores/HistoryStore/selectors"; import { getConversationRoute } from "../utils"; +import { useRagbitsContext } from "@ragbits/api-client-react"; +import { isTemporaryConversation } from "../../../core/stores/HistoryStore/utils"; export default function ConversationGuard({ children }: PropsWithChildren) { const navigate = useNavigate(); + const { client: ragbitsClient } = useRagbitsContext(); const conversations = useHistoryStore( useShallow((s) => Object.keys(s.conversations)), ); - const { selectConversation } = useHistoryActions(); + const { selectConversation, loadSharedConversation, newConversation } = + useHistoryActions(); const params = useParams(); const conversationId = params.conversationId; - const isValidConversation = + const isKnown = conversationId && typeof conversationId === "string" && conversations.includes(conversationId); + const isTemp = + typeof conversationId === "string" && + isTemporaryConversation(conversationId); + const isServerOnly = useHistoryStore( + (s) => + conversationId != null && + s.conversations[conversationId]?.isServerOnly === true, + ); + const [loading, setLoading] = useState(false); useEffect(() => { - if (isValidConversation) { + const fallbackToHomeConversation = () => { + const newestConversation = conversations.at(-1); + const target = newestConversation ?? newConversation(); + selectConversation(target); + navigate(getConversationRoute(target), { replace: true }); + }; + + // Temp IDs are local-only placeholders for unsent conversations; the + // backend has no record of them, so don't waste a round-trip just to 404. + const needsFetch = !isTemp && (!isKnown || isServerOnly); + + if (conversationId && needsFetch && !loading) { + setLoading(true); + loadSharedConversation(conversationId, ragbitsClient).then((loaded) => { + setLoading(false); + if (loaded) { + selectConversation(conversationId); + } else if (isKnown) { + selectConversation(conversationId); + } else { + fallbackToHomeConversation(); + } + }); + return; + } + + if (isKnown && !isServerOnly) { selectConversation(conversationId); return; } - const newestConversation = conversations.at(-1); - if (!newestConversation) { - throw new Error("No conversation to navigate to"); + // Either no conversationId in the route, or a temp/local id that the + // store no longer knows about (e.g. after a logout/login wipe). Either + // way, fall back to the most recent conversation we have, or spin up a + // brand-new one if the store is empty. + if (!conversationId || (isTemp && !isKnown)) { + fallbackToHomeConversation(); } - selectConversation(newestConversation); - navigate(getConversationRoute(newestConversation), { replace: true }); }, [ conversations, - isValidConversation, + isKnown, + isTemp, + isServerOnly, navigate, selectConversation, + loadSharedConversation, + newConversation, conversationId, + loading, + ragbitsClient, ]); return children; diff --git a/typescript/ui/src/plugins/SharePlugin/components/ShareButton.tsx b/typescript/ui/src/plugins/SharePlugin/components/ShareButton.tsx index cfa40bc2ff..ddfecb7ed3 100644 --- a/typescript/ui/src/plugins/SharePlugin/components/ShareButton.tsx +++ b/typescript/ui/src/plugins/SharePlugin/components/ShareButton.tsx @@ -1,177 +1,168 @@ -import { strToU8, zlibSync, strFromU8, unzlibSync } from "fflate"; import { Button, + Chip, + Divider, + Input, Modal, ModalBody, ModalContent, + ModalFooter, ModalHeader, useDisclosure, } from "@heroui/react"; import { Icon } from "@iconify/react"; import DelayedTooltip from "../../../core/components/DelayedTooltip"; -import { useState, useRef, useEffect } from "react"; -import { toJSONSafe } from "../../../core/utils/json"; -import { Conversation } from "../../../core/types/history"; -import { useHistoryPrimitives } from "../../../core/stores/HistoryStore/selectors"; -import { useNavigate } from "react-router"; -import { getConversationRoute } from "../../ChatHistoryPlugin/utils"; +import { useState, useEffect, useCallback } from "react"; +import { useHistoryStore } from "../../../core/stores/HistoryStore/useHistoryStore"; +import { useConversationProperty } from "../../../core/stores/HistoryStore/selectors"; +import { + useRagbitsCall, + useRagbitsContext, + type ConversationShareResponse, +} from "@ragbits/api-client-react"; const DEFAULT_ICON = "heroicons:share"; const SUCCESS_ICON = "heroicons:check"; -const SHARE_TAG = "RAGBITS-STATE"; -const SHARE_START_TAG = `<${SHARE_TAG}>`; -const SHARE_END_TAG = ``; - -interface SharedState { - history: Conversation["history"]; - followupMessages: Conversation["followupMessages"]; - chatOptions: Conversation["chatOptions"]; - serverState: Conversation["serverState"]; - conversationId: Conversation["conversationId"]; -} - -function isSharedState(value: unknown): value is SharedState { - if (typeof value !== "object" || value === null) return false; - - const state = value as Partial; - if (typeof state.history !== "object") return false; - if ("followupMessages" in state && typeof state.followupMessages !== "object") - return false; - if ("chatOptions" in state && typeof state.chatOptions !== "object") - return false; - if ("serverState" in state && typeof state.serverState !== "object") - return false; - if ( - "conversationId" in state && - typeof state.conversationId !== "string" && - typeof state.conversationId !== "object" - ) - return false; - - return true; -} export default function ShareButton() { - const { restore, getCurrentConversation } = useHistoryPrimitives(); const { isOpen, onOpen, onClose } = useDisclosure(); - const [icon, setIcon] = useState(DEFAULT_ICON); - const iconTimerRef = useRef | null>(null); - const navigate = useNavigate(); - - const onShare = () => { - const { - chatOptions, - history, - serverState, - conversationId, - followupMessages, - } = getCurrentConversation(); - - const state = toJSONSafe({ - chatOptions, - history: history, - serverState, - conversationId, - followupMessages, - }); - const buffer = strToU8( - `${SHARE_START_TAG}${JSON.stringify(state)}${SHARE_END_TAG}`, - ); - const encodedState = btoa(strFromU8(zlibSync(buffer, { level: 9 }), true)); - - navigator.clipboard.writeText(encodedState); - setIcon(SUCCESS_ICON); - onClose(); - - if (iconTimerRef.current) { - clearTimeout(iconTimerRef.current); + const [inputValue, setInputValue] = useState(""); + const [pendingRecipients, setPendingRecipients] = useState([]); + const [existingRecipients, setExistingRecipients] = useState< + ConversationShareResponse[] + >([]); + const [isLoading, setIsLoading] = useState(false); + const [error, setError] = useState(null); + const [headerIcon, setHeaderIcon] = useState(DEFAULT_ICON); + + const conversationId = useHistoryStore((s) => s.currentConversation); + const isShared = useConversationProperty((s) => s.isShared); + const { client } = useRagbitsContext(); + + const updateShares = useRagbitsCall( + "/api/conversations/:conversationId/shares", + { method: "PUT" }, + ); + const revokeShareCall = useRagbitsCall( + "/api/conversations/:conversationId/shares/:recipient", + { method: "DELETE" }, + ); + + const loadShares = useCallback(async () => { + if (!conversationId) return; + setIsLoading(true); + try { + const detail = await client.makeRequest( + "/api/conversations/:conversationId", + { + method: "GET", + pathParams: { conversationId }, + }, + ); + setExistingRecipients(detail?.shares ?? []); + } catch (err) { + console.error("Failed to load shares", err); + setError("Failed to load shares"); + } finally { + setIsLoading(false); } - iconTimerRef.current = setTimeout(() => { - setIcon(DEFAULT_ICON); - }, 2000); + }, [conversationId, client]); + + useEffect(() => { + if (isOpen) { + loadShares(); + setPendingRecipients([]); + setInputValue(""); + setError(null); + } + // We intentionally omit loadShares from deps - it's rebuilt on every render + // by useRagbitsCall and would cause an infinite reload loop. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [isOpen]); + + const addRecipient = () => { + const value = inputValue.trim(); + if (!value) return; + + const allRecipients = [ + ...existingRecipients.map((r) => r.recipient), + ...pendingRecipients, + ]; + if (allRecipients.some((r) => r.toLowerCase() === value.toLowerCase())) { + setError("Already added"); + return; + } + + setPendingRecipients((prev) => [...prev, value]); + setInputValue(""); + setError(null); }; - const onOpenChange = () => { - onClose(); + const removePending = (recipient: string) => { + setPendingRecipients((prev) => prev.filter((r) => r !== recipient)); }; - useEffect(() => { - const decode = (e: ClipboardEvent) => { - if (!e.clipboardData) { - console.warn("[Share] Nothing to parse, skipping."); - return; - } + const removeExisting = async (recipient: string) => { + try { + await revokeShareCall.call({ + pathParams: { conversationId, recipient }, + }); + setExistingRecipients((prev) => + prev.filter((r) => r.recipient !== recipient), + ); + } catch (err) { + console.error("Failed to revoke share", err); + setError("Failed to remove recipient"); + } + }; + + const handleSave = async () => { + if (pendingRecipients.length === 0 && existingRecipients.length > 0) { + onClose(); + return; + } - const types = e.clipboardData.types; - if (!types.includes("text/plain") && !types.includes("text")) { - console.warn( - "[Share] Invalid content type of pasted content, skipping.", - ); + try { + const allRecipients = [ + ...existingRecipients.map((r) => r.recipient), + ...pendingRecipients, + ]; + if (allRecipients.length === 0) { + onClose(); return; } + const updated = await updateShares.call({ + pathParams: { conversationId }, + body: { + recipients: allRecipients as [string, ...string[]], + }, + }); + setExistingRecipients(updated ?? []); + setPendingRecipients([]); + onClose(); + } catch (err) { + console.error("Failed to share conversation", err); + setError("Failed to share conversation"); + } + }; - const pastedText = - e.clipboardData.getData("text/plain") ?? - e.clipboardData.getData("text"); - try { - const pastedBinary = atob(pastedText); - - if (!pastedBinary.startsWith("\x78\xDA")) { - // No zlib header, ignore - console.warn("[Share] Incorrect header, skipping."); - return; - } - - // Try to decode and check for the existence of the state tags - const parsedText = strFromU8(unzlibSync(strToU8(pastedBinary, true))); - if ( - !parsedText.startsWith(SHARE_START_TAG) || - !parsedText.endsWith(SHARE_END_TAG) - ) { - console.warn( - "[Share] Failed to parse as valid Ragbits state, skipping.", - ); - return; - } - - e.preventDefault(); - e.stopPropagation(); - - const stateText = parsedText.slice( - SHARE_START_TAG.length, - -SHARE_END_TAG.length, - ); - const parsedState = JSON.parse(stateText); - if (!isSharedState(parsedState)) { - console.warn( - "[Share] Pasted state didn't pass validation, skipping.", - ); - return; - } - - const restoredConversationId = restore( - parsedState.history, - parsedState.followupMessages, - parsedState.chatOptions, - parsedState.serverState, - parsedState.conversationId, - ); - - navigate(getConversationRoute(restoredConversationId)); - } catch (e) { - console.error( - "[Share] Couldn't parse pasted string as valid Ragbits state", - e, - ); - } - }; + const copyLink = () => { + const url = `${window.location.origin}/conversation/${conversationId}`; + navigator.clipboard.writeText(url); + setHeaderIcon(SUCCESS_ICON); + setTimeout(() => setHeaderIcon(DEFAULT_ICON), 2000); + }; - window.addEventListener("paste", decode); + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === "Enter" || e.key === ",") { + e.preventDefault(); + addRecipient(); + } + }; + + if (isShared) return null; - return () => { - window.removeEventListener("paste", decode); - }; - }); + const isSaving = updateShares.isLoading; return ( <> @@ -183,47 +174,119 @@ export default function ShareButton() { aria-label="Share conversation" onPress={onOpen} > - + - + - {(onClose) => ( - <> - - Share conversation - - -
-

- You are about to copy a code that allows sharing and storing - your current app state. Once copied, you can paste this code - anywhere on the site to instantly return to this exact - setup. It’s a quick way to save your progress or share it - with others. -

-
- - -
+ {r} + + ))}
-
- - )} + )} + + {existingRecipients.length > 0 && ( + <> + +
+ + Shared with + + {existingRecipients.map((share) => ( +
+ + {share.recipient} + + +
+ ))} +
+ + )} + + {isLoading && ( + Loading... + )} + + + + + + +
+ + +
+
diff --git a/typescript/ui/src/plugins/SharePlugin/components/SharedBanner.tsx b/typescript/ui/src/plugins/SharePlugin/components/SharedBanner.tsx new file mode 100644 index 0000000000..31a8b5fdf0 --- /dev/null +++ b/typescript/ui/src/plugins/SharePlugin/components/SharedBanner.tsx @@ -0,0 +1,16 @@ +import { Icon } from "@iconify/react"; +import { useConversationProperty } from "../../../core/stores/HistoryStore/selectors"; + +export default function SharedBanner() { + const isShared = useConversationProperty((s) => s.isShared); + const sharedBy = useConversationProperty((s) => s.sharedBy); + + if (!isShared || !sharedBy) return null; + + return ( +
+ + Shared by {sharedBy} +
+ ); +} diff --git a/typescript/ui/src/plugins/SharePlugin/components/SharedItemIcon.tsx b/typescript/ui/src/plugins/SharePlugin/components/SharedItemIcon.tsx new file mode 100644 index 0000000000..bb23e6e885 --- /dev/null +++ b/typescript/ui/src/plugins/SharePlugin/components/SharedItemIcon.tsx @@ -0,0 +1,24 @@ +import { Icon } from "@iconify/react"; +import { useHistoryStore } from "../../../core/stores/HistoryStore/useHistoryStore"; + +interface SharedItemIconProps { + conversationId: string; +} + +export default function SharedItemIcon({ + conversationId, +}: SharedItemIconProps) { + const isShared = useHistoryStore( + (s) => s.conversations[conversationId]?.isShared ?? false, + ); + + if (!isShared) return null; + + return ( + + ); +} diff --git a/typescript/ui/src/plugins/SharePlugin/index.tsx b/typescript/ui/src/plugins/SharePlugin/index.tsx index 18d8109a95..25d0e57811 100644 --- a/typescript/ui/src/plugins/SharePlugin/index.tsx +++ b/typescript/ui/src/plugins/SharePlugin/index.tsx @@ -3,12 +3,20 @@ import { createPlugin } from "../../core/utils/plugins/utils"; import { makeSlot } from "../../core/utils/slots/utils"; const ShareButton = lazy(() => import("./components/ShareButton")); +const SharedBanner = lazy(() => import("./components/SharedBanner")); +const SharedItemIcon = lazy(() => import("./components/SharedItemIcon")); export const SharePluginName = "SharePluginName"; export const SharePlugin = createPlugin({ name: SharePluginName, components: { ShareButton, + SharedBanner, + SharedItemIcon, }, - slots: [makeSlot("layout.headerActions", ShareButton, 5)], + slots: [ + makeSlot("layout.headerActions", ShareButton, 5), + makeSlot("chat.banner.top", SharedBanner, 10), + makeSlot("chatHistory.itemDecorator", SharedItemIcon, 10), + ], }); diff --git a/typescript/ui/src/ragbits/stores/HistoryStore/historyStore.ts b/typescript/ui/src/ragbits/stores/HistoryStore/historyStore.ts index ff6204b944..5426894e92 100644 --- a/typescript/ui/src/ragbits/stores/HistoryStore/historyStore.ts +++ b/typescript/ui/src/ragbits/stores/HistoryStore/historyStore.ts @@ -1,7 +1,9 @@ import { ChatRequest, ChatResponse, + HttpError, MessageRole, + RagbitsClient, } from "@ragbits/api-client-react"; import { ChatMessage, @@ -18,7 +20,6 @@ import { initialHistoryValues, isTemporaryConversation, updateConversation, - getTemporaryConversationId, initialConversationValues, } from "../../../core/stores/HistoryStore/utils"; import { v4 as uuidv4 } from "uuid"; @@ -159,34 +160,6 @@ export const createHistoryStore = immer((set, get) => ({ return conversation; }, - restore: ( - history: Conversation["history"], - followupMessages: Conversation["followupMessages"], - chatOptions: Conversation["chatOptions"], - serverState: Conversation["serverState"], - ) => { - // Copied conversation should be treated as temporary one, it would get it's own - // id after first message - const conversationId = getTemporaryConversationId(); - const conversation: Conversation = { - ...initialConversationValues(), - followupMessages, - chatOptions, - serverState, - history, - conversationId, - }; - const nonUserMessages = Object.values(history).filter( - (m) => m.role !== MessageRole.User, - ); - conversation.eventsLog = nonUserMessages.map(() => []); - set((draft: HistoryStore) => { - draft.conversations[conversationId] = conversation; - draft.currentConversation = conversationId; - }); - - return conversationId; - }, addMessage: (conversationId, message) => { const id = uuidv4(); @@ -251,14 +224,36 @@ export const createHistoryStore = immer((set, get) => ({ draft.currentConversation = conversationId; }); }, - deleteConversation: (conversationId) => { + deleteConversation: (conversationId, ragbitsClient) => { const { actions: { newConversation }, primitives: { stopAnswering }, currentConversation, + conversations, } = get(); stopAnswering(conversationId); + const conv = conversations[conversationId]; + const isPersisted = !isTemporaryConversation(conversationId); + if (isPersisted && ragbitsClient) { + const serverCall = conv?.isShared + ? ragbitsClient.makeRequest("/api/shared/:conversationId", { + method: "DELETE", + pathParams: { conversationId }, + }) + : ragbitsClient.makeRequest("/api/conversations/:conversationId", { + method: "DELETE", + pathParams: { conversationId }, + }); + serverCall.catch((err) => { + // 404 means the row is already gone server-side (deleted in another + // tab, share revoked, stale localStorage entry). Local removal is + // already happening below, so treat it as success. + if (err instanceof HttpError && err.status === 404) return; + console.error(`Failed to delete conversation ${conversationId}`, err); + }); + } + set((draft) => { delete draft.conversations[conversationId]; }); @@ -342,6 +337,121 @@ export const createHistoryStore = immer((set, get) => ({ return newConversation.conversationId; }, + loadServerConversations: async (ragbitsClient: RagbitsClient) => { + let metas; + try { + metas = await ragbitsClient.makeRequest("/api/conversations", { + method: "GET", + }); + } catch (err) { + console.error("Failed to load server conversations", err); + return; + } + set((draft: HistoryStore) => { + const serverIds = new Set((metas ?? []).map((m) => m.conversation_id)); + + // Drop persisted conversations that no longer exist on the server. + // The server is authoritative for any non-temp conversation: if it + // didn't return it, the conversation was deleted, the share was + // revoked, or it was dismissed. We keep the currently selected + // conversation around so a redirect (handled by ConversationGuard) + // can resolve cleanly instead of crashing on a missing entry. + for (const id of Object.keys(draft.conversations)) { + if ( + !isTemporaryConversation(id) && + id !== draft.currentConversation && + !serverIds.has(id) + ) { + delete draft.conversations[id]; + } + } + + for (const meta of metas ?? []) { + const existing = draft.conversations[meta.conversation_id]; + if (existing) { + if (meta.is_shared) { + existing.isShared = true; + existing.sharedBy = meta.shared_by ?? undefined; + } + if (meta.summary && !existing.summary) { + existing.summary = meta.summary; + } + } else { + draft.conversations[meta.conversation_id] = { + ...initialConversationValues(), + conversationId: meta.conversation_id, + summary: meta.summary ?? undefined, + isShared: meta.is_shared ?? false, + sharedBy: meta.shared_by ?? undefined, + isServerOnly: true, + }; + } + } + }); + }, + + loadSharedConversation: async ( + conversationId: string, + ragbitsClient: RagbitsClient, + ) => { + let detail; + try { + detail = await ragbitsClient.makeRequest( + "/api/conversations/:conversationId", + { + method: "GET", + pathParams: { conversationId }, + }, + ); + } catch (err) { + // 404 just means the user has no access to this conversation (never + // existed, share revoked, deleted) — that's an expected outcome of + // following a stale link, not a bug worth logging. + if (!(err instanceof HttpError && err.status === 404)) { + console.error( + `Failed to load shared conversation ${conversationId}`, + err, + ); + } + return false; + } + if (!detail) return false; + + const history: Record = {}; + let lastId: string | null = null; + for (const interaction of detail.messages) { + const userMsgId = interaction.message_id ?? uuidv4(); + history[userMsgId] = { + id: userMsgId, + role: MessageRole.User, + content: interaction.message, + }; + const botMsgId = `${userMsgId}-response`; + history[botMsgId] = { + id: botMsgId, + role: MessageRole.Assistant, + content: interaction.response, + }; + lastId = botMsgId; + } + + set((draft: HistoryStore) => { + const existing = draft.conversations[detail.conversation_id]; + const conv: Conversation = { + ...initialConversationValues(), + conversationId: detail.conversation_id, + summary: existing?.summary, + isShared: detail.is_shared ?? false, + sharedBy: detail.shared_by ?? undefined, + isServerOnly: false, + history, + lastMessageId: lastId, + }; + draft.conversations[detail.conversation_id] = conv; + }); + return true; + }, + sendMessage: (text, ragbitsClient, additionalContext) => { const { _internal: { handleResponse }, @@ -349,7 +459,9 @@ export const createHistoryStore = immer((set, get) => ({ computed: { getContext }, } = get(); - const { history, conversationId } = getCurrentConversation(); + const { history, conversationId, isShared } = getCurrentConversation(); + + if (isShared) return; addMessage(conversationId, { role: MessageRole.User, diff --git a/uv.lock b/uv.lock index be72be6434..2b89e32620 100644 --- a/uv.lock +++ b/uv.lock @@ -5717,7 +5717,7 @@ wheels = [ [[package]] name = "ragbits" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits" } dependencies = [ { name = "ragbits-agents" }, @@ -5847,7 +5847,7 @@ provides-extras = ["openai", "chroma", "local", "fastembed", "promptfoo", "otel" [[package]] name = "ragbits-agents" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-agents" } dependencies = [ { name = "ragbits-core" }, @@ -5883,7 +5883,7 @@ provides-extras = ["a2a", "mcp", "openai", "cli"] [[package]] name = "ragbits-chat" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-chat" } dependencies = [ { name = "bcrypt" }, @@ -5915,7 +5915,7 @@ provides-extras = ["sql"] [[package]] name = "ragbits-cli" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-cli" } dependencies = [ { name = "ragbits-core" }, @@ -5930,7 +5930,7 @@ requires-dist = [ [[package]] name = "ragbits-core" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-core" } dependencies = [ { name = "aiohttp" }, @@ -5990,6 +5990,9 @@ otel = [ pgvector = [ { name = "asyncpg" }, ] +postgres = [ + { name = "asyncpg" }, +] promptfoo = [ { name = "pyyaml" }, ] @@ -5999,6 +6002,9 @@ qdrant = [ s3 = [ { name = "boto3" }, ] +sqlite = [ + { name = "aiosqlite" }, +] weaviate = [ { name = "weaviate-client" }, ] @@ -6007,7 +6013,9 @@ weaviate = [ requires-dist = [ { name = "accelerate", marker = "extra == 'local'", specifier = ">=1.7.0" }, { name = "aiohttp", specifier = ">=3.13.3,<4.0.0" }, + { name = "aiosqlite", marker = "extra == 'sqlite'", specifier = ">=0.19.0,<1.0.0" }, { name = "asyncpg", marker = "extra == 'pgvector'", specifier = ">=0.30.0,<1.0.0" }, + { name = "asyncpg", marker = "extra == 'postgres'", specifier = ">=0.29.0,<1.0.0" }, { name = "azure-core", marker = "extra == 'azure'", specifier = ">=1.38.0,<2.0.0" }, { name = "azure-identity", marker = "extra == 'azure'", specifier = ">=1.19.0,<2.0.0" }, { name = "azure-storage-blob", marker = "extra == 'azure'", specifier = ">=12.24.1,<13.0.0" }, @@ -6043,11 +6051,11 @@ requires-dist = [ { name = "typer", specifier = ">=0.12.5,<1.0.0" }, { name = "weaviate-client", marker = "extra == 'weaviate'", specifier = ">=4.15.4,<5.0.0" }, ] -provides-extras = ["chroma", "local", "fastembed", "promptfoo", "otel", "logfire", "qdrant", "pgvector", "fastembed-gpu", "azure", "gcs", "hf", "s3", "google-drive", "weaviate"] +provides-extras = ["chroma", "local", "fastembed", "promptfoo", "otel", "logfire", "qdrant", "pgvector", "fastembed-gpu", "azure", "gcs", "hf", "s3", "google-drive", "weaviate", "postgres", "sqlite"] [[package]] name = "ragbits-document-search" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-document-search" } dependencies = [ { name = "docling", extra = ["easyocr"] }, @@ -6087,7 +6095,7 @@ provides-extras = ["unstructured", "ray"] [[package]] name = "ragbits-evaluate" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-evaluate" } dependencies = [ { name = "datasets" }, @@ -6125,7 +6133,7 @@ provides-extras = ["agents", "document-search", "relari"] [[package]] name = "ragbits-guardrails" -version = "1.7.0.dev202604150306" +version = "1.7.0.dev202604280307" source = { editable = "packages/ragbits-guardrails" } dependencies = [ { name = "ragbits-core" }, @@ -6150,9 +6158,9 @@ source = { virtual = "." } dependencies = [ { name = "mike" }, { name = "ragbits-agents", extra = ["a2a", "cli", "mcp"] }, - { name = "ragbits-chat" }, + { name = "ragbits-chat", extra = ["sql"] }, { name = "ragbits-cli" }, - { name = "ragbits-core", extra = ["azure", "chroma", "fastembed", "gcs", "google-drive", "hf", "local", "logfire", "otel", "pgvector", "qdrant", "s3", "weaviate"] }, + { name = "ragbits-core", extra = ["azure", "chroma", "fastembed", "gcs", "google-drive", "hf", "local", "logfire", "otel", "pgvector", "postgres", "qdrant", "s3", "sqlite", "weaviate"] }, { name = "ragbits-document-search", extra = ["ray", "unstructured"] }, { name = "ragbits-evaluate", extra = ["relari"] }, { name = "ragbits-guardrails", extra = ["openai"] }, @@ -6189,9 +6197,9 @@ dev = [ requires-dist = [ { name = "mike", specifier = ">=2.1.3" }, { name = "ragbits-agents", extras = ["a2a", "cli", "mcp"], editable = "packages/ragbits-agents" }, - { name = "ragbits-chat", editable = "packages/ragbits-chat" }, + { name = "ragbits-chat", extras = ["sql"], editable = "packages/ragbits-chat" }, { name = "ragbits-cli", editable = "packages/ragbits-cli" }, - { name = "ragbits-core", extras = ["chroma", "fastembed", "local", "otel", "logfire", "qdrant", "pgvector", "weaviate", "azure", "gcs", "hf", "s3", "google-drive"], editable = "packages/ragbits-core" }, + { name = "ragbits-core", extras = ["chroma", "fastembed", "local", "otel", "logfire", "qdrant", "pgvector", "weaviate", "azure", "gcs", "hf", "s3", "google-drive", "postgres", "sqlite"], editable = "packages/ragbits-core" }, { name = "ragbits-document-search", extras = ["unstructured", "ray"], editable = "packages/ragbits-document-search" }, { name = "ragbits-evaluate", extras = ["relari"], editable = "packages/ragbits-evaluate" }, { name = "ragbits-guardrails", extras = ["openai"], editable = "packages/ragbits-guardrails" },