diff --git a/.gitignore b/.gitignore index 385ff42..65e1796 100644 --- a/.gitignore +++ b/.gitignore @@ -102,6 +102,7 @@ dmypy.json # Playwright tests/e2e/playwright-report/ tests/e2e/test-results/ +tests/e2e/.auth/ # Misc local files logs.txt diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..2cf4ffc --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,63 @@ +# OneAlert Mission Control Design System + +## Physical scene + +An analyst uses OneAlert on a 24–27 inch monitor during a long shift in a dim operations room, repeatedly scanning changing severity, device, and approval signals. A low-glare dark theme with restrained high-contrast accents is therefore the default. + +## Color strategy + +Restrained tinted neutrals with semantic data colors. Cyan is used for navigation, focus, and primary actions—not decoration. + +- Canvas: ink/navy 950–900. +- Elevated surfaces: navy 875–800. +- Borders: cool slate 750–650. +- Primary: cyan 500–300. +- Danger: rose/red 500–300. +- Warning: amber 500–300. +- Success: emerald 500–300. +- Text: tinted neutral 50–500; pure white and pure black are avoided. + +The Tailwind theme in `frontend-v2/src/index.css` is the source of truth. Components consume semantic tokens rather than ad-hoc colors. + +## Typography + +- UI: Inter/system sans, compact and highly legible. +- Technical data: ui-monospace for IPs, CVEs, ports, IDs, timestamps, and generated queries. +- Page titles: 24–30px, 700 weight. +- Section titles: 16–18px, 600–700 weight. +- Body: 13–14px. +- Labels/eyebrows: 10–12px with restrained tracking. + +## Geometry and elevation + +- 4px base spacing scale: 4, 8, 12, 16, 24, 32, 48. +- Controls: 36–40px; mobile touch targets at least 44px. +- Radii: 4px for tokens, 8px for controls/panels, 12px only for major overlays. +- Panels use borders and tonal separation; shadows are reserved for overlays and sticky command surfaces. + +## Application shell + +- Desktop: fixed 248px grouped sidebar and sticky 56px command bar. +- Tablet: collapsible/icon-aware navigation. +- Mobile: compact command bar plus modal navigation drawer; dense tables scroll horizontally. +- Main content uses a fluid grid and wide working area, not a narrow centered container. + +## Standard page anatomy + +1. Page header: eyebrow/breadcrumb, title, context, primary action. +2. Operational strip: compact key counts, scope, freshness, and health. +3. Filter/action bar: search, filters, result count, reset/retry. +4. Primary work surface: dense table, timeline, graph, or investigation view. +5. Contextual detail: drawer or secondary panel without losing list position. + +## Required states + +Every remote-data surface defines loading skeleton, populated, filtered-empty, true-empty, partial failure, full failure with retry, stale/refreshing, and permission/session failure. Errors use icon + title + actionable explanation and never collapse to zero-valued metrics. + +## Interaction and accessibility + +- Semantic buttons, links, tables, headings, labels, and status regions. +- Visible focus; keyboard-accessible navigation/drawers/dialogs; Escape closes overlays. +- Status never relies on color alone. +- Motion is functional and under 250ms; `prefers-reduced-motion` disables it. +- Charts have textual summaries or labels. diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 0000000..00b715f --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,40 @@ +# OneAlert Product Context + +## Register + +Product UI — an operational security application where design serves fast, accurate decisions. + +## Product purpose + +OneAlert is an open-source AI-assisted security operations platform for industrial and OT/ICS networks. It gives small and mid-sized operators the asset visibility, alert triage, investigation, response, hunting, validation, and audit workflows normally found in expensive enterprise platforms. + +## Primary users + +- SOC analysts who continuously scan dense alert, event, and investigation data. +- OT engineers who need device, Purdue-level, protocol, and topology context without disrupting operations. +- Security managers who prioritize exposure, approvals, and response readiness. + +## Product principles + +1. Preserve operational density; improve hierarchy instead of hiding information. +2. Every summary must lead to a filtered, actionable detail view. +3. OT safety and human approval gates must remain visible near risky actions. +4. Partial, stale, failed, and empty data must never look like a healthy zero state. +5. Technical identifiers remain easy to scan and copy. +6. Accessibility and keyboard operation are production requirements. + +## Brand and tone + +OneAlert should feel calm under pressure: precise, credible, industrial, and quietly advanced. Language is direct and operational. The interface avoids consumer-app playfulness, neon cyberpunk decoration, excessive gradients, and large low-information cards. + +## Approved visual direction + +Dense “Mission Control”: tinted near-black/navy surfaces, cool cyan as the primary interactive signal, amber for attention, red only for genuine danger, and green only for verified healthy states. The interface uses compact typography, strong alignment, restrained borders, and purposeful depth. + +## Competitive references + +- Claroty: asset categorization and risk-first inventory summaries. +- Nozomi Vantage: global-to-site health and drill-down. +- Dragos Platform: prioritized insights that unify alerts, vulnerabilities, assets, and guidance. +- Tenable OT: dense role-specific dashboards, interactive widgets, and graph/table drill-down. +- Mosaic/enterprise admin patterns: consistent React/Tailwind navigation, tables, filters, and responsive structure. diff --git a/backend/demo.py b/backend/demo.py index ddee038..2a07b10 100644 --- a/backend/demo.py +++ b/backend/demo.py @@ -21,7 +21,7 @@ uvicorn.run( "backend.main:app", - host="0.0.0.0", + host="127.0.0.1", port=8000, reload=False, log_level="info", diff --git a/backend/models/organization.py b/backend/models/organization.py index b72cd1a..c769582 100644 --- a/backend/models/organization.py +++ b/backend/models/organization.py @@ -9,12 +9,12 @@ request/response validation and serialization. """ -from sqlalchemy import Column, Integer, String, DateTime, Boolean +from sqlalchemy import Column, Integer, String, DateTime from sqlalchemy.orm import relationship from sqlalchemy.sql import func from backend.database.db import Base -from pydantic import BaseModel -from typing import Optional +from pydantic import BaseModel, ConfigDict +from typing import Literal, Optional from datetime import datetime @@ -41,8 +41,8 @@ class OrgCreate(BaseModel): """Schema for organization creation.""" name: str slug: str - plan: str = "free" - model_config = {"from_attributes": True} + plan: Literal["free"] = "free" + model_config = ConfigDict(from_attributes=True, extra="forbid") class OrgResponse(BaseModel): @@ -60,7 +60,4 @@ class OrgResponse(BaseModel): class OrgUpdate(BaseModel): """Schema for organization updates.""" name: Optional[str] = None - plan: Optional[str] = None - max_assets: Optional[int] = None - max_users: Optional[int] = None - model_config = {"from_attributes": True} + model_config = ConfigDict(from_attributes=True, extra="forbid") diff --git a/backend/models/user.py b/backend/models/user.py index 147bfef..ca10f0e 100644 --- a/backend/models/user.py +++ b/backend/models/user.py @@ -12,13 +12,14 @@ from sqlalchemy.orm import relationship from sqlalchemy.sql import func from backend.database.db import Base -from pydantic import BaseModel, Field, EmailStr # Ensure compatibility with Pydantic v2 +from pydantic import BaseModel, EmailStr, field_validator from typing import Optional, List from datetime import datetime -from fastapi import Depends, HTTPException, status +from fastapi import Depends from backend.database.db import get_async_db from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy import select +from backend.services.auth_service import validate_new_password class User(Base): @@ -78,6 +79,11 @@ class UserBase(BaseModel): class UserCreate(UserBase): """Schema for user creation.""" password: str + + @field_validator("password") + @classmethod + def validate_password(cls, value: str) -> str: + return validate_new_password(value) model_config = {"from_attributes": True} @@ -105,20 +111,26 @@ class UserUpdate(BaseModel): webhook_url: Optional[str] = None mfa_enabled: Optional[bool] = False mfa_secret: Optional[str] = None + + @field_validator("password") + @classmethod + def validate_password(cls, value: Optional[str]) -> Optional[str]: + return validate_new_password(value) if value is not None else value model_config = {"from_attributes": True} -class UserResponse(UserBase): +class UserResponse(BaseModel): """Schema for user response.""" id: int + email: EmailStr + full_name: Optional[str] = None + company: Optional[str] = None is_active: bool is_verified: bool created_at: datetime updated_at: Optional[datetime] = None org_id: Optional[int] = None - slack_webhook_url: Optional[str] = None - webhook_url: Optional[str] = None mfa_enabled: Optional[bool] = False model_config = {"from_attributes": True} @@ -141,4 +153,4 @@ class TokenData(BaseModel): async def list_users(db: AsyncSession = Depends(get_async_db)) -> List[User]: result = await db.execute(select(User)) - return result.scalars().all() \ No newline at end of file + return result.scalars().all() diff --git a/backend/routers/auth.py b/backend/routers/auth.py index cd560be..020907d 100644 --- a/backend/routers/auth.py +++ b/backend/routers/auth.py @@ -6,15 +6,15 @@ from datetime import timedelta import secrets import time -from fastapi import APIRouter, Depends, HTTPException, status, Request +from fastapi import APIRouter, Depends, HTTPException, status, Request, Response from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy import select from typing import Optional, List from backend.database.db import get_async_db -from pydantic import BaseModel -from backend.models.user import User, UserCreate, UserResponse, Token, GitHubUserCreate +from pydantic import BaseModel, ConfigDict, HttpUrl, field_validator +from backend.models.user import User, UserCreate, UserResponse, Token from backend.models.audit_log import AuditLog from backend.services.auth_service import ( create_access_token, @@ -76,6 +76,12 @@ async def get_current_user( if user is None: raise credentials_exception + + if not user.is_active: + raise HTTPException( + status_code=status.HTTP_403_FORBIDDEN, + detail="Inactive user", + ) return user @@ -127,6 +133,7 @@ async def register_user( @limiter.limit("5/minute") async def login_user( request: Request, + response: Response, form_data: OAuth2PasswordRequestForm = Depends(), db: AsyncSession = Depends(get_async_db) ): @@ -171,9 +178,32 @@ async def login_user( data={"sub": user.email}, expires_delta=access_token_expires ) + response.set_cookie( + key="access_token", + value=access_token, + httponly=True, + secure=settings.environment == "production", + samesite="lax", + max_age=settings.access_token_expire_minutes * 60, + path="/", + ) + return {"access_token": access_token, "token_type": "bearer"} +@router.post("/logout") +async def logout_user(response: Response): + """Expire the browser session cookie; safe to call even when logged out.""" + response.delete_cookie( + key="access_token", + path="/", + secure=settings.environment == "production", + httponly=True, + samesite="lax", + ) + return {"success": True} + + @router.get("/me", response_model=UserResponse) async def read_current_user(current_user: User = Depends(get_active_user)): """Get current user profile.""" @@ -246,18 +276,30 @@ async def github_callback(code: str, state: Optional[str] = None): ) +class WebhookIntegrationsUpdate(BaseModel): + """Write-only notification endpoints; credentials are never serialized back.""" + + slack_webhook_url: Optional[HttpUrl] = None + webhook_url: Optional[HttpUrl] = None + model_config = ConfigDict(extra="forbid") + + @field_validator("slack_webhook_url", "webhook_url") + @classmethod + def require_https(cls, value: Optional[HttpUrl]) -> Optional[HttpUrl]: + if value is not None and value.scheme != "https": + raise ValueError("Webhook URLs must use HTTPS") + return value + + @router.patch("/me/integrations", response_model=UserResponse) async def update_my_integrations( - slack_webhook_url: Optional[str] = None, - webhook_url: Optional[str] = None, + payload: WebhookIntegrationsUpdate, current_user: User = Depends(get_current_user), db: AsyncSession = Depends(get_async_db) ): """Update Slack/Webhook integration URLs for the current user.""" - if slack_webhook_url is not None: - current_user.slack_webhook_url = slack_webhook_url - if webhook_url is not None: - current_user.webhook_url = webhook_url + for field, value in payload.model_dump(exclude_unset=True).items(): + setattr(current_user, field, str(value) if value is not None else None) db.add(current_user) await db.commit() await db.refresh(current_user) diff --git a/backend/routers/billing.py b/backend/routers/billing.py index a5d1755..2f8d6f8 100644 --- a/backend/routers/billing.py +++ b/backend/routers/billing.py @@ -15,7 +15,6 @@ from backend.database.db import get_async_db from backend.models.subscription import ( Subscription, - SubscriptionResponse, PlanInfo, CheckoutRequest, PLAN_LIMITS, @@ -23,7 +22,7 @@ from backend.models.user import User from backend.models.asset import Asset from backend.models.organization import Organization -from backend.routers.auth import get_current_user +from backend.routers.auth import get_active_user from backend.services.billing_service import ( get_plan_info, PLAN_PRICES, @@ -38,6 +37,15 @@ STRIPE_WEBHOOK_SECRET = os.getenv("STRIPE_WEBHOOK_SECRET", "") +def _require_org_admin(current_user: User) -> None: + """Restrict subscription mutations to active organization admins.""" + if current_user.role != "admin": + raise HTTPException( + status_code=status.HTTP_403_FORBIDDEN, + detail="Only organization admins can manage billing", + ) + + @router.get("/plans", response_model=List[PlanInfo]) async def list_plans(): """List all available plans with pricing and limits.""" @@ -51,7 +59,7 @@ async def list_plans(): @router.get("/subscription") async def get_subscription( - current_user: User = Depends(get_current_user), + current_user: User = Depends(get_active_user), db: AsyncSession = Depends(get_async_db), ): """Get the current organization's subscription.""" @@ -103,7 +111,7 @@ async def get_subscription( @router.post("/checkout") async def create_checkout_session( checkout_req: CheckoutRequest, - current_user: User = Depends(get_current_user), + current_user: User = Depends(get_active_user), db: AsyncSession = Depends(get_async_db), ): """Create a Stripe checkout session for plan upgrade.""" @@ -113,6 +121,8 @@ async def create_checkout_session( detail="User does not belong to an organization", ) + _require_org_admin(current_user) + if checkout_req.plan not in ["starter", "pro", "enterprise"]: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, @@ -239,7 +249,7 @@ async def stripe_webhook( @router.post("/cancel") async def cancel_subscription( - current_user: User = Depends(get_current_user), + current_user: User = Depends(get_active_user), db: AsyncSession = Depends(get_async_db), ): """Cancel subscription at the end of the current billing period.""" @@ -249,6 +259,8 @@ async def cancel_subscription( detail="User does not belong to an organization", ) + _require_org_admin(current_user) + result = await db.execute( select(Subscription).where(Subscription.org_id == current_user.org_id) ) @@ -284,7 +296,7 @@ async def cancel_subscription( @router.get("/usage") async def get_usage( - current_user: User = Depends(get_current_user), + current_user: User = Depends(get_active_user), db: AsyncSession = Depends(get_async_db), ): """Get current usage vs plan limits for the organization.""" diff --git a/backend/routers/events.py b/backend/routers/events.py index c0ddb39..8aa74a5 100644 --- a/backend/routers/events.py +++ b/backend/routers/events.py @@ -8,7 +8,7 @@ from backend.database.db import get_async_db from backend.models.user import User from backend.models.security_event import ( - SecurityEvent, EventSource, SecurityEventResponse, + SecurityEvent, EventSource, EventBatchIngest, EventListResponse, EventSourceResponse, ) from backend.routers.auth import get_active_user @@ -20,6 +20,29 @@ router = APIRouter() +MAX_EVENT_UPLOAD_BYTES = 10 * 1024 * 1024 +UPLOAD_READ_CHUNK_BYTES = 64 * 1024 + + +async def _read_upload_with_limit( + file: UploadFile, + *, + max_bytes: int = MAX_EVENT_UPLOAD_BYTES, + chunk_size: int = UPLOAD_READ_CHUNK_BYTES, +) -> bytes: + """Read an upload without ever buffering more than the configured cap.""" + chunks = [] + total = 0 + while chunk := await file.read(chunk_size): + total += len(chunk) + if total > max_bytes: + raise HTTPException( + status_code=status.HTTP_413_CONTENT_TOO_LARGE, + detail="Uploaded file is too large", + ) + chunks.append(chunk) + return b"".join(chunks) + @router.post("/ingest", status_code=status.HTTP_201_CREATED) async def ingest_events_webhook( @@ -60,7 +83,7 @@ async def upload_events_file( """ from backend.services.event_ingestion import ingest_events - content = await file.read() + content = await _read_upload_with_limit(file) text = content.decode("utf-8", errors="replace") # Parse as JSON array or newline-delimited JSON diff --git a/backend/routers/integrations.py b/backend/routers/integrations.py index 5985ec3..e113dde 100644 --- a/backend/routers/integrations.py +++ b/backend/routers/integrations.py @@ -2,7 +2,6 @@ Integrations router for managing SIEM/SOAR integration configurations. Provides CRUD endpoints for integration configs plus connection testing. """ -from typing import List from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy import select @@ -20,6 +19,7 @@ from backend.services.integrations.sentinel import SentinelIntegration from backend.services.integrations.servicenow import ServiceNowIntegration from backend.services.integrations.pagerduty import PagerDutyIntegration +from backend.services.integrations.base import validate_outbound_url router = APIRouter() @@ -37,6 +37,30 @@ "pagerduty": PagerDutyIntegration, } +INTEGRATION_URL_FIELDS = { + "splunk": "hec_url", + "servicenow": "instance_url", +} + + +async def validate_integration_config(integration_type: str, config: dict) -> None: + """Validate any user-controlled outbound endpoint before persistence.""" + url_field = INTEGRATION_URL_FIELDS.get(integration_type) + if url_field and config.get(url_field): + await validate_outbound_url(config[url_field]) + + +async def _require_safe_integration_config( + integration_type: str, config: dict +) -> None: + try: + await validate_integration_config(integration_type, config) + except ValueError as exc: + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail="Integration endpoint must be a public HTTPS URL", + ) from exc + @router.get("/types") async def list_integration_types( @@ -78,6 +102,8 @@ async def create_integration( detail=f"Invalid integration type. Must be one of: {valid_types}", ) + await _require_safe_integration_config(payload.integration_type, payload.config) + config = IntegrationConfig( user_id=current_user.id, integration_type=payload.integration_type, @@ -113,6 +139,10 @@ async def update_integration( raise HTTPException(status_code=404, detail="Integration not found") update_data = payload.model_dump(exclude_unset=True) + if "config" in update_data: + await _require_safe_integration_config( + config.integration_type, update_data["config"] + ) for key, value in update_data.items(): setattr(config, key, value) diff --git a/backend/routers/organizations.py b/backend/routers/organizations.py index fda07a2..9f9892f 100644 --- a/backend/routers/organizations.py +++ b/backend/routers/organizations.py @@ -17,9 +17,6 @@ router = APIRouter() -VALID_PLANS = {"free", "starter", "pro", "enterprise"} - - @router.post("/", response_model=OrgResponse, status_code=status.HTTP_201_CREATED) async def create_organization( org_data: OrgCreate, @@ -27,13 +24,6 @@ async def create_organization( db: AsyncSession = Depends(get_async_db), ): """Create a new organization and assign the creator as admin.""" - # Validate plan - if org_data.plan not in VALID_PLANS: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail=f"Invalid plan. Must be one of: {', '.join(sorted(VALID_PLANS))}", - ) - # Check if user already belongs to an organization if current_user.org_id is not None: raise HTTPException( @@ -55,7 +45,7 @@ async def create_organization( org = Organization( name=org_data.name, slug=org_data.slug, - plan=org_data.plan, + plan="free", ) db.add(org) await db.flush() # Get org.id before assigning to user @@ -125,12 +115,6 @@ async def update_my_organization( # Apply updates update_data = org_update.model_dump(exclude_unset=True) - if "plan" in update_data and update_data["plan"] not in VALID_PLANS: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail=f"Invalid plan. Must be one of: {', '.join(sorted(VALID_PLANS))}", - ) - for field, value in update_data.items(): setattr(org, field, value) diff --git a/backend/routers/sensor_ingest.py b/backend/routers/sensor_ingest.py index 33c32c3..2723382 100644 --- a/backend/routers/sensor_ingest.py +++ b/backend/routers/sensor_ingest.py @@ -14,7 +14,7 @@ """ from typing import List, Dict, Any -from fastapi import APIRouter, Depends, HTTPException, status, Header +from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy import select import logging @@ -22,7 +22,7 @@ from backend.database.db import get_async_db from backend.models.user import User -from backend.models.discovered_device import DiscoveredDevice, DiscoveryMethod +from backend.models.discovered_device import DiscoveredDevice from backend.routers.auth import get_active_user logger = logging.getLogger(__name__) @@ -158,11 +158,11 @@ async def ingest_sensor_batch( except HTTPException: raise - except Exception as e: - logger.error(f"Sensor ingestion error: {e}") + except Exception: + logger.exception("Sensor ingestion failed") raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - detail=f"Ingestion error: {str(e)}" + detail="Unable to ingest sensor batch" ) @@ -186,11 +186,11 @@ async def ingest_single_device( "action": result.get("status") } - except Exception as e: - logger.error(f"Single device ingestion error: {e}") + except Exception: + logger.exception("Single device ingestion failed") raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - detail=str(e) + detail="Unable to ingest device" ) @@ -347,7 +347,7 @@ async def _calculate_risk_score(device_data: Dict[str, Any]) -> float: version_parts = firmware.split(".") if int(version_parts[0]) < 2: score += 20 - except: + except (ValueError, IndexError): pass # Factor 4: Missing critical protocol (if OT but no security/encr) diff --git a/backend/services/alert_senders/slack.py b/backend/services/alert_senders/slack.py index 8eecbd7..ccfe610 100644 --- a/backend/services/alert_senders/slack.py +++ b/backend/services/alert_senders/slack.py @@ -8,5 +8,5 @@ def __init__(self, webhook_url: str): def send_alert(self, alert): message = f"*{alert['title']}* ({alert['cve_id']})\n<{alert['url']}|View Details>" payload = {"text": message} - response = requests.post(self.webhook_url, json=payload) - response.raise_for_status() \ No newline at end of file + response = requests.post(self.webhook_url, json=payload, timeout=10, allow_redirects=False) + response.raise_for_status() diff --git a/backend/services/alert_senders/webhook.py b/backend/services/alert_senders/webhook.py index ec6c8a3..a7e218b 100644 --- a/backend/services/alert_senders/webhook.py +++ b/backend/services/alert_senders/webhook.py @@ -6,5 +6,5 @@ def __init__(self, url: str): self.url = url def send_alert(self, alert): - response = requests.post(self.url, json=alert) - response.raise_for_status() \ No newline at end of file + response = requests.post(self.url, json=alert, timeout=10, allow_redirects=False) + response.raise_for_status() diff --git a/backend/services/auth_service.py b/backend/services/auth_service.py index fa9c3ad..c6355dd 100644 --- a/backend/services/auth_service.py +++ b/backend/services/auth_service.py @@ -12,28 +12,33 @@ # Password hashing context pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") +MIN_PASSWORD_LENGTH = 8 +MAX_BCRYPT_PASSWORD_BYTES = 72 -def _truncate_password(password: str) -> str: - """Truncate password to 72 bytes (bcrypt limit) to avoid ValueError. - - Encodes to UTF-8, slices at 72 bytes, then decodes safely so that no - multi-byte character is split at the boundary. - """ - encoded = password.encode("utf-8") - if len(encoded) <= 72: - return password - return encoded[:72].decode("utf-8", errors="ignore") +def validate_new_password(password: str) -> str: + """Validate a new password without silently changing its credential bytes.""" + if len(password) < MIN_PASSWORD_LENGTH: + raise ValueError( + f"Password must be at least {MIN_PASSWORD_LENGTH} characters long" + ) + if len(password.encode("utf-8")) > MAX_BCRYPT_PASSWORD_BYTES: + raise ValueError( + f"Password must not exceed {MAX_BCRYPT_PASSWORD_BYTES} UTF-8 bytes" + ) + return password def verify_password(plain_password: str, hashed_password: str) -> bool: """Verify a plain password against its hash.""" - return pwd_context.verify(_truncate_password(plain_password), hashed_password) + if len(plain_password.encode("utf-8")) > MAX_BCRYPT_PASSWORD_BYTES: + return False + return pwd_context.verify(plain_password, hashed_password) def get_password_hash(password: str) -> str: """Generate password hash.""" - return pwd_context.hash(_truncate_password(password)) + return pwd_context.hash(validate_new_password(password)) def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -> str: diff --git a/backend/services/integrations/base.py b/backend/services/integrations/base.py index b9496d9..eab849b 100644 --- a/backend/services/integrations/base.py +++ b/backend/services/integrations/base.py @@ -1,5 +1,55 @@ -"""Base class for SIEM/SOAR integrations.""" +"""Base class and security helpers for SIEM/SOAR integrations.""" + +import asyncio +import ipaddress +import socket from abc import ABC, abstractmethod +from urllib.parse import urlsplit + + +INTEGRATION_REQUEST_ERROR = "Integration request failed" + + +async def validate_outbound_url(url: str) -> str: + """Require HTTPS and reject endpoints resolving to non-public networks.""" + try: + parsed = urlsplit(url) + port = parsed.port or 443 + except (TypeError, ValueError) as exc: + raise ValueError("Invalid integration URL") from exc + + if parsed.scheme.lower() != "https": + raise ValueError("Integration URL must use HTTPS") + if not parsed.hostname or parsed.username or parsed.password or parsed.fragment: + raise ValueError("Invalid integration URL") + + try: + addresses = await asyncio.to_thread( + socket.getaddrinfo, + parsed.hostname, + port, + type=socket.SOCK_STREAM, + ) + except socket.gaierror as exc: + raise ValueError("Integration hostname could not be resolved") from exc + + if not addresses: + raise ValueError("Integration hostname could not be resolved") + + for address in addresses: + ip = ipaddress.ip_address(address[4][0]) + if ( + not ip.is_global + or ip.is_private + or ip.is_loopback + or ip.is_link_local + or ip.is_multicast + or ip.is_reserved + or ip.is_unspecified + ): + raise ValueError("Integration hostname must resolve only to public addresses") + + return url class BaseIntegration(ABC): diff --git a/backend/services/integrations/pagerduty.py b/backend/services/integrations/pagerduty.py index 3774b96..bad17a0 100644 --- a/backend/services/integrations/pagerduty.py +++ b/backend/services/integrations/pagerduty.py @@ -1,6 +1,12 @@ """PagerDuty integration for incident triggering.""" +import logging + import httpx -from .base import BaseIntegration +from .base import BaseIntegration, INTEGRATION_REQUEST_ERROR, validate_outbound_url + + +logger = logging.getLogger(__name__) +PAGERDUTY_EVENTS_URL = "https://events.pagerduty.com/v2/enqueue" class PagerDutyIntegration(BaseIntegration): @@ -30,14 +36,18 @@ async def send_alert(self, alert_data: dict) -> dict: } try: - async with httpx.AsyncClient(timeout=10.0) as client: + url = await validate_outbound_url(PAGERDUTY_EVENTS_URL) + async with httpx.AsyncClient( + timeout=10.0, verify=True, follow_redirects=False + ) as client: response = await client.post( - "https://events.pagerduty.com/v2/enqueue", + url, json=event ) return {"success": response.status_code == 202, "status_code": response.status_code} - except Exception as e: - return {"success": False, "error": str(e)} + except Exception: + logger.exception("PagerDuty alert delivery failed") + return {"success": False, "error": INTEGRATION_REQUEST_ERROR} async def test_connection(self) -> dict: if not self.routing_key: diff --git a/backend/services/integrations/sentinel.py b/backend/services/integrations/sentinel.py index 6b25de3..68112f7 100644 --- a/backend/services/integrations/sentinel.py +++ b/backend/services/integrations/sentinel.py @@ -4,8 +4,14 @@ import hashlib import hmac import base64 +import logging +import re from datetime import datetime, timezone -from .base import BaseIntegration +from .base import BaseIntegration, INTEGRATION_REQUEST_ERROR, validate_outbound_url + + +logger = logging.getLogger(__name__) +WORKSPACE_ID_PATTERN = re.compile(r"^[0-9a-fA-F-]{1,64}$") class SentinelIntegration(BaseIntegration): @@ -36,10 +42,15 @@ async def send_alert(self, alert_data: dict) -> dict: rfc1123_date = datetime.now(timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT") try: + if not WORKSPACE_ID_PATTERN.fullmatch(self.workspace_id): + raise ValueError("Invalid Sentinel workspace ID") signature = self._build_signature(rfc1123_date, len(body)) url = f"https://{self.workspace_id}.ods.opinsights.azure.com/api/logs?api-version=2016-04-01" + url = await validate_outbound_url(url) - async with httpx.AsyncClient(timeout=10.0) as client: + async with httpx.AsyncClient( + timeout=10.0, verify=True, follow_redirects=False + ) as client: response = await client.post( url, content=body, @@ -51,8 +62,9 @@ async def send_alert(self, alert_data: dict) -> dict: } ) return {"success": response.status_code in (200, 202), "status_code": response.status_code} - except Exception as e: - return {"success": False, "error": str(e)} + except Exception: + logger.exception("Sentinel alert delivery failed") + return {"success": False, "error": INTEGRATION_REQUEST_ERROR} async def test_connection(self) -> dict: if not self.workspace_id or not self.shared_key: diff --git a/backend/services/integrations/servicenow.py b/backend/services/integrations/servicenow.py index 770887b..aa605e3 100644 --- a/backend/services/integrations/servicenow.py +++ b/backend/services/integrations/servicenow.py @@ -1,6 +1,11 @@ """ServiceNow integration for incident creation.""" +import logging + import httpx -from .base import BaseIntegration +from .base import BaseIntegration, INTEGRATION_REQUEST_ERROR, validate_outbound_url + + +logger = logging.getLogger(__name__) class ServiceNowIntegration(BaseIntegration): @@ -26,28 +31,40 @@ async def send_alert(self, alert_data: dict) -> dict: } try: - async with httpx.AsyncClient(timeout=10.0) as client: + base_url = self.instance_url.rstrip("/") + url = await validate_outbound_url(f"{base_url}/api/now/table/incident") + async with httpx.AsyncClient( + timeout=10.0, verify=True, follow_redirects=False + ) as client: response = await client.post( - f"{self.instance_url}/api/now/table/incident", + url, json=incident, auth=(self.username, self.password), headers={"Accept": "application/json"} ) return {"success": response.status_code == 201, "status_code": response.status_code} - except Exception as e: - return {"success": False, "error": str(e)} + except Exception: + logger.exception("ServiceNow incident creation failed") + return {"success": False, "error": INTEGRATION_REQUEST_ERROR} async def test_connection(self) -> dict: if not self.instance_url or not self.username: return {"success": False, "error": "ServiceNow not configured"} try: - async with httpx.AsyncClient(timeout=10.0) as client: + base_url = self.instance_url.rstrip("/") + url = await validate_outbound_url( + f"{base_url}/api/now/table/sys_user?sysparm_limit=1" + ) + async with httpx.AsyncClient( + timeout=10.0, verify=True, follow_redirects=False + ) as client: response = await client.get( - f"{self.instance_url}/api/now/table/sys_user?sysparm_limit=1", + url, auth=(self.username, self.password), headers={"Accept": "application/json"} ) return {"success": response.status_code == 200} - except Exception as e: - return {"success": False, "error": str(e)} + except Exception: + logger.exception("ServiceNow connection test failed") + return {"success": False, "error": INTEGRATION_REQUEST_ERROR} diff --git a/backend/services/integrations/splunk.py b/backend/services/integrations/splunk.py index 7bfedad..f024c6d 100644 --- a/backend/services/integrations/splunk.py +++ b/backend/services/integrations/splunk.py @@ -1,6 +1,11 @@ """Splunk HTTP Event Collector integration.""" +import logging + import httpx -from .base import BaseIntegration +from .base import BaseIntegration, INTEGRATION_REQUEST_ERROR, validate_outbound_url + + +logger = logging.getLogger(__name__) class SplunkIntegration(BaseIntegration): @@ -26,28 +31,36 @@ async def send_alert(self, alert_data: dict) -> dict: } try: - # verify=False used for dev convenience with self-signed certs - async with httpx.AsyncClient(timeout=10.0, verify=False) as client: + base_url = self.hec_url.rstrip("/") + url = await validate_outbound_url(f"{base_url}/services/collector/event") + async with httpx.AsyncClient( + timeout=10.0, verify=True, follow_redirects=False + ) as client: response = await client.post( - f"{self.hec_url}/services/collector/event", + url, json=event, headers={"Authorization": f"Splunk {self.hec_token}"} ) return {"success": response.status_code == 200, "status_code": response.status_code} - except Exception as e: - return {"success": False, "error": str(e)} + except Exception: + logger.exception("Splunk alert delivery failed") + return {"success": False, "error": INTEGRATION_REQUEST_ERROR} async def test_connection(self) -> dict: if not self.hec_url or not self.hec_token: return {"success": False, "error": "Splunk HEC not configured"} try: - # verify=False used for dev convenience with self-signed certs - async with httpx.AsyncClient(timeout=10.0, verify=False) as client: + base_url = self.hec_url.rstrip("/") + url = await validate_outbound_url(f"{base_url}/services/collector/health") + async with httpx.AsyncClient( + timeout=10.0, verify=True, follow_redirects=False + ) as client: response = await client.get( - f"{self.hec_url}/services/collector/health", + url, headers={"Authorization": f"Splunk {self.hec_token}"} ) return {"success": response.status_code == 200} - except Exception as e: - return {"success": False, "error": str(e)} + except Exception: + logger.exception("Splunk connection test failed") + return {"success": False, "error": INTEGRATION_REQUEST_ERROR} diff --git a/docs/plans/2026-07-13-mission-control-revamp.md b/docs/plans/2026-07-13-mission-control-revamp.md new file mode 100644 index 0000000..fa0f98e --- /dev/null +++ b/docs/plans/2026-07-13-mission-control-revamp.md @@ -0,0 +1,128 @@ +# OneAlert Mission Control Implementation Plan + +> **Execution:** Implement task-by-task in this session with red/green verification and a final adversarial review. + +**Goal:** Deliver a cohesive, high-density Mission Control UI and fix verified security/correctness defects discovered during local testing. + +**Architecture:** Preserve React/Vite/FastAPI contracts. Add small reusable presentation/state components, centralize API error normalization, rebuild the application shell, then migrate high-value routes to the shared patterns. Backend changes remain narrow and regression-tested. + +**Tech Stack:** React 19, TypeScript 6, Tailwind CSS 4, React Router, Axios, Zustand, Recharts, FastAPI, SQLAlchemy, pytest, Playwright. + +--- + +### Task 1: Baseline and regression coverage + +**Files:** +- Modify: `tests/e2e/local-ui-flow.spec.ts` +- Create: `tests/e2e/ui-resilience.spec.ts` +- Modify/Create targeted `tests/test_*.py` only for confirmed backend defects. + +**Steps:** +1. Run current build, lint, pytest, npm audit, and E2E prerequisites; record failures. +2. Add tests for error-envelope parsing, dashboard request failure, expired session, mobile navigation, keyboard dismissal, and retry behavior. +3. Add targeted failing security tests for each confirmed backend issue. +4. Run each test alone and confirm the intended failure before implementation. + +### Task 2: Tokens and shared UI states + +**Files:** +- Modify: `frontend-v2/src/index.css` +- Create: `frontend-v2/src/components/ui/AsyncState.tsx` +- Create: `frontend-v2/src/components/ui/PageHeader.tsx` +- Create: `frontend-v2/src/components/ui/StatusBadge.tsx` +- Create: `frontend-v2/src/components/ui/Panel.tsx` +- Create: `frontend-v2/src/api/errors.ts` + +**Steps:** +1. Define the tinted neutral, semantic color, typography, spacing, radius, elevation, z-index, and motion tokens. +2. Implement composable loading/error/empty components with semantic live regions and retry actions. +3. Normalize Axios/backend envelope errors without exposing internals. +4. Run build/lint and the new error-path tests. + +### Task 3: Application shell and navigation + +**Files:** +- Modify: `frontend-v2/src/components/layout/AppLayout.tsx` +- Modify: `frontend-v2/src/components/layout/Sidebar.tsx` +- Create: `frontend-v2/src/components/layout/CommandBar.tsx` +- Modify: `frontend-v2/src/App.tsx` + +**Steps:** +1. Group routes by operational intent and expose accessible active states. +2. Add sticky command bar, platform health cue, user context, skip link, and mobile drawer. +3. Support Escape/backdrop close, focus handling, body scroll safety, and reduced motion. +4. Verify desktop, tablet, and mobile navigation tests. + +### Task 4: Authentication and session hardening + +**Files:** +- Modify: `frontend-v2/src/api/client.ts` +- Modify: `frontend-v2/src/stores/authStore.ts` +- Modify: `frontend-v2/src/pages/Login.tsx` +- Modify: `frontend-v2/src/pages/Register.tsx` +- Modify: `frontend-v2/src/components/ProtectedRoute.tsx` + +**Steps:** +1. Correctly parse standardized API errors and clear complete auth state on expiry. +2. Prevent login-request 401s from triggering session redirects. +3. Add accessible field/error relationships, progress feedback, and autocomplete attributes. +4. Verify invalid credentials, network failure, expired session, and successful navigation. + +### Task 5: Dashboard insight hub + +**Files:** +- Modify: `frontend-v2/src/pages/Dashboard.tsx` +- Modify: `frontend-v2/src/components/KPICard.tsx` +- Modify: `frontend-v2/src/components/charts/*.tsx` + +**Steps:** +1. Fetch independent dashboard resources with partial-failure handling and freshness metadata. +2. Recompose into KPI rail, priority queue/insight hub, agent lanes, telemetry health, and analysis panels. +3. Add drill-down links and textual chart context. +4. Verify populated, zero, partial-failure, and full-failure states. + +### Task 6: Operational route migration + +**Files:** +- Modify: `frontend-v2/src/pages/{Cases,CaseDetail,Alerts,Events,Assets,OTDiscovery,MitreMap,HuntLab,ResponsePlans,Validation,AuditLog,Settings}.tsx` +- Modify: `frontend-v2/src/components/AlertDetail.tsx` +- Modify: `frontend-v2/src/components/Toast.tsx` + +**Steps:** +1. Apply standard page headers, filters, status tokens, dense panel/table treatment, and technical typography. +2. Replace silent initial-load failures with retryable error states. +3. Differentiate empty and filtered-empty states; keep mutation failures actionable. +4. Add accessible overlay labels/dismissal and mutation-disabled states. +5. Run the full route journey and route-specific edge tests. + +### Task 7: Confirmed backend/security fixes + +**Files:** +- Determined by audit evidence; expected areas include `backend/services/integrations/`, auth/session middleware, and affected tests. + +**Steps:** +1. State one root-cause hypothesis per confirmed defect. +2. Demonstrate a failing regression/security test. +3. Apply the smallest fix at the trust boundary. +4. Run the targeted test and the full backend suite. + +### Task 8: Local visual iteration and completion gate + +**Files:** +- Modify implementation/tests only where browser evidence finds a defect. + +**Steps:** +1. Build frontend and run the local FastAPI app with seeded demo data. +2. Execute Playwright desktop/mobile happy and non-happy journeys. +3. Review screenshots for hierarchy, overflow, truncation, contrast, and state clarity; iterate. +4. Run fresh build, lint, pytest, E2E, npm audit, source security scan, and git diff review. +5. Apply the Devil’s Advocate pre-mortem; fix blocking findings and re-run affected gates. + +## Done criteria + +- All routes use the Mission Control shell and coherent tokens. +- Operational density is preserved or improved. +- Remote-data failures are visible and recoverable. +- Authentication/session edge cases behave predictably. +- Confirmed high-impact security defects are regression-tested and fixed. +- Fresh verification commands substantiate every completion claim. diff --git a/docs/superpowers/specs/2026-07-13-mission-control-design.md b/docs/superpowers/specs/2026-07-13-mission-control-design.md new file mode 100644 index 0000000..a308ae7 --- /dev/null +++ b/docs/superpowers/specs/2026-07-13-mission-control-design.md @@ -0,0 +1,57 @@ +# OneAlert Mission Control Redesign + +## Goal + +Revamp the entire React frontend into a cohesive, high-density OT security operations workspace while fixing confirmed failure-path, accessibility, and security defects. + +## Research synthesis + +Current competitor material points to four durable patterns: asset-first segmentation (Claroty), global-to-site health (Nozomi), a prioritized cross-domain insight hub (Dragos), and role-specific interactive drill-downs (Tenable OT). Marketplace research adds grouped navigation, sticky working controls, dense tables, and responsive drawers from established Tailwind/React dashboard systems. + +OneAlert will combine these patterns without copying a competitor’s brand or screen composition. Its differentiator remains governed AI agents and OT-safe response approval. + +## Information architecture + +Navigation is grouped by analyst intent: + +- Command: Overview, Investigations. +- Observe: Alerts, Events, Assets, OT Discovery. +- Analyze: MITRE ATT&CK, Hunt Lab. +- Act: Response Plans, Validation. +- Govern: Audit Log, Settings. + +The command bar provides current page context, platform status, a compact quick-search affordance, and mobile navigation. Page structure stays consistent while allowing specialized dense work surfaces. + +## Dashboard + +The dashboard becomes a prioritized starting point rather than a collection of equal cards. It shows freshness and partial failures explicitly, a compact risk/asset KPI rail, prioritized operational queues, agent lane status, telemetry health, severity/trend analysis, and OT zone risk. Summary elements provide obvious drill-down routes. + +## Operational pages + +List pages retain dense data and add consistent headers, filter bars, result counts, loading skeletons, retryable failures, filtered-empty differentiation, and responsive overflow. Investigation and response views keep context visible around decisions. Risky actions expose approval/safety state and require clear confirmation where consequences are material. + +## Authentication and session behavior + +Authentication screens use the same visual identity with explicit field relationships, accessible errors, submit progress, and credible platform context. API errors are normalized from the backend envelope. Expired sessions clear all auth state and redirect predictably without confusing login failures. + +## Error and edge-case model + +- A failed dashboard request does not render a healthy zero; successful sections remain visible and failed sections identify themselves. +- Initial-load failures expose retry. +- Empty data, filtered-empty data, and permission failures have different copy/actions. +- Repeated clicks are prevented while mutations run. +- Invalid route/resource IDs render a recovery path. +- Mobile navigation is reachable, closable, and does not trap background interaction. + +## Security scope + +The audit covers token storage/cookie behavior, auth and tenant boundaries, validation, CSP/CORS, unsafe outbound TLS, uploads, rate limits, dependency advisories, and sensitive logging. Only confirmed, regression-tested defects are changed. + +## Verification + +- Frontend TypeScript build and ESLint. +- Backend pytest suite and targeted regression tests. +- npm dependency audit and source security scan. +- Playwright happy/non-happy journeys at mobile and desktop sizes. +- Keyboard/focus, reduced-motion, error, empty, and expired-session checks. +- Fresh local screenshots reviewed against this specification. diff --git a/frontend-v2/dist/assets/Alerts-DCdbzOXS.js b/frontend-v2/dist/assets/Alerts-DCdbzOXS.js new file mode 100644 index 0000000..c33fa69 --- /dev/null +++ b/frontend-v2/dist/assets/Alerts-DCdbzOXS.js @@ -0,0 +1 @@ +import{a as e,r as t}from"./AsyncState-CuK4jvuL.js";import{E as n,_ as r,b as i,g as a,k as o,n as s,p as c,r as l,t as u,u as d,y as f}from"./index-CjOT90JS.js";import{t as p}from"./PageHeader-BCt4-hcp.js";var m=a(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),h=a(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),g=o(n(),1),_=r(),v={critical:`text-danger`,high:`text-warning`,medium:`text-info`,low:`text-success`};function y({alert:e,onClose:t,onAcknowledge:n}){let r=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null;r.current?.focus();let n=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`keydown`,n),e?.focus()}},[t]),(0,_.jsxs)(`div`,{className:`fixed inset-0 z-50 flex justify-end`,children:[(0,_.jsx)(`div`,{className:`absolute inset-0 bg-black/50`,onClick:t}),(0,_.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`alert-detail-title`,className:`relative h-full w-full max-w-lg overflow-y-auto border-l border-surface-700 bg-surface-900 p-6 shadow-[var(--oa-shadow-float)]`,children:[(0,_.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,_.jsx)(`h2`,{id:`alert-detail-title`,className:`text-lg font-semibold text-white`,children:e.cve_id}),(0,_.jsx)(`button`,{ref:r,onClick:t,"aria-label":`Close alert details`,className:`grid h-9 w-9 place-items-center rounded-md text-surface-400 hover:bg-surface-800 hover:text-white`,children:(0,_.jsx)(l,{className:`w-5 h-5`,"aria-hidden":`true`})})]}),(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Title`}),(0,_.jsx)(`p`,{className:`text-surface-200 mt-1`,children:e.title})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Severity`}),(0,_.jsx)(`p`,{className:s(`mt-1 font-medium capitalize`,v[e.severity]),children:e.severity})]}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`CVSS`}),(0,_.jsx)(`p`,{className:`text-surface-200 mt-1`,children:e.cvss_score??`N/A`})]})]}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Affected Asset`}),(0,_.jsxs)(`p`,{className:`text-surface-200 mt-1`,children:[e.asset_name,` (`,e.asset_vendor,` `,e.asset_product,`)`]})]}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Description`}),(0,_.jsx)(`p`,{className:`text-surface-300 mt-1 text-sm leading-relaxed`,children:e.description})]}),e.remediation&&(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Remediation`}),(0,_.jsx)(`p`,{className:`text-surface-300 mt-1 text-sm`,children:e.remediation})]}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Source`}),(0,_.jsx)(`p`,{className:`text-surface-300 mt-1 text-sm`,children:e.source})]}),(0,_.jsxs)(`div`,{className:`pt-4 border-t border-surface-700 space-y-3`,children:[e.status===`pending`&&(0,_.jsx)(`button`,{onClick:()=>n(e.id),className:`w-full py-2.5 bg-primary-600 hover:bg-primary-700 text-white rounded-lg font-medium transition-colors`,children:`Acknowledge Alert`}),(0,_.jsxs)(`a`,{href:`https://nvd.nist.gov/vuln/detail/${e.cve_id}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center justify-center gap-2 w-full py-2.5 bg-surface-800 hover:bg-surface-700 text-surface-300 rounded-lg font-medium transition-colors`,children:[(0,_.jsx)(m,{className:`w-4 h-4`}),`View on NVD`]})]})]})]})]})}var b={critical:`bg-danger/10 text-danger border-danger/20`,high:`bg-warning/10 text-warning border-warning/20`,medium:`bg-info/10 text-info border-info/20`,low:`bg-success/10 text-success border-success/20`};function x(){let[n,r]=(0,g.useState)([]),[a,o]=(0,g.useState)(0),[l,m]=(0,g.useState)(1),[v,x]=(0,g.useState)(1),[S,C]=(0,g.useState)(!0),[w,T]=(0,g.useState)(null),[E,D]=(0,g.useState)(``),[O,k]=(0,g.useState)(``),[A,j]=(0,g.useState)(``),[M,N]=(0,g.useState)(new Set),[P,F]=(0,g.useState)(null),[I,L]=(0,g.useState)(new Set),R=(0,g.useCallback)(async()=>{C(!0),F(null);try{let e={page:l,size:15};E&&(e.severity=E),O&&(e.status=O),A&&(e.cve_id=A);let t=await i.get(`/alerts/`,{params:e});r(t.data.alerts),o(t.data.total),x(t.data.pages)}catch(e){F(f(e,`Alerts could not be loaded.`))}finally{C(!1)}},[l,E,O,A]);(0,g.useEffect)(()=>{R()},[R]);let z=async e=>{if(!I.has(e)){L(t=>new Set(t).add(e));try{await i.post(`/alerts/${e}/acknowledge`),await R(),T(null)}catch(e){u(f(e,`Alert could not be acknowledged.`),`error`)}finally{L(t=>{let n=new Set(t);return n.delete(e),n})}}},B=async()=>{let e=Array.from(M).filter(e=>!I.has(e));if(e.length===0)return;L(t=>new Set([...t,...e]));let t=await Promise.allSettled(e.map(e=>i.post(`/alerts/${e}/acknowledge`))),n=e.filter((e,n)=>t[n].status===`rejected`);N(new Set(n)),L(t=>{let n=new Set(t);return e.forEach(e=>n.delete(e)),n}),await R(),n.length>0?u(`${n.length} alerts could not be acknowledged and remain selected.`,`error`):u(`${e.length} alerts acknowledged.`,`success`)},V=e=>{N(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,_.jsxs)(`div`,{className:`space-y-6`,children:[(0,_.jsx)(p,{eyebrow:`Observe`,title:`Alerts`,description:`${a} vulnerability and threat alerts across the monitored estate.`,actions:M.size>0?(0,_.jsxs)(`button`,{onClick:B,disabled:Array.from(M).some(e=>I.has(e)),className:`flex min-h-9 items-center gap-2 rounded-md bg-primary-500 px-3.5 text-sm font-semibold text-surface-950 hover:bg-primary-400 disabled:opacity-50`,children:[(0,_.jsx)(c,{className:`w-4 h-4`}),`Acknowledge (`,M.size,`)`]}):void 0}),(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,_.jsxs)(`div`,{className:`relative`,children:[(0,_.jsx)(d,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,_.jsx)(`input`,{type:`text`,placeholder:`Search CVE...`,value:A,onChange:e=>{j(e.target.value),m(1)},className:`pl-9 pr-4 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,_.jsxs)(`select`,{value:E,onChange:e=>{D(e.target.value),m(1)},className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,_.jsx)(`option`,{value:``,children:`All Severities`}),(0,_.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,_.jsx)(`option`,{value:`high`,children:`High`}),(0,_.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,_.jsx)(`option`,{value:`low`,children:`Low`})]}),(0,_.jsxs)(`select`,{value:O,onChange:e=>{k(e.target.value),m(1)},className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,_.jsx)(`option`,{value:``,children:`All Statuses`}),(0,_.jsx)(`option`,{value:`pending`,children:`Pending`}),(0,_.jsx)(`option`,{value:`acknowledged`,children:`Acknowledged`}),(0,_.jsx)(`option`,{value:`resolved`,children:`Resolved`})]})]}),P?(0,_.jsx)(t,{title:`Alerts unavailable`,description:P,action:(0,_.jsx)(e,{onClick:()=>void R()})}):(0,_.jsx)(`div`,{className:`oa-panel overflow-x-auto`,children:S?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-32`,children:(0,_.jsx)(`div`,{className:`animate-spin rounded-full h-6 w-6 border-b-2 border-primary-400`})}):n.length===0?(0,_.jsxs)(`div`,{className:`p-8 text-center text-surface-500`,children:[(0,_.jsx)(h,{className:`w-8 h-8 mx-auto mb-2 opacity-50`}),(0,_.jsx)(`p`,{children:`No alerts found`})]}):(0,_.jsxs)(`table`,{className:`w-full text-sm min-w-[500px]`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-400`,children:[(0,_.jsx)(`th`,{className:`px-4 py-3 text-left w-8 hidden sm:table-cell`,children:(0,_.jsx)(`input`,{type:`checkbox`,onChange:e=>{e.target.checked?N(new Set(n.map(e=>e.id))):N(new Set)},className:`rounded border-surface-600`,"aria-label":`Select all alerts`})}),(0,_.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`CVE`}),(0,_.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Severity`}),(0,_.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Asset`}),(0,_.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Status`}),(0,_.jsx)(`th`,{className:`px-4 py-3 text-left hidden md:table-cell`,children:`Date`})]})}),(0,_.jsx)(`tbody`,{children:n.map(e=>(0,_.jsxs)(`tr`,{onClick:()=>T(e),className:`border-b border-surface-700/50 hover:bg-surface-800 cursor-pointer transition-colors`,children:[(0,_.jsx)(`td`,{className:`px-4 py-3 hidden sm:table-cell`,onClick:e=>e.stopPropagation(),children:(0,_.jsx)(`input`,{type:`checkbox`,checked:M.has(e.id),onChange:()=>V(e.id),className:`rounded border-surface-600`,"aria-label":`Select alert ${e.cve_id}`})}),(0,_.jsx)(`td`,{className:`px-4 py-3 font-mono text-primary-300`,children:e.cve_id}),(0,_.jsx)(`td`,{className:`px-4 py-3`,children:(0,_.jsx)(`span`,{className:s(`px-2 py-0.5 rounded-full text-xs font-medium border`,b[e.severity]),children:e.severity})}),(0,_.jsx)(`td`,{className:`px-4 py-3 text-surface-300`,children:e.asset_name}),(0,_.jsx)(`td`,{className:`px-4 py-3`,children:(0,_.jsx)(`span`,{className:s(`text-xs`,e.status===`pending`?`text-warning`:`text-success`),children:e.status})}),(0,_.jsx)(`td`,{className:`px-4 py-3 text-surface-500 hidden md:table-cell`,children:new Date(e.created_at).toLocaleDateString()})]},e.id))})]})}),v>1&&(0,_.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,_.jsx)(`button`,{onClick:()=>m(e=>Math.max(1,e-1)),disabled:l===1,className:`px-3 py-1.5 bg-surface-800 border border-surface-600 rounded text-sm text-surface-300 disabled:opacity-50`,children:`Previous`}),(0,_.jsxs)(`span`,{className:`text-sm text-surface-400`,children:[`Page `,l,` of `,v]}),(0,_.jsx)(`button`,{onClick:()=>m(e=>Math.min(v,e+1)),disabled:l===v,className:`px-3 py-1.5 bg-surface-800 border border-surface-600 rounded text-sm text-surface-300 disabled:opacity-50`,children:`Next`})]}),w&&(0,_.jsx)(y,{alert:w,onClose:()=>T(null),onAcknowledge:z})]})}export{x as Alerts}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Assets-CS6iCC1b.js b/frontend-v2/dist/assets/Assets-CS6iCC1b.js new file mode 100644 index 0000000..4e9ad24 --- /dev/null +++ b/frontend-v2/dist/assets/Assets-CS6iCC1b.js @@ -0,0 +1 @@ +import{a as e,r as t}from"./AsyncState-CuK4jvuL.js";import{t as n}from"./plus-B6elnz9I.js";import{E as r,_ as i,b as a,g as o,k as s,l as c,n as l,t as u,u as d,y as f}from"./index-CjOT90JS.js";import{t as p}from"./PageHeader-BCt4-hcp.js";var m=o(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),h=o(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),g=s(r(),1),_=i();function v(){let[r,i]=(0,g.useState)([]),[o,s]=(0,g.useState)(0),[v,b]=(0,g.useState)(1),[x,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(!0),[T,E]=(0,g.useState)(!1),[D,O]=(0,g.useState)(null),[k,A]=(0,g.useState)(null),[j,M]=(0,g.useState)(!1),[N,P]=(0,g.useState)(new Set),F=(0,g.useCallback)(async()=>{w(!0),A(null);try{let e={page:v,size:15};x&&(e.search=x);let t=await a.get(`/assets/`,{params:e});i(t.data.assets),s(t.data.total)}catch(e){A(f(e,`Asset inventory could not be loaded.`))}finally{w(!1)}},[v,x]);(0,g.useEffect)(()=>{F()},[F]);let I=async e=>{if(!(N.has(e)||!confirm(`Delete this asset from the managed inventory?`))){P(t=>new Set(t).add(e));try{await a.delete(`/assets/${e}`),await F(),u(`Asset deleted.`,`success`)}catch(e){u(f(e,`Asset could not be deleted.`),`error`)}finally{P(t=>{let n=new Set(t);return n.delete(e),n})}}};return(0,_.jsxs)(`div`,{className:`space-y-6`,children:[(0,_.jsx)(p,{eyebrow:`Observe`,title:`Asset Inventory`,description:`${o} managed IT, IoT, and OT assets with operational context.`,actions:(0,_.jsxs)(`button`,{onClick:()=>{O(null),E(!0)},className:`flex min-h-9 items-center gap-2 rounded-md bg-primary-500 px-3.5 text-sm font-semibold text-surface-950 hover:bg-primary-400`,children:[(0,_.jsx)(n,{className:`w-4 h-4`}),`Add Asset`]})}),(0,_.jsxs)(`div`,{className:`relative max-w-sm`,children:[(0,_.jsx)(d,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,_.jsx)(`input`,{type:`text`,placeholder:`Search assets...`,value:x,onChange:e=>{S(e.target.value),b(1)},className:`w-full pl-9 pr-4 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),k?(0,_.jsx)(t,{title:`Asset inventory unavailable`,description:k,action:(0,_.jsx)(e,{onClick:()=>void F()})}):(0,_.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:C?(0,_.jsx)(`div`,{className:`col-span-full flex items-center justify-center h-32`,children:(0,_.jsx)(`div`,{className:`animate-spin rounded-full h-6 w-6 border-b-2 border-primary-400`})}):r.length===0?(0,_.jsxs)(`div`,{className:`col-span-full text-center py-12 text-surface-500`,children:[(0,_.jsx)(c,{className:`w-10 h-10 mx-auto mb-3 opacity-50`}),(0,_.jsx)(`p`,{children:`No assets found. Add your first asset to start monitoring.`})]}):r.map(e=>(0,_.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4 hover:border-surface-600 transition-colors`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`h3`,{className:`text-sm font-semibold text-white truncate`,children:e.name}),(0,_.jsxs)(`p`,{className:`text-xs text-surface-400 mt-1`,children:[e.vendor,` `,e.product]})]}),(0,_.jsxs)(`div`,{className:`flex gap-1 ml-2`,children:[(0,_.jsx)(`button`,{onClick:()=>{O(e),E(!0)},className:`p-1.5 text-surface-500 hover:text-primary-400 transition-colors`,"aria-label":`Edit ${e.name}`,children:(0,_.jsx)(m,{className:`w-3.5 h-3.5`})}),(0,_.jsx)(`button`,{onClick:()=>I(e.id),disabled:N.has(e.id),className:`p-1.5 text-surface-500 hover:text-danger transition-colors`,"aria-label":`Delete ${e.name}`,children:(0,_.jsx)(h,{className:`w-3.5 h-3.5`})})]})]}),(0,_.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,_.jsx)(`span`,{className:`px-2 py-0.5 bg-surface-700 rounded text-xs text-surface-300`,children:e.asset_type}),e.is_ot_asset&&(0,_.jsx)(`span`,{className:`px-2 py-0.5 bg-warning/10 text-warning border border-warning/20 rounded text-xs`,children:`OT`}),e.criticality&&(0,_.jsx)(`span`,{className:l(`px-2 py-0.5 rounded text-xs border`,e.criticality===`high`?`bg-danger/10 text-danger border-danger/20`:e.criticality===`medium`?`bg-warning/10 text-warning border-warning/20`:`bg-success/10 text-success border-success/20`),children:e.criticality})]}),e.version&&(0,_.jsxs)(`p`,{className:`text-xs text-surface-500 mt-2`,children:[`v`,e.version]})]},e.id))}),T&&(0,_.jsx)(y,{asset:D,onClose:()=>{E(!1),O(null)},onSave:async e=>{if(!j){M(!0);try{D?await a.put(`/assets/${D.id}`,e):await a.post(`/assets/`,e),E(!1),O(null),await F(),u(D?`Asset updated.`:`Asset created.`,`success`)}catch(e){u(f(e,`Asset could not be saved.`),`error`)}finally{M(!1)}}},saving:j})]})}function y({asset:e,onClose:t,onSave:n,saving:r}){let[i,a]=(0,g.useState)({name:e?.name||``,asset_type:e?.asset_type||`hardware`,vendor:e?.vendor||``,product:e?.product||``,version:e?.version||``,description:e?.description||``,is_ot_asset:e?.is_ot_asset||!1,network_zone:e?.network_zone||``,criticality:e?.criticality||`medium`});return(0,g.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!r&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,r]),(0,_.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,_.jsx)(`div`,{className:`absolute inset-0 bg-black/50`,onClick:t}),(0,_.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`asset-dialog-title`,className:`relative max-h-[90vh] w-full max-w-md overflow-y-auto rounded-xl border border-surface-700 bg-surface-900 p-6 shadow-[var(--oa-shadow-float)]`,children:[(0,_.jsx)(`h2`,{id:`asset-dialog-title`,className:`text-lg font-semibold text-white mb-4`,children:e?`Edit Asset`:`Add Asset`}),(0,_.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),n(i)},className:`space-y-3`,children:[(0,_.jsx)(`input`,{type:`text`,placeholder:`Name`,value:i.name,onChange:e=>a({...i,name:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,required:!0}),(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,_.jsx)(`input`,{type:`text`,placeholder:`Vendor`,value:i.vendor,onChange:e=>a({...i,vendor:e.target.value}),className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,required:!0}),(0,_.jsx)(`input`,{type:`text`,placeholder:`Product`,value:i.product,onChange:e=>a({...i,product:e.target.value}),className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,required:!0})]}),(0,_.jsx)(`input`,{type:`text`,placeholder:`Version`,value:i.version||``,onChange:e=>a({...i,version:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`}),(0,_.jsxs)(`select`,{value:i.asset_type,onChange:e=>a({...i,asset_type:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,_.jsx)(`option`,{value:`hardware`,children:`Hardware`}),(0,_.jsx)(`option`,{value:`software`,children:`Software`}),(0,_.jsx)(`option`,{value:`firmware`,children:`Firmware`}),(0,_.jsx)(`option`,{value:`plc`,children:`PLC`}),(0,_.jsx)(`option`,{value:`hmi`,children:`HMI`}),(0,_.jsx)(`option`,{value:`scada`,children:`SCADA`}),(0,_.jsx)(`option`,{value:`rtu`,children:`RTU`}),(0,_.jsx)(`option`,{value:`network_device`,children:`Network Device`}),(0,_.jsx)(`option`,{value:`other_ot`,children:`Other OT`})]}),(0,_.jsxs)(`select`,{value:i.criticality||`medium`,onChange:e=>a({...i,criticality:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,_.jsx)(`option`,{value:`low`,children:`Low Criticality`}),(0,_.jsx)(`option`,{value:`medium`,children:`Medium Criticality`}),(0,_.jsx)(`option`,{value:`high`,children:`High Criticality`})]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-surface-300`,children:[(0,_.jsx)(`input`,{type:`checkbox`,checked:i.is_ot_asset||!1,onChange:e=>a({...i,is_ot_asset:e.target.checked}),className:`rounded border-surface-600`}),`OT/ICS Asset`]}),(0,_.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:t,className:`flex-1 py-2 bg-surface-700 hover:bg-surface-600 text-surface-300 rounded-lg text-sm transition-colors`,children:`Cancel`}),(0,_.jsx)(`button`,{type:`submit`,disabled:r,className:`flex-1 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg text-sm font-medium transition-colors`,children:r?`Saving…`:e?`Update`:`Create`})]})]})]})]})}export{v as Assets}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/AsyncState-CuK4jvuL.js b/frontend-v2/dist/assets/AsyncState-CuK4jvuL.js new file mode 100644 index 0000000..25a649c --- /dev/null +++ b/frontend-v2/dist/assets/AsyncState-CuK4jvuL.js @@ -0,0 +1 @@ +import{_ as e,g as t,i as n}from"./index-CjOT90JS.js";var r=t(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),i=t(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),a=e();function o({title:e,description:t,action:r}){return(0,a.jsxs)(`div`,{className:`oa-panel flex min-h-44 flex-col items-center justify-center px-6 py-10 text-center`,role:`alert`,children:[(0,a.jsx)(`span`,{className:`mb-4 grid h-10 w-10 place-items-center rounded-md border border-danger/30 bg-danger/10 text-danger`,children:(0,a.jsx)(n,{className:`h-5 w-5`,"aria-hidden":`true`})}),(0,a.jsx)(`h2`,{className:`text-base font-semibold text-surface-50`,children:e}),(0,a.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-6 text-surface-400`,children:t}),r&&(0,a.jsx)(`div`,{className:`mt-5`,children:r})]})}function s({title:e,description:t,action:n}){return(0,a.jsxs)(`div`,{className:`oa-panel flex min-h-40 flex-col items-center justify-center px-6 py-9 text-center`,children:[(0,a.jsx)(r,{className:`mb-3 h-6 w-6 text-surface-500`,"aria-hidden":`true`}),(0,a.jsx)(`h2`,{className:`text-sm font-semibold text-surface-200`,children:e}),(0,a.jsx)(`p`,{className:`mt-1 max-w-lg text-sm text-surface-400`,children:t}),n&&(0,a.jsx)(`div`,{className:`mt-4`,children:n})]})}function c({onClick:e,label:t=`Retry`}){return(0,a.jsxs)(`button`,{type:`button`,onClick:e,className:`inline-flex min-h-9 items-center gap-2 rounded-md border border-surface-600 bg-surface-800 px-3 text-sm font-semibold text-surface-100 transition hover:border-primary-500/60 hover:text-primary-200`,children:[(0,a.jsx)(i,{className:`h-4 w-4`,"aria-hidden":`true`}),t]})}function l({rows:e=4,label:t=`Loading data`}){return(0,a.jsxs)(`div`,{className:`oa-panel space-y-3 p-5`,role:`status`,"aria-label":t,children:[(0,a.jsx)(`span`,{className:`sr-only`,children:t}),Array.from({length:e},(e,t)=>(0,a.jsx)(`div`,{className:`oa-skeleton h-10 rounded-md`,style:{opacity:1-t*.1}},t))]})}function u({messages:e,onRetry:t}){return(0,a.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border border-warning/30 bg-warning/8 px-4 py-3 text-sm text-warning sm:flex-row sm:items-center sm:justify-between`,role:`status`,children:[(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(n,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`font-semibold`,children:`Some live data is unavailable`}),(0,a.jsx)(`p`,{className:`mt-0.5 text-xs text-surface-300`,children:e.join(` · `)})]})]}),(0,a.jsx)(c,{onClick:t})]})}export{c as a,l as i,s as n,o as r,u as t}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/AuditLog-D7hVaLQG.js b/frontend-v2/dist/assets/AuditLog-D7hVaLQG.js new file mode 100644 index 0000000..e591521 --- /dev/null +++ b/frontend-v2/dist/assets/AuditLog-D7hVaLQG.js @@ -0,0 +1 @@ +import{a as e,i as t,r as n}from"./AsyncState-CuK4jvuL.js";import{E as r,_ as i,b as a,k as o,u as s,y as c}from"./index-CjOT90JS.js";import{t as l}from"./PageHeader-BCt4-hcp.js";var u=o(r(),1),d=i();function f(){let[r,i]=(0,u.useState)([]),[o,f]=(0,u.useState)(!0),[p,m]=(0,u.useState)(``),[h,g]=(0,u.useState)(``),_=async()=>{f(!0),g(``);try{let e=await a.get(`/auth/audit-logs`);i(e.data)}catch(e){g(c(e,`Audit activity could not be loaded.`))}finally{f(!1)}};(0,u.useEffect)(()=>{_()},[]);let v=r.filter(e=>!p||e.action.toLowerCase().includes(p.toLowerCase())||e.detail?.toLowerCase().includes(p.toLowerCase()));return o?(0,d.jsx)(t,{rows:6,label:`Loading audit activity`}):(0,d.jsxs)(`div`,{className:`space-y-6`,children:[(0,d.jsx)(l,{eyebrow:`Govern`,title:`Audit Log`,description:`Immutable operator, agent, approval, and configuration activity.`}),h?(0,d.jsx)(n,{title:`Audit log unavailable`,description:h,action:(0,d.jsx)(e,{onClick:()=>void _()})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`relative max-w-sm`,children:[(0,d.jsx)(s,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,d.jsx)(`input`,{type:`text`,placeholder:`Search actions...`,value:p,onChange:e=>m(e.target.value),className:`w-full pl-9 pr-4 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,d.jsx)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl overflow-hidden`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-400`,children:[(0,d.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Timestamp`}),(0,d.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Action`}),(0,d.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Target`}),(0,d.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Detail`})]})}),(0,d.jsx)(`tbody`,{children:v.length===0?(0,d.jsx)(`tr`,{children:(0,d.jsx)(`td`,{colSpan:4,className:`px-4 py-8 text-center text-surface-500`,children:`No audit log entries found`})}):v.map(e=>(0,d.jsxs)(`tr`,{className:`border-b border-surface-700/50 hover:bg-surface-800 transition-colors`,children:[(0,d.jsx)(`td`,{className:`px-4 py-3 text-surface-400 text-xs`,children:e.timestamp?new Date(e.timestamp).toLocaleString():`-`}),(0,d.jsx)(`td`,{className:`px-4 py-3 text-surface-200 font-medium`,children:e.action}),(0,d.jsx)(`td`,{className:`px-4 py-3 text-surface-400`,children:e.target_type?`${e.target_type} #${e.target_id}`:`-`}),(0,d.jsx)(`td`,{className:`px-4 py-3 text-surface-500 text-xs max-w-xs truncate`,children:e.detail||`-`})]},e.id))})]})})]})]})}export{f as AuditLog}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/CaseDetail-DQUd0l6u.js b/frontend-v2/dist/assets/CaseDetail-DQUd0l6u.js new file mode 100644 index 0000000..34c2159 --- /dev/null +++ b/frontend-v2/dist/assets/CaseDetail-DQUd0l6u.js @@ -0,0 +1 @@ +import{t as e}from"./clock-COi0udmh.js";import{a as t,i as n,r,t as i}from"./AsyncState-CuK4jvuL.js";import{E as a,_ as o,a as s,b as c,g as l,h as u,i as d,k as f,n as p,w as m,x as h,y as g}from"./index-CjOT90JS.js";var _=l(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),v=l(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),y=f(a(),1),b=o(),x={critical:`bg-red-500/20 text-red-400 border-red-500/30`,high:`bg-orange-500/20 text-orange-400 border-orange-500/30`,medium:`bg-yellow-500/20 text-yellow-400 border-yellow-500/30`,low:`bg-blue-500/20 text-blue-400 border-blue-500/30`,info:`bg-surface-500/20 text-surface-400 border-surface-500/30`},S={ai_analysis:v,alert:d,event:u,action:s,note:e};function C(){let{caseId:a}=m(),[o,l]=(0,y.useState)(null),[u,d]=(0,y.useState)([]),[f,C]=(0,y.useState)([]),[w,T]=(0,y.useState)(!0),[E,D]=(0,y.useState)(``),[O,k]=(0,y.useState)([]),A=(0,y.useCallback)(async()=>{T(!0);let[e,t,n]=await Promise.allSettled([c.get(`/cases/${a}`),c.get(`/cases/${a}/alerts`),c.get(`/cases/${a}/events`)]);e.status===`rejected`?(D(g(e.reason,`This case could not be loaded.`)),l(null)):(l(e.value.data),D(``));let r=[];t.status===`fulfilled`?d(t.value.data):(d([]),r.push(`Linked alerts unavailable`)),n.status===`fulfilled`?C(n.value.data):(C([]),r.push(`Linked events unavailable`)),k(r),T(!1)},[a]);return(0,y.useEffect)(()=>{A()},[A]),w?(0,b.jsx)(n,{rows:6,label:`Loading case investigation`}):o?(0,b.jsxs)(`div`,{className:`space-y-6`,children:[O.length>0&&(0,b.jsx)(i,{messages:O,onRetry:A}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(h,{to:`/cases`,className:`flex items-center gap-2 text-surface-400 hover:text-white text-sm mb-4 transition-colors`,children:[(0,b.jsx)(_,{className:`w-4 h-4`}),` Back to Cases`]}),(0,b.jsx)(`div`,{className:`flex items-start justify-between`,children:(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,b.jsx)(`span`,{className:p(`px-2.5 py-1 text-xs font-medium rounded-full border`,x[o.severity]),children:o.severity}),(0,b.jsx)(`span`,{className:`px-2.5 py-1 text-xs font-medium rounded-full bg-surface-700 text-surface-300`,children:o.status}),o.confidence_score&&(0,b.jsxs)(`span`,{className:`text-sm text-surface-400`,children:[Math.round(o.confidence_score*100),`% confidence`]})]}),(0,b.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:o.title}),o.summary&&(0,b.jsx)(`p`,{className:`text-surface-400 mt-2`,children:o.summary})]})})]}),(0,b.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,b.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`Alerts`}),(0,b.jsx)(`p`,{className:`text-2xl font-bold text-white mt-1`,children:o.alert_count})]}),(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,b.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`Events`}),(0,b.jsx)(`p`,{className:`text-2xl font-bold text-white mt-1`,children:o.event_count})]}),(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,b.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`MITRE Tactics`}),(0,b.jsx)(`p`,{className:`text-2xl font-bold text-white mt-1`,children:o.mitre_tactics?.length||0})]}),(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,b.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`Created By`}),(0,b.jsx)(`p`,{className:`text-lg font-medium text-primary-400 mt-1 capitalize`,children:o.created_by})]})]}),o.attack_narrative&&(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,b.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold text-white mb-3`,children:[(0,b.jsx)(v,{className:`w-5 h-5 text-primary-400`}),` AI Analysis`]}),(0,b.jsx)(`p`,{className:`text-surface-300 leading-relaxed whitespace-pre-wrap`,children:o.attack_narrative})]}),o.mitre_techniques&&o.mitre_techniques.length>0&&(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,b.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold text-white mb-3`,children:[(0,b.jsx)(s,{className:`w-5 h-5 text-primary-400`}),` MITRE ATT&CK Techniques`]}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o.mitre_techniques.map((e,t)=>(0,b.jsxs)(`span`,{className:`px-3 py-1.5 bg-primary-600/20 text-primary-300 text-sm rounded-lg border border-primary-500/20`,children:[e.id,`: `,e.name,e.confidence&&(0,b.jsxs)(`span`,{className:`ml-2 text-primary-500 text-xs`,children:[`(`,Math.round(e.confidence*100),`%)`]})]},t))})]}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,b.jsx)(`div`,{className:`lg:col-span-2`,children:(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,b.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Investigation Timeline`}),o.timeline.length===0?(0,b.jsx)(`p`,{className:`text-surface-500`,children:`No timeline entries yet.`}):(0,b.jsx)(`div`,{className:`space-y-4`,children:o.timeline.map(t=>(0,b.jsxs)(`div`,{className:`flex gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,b.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-surface-700 flex items-center justify-center`,children:(0,b.jsx)(S[t.entry_type]||e,{className:`w-4 h-4 text-primary-400`})}),(0,b.jsx)(`div`,{className:`flex-1 w-px bg-surface-700 mt-2`})]}),(0,b.jsxs)(`div`,{className:`flex-1 pb-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,b.jsx)(`span`,{className:`text-xs text-surface-500`,children:new Date(t.timestamp).toLocaleString()}),(0,b.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded bg-surface-700 text-surface-400`,children:t.entry_type}),(0,b.jsx)(`span`,{className:`text-xs text-surface-600`,children:t.source})]}),(0,b.jsx)(`p`,{className:`text-surface-300 text-sm`,children:t.content})]})]},t.id))})]})}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,b.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-3`,children:`Related Alerts`}),u.length===0?(0,b.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No linked alerts.`}):(0,b.jsx)(`div`,{className:`space-y-2`,children:u.map(e=>(0,b.jsxs)(`div`,{className:`p-3 bg-surface-900/50 rounded-lg`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,b.jsx)(`span`,{className:p(`px-1.5 py-0.5 text-xs rounded`,x[e.severity]),children:e.severity}),e.cve_id&&(0,b.jsx)(`span`,{className:`text-xs text-primary-400`,children:e.cve_id})]}),(0,b.jsx)(`p`,{className:`text-sm text-surface-300 truncate`,children:e.title})]},e.id))})]}),(0,b.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,b.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-3`,children:`Related Events`}),f.length===0?(0,b.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No linked events.`}):(0,b.jsx)(`div`,{className:`space-y-2 max-h-80 overflow-y-auto`,children:f.map(e=>(0,b.jsxs)(`div`,{className:`p-3 bg-surface-900/50 rounded-lg`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,b.jsx)(`span`,{className:p(`px-1.5 py-0.5 text-xs rounded`,x[e.severity]),children:e.severity}),(0,b.jsx)(`span`,{className:`text-xs text-surface-500`,children:e.event_type})]}),(0,b.jsxs)(`p`,{className:`text-xs text-surface-400`,children:[e.source_ip,` → `,e.dest_ip,` `,e.signature&&`| ${e.signature}`]})]},e.id))})]})]})]})]}):(0,b.jsx)(r,{title:`Case unavailable`,description:E||`The case may have been removed or you may not have access.`,action:(0,b.jsx)(t,{onClick:A})})}export{C as CaseDetail}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Cases--uF5onG8.js b/frontend-v2/dist/assets/Cases--uF5onG8.js new file mode 100644 index 0000000..d11b9eb --- /dev/null +++ b/frontend-v2/dist/assets/Cases--uF5onG8.js @@ -0,0 +1 @@ +import{a as e,i as t,n,r}from"./AsyncState-CuK4jvuL.js";import{t as i}from"./play-C2dygcG1.js";import{E as a,_ as o,b as s,g as c,k as l,n as u,o as d,t as f,x as p,y as m}from"./index-CjOT90JS.js";import{t as h}from"./PageHeader-BCt4-hcp.js";var g=c(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),_=l(a(),1),v=o(),y={critical:`bg-danger/10 text-danger border-danger/30`,high:`bg-warning/10 text-warning border-warning/30`,medium:`bg-info/10 text-info border-info/30`,low:`bg-success/10 text-success border-success/30`,info:`bg-surface-500/20 text-surface-400 border-surface-500/30`},b={open:`bg-red-500/20 text-red-400`,investigating:`bg-yellow-500/20 text-yellow-400`,resolved:`bg-green-500/20 text-green-400`,closed:`bg-surface-500/20 text-surface-400`,false_positive:`bg-surface-500/20 text-surface-500`};function x(){let[a,o]=(0,_.useState)([]),[c,l]=(0,_.useState)(!0),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(0),[T,E]=(0,_.useState)(null),D=async()=>{E(null);try{let e=await s.get(`/cases/`,{params:{size:50}});o(e.data.cases),w(e.data.total)}catch(e){E(m(e,`Investigations could not be loaded.`))}finally{l(!1)}},O=async()=>{S(!0);try{await s.post(`/cases/auto-triage`,null,{params:{hours_back:72}}),await D()}catch(e){f(m(e,`AI triage could not be started.`),`error`)}finally{S(!1)}};return(0,_.useEffect)(()=>{D()},[]),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[(0,v.jsx)(h,{eyebrow:`Command`,title:`Investigations`,description:`${C} cases correlated from alerts, security events, and agent analysis.`,actions:(0,v.jsxs)(`button`,{onClick:O,disabled:x,className:`flex min-h-9 items-center gap-2 rounded-md bg-primary-500 px-3.5 text-sm font-semibold text-surface-950 hover:bg-primary-400 disabled:opacity-50`,children:[(0,v.jsx)(i,{className:`w-4 h-4`}),x?`Running triage…`:`Run AI triage`]})}),c?(0,v.jsx)(t,{rows:3,label:`Loading investigations`}):T?(0,v.jsx)(r,{title:`Investigations unavailable`,description:T,action:(0,v.jsx)(e,{onClick:()=>void D()})}):a.length===0?(0,v.jsx)(n,{title:`No investigations yet`,description:`Run AI triage to correlate alerts and security events into investigation cases.`,action:(0,v.jsx)(`button`,{type:`button`,onClick:()=>void O(),className:`text-sm font-semibold text-primary-300`,children:`Run AI triage`})}):(0,v.jsx)(`div`,{className:`grid gap-4`,children:a.map(e=>(0,v.jsx)(p,{to:`/cases/${e.id}`,className:`oa-panel group block p-5 transition hover:border-primary-500/40 hover:bg-surface-800/55`,children:(0,v.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,v.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,v.jsx)(`span`,{className:u(`px-2 py-0.5 text-xs font-medium rounded-full border`,y[e.severity]),children:e.severity}),(0,v.jsx)(`span`,{className:u(`px-2 py-0.5 text-xs font-medium rounded-full`,b[e.status]),children:e.status}),e.confidence_score&&(0,v.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[Math.round(e.confidence_score*100),`% confidence`]})]}),(0,v.jsx)(`h3`,{className:`text-white font-medium truncate`,children:e.title}),e.summary&&(0,v.jsx)(`p`,{className:`text-surface-400 text-sm mt-1 line-clamp-2`,children:e.summary}),(0,v.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 text-xs text-surface-500`,children:[(0,v.jsxs)(`span`,{children:[e.alert_count,` alerts`]}),(0,v.jsxs)(`span`,{children:[e.event_count,` events`]}),e.mitre_tactics&&e.mitre_tactics.length>0&&(0,v.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,v.jsx)(d,{className:`w-3 h-3`}),e.mitre_tactics.length,` MITRE tactics`]}),(0,v.jsx)(`span`,{children:new Date(e.created_at).toLocaleDateString()}),(0,v.jsx)(`span`,{className:`capitalize`,children:e.created_by})]})]}),(0,v.jsx)(g,{className:`w-5 h-5 text-surface-600 group-hover:text-primary-400 transition-colors mt-1`})]})},e.id))})]})}export{x as Cases}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Dashboard-DzWggTdy.js b/frontend-v2/dist/assets/Dashboard-DzWggTdy.js new file mode 100644 index 0000000..a5045e4 --- /dev/null +++ b/frontend-v2/dist/assets/Dashboard-DzWggTdy.js @@ -0,0 +1,36 @@ +import{a as e,i as t,r as n,t as r}from"./AsyncState-CuK4jvuL.js";import{D as i,E as a,O as o,T as s,_ as c,b as l,g as u,h as d,i as f,k as p,l as m,n as h,s as g,x as _,y as v}from"./index-CjOT90JS.js";import{t as y}from"./PageHeader-BCt4-hcp.js";import{n as b,t as x}from"./StatusBadge-Cza7NGb-.js";var S=u(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),C=u(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),w=u(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),T=u(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),E=u(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),D=u(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),O=p(a()),k=c(),ee={info:`text-info bg-info/10 border-info/20`,danger:`text-danger bg-danger/10 border-danger/20`,success:`text-success bg-success/10 border-success/20`,warning:`text-warning bg-warning/10 border-warning/20`};function A({title:e,value:t,icon:n,color:r,detail:i}){return(0,k.jsx)(`div`,{className:`oa-panel p-4 sm:p-5`,children:(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{className:`text-sm text-surface-400`,children:e}),(0,k.jsx)(`p`,{className:`mt-1 text-2xl font-bold tabular-nums text-surface-50 sm:text-3xl`,children:t}),i&&(0,k.jsx)(`p`,{className:`mt-1 text-[11px] text-surface-500`,children:i})]}),(0,k.jsx)(`div`,{className:h(`rounded-md border p-2.5`,ee[r]),children:(0,k.jsx)(n,{className:`h-5 w-5`,"aria-hidden":`true`})})]})})}var j=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function M(e){return typeof e==`string`&&j.includes(e)}var te=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function ne(e){return typeof e==`string`&&te.has(e)}function re(e){return typeof e==`string`&&e.startsWith(`data-`)}function ie(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ne(n)||re(n))&&(t[n]=e[n]);return t}function ae(e){if(e==null)return null;if((0,O.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return ie(t)}return typeof e==`object`&&!Array.isArray(e)?ie(e):null}function N(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ne(n)||re(n)||M(n))&&(t[n]=e[n]);return t}var oe=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=ce(e,oe),d=a||{width:r,height:i,x:0,y:0},f=h(`recharts-surface`,o);return O.createElement(`svg`,se({},N(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),O.createElement(`title`,null,c),O.createElement(`desc`,null,l),n)}),de=[`children`,`className`];function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,i=pe(e,de),a=h(`recharts-layer`,r);return O.createElement(`g`,fe({className:a},N(i),{ref:t}),n)}),ge=(0,O.createContext)(null),_e=()=>(0,O.useContext)(ge);function P(e){return function(){return e}}var ve=Math.cos,ye=Math.sin,be=Math.sqrt,xe=Math.PI;xe/2;var Se=2*xe,Ce=Math.PI,we=2*Ce,Te=1e-6,Ee=we-Te;function De(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return De;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tTe)if(!(Math.abs(u*s-c*l)>Te)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Ce-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Te&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Te||Math.abs(this._y1-l)>Te)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%we+we),d>Ee?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Te&&this._append`A${n},${n},0,${+(d>=Ce)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Ae(){return new ke}Ae.prototype=ke.prototype;function je(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new ke(t)}Array.prototype.slice;function Me(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ne(e){this._context=e}Ne.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Pe(e){return new Ne(e)}function Fe(e){return e[0]}function Ie(e){return e[1]}function Le(e,t){var n=P(!0),r=null,i=Pe,a=null,o=je(s);e=typeof e==`function`?e:e===void 0?Fe:P(e),t=typeof t==`function`?t:t===void 0?Ie:P(t);function s(s){var c,l=(s=Me(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Le().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:P(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:P(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:P(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:P(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:P(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:P(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:P(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var ze=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function Be(e){return new ze(e,!0)}function Ve(e){return new ze(e,!1)}var He={draw(e,t){let n=be(t/xe);e.moveTo(n,0),e.arc(0,0,n,0,Se)}},Ue={draw(e,t){let n=be(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},We=be(1/3),Ge=We*2,Ke={draw(e,t){let n=be(t/Ge),r=n*We;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},qe={draw(e,t){let n=be(t),r=-n/2;e.rect(r,r,n,n)}},Je=.8908130915292852,Ye=ye(xe/10)/ye(7*xe/10),Xe=ye(Se/10)*Ye,Ze=-ve(Se/10)*Ye,Qe={draw(e,t){let n=be(t*Je),r=Xe*n,i=Ze*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Se*t/5,o=ve(a),s=ye(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},$e=be(3),et={draw(e,t){let n=-be(t/($e*3));e.moveTo(0,n*2),e.lineTo(-$e*n,-n),e.lineTo($e*n,-n),e.closePath()}},tt=-.5,nt=be(3)/2,rt=1/be(12),it=(rt/2+1)*3,at={draw(e,t){let n=be(t/it),r=n/2,i=n*rt,a=r,o=n*rt+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(tt*r-nt*i,nt*r+tt*i),e.lineTo(tt*a-nt*o,nt*a+tt*o),e.lineTo(tt*s-nt*c,nt*s+tt*c),e.lineTo(tt*r+nt*i,tt*i-nt*r),e.lineTo(tt*a+nt*o,tt*o-nt*a),e.lineTo(tt*s+nt*c,tt*c-nt*s),e.closePath()}};function ot(e,t){let n=null,r=je(i);e=typeof e==`function`?e:P(e||He),t=typeof t==`function`?t:P(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:P(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:P(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function st(){}function ct(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function lt(e){this._context=e}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ut(e){return new lt(e)}function dt(e){this._context=e}dt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ct(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ft(e){return new dt(e)}function pt(e){this._context=e}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ct(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mt(e){return new pt(e)}function ht(e){this._context=e}ht.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function gt(e){return new ht(e)}function _t(e){return e<0?-1:1}function vt(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(_t(a)+_t(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function yt(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bt(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function xt(e){this._context=e}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:bt(this,this._t0,yt(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,bt(this,yt(this,n=vt(this,e,t)),n);break;default:bt(this,this._t0,n=vt(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function St(e){this._context=new Ct(e)}(St.prototype=Object.create(xt.prototype)).point=function(e,t){xt.prototype.point.call(this,t,e)};function Ct(e){this._context=e}Ct.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function wt(e){return new xt(e)}function Tt(e){return new St(e)}function Et(e){this._context=e}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Dt(e),i=Dt(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function At(e){return new kt(e,.5)}function jt(e){return new kt(e,0)}function Mt(e){return new kt(e,1)}function Nt(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n=0;)n[t]=t;return n}function Ft(e,t){return e[t]}function It(e){let t=[];return t.key=e,t}function Lt(){var e=P([]),t=Pt,n=Nt,r=Ft;function i(i){var a=Array.from(e.apply(this,arguments),It),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),Ht=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),Ut=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),Wt=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),Gt=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Wt(),n=Ut();function r(e){if(Array.isArray(e))return e.map(n.toKey);if(typeof e==`symbol`)return[e];e=t.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Vt(),n=Ht(),r=Ut(),i=Gt();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e{t.exports=Kt().get})),Jt=4;function Yt(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jt),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function F(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Yt(i)+n},``)}var Xt=p(qt()),Zt=e=>e===0?0:e>0?1:-1,Qt=e=>typeof e==`number`&&e!=+e,$t=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,I=e=>(typeof e==`number`||e instanceof Number)&&!Qt(e),en=e=>I(e)||typeof e==`string`,tn=0,nn=e=>{var t=++tn;return`${e||``}${t}`},rn=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!I(e)&&typeof e!=`string`)return n;var i;if($t(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Qt(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},an=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;re&&(typeof t==`function`?t(e):(0,Xt.default)(e,t))===n)}var L=e=>e==null,cn=e=>L(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function ln(e){return e!=null}function un(){}var dn=[`type`,`size`,`sizeType`];function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;tbn[`symbol${cn(e)}`]||He,Cn=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*xn;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},wn=(e,t)=>{bn[`symbol${cn(e)}`]=t},Tn=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=mn(mn({},vn(e,dn)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=Sn(a),t=ot().type(e).size(Cn(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=N(i);return I(c)&&I(l)&&I(n)?O.createElement(`path`,fn({},u,{className:h(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};Tn.registerSymbol=wn;var En=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Dn=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,O.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{M(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},On=(e,t,n)=>r=>(e(t,n,r),null),kn=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];M(i)&&typeof a==`function`&&(r||={},r[i]=On(a,t,n))}),r};function An(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jn(e){for(var t=1;t(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function In(){return In=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var d=t.formatter||i,f=h({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?Rn({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return O.createElement(`li`,In({className:f,style:l,key:`legend-item-${r}`},kn(e,t,r)),O.createElement(ue,{width:n,height:n,viewBox:c,style:u,"aria-label":`${t.value} legend icon`},O.createElement(Gn,{data:t,iconType:o,inactiveColor:a})),O.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var qn=e=>{var t=Fn(e,Un),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return O.createElement(`ul`,{className:`recharts-default-legend`,style:a},O.createElement(Kn,In({},t,{payload:n})))},Jn=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){let n=new Map;for(let r=0;r{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),Xn=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e}e.identity=t})),Zn=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),Qn=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Zn();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),$n=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),er=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Qn(),n=$n();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),tr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Kt();function n(e){return function(n){return t.get(n,e)}}e.property=n})),nr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),rr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),ir=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),ar=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=nr(),n=rr(),r=ir();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,n,i,s){if(n===e)return!0;switch(typeof n){case`object`:return o(e,n,i,s);case`function`:return Object.keys(n).length>0?a(e,{...n},i,s):r.isEqualsSameValueZero(e,n);default:return t.isObject(e)?typeof n!=`string`||n===``:r.isEqualsSameValueZero(e,n)}}function o(e,t,r,i){if(t==null)return!0;if(Array.isArray(t))return c(e,t,r,i);if(t instanceof Map)return s(e,t,r,i);if(t instanceof Set)return l(e,t,r,i);let a=Object.keys(t);if(e==null||n.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let o=0;o{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ar();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),sr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),cr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),lr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),ur=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),dr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=sr(),n=cr(),r=lr(),i=rr(),a=ur();function o(e,t){return s(e,void 0,e,new Map,t)}function s(e,t,n,r=new Map,o=void 0){let u=o?.(e,t,n,r);if(u!==void 0)return u;if(i.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let i=0;i{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=dr();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),pr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=or(),n=fr();function r(e){return e=n.cloneDeep(e),n=>t.isMatch(n,e)}e.matches=r})),mr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=dr(),n=cr(),r=lr();function i(e,i){return t.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(n.getTag(e)===r.objectTag&&typeof e.constructor!=`function`){let n={};return c.set(e,n),t.copyProperties(n,e,s,c),n}switch(Object.prototype.toString.call(e)){case r.numberTag:case r.stringTag:case r.booleanTag:{let n=new e.constructor(e?.valueOf());return t.copyProperties(n,e),n}case r.argumentsTag:{let n={};return t.copyProperties(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}e.cloneDeepWith=i})),hr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=mr();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),gr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cr();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),vr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Ht(),n=gr(),r=_r(),i=Gt();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?i.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=or(),n=Ut(),r=hr(),i=Kt(),a=vr();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=n.toKey(e);break}return o=r.cloneDeep(o),function(n){let r=i.get(n,e);return r===void 0?a.has(n,e):o===void 0?r===void 0:t.isMatch(r,o)}}e.matchesProperty=o})),br=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Xn(),n=tr(),r=pr(),i=yr();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),xr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Jn(),n=Yn(),r=Xn(),i=er(),a=br();function o(e,o=r.identity){return i.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(a.iteratee(o),1)):[]}e.uniqBy=o})),Sr=p(i(((e,t)=>{t.exports=xr().uniqBy}))());function Cr(e,t,n){return t===!0?(0,Sr.default)(e,n):typeof t==`function`?(0,Sr.default)(e,t):e}var wr=i((e=>{var t=a();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return s(function(){a.value=n,a.getSnapshot=t,u(a)&&l({inst:a})},[e,n,t]),o(function(){return u(a)&&l({inst:a}),e(function(){u(a)&&l({inst:a})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Tr=i(((e,t)=>{t.exports=wr()})),Er=i((e=>{var t=a(),n=Tr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),a!==void 0&&f.hasValue){var t=f.value;if(a(t,e))return c=t}return c=e}if(t=c,i(s,e))return t;var n=r(e);return a!==void 0&&a(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,a]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Dr=i(((e,t)=>{t.exports=Er()})),Or=(0,O.createContext)(null),kr=Dr(),Ar=e=>e,R=()=>{var e=(0,O.useContext)(Or);return e?e.store.dispatch:Ar},jr=()=>{},Mr=()=>jr,Nr=(e,t)=>e===t;function z(e){var t=(0,O.useContext)(Or),n=(0,O.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:jr,[t,e]);return(0,kr.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Mr,t?t.store.getState:jr,t?t.store.getState:jr,n,Nr)}function Pr(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Fr(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Ir(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Lr=e=>Array.isArray(e)?e:[e];function Rr(e){let t=Array.isArray(e[0])?e[0]:e;return Ir(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function zr(e,t){let n=[],{length:r}=e;for(let i=0;i{n=Wr(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Kr(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Pr(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Gr,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Lr(c),p=Lr(u),m=Rr(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=zr(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var B=Kr(Gr),qr=Object.assign((e,t=B)=>{Fr(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>qr}),Jr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(en)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),Yr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),Xr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Yr(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),Zr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Jr(),n=Xr(),r=Gt();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;et==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||n.isKey(e)?e:{key:e,path:r.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,n)=>{for(let r=0;re.original)}e.orderBy=i})),Qr=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=gr(),n=Qn(),r=nr(),i=ir();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&t.isIndex(a)&&a{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Zr(),n=Qr(),r=$r();function i(e,...i){let a=i.length;return a>1&&r.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&r.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),t.orderBy(e,n.flatten(i),[`asc`])}e.sortBy=i})),ti=p(i(((e,t)=>{t.exports=ei().sortBy}))()),ni=e=>e.legend.settings,ri=e=>e.legend.size,ii=B([e=>e.legend.payload,ni],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?(0,ti.default)(r,n):r});function ai(){return z(ii)}var oi=1;function si(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,O.useState)({height:0,left:0,top:0,width:0});return[t,(0,O.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>oi||Math.abs(i.left-t.left)>oi||Math.abs(i.top-t.top)>oi||Math.abs(i.width-t.width)>oi)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function ci(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var li=typeof Symbol==`function`&&Symbol.observable||`@@observable`,ui=()=>Math.random().toString(36).substring(7).split(``).join(`.`),di={INIT:`@@redux/INIT${ui()}`,REPLACE:`@@redux/REPLACE${ui()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ui()}`};function fi(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function pi(e,t,n){if(typeof e!=`function`)throw Error(ci(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(ci(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(ci(1));return n(pi)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(ci(3));return i}function d(e){if(typeof e!=`function`)throw Error(ci(4));if(c)throw Error(ci(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(ci(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!fi(e))throw Error(ci(7));if(e.type===void 0)throw Error(ci(8));if(typeof e.type!=`string`)throw Error(ci(17));if(c)throw Error(ci(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(ci(10));r=e,f({type:di.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(ci(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[li](){return this}}}return f({type:di.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[li]:m}}function mi(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:di.INIT})===void 0)throw Error(ci(12));if(n(void 0,{type:di.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(ci(13))})}function hi(e){let t=Object.keys(e),n={};for(let r=0;re:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function _i(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(ci(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=gi(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function vi(e){return fi(e)&&`type`in e&&typeof e.type==`string`}var yi=Symbol.for(`immer-nothing`),bi=Symbol.for(`immer-draftable`),xi=Symbol.for(`immer-state`);function Si(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ci=Object,wi=Ci.getPrototypeOf,Ti=`constructor`,Ei=`prototype`,Di=`configurable`,Oi=`enumerable`,ki=`writable`,Ai=`value`,ji=e=>!!e&&!!e[xi];function Mi(e){return e?Fi(e)||Hi(e)||!!e[bi]||!!e[Ti]?.[bi]||Ui(e)||Wi(e):!1}var Ni=Ci[Ei][Ti].toString(),Pi=new WeakMap;function Fi(e){if(!e||!Gi(e))return!1;let t=wi(e);if(t===null||t===Ci[Ei])return!0;let n=Ci.hasOwnProperty.call(t,Ti)&&t[Ti];if(n===Object)return!0;if(!Ki(n))return!1;let r=Pi.get(n);return r===void 0&&(r=Function.toString.call(n),Pi.set(n,r)),r===Ni}function Ii(e,t,n=!0){Li(e)===0?(n?Reflect.ownKeys(e):Ci.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Li(e){let t=e[xi];return t?t.type_:Hi(e)?1:Ui(e)?2:Wi(e)?3:0}var Ri=(e,t,n=Li(e))=>n===2?e.has(t):Ci[Ei].hasOwnProperty.call(e,t),zi=(e,t,n=Li(e))=>n===2?e.get(t):e[t],Bi=(e,t,n,r=Li(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Vi(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Hi=Array.isArray,Ui=e=>e instanceof Map,Wi=e=>e instanceof Set,Gi=e=>typeof e==`object`,Ki=e=>typeof e==`function`,qi=e=>typeof e==`boolean`;function Ji(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Yi=e=>e.copy_||e.base_,Xi=e=>e.modified_?e.copy_:e.base_;function Zi(e,t){if(Ui(e))return new Map(e);if(Wi(e))return new Set(e);if(Hi(e))return Array[Ei].slice.call(e);let n=Fi(e);if(t===!0||t===`class_only`&&!n){let t=Ci.getOwnPropertyDescriptors(e);delete t[xi];let n=Reflect.ownKeys(t);for(let r=0;r1&&Ci.defineProperties(e,{set:ea,add:ea,clear:ea,delete:ea}),Ci.freeze(e),t&&Ii(e,(e,t)=>{Qi(t,!0)},!1),e)}function $i(){Si(2)}var ea={[Ai]:$i};function ta(e){return e===null||!Gi(e)||Ci.isFrozen(e)}var na=`MapSet`,ra=`Patches`,ia=`ArrayMethods`,aa={};function oa(e){let t=aa[e];return t||Si(0,e),t}var sa=e=>!!aa[e],ca,la=()=>ca,ua=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:sa(na)?oa(na):void 0,arrayMethodsPlugin_:sa(ia)?oa(ia):void 0});function da(e,t){t&&(e.patchPlugin_=oa(ra),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fa(e){pa(e),e.drafts_.forEach(ha),e.drafts_=null}function pa(e){e===ca&&(ca=e.parent_)}var ma=e=>ca=ua(ca,e);function ha(e){let t=e[xi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ga(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[xi].modified_&&(fa(t),Si(4)),Mi(e)&&(e=_a(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[xi].base_,e,t)}else e=_a(t,n);return va(t,e,!0),fa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===yi?void 0:e}function _a(e,t){if(ta(t))return t;let n=t[xi];if(!n)return Ea(t,e.handledSet_,e);if(!ba(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);wa(n,e)}return n.copy_}function va(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Qi(t,n)}function ya(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ba=(e,t)=>e.scope_===t,xa=[];function Sa(e,t,n,r){let i=Yi(e),a=e.type_;if(r!==void 0&&zi(i,r,a)===t){Bi(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Ii(i,(e,n)=>{if(ji(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??xa;for(let e of o)Bi(i,e,n,a)}function Ca(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!ba(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Xi(i);Sa(e,i.draft_??i,a,n),wa(i,r)})}function wa(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}ya(e)}}function Ta(e,t,n){let{scope_:r}=e;if(ji(n)){let i=n[xi];ba(i,r)&&i.callbacks_.push(function(){Pa(e),Sa(e,n,Xi(i),t)})}else Mi(n)&&e.callbacks_.push(function(){let i=Yi(e);e.type_===3?i.has(n)&&Ea(n,r.handledSet_,r):zi(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ea(zi(e.copy_,t,e.type_),r.handledSet_,r)})}function Ea(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ji(e)||t.has(e)||!Mi(e)||ta(e)?e:(t.add(e),Ii(e,(r,i)=>{if(ji(i)){let t=i[xi];ba(t,n)&&(Bi(e,r,Xi(t),e.type_),ya(t))}else Mi(i)&&Ea(i,t,n)}),e)}function Da(e,t){let n=Hi(e),r={type_:+!!n,scope_:t?t.scope_:la(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Oa;n&&(i=[r],a=ka);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Oa={get(e,t){if(t===xi)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Yi(e);if(!Ri(i,t,e.type_))return ja(e,i,t);let a=i[t];if(e.finalized_||!Mi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Ji(t))return a;if(a===Aa(e.base_,t)){Pa(e);let n=e.type_===1?+t:t,r=Ia(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Yi(e)},ownKeys(e){return Reflect.ownKeys(Yi(e))},set(e,t,n){let r=Ma(Yi(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Aa(Yi(e),t),i=r?.[xi];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Vi(n,r)&&(n!==void 0||Ri(e.base_,t,e.type_)))return!0;Pa(e),Na(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),Ta(e,t,n),!0)},deleteProperty(e,t){return Pa(e),Aa(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Na(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Yi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ki]:!0,[Di]:e.type_!==1||t!==`length`,[Oi]:r[Oi],[Ai]:n[t]}},defineProperty(){Si(11)},getPrototypeOf(e){return wi(e.base_)},setPrototypeOf(){Si(12)}},ka={};for(let e in Oa){let t=Oa[e];ka[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}ka.deleteProperty=function(e,t){return ka.set.call(this,e,t,void 0)},ka.set=function(e,t,n){return Oa.set.call(this,e[0],t,n,e[0])};function Aa(e,t){let n=e[xi];return(n?Yi(n):e)[t]}function ja(e,t,n){let r=Ma(t,n);return r?Ai in r?r[Ai]:r.get?.call(e.draft_):void 0}function Ma(e,t){if(!(t in e))return;let n=wi(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=wi(n)}}function Na(e){e.modified_||(e.modified_=!0,e.parent_&&Na(e.parent_))}function Pa(e){e.copy_||=(e.assigned_=new Map,Zi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Fa=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Ki(e)&&!Ki(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Ki(t)||Si(6),n!==void 0&&!Ki(n)&&Si(7);let r;if(Mi(e)){let i=ma(this),a=Ia(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?fa(i):pa(i)}return da(i,n),ga(r,i)}else if(!e||!Gi(e)){if(r=t(e),r===void 0&&(r=e),r===yi&&(r=void 0),this.autoFreeze_&&Qi(r,!0),n){let t=[],i=[];oa(ra).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else Si(1,e)},this.produceWithPatches=(e,t)=>{if(Ki(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},qi(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),qi(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),qi(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Mi(e)||Si(8),ji(e)&&(e=La(e));let t=ma(this),n=Ia(t,e,void 0);return n[xi].isManual_=!0,pa(t),n}finishDraft(e,t){let n=e&&e[xi];(!n||!n.isManual_)&&Si(9);let{scope_:r}=n;return da(r,t),ga(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=oa(ra).applyPatches_;return ji(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Ia(e,t,n,r){let[i,a]=Ui(t)?oa(na).proxyMap_(t,n):Wi(t)?oa(na).proxySet_(t,n):Da(t,n);return(n?.scope_??la()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Ca(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function La(e){return ji(e)||Si(10,e),Ra(e)}function Ra(e){if(!Mi(e)||ta(e))return e;let t=e[xi],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Zi(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Zi(e,!0);return Ii(n,(e,t)=>{Bi(n,e,Ra(t))},r),t&&(t.finalized_=!1),n}var za=new Fa().produce;function Ba(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var Va=Ba(),Ha=Ba,Ua=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?gi:gi.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Wa(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Qo(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>vi(t)&&t.type===e,n}var Ga=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Ka(e){return Mi(e)?za(e,()=>{}):e}function qa(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ja(e){return typeof e==`boolean`}var Ya=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Ga;return t&&(Ja(t)?a.push(Va):a.push(Ha(t.extraArgument))),a},Xa=`RTK_autoBatch`,V=()=>e=>({payload:e,meta:{[Xa]:!0}}),Za=e=>t=>{setTimeout(t,e)},Qa=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame:Za(10):e.type===`callback`?e.queueNotification:Za(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Xa],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},$a=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Ga(e);return n&&r.push(Qa(typeof n==`object`?n:void 0)),r};function eo(e){let t=Ya(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(fi(n))c=hi(n);else throw Error(Qo(1));let l;l=typeof r==`function`?r(t):t();let u=gi;i&&(u=Ua({trace:!1,...typeof i==`object`&&i}));let d=$a(_i(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return pi(c,o,p)}function to(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Qo(28));if(r in t)throw Error(Qo(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function no(e){return typeof e==`function`}function ro(e,t){let[n,r,i]=to(t),a;if(no(e))a=()=>Ka(e());else{let t=Ka(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(ji(e)){let r=n(e,t);return r===void 0?e:r}else if(Mi(e))return za(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var io=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,ao=(e=21)=>{let t=``,n=e;for(;n--;)t+=io[Math.random()*64|0];return t},oo=Symbol.for(`rtk-slice-createasyncthunk`);function so(e,t){return`${e}/${t}`}function co({creators:e}={}){let t=e?.asyncThunk?.[oo];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Qo(11));let i=(typeof e.reducers==`function`?e.reducers(fo()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Qo(12));if(n in o.sliceCaseReducersByType)throw Error(Qo(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:so(n,r),createNotation:typeof e.reducers==`function`};mo(a)?go(o,a,s,t):po(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?to(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return ro(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=qa(d,r,m)),i}function i(t=l){return qa(qa(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=lo(a,t,()=>qa(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function lo(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var uo=co();function fo(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function po({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!ho(r))throw Error(Qo(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Wa(e,o):Wa(e))}function mo(e){return e._reducerDefinitionType===`asyncThunk`}function ho(e){return e._reducerDefinitionType===`reducerWithPrepare`}function go({type:e,reducerName:t},n,r,i){if(!i)throw Error(Qo(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||_o,pending:s||_o,rejected:c||_o,settled:l||_o})}function _o(){}var vo=`task`,yo=`listener`,bo=`completed`,xo=`cancelled`,So=`task-${xo}`,Co=`task-${bo}`,wo=`${yo}-${xo}`,To=`${yo}-${bo}`,Eo=class{constructor(e){this.code=e,this.message=`${vo} ${xo} (reason: ${e})`}name=`TaskAbortError`;message},Do=(e,t)=>{if(typeof e!=`function`)throw TypeError(Qo(32))},Oo=()=>{},ko=(e,t=Oo)=>(e.catch(t),e),Ao=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),jo=e=>{if(e.aborted)throw new Eo(e.reason)};function Mo(e,t){let n=Oo;return new Promise((r,i)=>{let a=()=>i(new Eo(e.reason));if(e.aborted){a();return}n=Ao(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Oo})}var No=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof Eo?`cancelled`:`rejected`,error:e}}finally{t?.()}},Po=e=>t=>ko(Mo(e,t).then(t=>(jo(e),t))),Fo=e=>{let t=Po(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:Io}=Object,Lo={},Ro=`listenerMiddleware`,zo=(e,t)=>{let n=t=>Ao(e,()=>t.abort(e.reason));return(r,i)=>{Do(r,`taskExecutor`);let a=new AbortController;n(a);let o=No(async()=>{jo(e),jo(a.signal);let t=await r({pause:Po(a.signal),delay:Fo(a.signal),signal:a.signal});return jo(a.signal),t},()=>a.abort(Co));return i?.autoJoin&&t.push(o.catch(Oo)),{result:Po(e)(o),cancel(){a.abort(So)}}}},Bo=(e,t)=>{let n=async(n,r)=>{jo(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await Mo(t,Promise.race(a));return jo(t),e}finally{i()}};return(e,t)=>ko(n(e,t))},Vo=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Wa(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Qo(21));return Do(a,`options.listener`),{predicate:i,type:t,effect:a}},Ho=Io(e=>{let{type:t,predicate:n,effect:r}=Vo(e);return{id:ao(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Qo(22))}}},{withTypes:()=>Ho}),Uo=(e,t)=>{let{type:n,effect:r,predicate:i}=Vo(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},Wo=e=>{e.pending.forEach(e=>{e.abort(wo)})},Go=(e,t)=>()=>{for(let e of t.keys())Wo(e);e.clear()},Ko=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},qo=Io(Wa(`${Ro}/add`),{withTypes:()=>qo}),Jo=Wa(`${Ro}/removeAll`),Yo=Io(Wa(`${Ro}/remove`),{withTypes:()=>Yo}),Xo=(...e)=>{console.error(`${Ro}/error`,...e)},Zo=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=Xo}=e;Do(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Wo(e)}),c=e=>{let n=Uo(t,e)??Ho(e);return s(n)};Io(c,{withTypes:()=>c});let l=e=>{let n=Uo(t,e);return n&&(n.unsubscribe(),e.cancelActive&&Wo(n)),!!n};Io(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=Bo(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,Io({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:Fo(u.signal),pause:Po(u.signal),extra:a,signal:u.signal,fork:zo(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(wo),n.delete(e))})},cancel:()=>{u.abort(wo),e.pending.delete(u)},throwIfCancelled:()=>{jo(u.signal)}})))}catch(e){e instanceof Eo||Ko(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(To),i(e),e.pending.delete(u)}},d=Go(t,n);return{middleware:e=>n=>r=>{if(!vi(r))return n(r);if(qo.match(r))return c(r.payload);if(Jo.match(r)){d();return}if(Yo.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===Lo)throw Error(Qo(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,Ko(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=Lo}return s},startListening:c,stopListening:l,clearListeners:d}};function Qo(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var $o=uo({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:es,setLayout:ts,setChartSize:ns,setScale:rs}=$o.actions,is=$o.reducer;function as(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function H(e){return Number.isFinite(e)}function os(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function ss(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cs(e){for(var t=1;t{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&I(e[a]))return cs(cs({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&I(e[o]))return cs(cs({},e),{},{[o]:e[o]+(i||0)})}return e},ps=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,ms=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},hs=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Zt(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return H(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(ln):c&&l?l.map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ln):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ln):o.domain().map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(ln)},gs=(e,t)=>{if(!t||t.length!==2||!I(t[0])||!I(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!I(e[0])||e[0]r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Rt,none:Nt,silhouette:zt,wiggle:Bt,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},vs=(e,t,n)=>{var r=_s[n]??Nt,i=Lt().keys(t).value((e,t)=>Number(U(e,t,0))).order(Pt).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=U(e[i],t[r],0);Array.isArray(a)&&a.length===2&&I(a[0])&&I(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function ys(e){return e==null?void 0:String(e)}var bs=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=U(a,t.dataKey,t.scale.domain()[o]);if(L(s))return null;var c=t.scale.map(s);return I(c)?c-i/2+r:null},xs=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Ss=e=>{var t=e.flat(2).filter(I);return[Math.min(...t),Math.max(...t)]},Cs=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ws=(e,t,n)=>{if(e!=null)return Cs(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=Ss(as(r,t,n));return!H(i[0])||!H(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},Ts=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Es=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ds=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,ti.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},js=(e,t)=>t===`centric`?e.angle:e.radius,Ms=e=>e.layout.width,Ns=e=>e.layout.height,Ps=e=>e.layout.scale,Fs=e=>e.layout.margin,Is=B(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Ls=B(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Rs=`data-recharts-item-index`,zs=`data-recharts-item-id`;function Bs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vs(e){for(var t=1;te.brush.height;function Ks(e){return Ls(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function qs(e){return Ls(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Js(e){return Is(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function Ys(e){return Is(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var W=B([Ms,Ns,Fs,Gs,Ks,qs,Js,Ys,ni,ri],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=Vs(Vs({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=fs(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return Vs(Vs({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Xs=B(W,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Zs=B(Ms,Ns,(e,t)=>({x:0,y:0,width:e,height:t})),Qs=(0,O.createContext)(null),$s=()=>(0,O.useContext)(Qs)!=null,ec=e=>e.brush,tc=B([ec,W,Fs],(e,t,n)=>({height:e.height,x:I(e.x)?e.x:t.left,y:I(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:I(e.width)?e.width:t.width})),nc=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),rc=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=nc();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),ic=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=rc();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),ac=i(((e,t)=>{t.exports=ic().throttle})),oc=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},sc={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},cc=(e,t,n)=>{var{width:r=sc.width,height:i=sc.height,aspect:a,maxHeight:o}=n,s=$t(r)?e:Number(r),c=$t(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},lc={width:0,height:0,overflow:`visible`},uc={width:0,overflowX:`visible`},dc={height:0,overflowY:`visible`},fc={},pc=e=>{var{width:t,height:n}=e,r=$t(t),i=$t(n);return r&&i?lc:r?uc:i?dc:fc};function mc(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=sc.width,a=sc.height):i===void 0?i=r&&r>0?void 0:sc.width:a===void 0&&(a=r&&r>0?void 0:sc.height),{width:i,height:a}}var hc=p(ac());function gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return Cc(i)?O.createElement(Sc.Provider,{value:i},t):null}var Tc=()=>(0,O.useContext)(Sc),Ec=(0,O.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=sc.initialDimension,width:i,height:a,minWidth:o=sc.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=sc.debounce,id:d,className:f,onResize:p,style:m={}}=e,g=(0,O.useRef)(null),_=(0,O.useRef)();_.current=p,(0,O.useImperativeHandle)(t,()=>g.current);var[v,y]=(0,O.useState)({containerWidth:r.width,containerHeight:r.height}),b=(0,O.useCallback)((e,t)=>{y(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,O.useEffect)(()=>{if(g.current==null||typeof ResizeObserver>`u`)return un;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;b(r,i),(t=_.current)==null||t.call(_,r,i)}};u>0&&(e=(0,hc.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=g.current.getBoundingClientRect();return b(n,r),t.observe(g.current),()=>{t.disconnect()}},[b,u]);var{containerWidth:x,containerHeight:S}=v;oc(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:C,calculatedHeight:w}=cc(x,S,{width:i,height:a,aspect:n,maxHeight:c});return oc(C!=null&&C>0||w!=null&&w>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,C,w,i,a,o,s,n),O.createElement(`div`,{id:d?`${d}`:void 0,className:h(`recharts-responsive-container`,f),style:vc(vc({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:g},O.createElement(`div`,{style:pc({width:i,height:a})},O.createElement(wc,{width:C,height:w},l)))}),Dc=(0,O.forwardRef)((e,t)=>{var n=Tc();if(os(n.width)&&os(n.height))return e.children;var{width:r,height:i}=mc({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=cc(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return I(a)&&I(o)?O.createElement(wc,{width:a,height:o},e.children):O.createElement(Ec,gc({},e,{width:r,height:i,ref:t}))});function Oc(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var kc=()=>{var e=$s(),t=z(Xs),n=z(tc),r=z(ec)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},Ac={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},jc=()=>z(W)??Ac,Mc=()=>z(Ms),Nc=()=>z(Ns),Pc=()=>z(e=>e.layout.margin),G=e=>e.layout.layoutType,Fc=()=>z(G),Ic=()=>{var e=Fc();if(e===`horizontal`||e===`vertical`)return e},Lc=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},Rc=()=>Fc()!==void 0,zc=e=>{var t=R(),n=$s(),{width:r,height:i}=e,a=Tc(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,O.useEffect)(()=>{!n&&os(o)&&os(s)&&t(ns({width:o,height:s}))},[t,n,o,s]),null},Bc=Symbol.for(`immer-nothing`),Vc=Symbol.for(`immer-draftable`),Hc=Symbol.for(`immer-state`);function Uc(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wc=Object.getPrototypeOf;function Gc(e){return!!e&&!!e[Hc]}function Kc(e){return e?Yc(e)||Array.isArray(e)||!!e[Vc]||!!e.constructor?.[Vc]||tl(e)||nl(e):!1}var qc=Object.prototype.constructor.toString(),Jc=new WeakMap;function Yc(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;if(typeof n!=`function`)return!1;let r=Jc.get(n);return r===void 0&&(r=Function.toString.call(n),Jc.set(n,r)),r===qc}function Xc(e,t,n=!0){Zc(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Zc(e){let t=e[Hc];return t?t.type_:Array.isArray(e)?1:tl(e)?2:nl(e)?3:0}function Qc(e,t){return Zc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function $c(e,t,n){let r=Zc(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function el(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function tl(e){return e instanceof Map}function nl(e){return e instanceof Set}function rl(e){return e.copy_||e.base_}function il(e,t){if(tl(e))return new Map(e);if(nl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Yc(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[Hc];let n=Reflect.ownKeys(t);for(let r=0;r1&&Object.defineProperties(e,{set:sl,add:sl,clear:sl,delete:sl}),Object.freeze(e),t&&Object.values(e).forEach(e=>al(e,!0)),e)}function ol(){Uc(2)}var sl={value:ol};function cl(e){return typeof e!=`object`||!e||Object.isFrozen(e)}var ll={};function ul(e){let t=ll[e];return t||Uc(0,e),t}var dl;function fl(){return dl}function pl(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ml(e,t){t&&(ul(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function hl(e){gl(e),e.drafts_.forEach(vl),e.drafts_=null}function gl(e){e===dl&&(dl=e.parent_)}function _l(e){return dl=pl(dl,e)}function vl(e){let t=e[Hc];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yl(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[Hc].modified_&&(hl(t),Uc(4)),Kc(e)&&(e=bl(t,e),t.parent_||Sl(t,e)),t.patches_&&ul(`Patches`).generateReplacementPatches_(n[Hc].base_,e,t.patches_,t.inversePatches_)):e=bl(t,n,[]),hl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Bc?void 0:e}function bl(e,t,n){if(cl(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[Hc];if(!i)return Xc(t,(r,a)=>xl(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Sl(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),Xc(a,(r,a)=>xl(e,i,t,r,a,n,o),r),Sl(e,t,!1),n&&e.patches_&&ul(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function xl(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=cl(i);if(!(s&&!o)){if(Gc(i)){let o=bl(e,i,a&&t&&t.type_!==3&&!Qc(t.assigned_,r)?a.concat(r):void 0);if($c(n,r,o),Gc(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Kc(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;bl(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(tl(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Sl(e,i)}}}function Sl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&al(t,n)}function Cl(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:fl(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=wl;n&&(i=[r],a=Tl);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var wl={get(e,t){if(t===Hc)return e;let n=rl(e);if(!Qc(n,t))return Dl(e,n,t);let r=n[t];return e.finalized_||!Kc(r)?r:r===El(e.base_,t)?(Al(e),e.copy_[t]=Ml(r,e)):r},has(e,t){return t in rl(e)},ownKeys(e){return Reflect.ownKeys(rl(e))},set(e,t,n){let r=Ol(rl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=El(rl(e),t),i=r?.[Hc];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(el(n,r)&&(n!==void 0||Qc(e.base_,t)))return!0;Al(e),kl(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return El(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Al(e),kl(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=rl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){Uc(11)},getPrototypeOf(e){return Wc(e.base_)},setPrototypeOf(){Uc(12)}},Tl={};Xc(wl,(e,t)=>{Tl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Tl.deleteProperty=function(e,t){return Tl.set.call(this,e,t,void 0)},Tl.set=function(e,t,n){return wl.set.call(this,e[0],t,n,e[0])};function El(e,t){let n=e[Hc];return(n?rl(n):e)[t]}function Dl(e,t,n){let r=Ol(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function Ol(e,t){if(!(t in e))return;let n=Wc(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Wc(n)}}function kl(e){e.modified_||(e.modified_=!0,e.parent_&&kl(e.parent_))}function Al(e){e.copy_||=il(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var jl=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&Uc(6),n!==void 0&&typeof n!=`function`&&Uc(7);let r;if(Kc(e)){let i=_l(this),a=Ml(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?hl(i):gl(i)}return ml(i,n),yl(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===Bc&&(r=void 0),this.autoFreeze_&&al(r,!0),n){let t=[],i=[];ul(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else Uc(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kc(e)||Uc(8),Gc(e)&&(e=Nl(e));let t=_l(this),n=Ml(e,void 0);return n[Hc].isManual_=!0,gl(t),n}finishDraft(e,t){let n=e&&e[Hc];(!n||!n.isManual_)&&Uc(9);let{scope_:r}=n;return ml(r,t),yl(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=ul(`Patches`).applyPatches_;return Gc(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Ml(e,t){let n=tl(e)?ul(`MapSet`).proxyMap_(e,t):nl(e)?ul(`MapSet`).proxySet_(e,t):Cl(e,t);return(t?t.scope_:fl()).drafts_.push(n),n}function Nl(e){return Gc(e)||Uc(10,e),Pl(e)}function Pl(e){if(!Kc(e)||cl(e))return e;let t=e[Hc],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=il(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=il(e,!0);return Xc(n,(e,t)=>{$c(n,e,Pl(t))},r),t&&(t.finalized_=!1),n}new jl().produce;function K(e){return e}var Fl=uo({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(K(t.payload))},prepare:V()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=La(e).payload.indexOf(K(n));i>-1&&(e.payload[i]=K(r))},prepare:V()},removeLegendPayload:{reducer(e,t){var n=La(e).payload.indexOf(K(t.payload));n>-1&&e.payload.splice(n,1)},prepare:V()}}}),{setLegendSize:Il,setLegendSettings:Ll,addLegendPayload:Rl,replaceLegendPayload:zl,removeLegendPayload:Bl}=Fl.actions,Vl=Fl.reducer,Hl=i((e=>{var t=a();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));i(((e,t)=>{t.exports=Hl()}))();function Ul(e){e()}function Wl(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Ul(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Gl={notify(){},get:()=>[]};function Kl(e,t){let n,r=Gl,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Wl())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Gl)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var ql=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Jl=typeof navigator<`u`&&navigator.product===`ReactNative`,Yl=ql||Jl?O.useLayoutEffect:O.useEffect;function Xl(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function Zl(e,t){if(Xl(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r{let e=Kl(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=O.useMemo(()=>i.getState(),[i]);Yl(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||tu;return O.createElement(s.Provider,{value:a},t)}var ru=nu,iu=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function au(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function ou(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(iu.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Zl(e[n],t[n]))return!1}else if(!au(e[n],t[n]))return!1;return!0}var su=p(s()),cu=[`contextPayload`];function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(Ll(e))},[t,e]),null}function xu(e){var t=R();return(0,O.useEffect)(()=>(t(Il(e)),()=>{t(Il({width:0,height:0}))}),[t,e]),null}function Su(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var Cu={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function wu(e){var t=Fn(e,Cu),n=ai(),r=_e(),i=Pc(),{width:a,height:o,wrapperStyle:s,portal:c}=t,[l,u]=si([n]),d=Mc(),f=Nc();if(d==null||f==null)return null;var p=d-(i?.left||0)-(i?.right||0),m=Su(t.layout,o,a,p),h=c?s:du(du({position:`absolute`,width:m?.width||a||`auto`,height:m?.height||o||`auto`},yu(s,t,i,d,f,l)),s),g=c??r;return g==null||n==null?null:(0,su.createPortal)(O.createElement(`div`,{className:`recharts-legend-wrapper`,style:h,ref:u},O.createElement(bu,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&O.createElement(xu,{width:l.width,height:l.height}),O.createElement(vu,lu({},t,m,{margin:i,chartWidth:d,chartHeight:f,contextPayload:n}))),g)}var Tu=O.memo(wu,ou);Tu.displayName=`Legend`;function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=Nu.separator,contentStyle:n,itemStyle:r,labelStyle:i=Nu.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:f=Nu.accessibilityLayer}=e,p=()=>{if(a&&a.length){var e={padding:0,margin:0},n=Pu(a,s).map((e,n)=>{if(!e||e.type===`none`)return null;var i=e.formatter||o||Mu,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var f=Ou(Ou({},Nu.itemStyle),{},{color:e.color||Nu.itemStyle.color},r);return O.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:f},en(u)?O.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,en(u)?O.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,O.createElement(`span`,{className:`recharts-tooltip-item-value`},l),O.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return O.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},m=Ou(Ou({},Nu.contentStyle),n),g=Ou({margin:0},i),_=!L(u),v=_?u:``,y=h(`recharts-default-tooltip`,c),b=h(`recharts-tooltip-label`,l);_&&d&&a!=null&&(v=d(u,a));var x=f?{role:`status`,"aria-live":`assertive`}:{};return O.createElement(`div`,Eu({className:y,style:m},x),O.createElement(`p`,{className:b,style:g},O.isValidElement(v)?v:`${v}`),p())},Iu=`recharts-tooltip-wrapper`,Lu={visibility:`hidden`};function Ru(e){var{coordinate:t,translateX:n,translateY:r}=e;return h(Iu,{[`${Iu}-right`]:I(n)&&t&&I(t.x)&&n>=t.x,[`${Iu}-left`]:I(n)&&t&&I(t.x)&&n=t.y,[`${Iu}-top`]:I(r)&&t&&I(t.y)&&r0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(uf+l?Math.max(u,f):Math.max(d,f)}function Bu(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Vu(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=zu({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=zu({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Bu({translateX:d,translateY:f,useTranslate3d:c})):u=Lu,{cssProperties:u,cssClasses:Ru({translateX:d,translateY:f,coordinate:n})}}var Hu={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Uu(){var[e,t]=(0,O.useState)(()=>Hu.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,O.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function Wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gu(e){for(var t=1;t({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));O.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(Gu(Gu({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=Vu({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=Gu(Gu({},e.hasPortalFromProps?{}:Gu(Gu({transition:Yu({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return O.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var Zu=O.memo(Xu),Qu=()=>z(e=>e.rootProps.accessibilityLayer)??!0;function $u(){return $u=Object.assign?Object.assign.bind():function(e){for(var t=1;tH(e.x)&&H(e.y),sd=e=>e.base!=null&&od(e.base)&&od(e),cd=e=>e.x,ld=e=>e.y,ud=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${cn(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=ad[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return ad[n]||Pe},dd={connectNulls:!1,type:`linear`},fd=e=>{var{type:t=dd.type,points:n=[],baseLine:r,layout:i,connectNulls:a=dd.connectNulls}=e,o=ud(t,i),s=a?n.filter(od):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>td(td({},e),{},{base:r[t]}));return c=i===`vertical`?Re().y(ld).x1(cd).x0(e=>e.base.x):Re().x(cd).y1(ld).y0(e=>e.base.y),c.defined(sd).curve(o)(a?l.filter(sd):l)}return(i===`vertical`&&I(r)?Re().y(ld).x1(cd).x0(r):I(r)?Re().x(cd).y1(ld).y0(r):Le().x(cd).y(ld)).defined(od).curve(o)(s)},pd=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Fc();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?fd(o):r;return O.createElement(`path`,$u({},ie(e),Dn(e),{className:h(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},md=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function hd(){return hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t`M${e},${i}v${r}M${a},${t}h${n}`,wd=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=xd(e,md),l=_d({x:t,y:n,top:r,left:i,width:a,height:o},c);return!I(t)||!I(n)||!I(a)||!I(o)||!I(r)||!I(i)?null:O.createElement(`path`,hd({},N(l),{className:h(`recharts-cross`,s),d:Cd(t,n,a,o,r,i)}))};function Td(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function Ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dd(e){for(var t=1;te.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),Md=(e,t,n)=>e.map(e=>`${jd(e)} ${t}ms ${n}`).join(`,`),Nd=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),Pd=(e,t)=>Object.keys(t).reduce((n,r)=>Dd(Dd({},n),{},{[r]:e(r,t[r])}),{});function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Id(e){for(var t=1;te+(t-e)*n,Vd=e=>{var{from:t,to:n}=e;return t!==n},Hd=(e,t,n)=>{var r=Pd((t,n)=>{if(Vd(n)){var[r,i]=e(n.from,n.to,n.velocity);return Id(Id({},n),{},{from:r,velocity:i})}return n},t);return n<1?Pd((e,t)=>Vd(t)&&r[e]!=null?Id(Id({},t),{},{velocity:Bd(t.velocity,r[e].velocity,n),from:Bd(t.from,r[e].from,n)}):t,t):Hd(e,r,n-1)};function Ud(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>Id(Id({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>Pd((e,t)=>t.from,s),l=()=>!Object.values(s).filter(Vd).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=Hd(n,s,f),i(Id(Id(Id({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function Wd(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:Id(Id({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=Pd((e,t)=>Bd(...t,n(d)),c);if(a(Id(Id(Id({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=Pd((e,t)=>Bd(...t,n(1)),c);a(Id(Id(Id({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var Gd=(e,t,n,r,i,a)=>{var o=Nd(e,t);return n==null?()=>(i(Id(Id({},e),t)),()=>{}):n.isStepper===!0?Ud(e,t,n,o,i,a):Wd(e,t,n,r,o,i,a)},Kd=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],qd=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),Jd=(e,t)=>n=>qd(Kd(e,t),n),Yd=(e,t)=>n=>qd([...Kd(e,t).map((e,t)=>e*t).slice(1),0],n),Xd=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},Zd=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=Xd(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},Qd=(e,t,n,r)=>{var i=Jd(e,n),a=Jd(t,r),o=Yd(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},$d=function(){return Qd(...Zd(...arguments))},ef=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},tf=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return $d(e);case`spring`:return ef();default:if(e.split(`(`)[0]===`cubic-bezier`)return $d(e)}return typeof e==`function`?e:null};function nf(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}var rf=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function af(){return nf(new rf)}var of=(0,O.createContext)(af);function sf(e,t){var n=(0,O.useContext)(of);return(0,O.useMemo)(()=>t??n(e),[e,t,n])}var cf={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},lf={t:0},uf={t:1};function df(e){var t=Fn(e,cf),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=Uu(),d=n===`auto`?!Hu.isSsr&&!u:n,f=sf(t.animationId,t.animationManager),[p,m]=(0,O.useState)(d?lf:uf),h=(0,O.useRef)(null);return(0,O.useEffect)(()=>{d||m(uf)},[d]),(0,O.useEffect)(()=>{if(!d||!r)return un;var e=Gd(lf,uf,tf(a),i,m,f.getTimeoutController());return f.start([c,o,()=>{h.current=e()},i,s]),()=>{f.stop(),h.current&&h.current(),s()}},[d,r,i,a,o,c,s,f]),l(p.t)}function ff(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,O.useRef)(nn(t)),r=(0,O.useRef)(e);return r.current!==e&&(n.current=nn(t),r.current=e),n.current}var pf=[`radius`],mf=[`radius`],hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf;function Tf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t{var a=Yt(n),o=Yt(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;ps?s:h}d=F(hf||=Nf([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=F(gf||=Nf([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=F(_f||=Nf([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=F(vf||=Nf([`A `,`,`,`,0,0,`,`, + `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=F(yf||=Nf([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=F(bf||=Nf([`A `,`,`,`,0,0,`,`, + `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=F(xf||=Nf([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=F(Sf||=Nf([`A `,`,`,`,0,0,`,`, + `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=F(Cf||=Nf(`M .,. + A .,.,0,0,.,.,. + L .,. + A .,.,0,0,.,.,. + L .,. + A .,.,0,0,.,.,. + L .,. + A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=F(wf||=Nf([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},Ff={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},If=e=>{var t=Fn(e,Ff),n=(0,O.useRef)(null),[r,i]=(0,O.useState)(-1);(0,O.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:g}=t,_=(0,O.useRef)(s),v=(0,O.useRef)(c),y=(0,O.useRef)(a),b=(0,O.useRef)(o),x=ff((0,O.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var S=h(`recharts-rectangle`,u);if(!g){var C=N(t),{radius:w}=C,T=jf(C,pf);return O.createElement(`path`,Af({},T,{x:Yt(a),y:Yt(o),width:Yt(s),height:Yt(c),radius:typeof l==`number`?l:void 0,className:S,d:Pf(a,o,s,c,l)}))}var E=_.current,D=v.current,k=y.current,ee=b.current,A=`0px ${r===-1?1:r}px`,j=`${r}px ${r}px`,M=Md([`strokeDasharray`],f,typeof d==`string`?d:Ff.animationEasing);return O.createElement(df,{animationId:x,key:x,canBegin:r>0,duration:f,easing:d,isActive:g,begin:p},e=>{var r=on(E,s,e),i=on(D,c,e),u=on(k,a,e),d=on(ee,o,e);n.current&&(_.current=r,v.current=i,y.current=u,b.current=d);var f=m?e>0?{transition:M,strokeDasharray:j}:{strokeDasharray:A}:{strokeDasharray:j},p=N(t),{radius:h}=p,g=jf(p,mf);return O.createElement(`path`,Af({},g,{radius:typeof l==`number`?l:void 0,className:S,d:Pf(u,d,r,i,l),ref:n,style:Ef(Ef({},f),t.style)}))})};function Lf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rf(e){for(var t=1;te*180/Math.PI,q=(e,t,n,r)=>({x:e+Math.cos(-Hf*r)*n,y:t+Math.sin(-Hf*r)*n}),Wf=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},Gf=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Kf=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Gf({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:Uf(c),angleInRadian:c}},qf=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Jf=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},Yf=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Kf({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(is||i===0)return null;var{startAngle:c,endAngle:l}=qf(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u=c&&u<=l}else{for(;u>c;)u-=360;for(;u=l&&u<=c}return d?Rf(Rf({},t),{},{radius:i,angle:Jf(u,t)}):null};function Xf(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[q(t,n,r,i),q(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var Zf,Qf,$f,ep,tp,np,rp;function ip(){return ip=Object.assign?Object.assign.bind():function(e){for(var t=1;tZt(t-e)*Math.min(Math.abs(t-e),359.999),sp=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/Hf,d=c?i:i+a*u,f=q(t,n,l,d),p=q(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:q(t,n,l*Math.cos(u*Hf),m),theta:u}},cp=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=op(a,o),c=a+s,l=q(t,n,i,a),u=q(t,n,i,c),d=F(Zf||=ap([`M `,`,`,` + A `,`,`,`,0, + `,`,`,`, + `,`,`,` + `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=q(t,n,r,a),p=q(t,n,r,c);d+=F(Qf||=ap([`L `,`,`,` + A `,`,`,`,0, + `,`,`,`, + `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=F($f||=ap([`L `,`,`,` Z`]),t,n);return d},lp=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=Zt(l-c),{circleTangency:d,lineTangency:f,theta:p}=sp({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=sp({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?F(ep||=ap([`M `,`,`,` + a`,`,`,`,0,0,1,`,`,0 + a`,`,`,`,0,0,1,`,`,0 + `]),f.x,f.y,a,a,a*2,a,a,-a*2):cp({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=F(tp||=ap([`M `,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,` + A`,`,`,`,0,`,`,`,`,`,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,` + `]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=sp({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=sp({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=F(np||=ap([`L`,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,` + A`,`,`,`,0,`,`,`,`,`,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=F(rp||=ap([`L`,`,`,`Z`]),t,n);return v},up={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},dp=e=>{var t=Fn(e,up),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a0&&Math.abs(l-u)<360?lp({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):cp({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return O.createElement(`path`,ip({},N(t),{className:f,d:g}))};function fp(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(En(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=q(r,i,a,s),l=q(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return Xf(t)}}var pp=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Yr();function n(e){return t.isSymbol(e)?NaN:Number(e)}e.toNumber=n})),mp=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=pp();function n(e){return e?(e=t.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}e.toFinite=n})),hp=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=$r(),n=mp();function r(e,r,i){i&&typeof i!=`number`&&t.isIterateeCall(e,r,i)&&(r=i=void 0),e=n.toFinite(e),r===void 0?(r=e,e=0):r=n.toFinite(r),i=i===void 0?e{t.exports=hp().range})),_p=e=>e.chartData,vp=B([_p],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),yp=(e,t,n,r)=>r?vp(e):_p(e),bp=(e,t,n)=>n?vp(e):_p(e),xp=B([yp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)}),Sp=B([vp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)}),Cp=B([_p],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});function wp(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(H(t)&&H(n))return!0}return!1}function Tp(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Ep(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(H(n))i=n;else if(typeof n==`function`)return;if(H(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(wp(o))return o}}function Dp(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(wp(r))return Tp(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(I(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&&Ts.test(i)){var c=Ts.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(I(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&Es.test(a)){var u=Es.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(wp(f))return t==null?f:Tp(f,t,n)}}}var J=p(i(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),ee(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),ee(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||en)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;tr?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,ee=r.constructor,A=r.s==i.s?1:-1,j=r.d,M=i.d;if(!r.s)return new ee(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=M.length,T=j.length,g=new ee(A),_=g.d=[],u=0;M[u]==(j[u]||0);)++u;if(M[u]>(j[u]||0)&&--l,x=o==null?o=ee.precision:s?o+(S(r)-S(i))+1:o,x<0)return new ee(0);if(x=x/p+2|0,u=0,O==1)for(d=0,M=M[0],x++;(u1&&(M=e(M,d),j=e(j,d),O=M.length,T=j.length),w=O,v=j.slice(0,O),y=v.length;y=f/2&&++E;do d=0,c=t(M,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(M,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),rh||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function ee(e,t){if(e.length>t)return e.length=t,!0}function A(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=A,i.config=i.set=j,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=A(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function Op(e){return e===0?1:Math.floor(new J.default(e).abs().log(10).toNumber())+1}function kp(e,t,n){for(var r=new J.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var Ap=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},jp=(e,t,n)=>{if(e.lte(0))return new J.default(0);var r=Op(e.toNumber()),i=new J.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new J.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new J.default(s.toNumber()):new J.default(Math.ceil(s.toNumber()))},Mp=(e,t,n)=>{if(e.lte(0))return new J.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new J.default(i).abs().log(10).toNumber()),o=new J.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new J.default(10).pow(l))}var u=new J.default(r[c]??1).mul(o);return t?u:new J.default(Math.ceil(u.toNumber()))},Np=(e,t,n)=>{var r=new J.default(1),i=new J.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new J.default(10).pow(Op(e)-1),i=new J.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new J.default(Math.floor(e)))}else e===0?i=new J.default(Math.floor((t-1)/2)):n||(i=new J.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:jp;if(!Number.isFinite((t-e)/(n-1)))return{step:new J.default(0),tickMin:new J.default(0),tickMax:new J.default(0)};var o=a(new J.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new J.default(0):(s=new J.default(e).add(t).div(2),s=s.sub(new J.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new J.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?Pp(e,t,n,r,i+1,a):(u0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new J.default(c).mul(o)),tickMax:s.add(new J.default(l).mul(o))})},Fp=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=Ap([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return Np(s,r,i);var{step:u,tickMin:d,tickMax:f}=Pp(s,c,o,i,0,a===`snap125`?Mp:jp),p=kp(d,f.add(new J.default(.1).mul(u)),u);return t>n?p.reverse():p},Ip=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=Ap([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?Mp:jp,l=Math.max(t,2),u=c(new J.default(s).sub(o).div(l-1),i,0),d=[...kp(new J.default(o),new J.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},Lp=e=>e.rootProps.maxBarSize,Rp=e=>e.rootProps.barGap,zp=e=>e.rootProps.barCategoryGap,Bp=e=>e.rootProps.barSize,Vp=e=>e.rootProps.stackOffset,Hp=e=>e.rootProps.reverseStackOrder,Up=e=>e.options.chartName,Wp=e=>e.rootProps.syncId,Gp=e=>e.rootProps.syncMethod,Kp=e=>e.options.eventEmitter,qp={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Jp={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:qp.axis},Yp={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:qp.axis},Xp=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Zp(e,t,n){if(n!==`auto`)return n;if(e!=null)return ps(e,t)?`category`:`number`}function Qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $p(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Lc],(e,t)=>{if(e!=null)return e;var n=Zp(t,`angleAxis`,rm.type)??`category`;return $p($p({},rm),{},{type:n})}),om=B([(e,t)=>e.polarAxis.radiusAxis[t],Lc],(e,t)=>{if(e!=null)return e;var n=Zp(t,`radiusAxis`,im.type)??`category`;return $p($p({},im),{},{type:n})}),sm=e=>e.polarOptions,cm=B([Ms,Ns,W],Wf),lm=B([sm,cm],(e,t)=>{if(e!=null)return rn(e.innerRadius,t,0)}),um=B([sm,cm],(e,t)=>{if(e!=null)return rn(e.outerRadius,t,t*.8)}),dm=B([sm],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});B([am,dm],Xp);var fm=B([cm,lm,um],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});B([om,fm],Xp);var pm=B([G,sm,lm,um,Ms,Ns],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:rn(o,i,i/2),cy:rn(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),Y=(e,t)=>t,mm=(e,t,n)=>n;function hm(e){return e?.id}function gm(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(!(t==null||t.length===0)){var n=hm(e);t.forEach((t,r)=>{var s=a==null||i?r:String(U(t,a,null)),c=U(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function _m(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var vm=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function ym(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function bm(e,t){if(e.length===t.length){for(var n=0;n{var t=G(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},Sm=e=>e.tooltip.settings.axisId;function Cm(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var wm=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!wp(t)){for(var n,r,i=0;ir)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function Tm(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Em(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Dm(e){let t,n,r;e.length===2?(t=e===Tm||e===Em?e:Om,n=e,r=e):(t=Tm,n=(t,n)=>Tm(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Om(){return 0}function km(e){return e===null?NaN:+e}function*Am(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var jm=Dm(Tm),Mm=jm.right;jm.left,Dm(km).center;var Nm=class extends Map{constructor(e,t=Lm){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(Pm(this,e))}has(e){return super.has(Pm(this,e))}set(e,t){return super.set(Fm(this,e),t)}delete(e){return super.delete(Im(this,e))}};function Pm({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function Fm({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Im({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Lm(e){return typeof e==`object`&&e?e.valueOf():e}function Rm(e=Tm){if(e===Tm)return zm;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function zm(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et))}var Bm=Math.sqrt(50),Vm=Math.sqrt(10),Hm=Math.sqrt(2);function Um(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Bm?10:a>=Vm?5:a>=Hm?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function Jm(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ym(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?zm:Rm(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));Ym(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Xm(e,n,t),i(e[r],a)>0&&Xm(e,n,r);o0;)--s}i(e[n],a)===0?Xm(e,n,s):(++s,Xm(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Xm(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Zm(e,t,n){if(e=Float64Array.from(Am(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Jm(e);if(t>=1)return qm(e);var r,i=(r-1)*t,a=Math.floor(i),o=qm(Ym(e,a).subarray(0,a+1));return o+(Jm(e.subarray(a+1))-o)*(i-a)}}function Qm(e,t,n=km){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function $m(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gh.exec(e))?new Mh(t[1],t[2],t[3],1):(t=_h.exec(e))?new Mh(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=vh.exec(e))?kh(t[1],t[2],t[3],t[4]):(t=yh.exec(e))?kh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bh.exec(e))?zh(t[1],t[2]/100,t[3]/100,1):(t=xh.exec(e))?zh(t[1],t[2]/100,t[3]/100,t[4]):Sh.hasOwnProperty(e)?Oh(Sh[e]):e===`transparent`?new Mh(NaN,NaN,NaN,0):null}function Oh(e){return new Mh(e>>16&255,e>>8&255,e&255,1)}function kh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mh(e,t,n,r)}function Ah(e){return e instanceof lh||(e=Dh(e)),e?(e=e.rgb(),new Mh(e.r,e.g,e.b,e.opacity)):new Mh}function jh(e,t,n,r){return arguments.length===1?Ah(e):new Mh(e,t,n,r??1)}function Mh(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sh(Mh,jh,ch(lh,{brighter(e){return e=e==null?dh:dh**+e,new Mh(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?uh:uh**+e,new Mh(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mh(Lh(this.r),Lh(this.g),Lh(this.b),Ih(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Nh,formatHex:Nh,formatHex8:Ph,formatRgb:Fh,toString:Fh}));function Nh(){return`#${Rh(this.r)}${Rh(this.g)}${Rh(this.b)}`}function Ph(){return`#${Rh(this.r)}${Rh(this.g)}${Rh(this.b)}${Rh((isNaN(this.opacity)?1:this.opacity)*255)}`}function Fh(){let e=Ih(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Lh(this.r)}, ${Lh(this.g)}, ${Lh(this.b)}${e===1?`)`:`, ${e})`}`}function Ih(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Lh(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Rh(e){return e=Lh(e),(e<16?`0`:``)+e.toString(16)}function zh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Hh(e,t,n,r)}function Bh(e){if(e instanceof Hh)return new Hh(e.h,e.s,e.l,e.opacity);if(e instanceof lh||(e=Dh(e)),!e)return new Hh;if(e instanceof Hh)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new Hh(o,s,c,e.opacity)}function Vh(e,t,n,r){return arguments.length===1?Bh(e):new Hh(e,t,n,r??1)}function Hh(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sh(Hh,Vh,ch(lh,{brighter(e){return e=e==null?dh:dh**+e,new Hh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?uh:uh**+e,new Hh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Mh(Gh(e>=240?e-240:e+120,i,r),Gh(e,i,r),Gh(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Hh(Uh(this.h),Wh(this.s),Wh(this.l),Ih(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Ih(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Uh(this.h)}, ${Wh(this.s)*100}%, ${Wh(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Uh(e){return e=(e||0)%360,e<0?e+360:e}function Wh(e){return Math.max(0,Math.min(1,e||0))}function Gh(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Kh=e=>()=>e;function qh(e,t){return function(n){return e+n*t}}function Jh(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Yh(e){return(e=+e)==1?Xh:function(t,n){return n-t?Jh(t,n,e):Kh(isNaN(t)?n:t)}}function Xh(e,t){var n=t-e;return n?qh(e,n):Kh(isNaN(e)?t:e)}var Zh=(function e(t){var n=Yh(t);function r(e,t){var r=n((e=jh(e)).r,(t=jh(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Xh(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Qh(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ng(r,i)})),n=ag.lastIndex;return nt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function vg(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?yg:vg,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),ng))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,pg),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=ug,u()},d.clamp=function(e){return arguments.length?(o=e?!0:hg,u()):o!==hg},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Sg(){return xg()(hg,hg)}function Cg(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function wg(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Tg(e){return e=wg(Math.abs(e)),e?e[1]:NaN}function Eg(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Dg(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Og=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kg(e){if(!(t=Og.exec(e)))throw Error(`invalid format: `+e);var t;return new Ag({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}kg.prototype=Ag.prototype;function Ag(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Ag.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function jg(e){out:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Mg;function Ng(e,t){var n=wg(e,t);if(!n)return Mg=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Mg=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+wg(e,Math.max(0,t+a-1))[0]}function Pg(e,t){var n=wg(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Fg={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Cg,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Pg(e*100,t),r:Pg,s:Ng,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ig(e){return e}var Lg=Array.prototype.map,Rg=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function zg(e){var t=e.grouping===void 0||e.thousands===void 0?Ig:Eg(Lg.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?Ig:Dg(Lg.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=kg(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Fg[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Fg[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=jg(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Mg!==void 0?Rg[8+Mg/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++op||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(Tg(t)/3)))*3,r=10**-n,i=l((e=kg(e),e.type=`f`,e),{suffix:Rg[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Bg,Vg,Hg;Ug({thousands:`,`,grouping:[3],currency:[`$`,``]});function Ug(e){return Bg=zg(e),Vg=Bg.format,Hg=Bg.formatPrefix,Bg}function Wg(e){return Math.max(0,-Tg(Math.abs(e)))}function Gg(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tg(t)/3)))*3-Tg(Math.abs(e)))}function Kg(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tg(t)-Tg(e))+1}function qg(e,t,n,r){var i=Km(e,t,n),a;switch(r=kg(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Gg(i,o))&&(r.precision=a),Hg(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Kg(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Wg(i))&&(r.precision=a-(r.type===`%`)*2);break}return Vg(r)}function Jg(e){var t=e.domain;return e.ticks=function(e){var n=t();return Wm(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return qg(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=Gm(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Yg(){var e=Sg();return e.copy=function(){return bg(e,Yg())},eh.apply(e,arguments),Jg(e)}function Xg(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,pg),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Xg(e).unknown(t)},e=arguments.length?Array.from(e,pg):[0,1],Jg(n)}function Zg(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return ae**+t}function i_(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function a_(e){return(t,n)=>-e(-t,n)}function o_(e){let t=e(Qg,$g),n=t.domain,r=10,i,a;function o(){return i=i_(r),a=r_(r),n()[0]<0?(i=a_(i),a=a_(a),e(e_,t_)):e(Qg,$g),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s0){for(;l<=u;++l)for(d=1;ds)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(fs)break;m.push(f)}m.length*2{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=kg(n)).precision==null&&(n.trim=!0),n=Vg(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*rn(Zg(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function s_(){let e=o_(xg()).domain([1,10]);return e.copy=()=>bg(e,s_()).base(e.base()),eh.apply(e,arguments),e}function c_(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function l_(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function u_(e){var t=1,n=e(c_(t),l_(t));return n.constant=function(n){return arguments.length?e(c_(t=+n),l_(t)):t},Jg(n)}function d_(){var e=u_(xg());return e.copy=function(){return bg(e,d_()).constant(e.constant())},eh.apply(e,arguments)}function f_(e){return function(t){return t<0?-((-t)**+e):t**+e}}function p_(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function m_(e){return e<0?-e*e:e*e}function h_(e){var t=e(hg,hg),n=1;function r(){return n===1?e(hg,hg):n===.5?e(p_,m_):e(f_(n),f_(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},Jg(t)}function g_(){var e=h_(xg());return e.copy=function(){return bg(e,g_()).exponent(e.exponent())},eh.apply(e,arguments),e}function __(){return g_.apply(null,arguments).exponent(.5)}function v_(e){return Math.sign(e)*e*e}function y_(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function b_(){var e=Sg(),t=[0,1],n=!1,r;function i(t){var i=y_(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(v_(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,pg)).map(v_)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return b_(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},eh.apply(i,arguments),Jg(i)}function x_(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return S_().domain([e,t]).range(i).unknown(a)},eh.apply(Jg(o),arguments)}function C_(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[Mm(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return C_().domain(e).range(t).unknown(n)},eh.apply(i,arguments)}var w_=new Date,T_=new Date;function E_(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(sE_(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(w_.setTime(+t),T_.setTime(+r),e(w_),e(T_),Math.floor(n(w_,T_))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var D_=E_(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);D_.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?E_(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):D_),D_.range;var O_=1e3,k_=O_*60,A_=k_*60,j_=A_*24,M_=j_*7,N_=j_*30,P_=j_*365,F_=E_(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*O_)},(e,t)=>(t-e)/O_,e=>e.getUTCSeconds());F_.range;var I_=E_(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*O_)},(e,t)=>{e.setTime(+e+t*k_)},(e,t)=>(t-e)/k_,e=>e.getMinutes());I_.range;var L_=E_(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*k_)},(e,t)=>(t-e)/k_,e=>e.getUTCMinutes());L_.range;var R_=E_(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*O_-e.getMinutes()*k_)},(e,t)=>{e.setTime(+e+t*A_)},(e,t)=>(t-e)/A_,e=>e.getHours());R_.range;var z_=E_(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*A_)},(e,t)=>(t-e)/A_,e=>e.getUTCHours());z_.range;var B_=E_(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*k_)/j_,e=>e.getDate()-1);B_.range;var V_=E_(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/j_,e=>e.getUTCDate()-1);V_.range;var H_=E_(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/j_,e=>Math.floor(e/j_));H_.range;function U_(e){return E_(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*k_)/M_)}var W_=U_(0),G_=U_(1),K_=U_(2),q_=U_(3),J_=U_(4),Y_=U_(5),X_=U_(6);W_.range,G_.range,K_.range,q_.range,J_.range,Y_.range,X_.range;function Z_(e){return E_(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/M_)}var Q_=Z_(0),$_=Z_(1),ev=Z_(2),tv=Z_(3),nv=Z_(4),rv=Z_(5),iv=Z_(6);Q_.range,$_.range,ev.range,tv.range,nv.range,rv.range,iv.range;var av=E_(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());av.range;var ov=E_(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ov.range;var sv=E_(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());sv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:E_(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),sv.range;var cv=E_(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());cv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:E_(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),cv.range;function lv(e,t,n,r,i,a){let o=[[F_,1,O_],[F_,5,5*O_],[F_,15,15*O_],[F_,30,30*O_],[a,1,k_],[a,5,5*k_],[a,15,15*k_],[a,30,30*k_],[i,1,A_],[i,3,3*A_],[i,6,6*A_],[i,12,12*A_],[r,1,j_],[r,2,2*j_],[n,1,M_],[t,1,N_],[t,3,3*N_],[e,1,P_]];function s(e,t,n){let r=te).right(o,i);if(a===o.length)return e.every(Km(t/P_,n/P_,r));if(a===0)return D_.every(Math.max(Km(t,n,r),1));let[s,c]=o[i/o[a-1][2]53)return null;`w`in r||(r.w=1),`Z`in r?(a=hv(gv(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?$_.ceil(a):$_(a),a=V_.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=mv(gv(r.y,0,1)),o=a.getDay(),a=o>4||o===0?G_.ceil(a):G_(a),a=B_.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?hv(gv(r.y,0,1)).getUTCDay():mv(gv(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,hv(r)):mv(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in vv?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function ee(e,n,r){return w(e,t,n,r)}function A(e,t,r){return w(e,n,t,r)}function j(e,t,n){return w(e,r,t,n)}function M(e){return o[e.getDay()]}function te(e){return a[e.getDay()]}function ne(e){return c[e.getMonth()]}function re(e){return s[e.getMonth()]}function ie(e){return i[+(e.getHours()>=12)]}function ae(e){return 1+~~(e.getMonth()/3)}function N(e){return o[e.getUTCDay()]}function oe(e){return a[e.getUTCDay()]}function se(e){return c[e.getUTCMonth()]}function ce(e){return s[e.getUTCMonth()]}function le(e){return i[+(e.getUTCHours()>=12)]}function ue(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var vv={"-":``,_:` `,0:`0`},yv=/^\s*\d+/,bv=/^%/,xv=/[\\^$*+?|[\]().{}]/g;function X(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a[e.toLowerCase(),t]))}function Tv(e,t,n){var r=yv.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ev(e,t,n){var r=yv.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ov(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Av(e,t,n){var r=yv.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function jv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mv(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Nv(e,t,n){var r=yv.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Fv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Iv(e,t,n){var r=yv.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Lv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Rv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function zv(e,t,n){var r=yv.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Bv(e,t,n){var r=yv.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Vv(e,t,n){var r=yv.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Hv(e,t,n){var r=bv.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Uv(e,t,n){var r=yv.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Wv(e,t,n){var r=yv.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Gv(e,t){return X(e.getDate(),t,2)}function Kv(e,t){return X(e.getHours(),t,2)}function qv(e,t){return X(e.getHours()%12||12,t,2)}function Jv(e,t){return X(1+B_.count(sv(e),e),t,3)}function Yv(e,t){return X(e.getMilliseconds(),t,3)}function Xv(e,t){return Yv(e,t)+`000`}function Zv(e,t){return X(e.getMonth()+1,t,2)}function Qv(e,t){return X(e.getMinutes(),t,2)}function $v(e,t){return X(e.getSeconds(),t,2)}function ey(e){var t=e.getDay();return t===0?7:t}function ty(e,t){return X(W_.count(sv(e)-1,e),t,2)}function ny(e){var t=e.getDay();return t>=4||t===0?J_(e):J_.ceil(e)}function ry(e,t){return e=ny(e),X(J_.count(sv(e),e)+(sv(e).getDay()===4),t,2)}function iy(e){return e.getDay()}function ay(e,t){return X(G_.count(sv(e)-1,e),t,2)}function oy(e,t){return X(e.getFullYear()%100,t,2)}function sy(e,t){return e=ny(e),X(e.getFullYear()%100,t,2)}function cy(e,t){return X(e.getFullYear()%1e4,t,4)}function ly(e,t){var n=e.getDay();return e=n>=4||n===0?J_(e):J_.ceil(e),X(e.getFullYear()%1e4,t,4)}function uy(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+X(t/60|0,`0`,2)+X(t%60,`0`,2)}function dy(e,t){return X(e.getUTCDate(),t,2)}function fy(e,t){return X(e.getUTCHours(),t,2)}function py(e,t){return X(e.getUTCHours()%12||12,t,2)}function my(e,t){return X(1+V_.count(cv(e),e),t,3)}function hy(e,t){return X(e.getUTCMilliseconds(),t,3)}function gy(e,t){return hy(e,t)+`000`}function _y(e,t){return X(e.getUTCMonth()+1,t,2)}function vy(e,t){return X(e.getUTCMinutes(),t,2)}function yy(e,t){return X(e.getUTCSeconds(),t,2)}function by(e){var t=e.getUTCDay();return t===0?7:t}function xy(e,t){return X(Q_.count(cv(e)-1,e),t,2)}function Sy(e){var t=e.getUTCDay();return t>=4||t===0?nv(e):nv.ceil(e)}function Cy(e,t){return e=Sy(e),X(nv.count(cv(e),e)+(cv(e).getUTCDay()===4),t,2)}function wy(e){return e.getUTCDay()}function Ty(e,t){return X($_.count(cv(e)-1,e),t,2)}function Ey(e,t){return X(e.getUTCFullYear()%100,t,2)}function Dy(e,t){return e=Sy(e),X(e.getUTCFullYear()%100,t,2)}function Oy(e,t){return X(e.getUTCFullYear()%1e4,t,4)}function ky(e,t){var n=e.getUTCDay();return e=n>=4||n===0?nv(e):nv.ceil(e),X(e.getUTCFullYear()%1e4,t,4)}function Ay(){return`+0000`}function jy(){return`%`}function My(e){return+e}function Ny(e){return Math.floor(e/1e3)}var Py,Fy,Iy;Ly({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function Ly(e){return Py=_v(e),Fy=Py.format,Py.parse,Iy=Py.utcFormat,Py.utcParse,Py}function Ry(e){return new Date(e)}function zy(e){return e instanceof Date?+e:+new Date(+e)}function By(e,t,n,r,i,a,o,s,c,l){var u=Sg(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>Zm(e,r/t))},n.copy=function(){return Xy(t).domain(e)},th.apply(n,arguments)}function Zy(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=hg,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*eih,scaleDiverging:()=>Qy,scaleDivergingLog:()=>$y,scaleDivergingPow:()=>tb,scaleDivergingSqrt:()=>nb,scaleDivergingSymlog:()=>eb,scaleIdentity:()=>Xg,scaleImplicit:()=>nh,scaleLinear:()=>Yg,scaleLog:()=>s_,scaleOrdinal:()=>rh,scalePoint:()=>oh,scalePow:()=>g_,scaleQuantile:()=>x_,scaleQuantize:()=>S_,scaleRadial:()=>b_,scaleSequential:()=>Gy,scaleSequentialLog:()=>Ky,scaleSequentialPow:()=>Jy,scaleSequentialQuantile:()=>Xy,scaleSequentialSqrt:()=>Yy,scaleSequentialSymlog:()=>qy,scaleSqrt:()=>__,scaleSymlog:()=>d_,scaleThreshold:()=>C_,scaleTime:()=>Vy,scaleUtc:()=>Hy,tickFormat:()=>qg});function ib(e){var t=rb;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${cn(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function ab(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=ib(e);if(r!=null)return r.domain(t).range(n),r}}function ob(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?ab(e.scale,n,r):ab(t,n,r)}function sb(e){return`scale${cn(e)}`}function cb(e){return sb(e)in rb}var lb=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return cb(r)?r:`point`}};function ub(e,t){for(var n=0,r=e.length,i=e[0]t)?n=a+1:r=a}return n}function db(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=ub(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function fb(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):db(e,void 0)}var pb=p(gp());function mb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hb(e){for(var t=1;te.cartesianAxis.xAxis[t],Sb=(e,t)=>xb(e,t)??bb,Cb={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:yb,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},wb=(e,t)=>e.cartesianAxis.yAxis[t],Tb=(e,t)=>wb(e,t)??Cb,Eb={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},Db=(e,t)=>e.cartesianAxis.zAxis[t]??Eb,Z=(e,t,n)=>{switch(t){case`xAxis`:return Sb(e,n);case`yAxis`:return Tb(e,n);case`zAxis`:return Db(e,n);case`angleAxis`:return am(e,n);case`radiusAxis`:return om(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},Ob=(e,t,n)=>{switch(t){case`xAxis`:return Sb(e,n);case`yAxis`:return Tb(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},kb=(e,t,n)=>{switch(t){case`xAxis`:return Sb(e,n);case`yAxis`:return Tb(e,n);case`angleAxis`:return am(e,n);case`radiusAxis`:return om(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},Ab=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function jb(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var Mb=e=>e.graphicalItems.cartesianItems,Nb=B([Y,mm],jb),Pb=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0||!e.hide),Fb=B([Mb,Z,Nb],Pb,{memoizeOptions:{resultEqualityCheck:ym}}),Ib=B([Fb],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(_m)),Lb=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),Rb=B([Fb],Lb),zb=e=>e.map(e=>e.data).filter(Boolean).flat(1),Bb=B([Fb],e=>e.some(e=>!e.data)),Vb=B([Fb],zb,{memoizeOptions:{resultEqualityCheck:ym}}),Hb=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Ub=B([Vb,yp],Hb),Wb=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:U(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:U(e,t.dataKey)})),Gb=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:s,dataEndIndex:c}=r,l=Wb(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...o.slice(s,c+1).map(e=>({value:U(e,t.dataKey)})).filter(e=>e.value!=null),...l]:l},Kb=B([Ub,Z,Fb,yp,Bb,Vb],Gb);function qb(e){if(en(e)||e instanceof Date){var t=Number(e);if(H(t))return t}}function Jb(e){if(Array.isArray(e)){var t=[qb(e[0]),qb(e[1])];return wp(t)?t:void 0}var n=qb(e);if(n!=null)return[n,n]}function Yb(e){return e.map(qb).filter(ln)}function Xb(e,t){var n=qb(e),r=qb(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Zb=B([Kb],e=>e?.map(e=>e.value).sort(Xb));function Qb(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function $b(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!Qt(t))r=t;else if(Array.isArray(t)){var i=Yb(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Yb(n.flatMap(t=>{var n=U(e,t.dataKey),i,a;if(Array.isArray(n)?[i,a]=n:i=a=n,!(!H(i)||!H(a)))return[r-i,r+a]}))}var ex=e=>kb(e,xm(e),Sm(e)),tx=B([ex],e=>e?.dataKey),nx=B([Ib,yp,ex],gm),rx=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:vs(e,o.map(hm),n),graphicalItems:o}]}))},ix=B([nx,Ib,Vp,Hp],rx),ax=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=ws(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},ox=B([Z],e=>e.allowDataOverflow),sx=e=>{if(e==null||!(`domain`in e))return yb;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=Yb(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??yb},cx=B([Z],sx),lx=B([cx,ox],Ep),ux=B([ix,_p,Y,lx],ax,{memoizeOptions:{resultEqualityCheck:vm}}),dx=e=>e.errorBars,fx=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>Qb(n,e)),px=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},mx=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>Qb(i,e));n.forEach(n=>{var r=U(n,t.dataKey??e.dataKey),i=$b(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||as)&&(s=l)}var u=Jb(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=Jb(U(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),H(o)&&H(s))return[o,s]},hx=B([Ub,Z,Rb,dx,Y,xp],mx,{memoizeOptions:{resultEqualityCheck:vm}});function gx(e){var{value:t}=e;if(en(t)||t instanceof Date)return t}var _x=(e,t,n)=>{var r=e.map(gx).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&an(r))?(0,pb.default)(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},vx=e=>e.referenceElements.dots,yx=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),bx=B([vx,Y,mm],yx),xx=e=>e.referenceElements.areas,Sx=B([xx,Y,mm],yx),Cx=e=>e.referenceElements.lines,wx=B([Cx,Y,mm],yx),Tx=(e,t)=>{if(e!=null){var n=Yb(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ex=B(bx,Y,Tx),Dx=(e,t)=>{if(e!=null){var n=Yb(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ox=B([Sx,Y],Dx);function kx(e){if(e.x!=null)return Yb([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:Yb(t)}function Ax(e){if(e.y!=null)return Yb([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:Yb(t)}var jx=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?kx(e):Ax(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Mx=B(Ex,B([wx,Y],jx),Ox,(e,t,n)=>px(e,n,t)),Nx=(e,t,n,r,i,a,o,s)=>n??Dp(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?px(r,a,i):px(a,i),e.allowDataOverflow),Px=B([Z,cx,lx,ux,hx,Mx,G,Y],Nx,{memoizeOptions:{resultEqualityCheck:vm}}),Fx=[0,1],Ix=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:s,type:c}=e,l=ps(t,a);return l&&s==null?(0,pb.default)(0,n?.length??0):c===`category`?_x(r,e,l):i===`expand`&&!l?Fx:o}},Lx=B([Z,G,Ub,Kb,Vp,Y,Px],Ix),Rx=B([Z,Ab,Up],lb),zx=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=sx(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&wp(e)){if(a)return Fp(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return Ip(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&wp(e))return Fp(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&wp(e))return Ip(e,t.tickCount,t.allowDecimals,`adaptive`)}}},Bx=B([Lx,kb,Rx],zx),Vx=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&wp(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},Hx=B([Z,Lx,Bx,Y],Vx),Ux=B(B(Kb,Z,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(Yb(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;si,(e,t,n,r,i)=>{if(!H(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=rn(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),Wx=(e,t,n)=>{var r=Sb(e,t);return r==null||typeof r.padding!=`string`?0:Ux(e,`xAxis`,t,n,r.padding)},Gx=(e,t,n)=>{var r=Tb(e,t);return r==null||typeof r.padding!=`string`?0:Ux(e,`yAxis`,t,n,r.padding)},Kx=B(Sb,Wx,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),qx=B(Tb,Gx,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),Jx=B([W,Kx,tc,ec,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Yx=B([W,G,qx,tc,ec,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Xx=(e,t,n,r)=>{switch(t){case`xAxis`:return Jx(e,n,r);case`yAxis`:return Yx(e,n,r);case`zAxis`:return Db(e,n)?.range;case`angleAxis`:return dm(e);case`radiusAxis`:return fm(e,n);default:return}},Zx=B([Z,Xx],Xp),Qx=B([Z,Rx,B([Rx,Hx],wm),Zx],ob),$x=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n;if(ps(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},eS=B([G,Kb,kb,Y],$x),tS=B([Qx],Cm);B([Qx],fb),B([Qx,Zb],db),B([Fb,dx,Y],fx);function nS(e,t){return e.idt.id)}var rS=(e,t)=>t,iS=(e,t,n)=>n,aS=B(Is,rS,iS,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(nS)),oS=B(Ls,rS,iS,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(nS)),sS=(e,t)=>({width:e.width,height:t.height}),cS=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),lS=B(W,Sb,sS),uS=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},dS=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},fS=B(Ns,W,aS,rS,iS,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=sS(t,n);o??=uS(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),pS=B(Ms,W,oS,rS,iS,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=cS(t,n);o??=dS(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),mS=B([W,Sb,(e,t)=>{var n=Sb(e,t);if(n!=null)return fS(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),hS=B([W,Tb,(e,t)=>{var n=Tb(e,t);if(n!=null)return pS(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),gS=B(W,Tb,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),_S=(e,t,n)=>{switch(t){case`xAxis`:return lS(e,n).width;case`yAxis`:return gS(e,n).height;default:return}},vS=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=ps(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&an(l))return c}},yS=B([G,Kb,Z,Y],vS),bS=B([G,Ob,Rx,tS,yS,eS,Xx,Bx,Y],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=ps(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),xS=B([G,kb,Rx,tS,Bx,Xx,yS,eS,Y],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=ps(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?Zt(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return H(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(ln):l&&s?s.map((e,t)=>{var n=r.map(e);return H(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(ln):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return H(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(ln):r.domain().map((e,t)=>{var n=r.map(e);return H(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(ln)}}),SS=B([G,kb,tS,Xx,yS,eS,Y],(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=ps(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?Zt(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return H(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(ln):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return H(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(ln):n.domain().map((e,t)=>{var r=n.map(e);return H(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(ln)}}),CS=B(Z,tS,(e,t)=>{if(!(e==null||t==null))return hb(hb({},e),{},{scale:t})});B((e,t,n)=>Db(e,n),B([B([Z,Rx,Lx,Zx],ob)],Cm),(e,t)=>{if(!(e==null||t==null))return hb(hb({},e),{},{scale:t})});var wS=B([G,Is,Ls],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});B([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);ae.options.defaultTooltipEventType,ES=e=>e.options.validateTooltipEventTypes;function DS(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function OS(e,t){return DS(t,TS(e),ES(e))}function kS(e){return z(t=>OS(t,e))}var AS=(e,t)=>{var n,r=Number(t);if(!(Qt(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},jS=e=>e.tooltip.settings,MS={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},NS=uo({name:`tooltip`,initialState:{itemInteraction:{click:MS,hover:MS},axisInteraction:{click:MS,hover:MS},keyboardInteraction:MS,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(K(t.payload))},prepare:V()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=La(e).tooltipItemPayloads.indexOf(K(n));i>-1&&(e.tooltipItemPayloads[i]=K(r))},prepare:V()},removeTooltipEntrySettings:{reducer(e,t){var n=La(e).tooltipItemPayloads.indexOf(K(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:V()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:PS,replaceTooltipEntrySettings:FS,removeTooltipEntrySettings:IS,setTooltipSettingsState:LS,setActiveMouseOverItemIndex:RS,mouseLeaveItem:zS,mouseLeaveChart:BS,setActiveClickItemIndex:VS,setMouseOverAxisIndex:HS,setMouseClickAxisIndex:US,setSyncInteraction:WS,setKeyboardInteraction:GS}=NS.actions,KS=NS.reducer;function qS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JS(e){for(var t=1;t{if(t==null)return MS;var i=QS(e,t,n);if(i==null)return MS;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if($S(i)){if(a)return JS(JS({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return JS(JS({},MS),{},{coordinate:i.coordinate})};function tC(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function nC(e,t){var n=tC(e),r=t[0],i=t[1];return n!==void 0&&n>=Math.min(r,i)&&n<=Math.max(r,i)}function rC(e,t,n){if(n==null||t==null)return!0;var r=U(e,t);return r==null||!wp(n)||nC(r,n)}var iC=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!H(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||rC(l,n,r)?String(c):null},aC=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},oC=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},sC=e=>e.options.tooltipPayloadSearcher,cC=e=>e.tooltip;function lC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uC(e){for(var t=1;te(t)}function _C(e){if(typeof e==`string`)return e}function vC(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?mC(e.name):void 0,unit:`unit`in e?hC(e.unit):void 0,dataKey:`dataKey`in e?gC(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?_C(e.color):void 0,fill:`fill`in e?_C(e.fill):void 0}}function yC(e,t){return e??t}var bC=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=yC(d,s),m=Array.isArray(p)?as(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?sn(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=vC(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=uC(uC({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(Os({tooltipEntrySettings:o,dataKey:i,payload:a,value:U(a,i),name:r==null?void 0:String(r)}))}):e.push(Os({tooltipEntrySettings:f,dataKey:h,payload:_,value:U(_,h),name:U(_,g)??f?.name})),e},[])}},xC=B([ex,Ab,Up],lb),SC=B([B([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),ex,B([xm,Sm],jb)],Pb,{memoizeOptions:{resultEqualityCheck:ym}}),CC=B([SC],e=>e.filter(_m)),wC=B([SC],zb,{memoizeOptions:{resultEqualityCheck:ym}}),TC=B([SC],e=>e.some(e=>!e.data)),EC=B([wC,_p],Hb),DC=B([CC,_p,ex],gm),OC=B([EC,ex,SC,_p,TC,wC],Gb),kC=B([ex],sx),AC=B([kC,B([ex],e=>e.allowDataOverflow)],Ep),jC=B([B([DC,B([SC],e=>e.filter(_m)),Vp,Hp],rx),_p,xm,AC],ax),MC=B([EC,ex,B([SC],Lb),dx,xm,Cp],mx,{memoizeOptions:{resultEqualityCheck:vm}}),NC=B([B([vx,xm,Sm],yx),xm],Tx),PC=B([B([xx,xm,Sm],yx),xm],Dx),FC=B([ex,G,EC,OC,Vp,xm,B([ex,kC,AC,jC,MC,B([NC,B([B([Cx,xm,Sm],yx),xm],jx),PC],px),G,xm],Nx)],Ix),IC=B([ex,FC,B([FC,ex,xC],zx),xm],Vx),LC=e=>Xx(e,xm(e),Sm(e),!1),RC=B([ex,LC],Xp),zC=B([B([ex,xC,IC,RC],ob)],Cm),BC=B([G,ex,xC,zC,LC,B([G,OC,ex,xm],vS),B([G,OC,ex,xm],$x),xm],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=ps(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?Zt(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return H(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(ln):r.domain().map((e,t)=>{var n=r.map(e);return H(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(ln)}}}),VC=B([TS,ES,jS],(e,t,n)=>DS(n.shared,e,t)),HC=e=>e.tooltip.settings.trigger,UC=e=>e.tooltip.settings.defaultIndex,WC=B([cC,VC,HC,UC],eC),GC=B([WC,EC,tx,FC],iC),KC=B([BC,GC],AS),qC=B([WC],e=>{if(e)return e.dataKey}),JC=B([WC],e=>{if(e)return e.graphicalItemId}),YC=B([cC,VC,HC,UC],oC),XC=B([WC,B([Ms,Ns,G,W,BC,UC,YC],aC)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ZC=B([WC],e=>e?.active??!1);B([B([YC,GC,_p,tx,KC,sC,VC],bC)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function QC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $C(e){for(var t=1;tz(ex),iw=()=>{var e=rw(),t=z(BC),n=z(zC);return Ds(!e||!n?void 0:$C($C({},e),{},{scale:n}),t)};function aw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ow(e){for(var t=1;t{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},dw=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return ow(ow(ow({},r),q(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return ow(ow(ow({},r),q(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function fw(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var pw=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(Zt(c-s)!==Zt(l-c)){var d=[];if(Zt(l-c)===Zt(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_(v.coordinate+b.coordinate)/2||_>0&&_(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},mw=()=>z(Up),hw=(e,t)=>t,gw=(e,t,n)=>n,_w=(e,t,n,r)=>r,vw=B(BC,e=>(0,ti.default)(e,e=>e.coordinate)),yw=B([cC,hw,gw,_w],eC),bw=B([yw,EC,tx,FC],iC),xw=(e,t,n)=>{if(t!=null){var r=cC(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},Sw=B([cC,hw,gw,_w],oC),Cw=B([Ms,Ns,G,W,BC,_w,Sw],aC),ww=B([yw,Cw],(e,t)=>e.coordinate??t),Tw=B([BC,bw],AS),Ew=B([Sw,bw,_p,tx,Tw,sC,hw],bC),Dw=B([yw,bw],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Ow=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&fw(e,o)){var s=pw(As(e,t),a,i,n,r),c=uw(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},kw=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=Yf(e,n);if(s){var c=pw(js(s,t),o,a,r,i),l=dw(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},Aw=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?Ow(e,t,r,i,a,o,s):kw(e,t,n,r,i,a,o)},jw=B(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Mw=B(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(qp));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:bm}});function Nw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pw(e){for(var t=1;tPw(Pw({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},zw=new Set(Object.values(qp));function Bw(e){return zw.has(e)}var Vw=uo({name:`zIndex`,initialState:Rw,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:V()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!Bw(n)&&delete e.zIndexMap[n])},prepare:V()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=K(r):e.zIndexMap[n].element=K(r):e.zIndexMap[n]={consumers:0,element:i?void 0:K(r),panoramaElement:i?K(r):void 0}},prepare:V()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:V()}}}),{registerZIndexPortal:Hw,unregisterZIndexPortal:Uw,registerZIndexPortalElement:Ww,unregisterZIndexPortalElement:Gw}=Vw.actions,Kw=Vw.reducer;function qw(e){var{zIndex:t,children:n}=e,r=Rc()&&t!==void 0&&t!==0,i=$s(),a=(0,O.useRef)(void 0),o=(0,O.useRef)(new Set),s=R(),c=z(e=>jw(e,t,i));if((0,O.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(Uw({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(Hw({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(Uw({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,O.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(Uw({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,su.createPortal)(n,l):null}function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,O.useContext)(rT),aT=p(i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Qt(n))return e[n]}},uT=uo({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),dT=uT.reducer,{createEventEmitter:fT}=uT.actions;function pT(e){return e.tooltip.syncInteraction}var mT=uo({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=K(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:hT,setDataStartEndIndexes:gT,setComputedData:_T}=mT.actions,vT=mT.reducer,yT=[`x`,`y`];function bT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xT(e){for(var t=1;t{if(e==null)return un;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(WS({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=TT(d,yT),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=xT(xT({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(xT(xT({},c),{},{payload:xT(xT({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(x==null||o==null){n(WS({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(b==null){n(WS({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(WS({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return oT.on(sT,s),()=>{oT.off(sT,s)}},[z(e=>e.rootProps.className),n,t,e,r,i,a,o])}function OT(){var e=z(Wp),t=z(Kp),n=R();(0,O.useEffect)(()=>{if(e==null)return un;var r=(r,i,a)=>{t!==a&&e===r&&n(gT(i))};return oT.on(cT,r),()=>{oT.off(cT,r)}},[n,t,e])}function kT(){var e=R();(0,O.useEffect)(()=>{e(fT())},[e]),DT(),OT()}function AT(e,t,n,r,i,a){var o=z(n=>xw(n,e,t)),s=z(JC),c=z(Kp),l=z(Wp),u=z(Gp),d=z(pT)?.sourceViewBox!=null,f=kc();(0,O.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=WS({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});oT.emit(sT,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function jT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MT(e){for(var t=1;t{x(LS({shared:g,trigger:_,axisId:b,active:n,defaultIndex:S}))},[x,g,_,b,n,S]);var C=kc(),w=Qu(),T=kS(g),{activeIndex:E,isActive:D}=z(e=>Dw(e,T,_,S))??{},k=z(e=>Ew(e,T,_,S)),ee=z(e=>Tw(e,T,_,S)),A=z(e=>ww(e,T,_,S)),j=k,M=iT(),te=n??D??!1,[ne,re]=si([j,te]),ie=T===`axis`?ee:void 0;AT(T,_,A,ie,E,te);var ae=y??M;if(ae==null||C==null||T==null)return null;var N=j??RT;te||(N=RT),s&&N.length&&(N=Cr(N.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,IT));var oe=N.length>0,se=MT(MT({},t),{},{payload:N,label:ie,active:te,activeIndex:E,coordinate:A,accessibilityLayer:w}),ce=O.createElement(Zu,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:te,coordinate:A,hasPayload:oe,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:C,wrapperStyle:m,lastBoundingBox:ne,innerRef:re,hasPortalFromProps:!!y},LT(o,se));return O.createElement(O.Fragment,null,(0,su.createPortal)(ce,ae),te&&O.createElement(nT,{cursor:h,tooltipEventType:T,coordinate:A,payload:N,index:E}))}var VT=e=>null;VT.displayName=`Cell`;function HT(e,t,n){return(t=UT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UT(e){var t=WT(e,`string`);return typeof t==`symbol`?t:t+``}function WT(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var GT=class{constructor(e){HT(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function KT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qT(e){for(var t=1;t{try{var n=document.getElementById(eE);n||(n=document.createElement(`span`),n.setAttribute(`id`,eE),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,$T,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},rE=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Hu.isSsr)return{width:0,height:0};if(!ZT.enableCache)return nE(e,t);var n=tE(e,t),r=QT.get(n);if(r)return r;var i=nE(e,t);return QT.set(n,i),i},iE;function aE(e,t,n){return(t=oE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oE(e){var t=sE(e,`string`);return typeof t==`symbol`?t:t+``}function sE(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var cE=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,lE=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,uE=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,dE=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,fE={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},pE=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function mE(e){return pE.includes(e)}var hE=`NaN`;function gE(e,t){return e*fE[t]}var _E=class e{static parse(t){var[,n,r]=dE.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,Qt(e)&&(this.unit=``),t!==``&&!uE.test(t)&&(this.num=NaN,this.unit=``),mE(t)&&(this.num=gE(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return Qt(this.num)}};iE=_E,aE(_E,`NaN`,new iE(NaN,``));function vE(e){if(e==null||e.includes(hE))return hE;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=cE.exec(t)??[],a=_E.parse(n??``),o=_E.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return hE;t=t.replace(cE,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=lE.exec(t)??[],d=_E.parse(c??``),f=_E.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return hE;t=t.replace(lE,p.toString())}return t}var yE=/\(([^()]*)\)/;function bE(e){for(var t=e,n;(n=yE.exec(t))!=null;){var[,r]=n;t=t.replace(yE,vE(r))}return t}function xE(e){var t=e.replace(/\s+/g,``);return t=bE(t),t=vE(t),t}function SE(e){try{return xE(e)}catch{return hE}}function CE(e){var t=SE(e.slice(5,-1));return t===hE?``:t}var wE=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],TE=[`dx`,`dy`,`angle`,`className`,`breakAll`];function EE(){return EE=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var i=[];return L(t)||(i=n?t.toString().split(``):t.toString().split(kE)),{wordsWithComputedWidth:i.map(e=>({word:e,width:rE(e,r).width})),spaceWidth:n?0:rE(`\xA0`,r).width}}catch{return null}};function jE(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function ME(e){return L(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var NE=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+ne.reduce((e,t)=>e.width>t.width?e:t),FE=`…`,IE=(e,t,n,r,i,a,o,s)=>{var c=AE({breakAll:n,style:r,children:e.slice(0,t)+FE});if(!c)return[!1,[]];var l=NE(c.wordsWithComputedWidth,a,o,s);return[l.length>i||PE(l).width>Number(a),l]},LE=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=I(a),u=String(o),d=NE(t,r,n,i);if(!l||i||!(d.length>a||PE(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=IE(u,g-1,c,s,a,r,n,i),[y]=IE(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},RE=e=>[{words:L(e)?[]:e.toString().split(kE),width:void 0}],zE=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Hu.isSsr){var s,c,l=AE({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return RE(r);return LE({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return RE(r)},BE=`#808080`,VE={angle:0,breakAll:!1,capHeight:`0.71em`,fill:BE,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},HE=(0,O.forwardRef)((e,t)=>{var n=Fn(e,VE),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=DE(n,wE),f=(0,O.useMemo)(()=>zE({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:p,dy:m,angle:g,className:_,breakAll:v}=d,y=DE(d,TE);if(!en(r)||!en(i)||f.length===0)return null;var b=Number(r)+(I(p)?p:0),x=Number(i)+(I(m)?m:0);if(!H(b)||!H(x))return null;var S;switch(u){case`start`:S=CE(`calc(${o})`);break;case`middle`:S=CE(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=CE(`calc(${f.length-1} * -${a})`);break}var C=[],w=f[0];if(c&&w!=null){var T=w.width,{width:E}=d;C.push(`scale(${I(E)&&I(T)?E/T:1})`)}return g&&C.push(`rotate(${g}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),O.createElement(`text`,EE({},N(y),{ref:t,x:b,y:x,className:h(`recharts-text`,_),textAnchor:l,fill:s.includes(`url`)?BE:s}),f.map((e,t)=>{var n=e.words.join(v?``:` `);return O.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});HE.displayName=`Text`;function UE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WE(e){for(var t=1;t{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=Oc(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?WE({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?WE({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?WE({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?WE({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?WE({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?WE({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?WE({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?WE({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v},k):n&&typeof n==`object`&&(I(n.x)||$t(n.x))&&(I(n.y)||$t(n.y))?WE({x:o+rn(n.x,m),y:s+rn(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):WE({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},YE=[`labelRef`],XE=[`content`];function ZE(e,t){if(e==null)return{};var n,r,i=QE(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,O.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return O.createElement(aD.Provider,{value:c},s)},sD=()=>{var e=(0,O.useContext)(aD),t=kc();return e||(t?Oc(t):void 0)},cD=(0,O.createContext)(null),lD=()=>{var e=(0,O.useContext)(cD),t=z(pm);return e||t},uD=e=>{var{value:t,formatter:n}=e,r=L(e.children)?t:e.children;return typeof n==`function`?n(r):r},dD=e=>e!=null&&typeof e==`function`,fD=(e,t)=>Zt(t-e)*Math.min(Math.abs(t-e),360),pD=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:f,clockWise:p}=i,m=(l+u)/2,g=fD(d,f),_=g>=0?1:-1,v,y;switch(t){case`insideStart`:v=d+_*a,y=p;break;case`insideEnd`:v=f-_*a,y=!p;break;case`end`:v=f+_*a,y=p;break;default:throw Error(`Unsupported position ${t}`)}y=g<=0?y:!y;var b=q(s,c,m,v),x=q(s,c,m,v+(y?1:-1)*359),S=`M${b.x},${b.y} + A${m},${m},0,1,${+!y}, + ${x.x},${x.y}`,C=L(e.id)?nn(`recharts-radial-line-`):e.id;return O.createElement(`text`,iD({},r,{dominantBaseline:`central`,className:h(`recharts-radial-bar-label`,o)}),O.createElement(`defs`,null,O.createElement(`path`,{id:C,d:S})),O.createElement(`textPath`,{xlinkHref:`#${C}`},n))},mD=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=q(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=q(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},hD=e=>e!=null&&`cx`in e&&I(e.cx),gD={angle:0,offset:5,zIndex:qp.label,position:`middle`,textBreakAll:!1};function _D(e){if(!hD(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function vD(e){var t=Fn(e,gD),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=lD(),f=sD(),p=n==null?i===`center`?f:d??f:hD(n)?n:Oc(n),m,g,_=_D(p);if(!p||L(a)&&L(o)&&!(0,O.isValidElement)(s)&&typeof s!=`function`)return null;var v=eD(eD({},t),{},{viewBox:p});if((0,O.isValidElement)(s)){var{labelRef:y}=v;return(0,O.cloneElement)(s,ZE(v,YE))}if(typeof s==`function`){var{content:b}=v;if(m=(0,O.createElement)(s,ZE(v,XE)),(0,O.isValidElement)(m))return m}else m=uD(t);var x=N(t);if(hD(p)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return pD(t,i,m,x,p);g=mD(p,t.offset,t.position)}else{if(!_)return null;var S=JE({viewBox:_,position:i,offset:t.offset,parentViewBox:hD(r)?void 0:r,clamp:!0});g=eD(eD({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width===void 0?{}:{width:S.width}),S.height===void 0?{}:{height:S.height})}return O.createElement(qw,{zIndex:t.zIndex},O.createElement(HE,iD({ref:u,className:h(`recharts-label`,c)},x,g,{textAnchor:jE(x.textAnchor)?x.textAnchor:g.textAnchor,breakAll:l}),m))}vD.displayName=`Label`;var yD=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?O.createElement(vD,iD({key:`label-implicit`},r)):en(e)?O.createElement(vD,iD({key:`label-implicit`,value:e},r)):(0,O.isValidElement)(e)?e.type===vD?(0,O.cloneElement)(e,eD({key:`label-implicit`},r)):O.createElement(vD,iD({key:`label-implicit`,content:e},r)):dD(e)?O.createElement(vD,iD({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?O.createElement(vD,iD({},e,{key:`label-implicit`},r)):null};function bD(e){var{label:t,labelRef:n}=e;return yD(t,sD(),n)||null}var xD=[`valueAccessor`],SD=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function CD(){return CD=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(ME(t))return t},DD=(0,O.createContext)(void 0),OD=DD.Provider,kD=(0,O.createContext)(void 0),AD=kD.Provider;function jD(){return(0,O.useContext)(DD)}function MD(){return(0,O.useContext)(kD)}function ND(e){var{valueAccessor:t=ED}=e,n=wD(e,xD),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=wD(n,SD),l=jD(),u=MD(),d=l||u;return!d||!d.length?null:O.createElement(qw,{zIndex:s??qp.label},O.createElement(he,{className:`recharts-label-list`},d.map((e,i)=>{var s=L(r)?t(e,i):U(e.payload,r),l=L(a)?{}:{id:`${a}-${i}`};return O.createElement(vD,CD({key:`label-${i}`},N(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}ND.displayName=`LabelList`;function PD(e){var{label:t}=e;return t?t===!0?O.createElement(ND,{key:`labelList-implicit`}):O.isValidElement(t)||dD(t)?O.createElement(ND,{key:`labelList-implicit`,content:t}):typeof t==`object`?O.createElement(ND,CD({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}var FD=e=>e.graphicalItems.polarItems,ID=B([FD,Z,B([Y,mm],jb)],Pb),LD=B([B([ID],zb),vp],Hb),RD=B([LD,Z,ID],Wb);B([LD,Z,ID],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:U(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:U(e,t.dataKey),errorDomain:[]})));var zD=()=>void 0,BD=B([Z,G,LD,RD,Vp,Y,B([Z,cx,lx,zD,B([LD,Z,ID,dx,Y,Sp],mx),zD,G,Y],Nx)],Ix);B([Rx,B([Z,BD,B([BD,kb,Rx],zx),Y],Vx)],wm);var VD=uo({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=K(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=K(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:HD,removeRadiusAxis:UD,addAngleAxis:WD,removeAngleAxis:GD}=VD.actions,KD=VD.reducer;function qD(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}function JD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YD(e){for(var t=1;tt],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),eO=[],tO=(e,t,n)=>n?.length===0?eO:n,nO=B([vp,$D,tO],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>YD(YD({},t.presentationProps),e.props))),i!=null)return i}}),rO=B([nO,$D,tO],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=U(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:ks(a,t.dataKey),color:o,payload:e,type:t.legendType}})}),iO=B([nO,$D,tO,W],(e,t,n,r)=>{if(!(t==null||e==null))return Mk({offset:r,pieSettings:t,displayedData:e,cells:n})}),aO=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),oO=i(((e,t)=>{t.exports=aO()}))(),sO=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,cO=null,lO=null,uO=e=>{if(e===cO&&Array.isArray(lO))return lO;var t=[];return O.Children.forEach(e,e=>{L(e)||((0,oO.isFragment)(e)?t=t.concat(uO(e.props.children)):t.push(e))}),lO=t,cO=e,t};function dO(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>sO(e)):[sO(t)],uO(e).forEach(e=>{var t=(0,Xt.default)(e,`type.displayName`)||(0,Xt.default)(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var fO=i((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),pO=i(((e,t)=>{t.exports=fO().isPlainObject})),mO,hO,gO,_O,vO;function yO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bO(e){for(var t=1;t{var a=n-r,o=F(mO||=TO([`M `,`,`,``]),e,t);return o+=F(hO||=TO([`L `,`,`,``]),e+n,t),o+=F(gO||=TO([`L `,`,`,``]),e+n-a/2,t+i),o+=F(_O||=TO([`L `,`,`,``]),e+n-a/2-r,t+i),o+=F(vO||=TO([`L `,`,`,` Z`]),e,t),o},DO={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},OO=e=>{var t=Fn(e,DO),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,f=(0,O.useRef)(null),[p,m]=(0,O.useState)(-1),g=(0,O.useRef)(i),_=(0,O.useRef)(a),v=(0,O.useRef)(o),y=(0,O.useRef)(n),b=(0,O.useRef)(r),x=ff(e,`trapezoid-`);if((0,O.useEffect)(()=>{if(f.current&&f.current.getTotalLength)try{var e=f.current.getTotalLength();e&&m(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var S=h(`recharts-trapezoid`,s);if(!d)return O.createElement(`g`,null,O.createElement(`path`,wO({},N(t),{className:S,d:EO(n,r,i,a,o)})));var C=g.current,w=_.current,T=v.current,E=y.current,D=b.current,k=`0px ${p===-1?1:p}px`,ee=`${p}px ${p}px`,A=Md([`strokeDasharray`],l,c);return O.createElement(df,{animationId:x,key:x,canBegin:p>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=on(C,i,e),c=on(w,a,e),l=on(T,o,e),u=on(E,n,e),d=on(D,r,e);f.current&&(g.current=s,_.current=c,v.current=l,y.current=u,b.current=d);var p=e>0?{transition:A,strokeDasharray:ee}:{strokeDasharray:k};return O.createElement(`path`,wO({},N(t),{className:S,d:EO(u,d,s,c,l),ref:f,style:bO(bO({},p),t.style)}))})},kO=p(pO()),AO=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function jO(e,t){if(e==null)return{};var n,r,i=MO(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var r=R();return(i,a)=>o=>{e?.(i,a,o),r(RS({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},WO=e=>{var t=R();return(n,r)=>i=>{e?.(n,r,i),t(zS())}},GO=(e,t,n)=>{var r=R();return(i,a)=>o=>{e?.(i,a,o),r(VS({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function KO(e){var{tooltipEntrySettings:t}=e,n=R(),r=$s(),i=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{r||(i.current===null?n(PS(t)):i.current!==t&&n(FS({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,O.useLayoutEffect)(()=>()=>{i.current&&=(n(IS(i.current)),null)},[n]),null}function qO(e){var{legendPayload:t}=e,n=R(),r=$s(),i=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{r||(i.current===null?n(Rl(t)):i.current!==t&&n(zl({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,O.useLayoutEffect)(()=>()=>{i.current&&=(n(Bl(i.current)),null)},[n]),null}function JO(e){var{legendPayload:t}=e,n=R(),r=z(G),i=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{r!==`centric`&&r!==`radial`||(i.current===null?n(Rl(t)):i.current!==t&&n(zl({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,O.useLayoutEffect)(()=>()=>{i.current&&=(n(Bl(i.current)),null)},[n]),null}var YO=O.useId??(()=>{var[e]=O.useState(()=>nn(`uid-`));return e});function XO(e,t){var n=YO();return t||(e?`${e}-${n}`:n)}var ZO=(0,O.createContext)(void 0),QO=e=>{var{id:t,type:n,children:r}=e,i=XO(`recharts-${n}`,t);return O.createElement(ZO.Provider,{value:i},r(i))},$O=uo({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(K(t.payload))},prepare:V()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=La(e).cartesianItems.indexOf(K(n));i>-1&&(e.cartesianItems[i]=K(r))},prepare:V()},removeCartesianGraphicalItem:{reducer(e,t){var n=La(e).cartesianItems.indexOf(K(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:V()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(K(t.payload))},prepare:V()},removePolarGraphicalItem:{reducer(e,t){var n=La(e).polarItems.indexOf(K(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:V()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=La(e).polarItems.indexOf(K(n));i>-1&&(e.polarItems[i]=K(r))},prepare:V()}}}),{addCartesianGraphicalItem:ek,replaceCartesianGraphicalItem:tk,removeCartesianGraphicalItem:nk,addPolarGraphicalItem:rk,removePolarGraphicalItem:ik,replacePolarGraphicalItem:ak}=$O.actions,ok=$O.reducer,sk=(0,O.memo)(e=>{var t=R(),n=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{n.current===null?t(ek(e)):n.current!==e&&t(tk({prev:n.current,next:e})),n.current=e},[t,e]),(0,O.useLayoutEffect)(()=>()=>{n.current&&=(t(nk(n.current)),null)},[t]),null}),ck=(0,O.memo)(e=>{var t=R(),n=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{n.current===null?t(rk(e)):n.current!==e&&t(ak({prev:n.current,next:e})),n.current=e},[t,e]),(0,O.useLayoutEffect)(()=>()=>{n.current&&=(t(ik(n.current)),null)},[t]),null}),lk=[`key`],uk=[`onMouseEnter`,`onClick`,`onMouseLeave`],dk=[`id`],fk=[`id`];function pk(){return pk=Object.assign?Object.assign.bind():function(e){for(var t=1;tdO(e.children,VT),[e.children]),n=z(n=>rO(n,e.id,t));return n==null?null:O.createElement(JO,{legendPayload:n})}function xk(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(O.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var{fill:n}=e;return typeof n==`string`?n:void 0}}var Sk=O.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:s,hide:c,tooltipType:l,id:u,activeShape:d}=e,f=xk(d),p={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return f==null||t==null?t:t.map(e=>Q(Q({},e),{},{color:f,fill:f}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:ks(s,t),hide:c,type:l,color:o,unit:``,graphicalItemId:u}};return O.createElement(KO,{tooltipEntrySettings:p})}),Ck=(e,t)=>e>t?`start`:ern(typeof t==`function`?t(e):t,n,n*.8),Tk=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,s=Wf(a,o);return{cx:i+rn(e.cx,a,a/2),cy:r+rn(e.cy,o,o/2),innerRadius:rn(e.innerRadius,s,0),outerRadius:wk(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},Ek=(e,t)=>Zt(t-e)*Math.min(Math.abs(t-e),360),Dk=(e,t)=>{if(O.isValidElement(e))return O.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=h(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className),{key:r}=t,i=mk(t,lk);return O.createElement(pd,pk({},i,{type:`linear`,className:n}))},Ok=(e,t,n)=>{if(O.isValidElement(e))return O.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),O.isValidElement(r)))return r;var i=h(`recharts-pie-label-text`,qD(e));return O.createElement(HE,pk({},t,{alignmentBaseline:`middle`,className:i}),r)};function kk(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var s=ie(n),c=ae(i),l=ae(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=q(e.cx,e.cy,e.outerRadius+u,n),d=Q(Q(Q(Q({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:Ck(r.x,e.cx)},r),f=Q(Q(Q(Q({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[q(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return O.createElement(qw,{zIndex:qp.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},O.createElement(he,null,a&&Dk(a,f),Ok(i,d,U(e,o))))});return O.createElement(he,{className:`recharts-pie-labels`},d)}function Ak(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i==`object`&&i&&`position`in i?O.createElement(PD,{label:i}):O.createElement(kk,{sectors:t,props:n,showLabels:r})}function jk(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,s=z(GC),c=z(qC),l=z(JC),{onMouseEnter:u,onClick:d,onMouseLeave:f}=i,p=mk(i,uk),m=UO(u,i.dataKey,o),h=WO(f),g=GO(d,i.dataKey,o);return t==null||t.length===0?null:O.createElement(O.Fragment,null,t.map((e,u)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var d=l==null||l===o,f=String(u)===s&&(c==null||i.dataKey===c)&&d,_=n&&f?n:s?r:null,v=Q(Q({},e),{},{stroke:e.stroke,tabIndex:-1,[Rs]:u,[zs]:o});return O.createElement(he,pk({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${u}`,tabIndex:-1,className:`recharts-pie-sector`},kn(p,e,u),{onMouseEnter:m(e,u),onMouseLeave:h(e,u),onClick:g(e,u)}),O.createElement(HO,pk({option:a??_,index:u,shapeType:`sector`,isActive:f},v)))}))}function Mk(e){var{pieSettings:t,displayedData:n,cells:r,offset:i}=e,{cornerRadius:a,startAngle:o,endAngle:s,dataKey:c,nameKey:l,tooltipType:u}=t,d=Math.abs(t.minAngle),f=Ek(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>U(e,c,0)!==0).length,g=(p>=360?h:h-1)*m,_=n.reduce((e,t)=>{var n=U(t,c,0);return e+(I(n)?n:0)},0),v=d>0&&_>0&&n.some(e=>{var t=U(e,c,0),n=(I(t)?t:0)/_;return t!==0&&n*p0){var x;b=n.map((e,n)=>{var s=U(e,c,0),d=U(e,l,n),p=Tk(t,i,e),h=(I(s)?s:0)/_,g,b=Q(Q({},e),r&&r[n]&&r[n].props),S=b!=null&&`fill`in b&&typeof b.fill==`string`?b.fill:t.fill;g=n?x.endAngle+Zt(f)*m*(s===0?0:1):o;var C=g+Zt(f)*((s===0?0:v)+h*y),w=(g+C)/2,T=(p.innerRadius+p.outerRadius)/2,E=[{name:d,value:s,payload:b,dataKey:c,type:u,color:S,fill:S,graphicalItemId:t.id}],D=q(p.cx,p.cy,T,w);return x=Q(Q(Q(Q({},t.presentationProps),{},{percent:h,cornerRadius:typeof a==`string`?parseFloat(a):a,name:d,tooltipPayload:E,midAngle:w,middleRadius:T,tooltipPosition:D},b),p),{},{value:s,dataKey:c,startAngle:g,endAngle:C,payload:b,paddingAngle:s===0?0:Zt(f)*m}),x})}return b}function Nk(e){var{showLabels:t,sectors:n,children:r}=e,i=(0,O.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return O.createElement(AD,{value:t?i:void 0},r)}function Pk(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,activeShape:l,inactiveShape:u,onAnimationStart:d,onAnimationEnd:f}=t,p=ff(t,`recharts-pie-`),m=n.current,[h,g]=(0,O.useState)(!1),_=(0,O.useCallback)(()=>{typeof f==`function`&&f(),g(!1)},[f]),v=(0,O.useCallback)(()=>{typeof d==`function`&&d(),g(!0)},[d]);return O.createElement(Nk,{showLabels:!h,sectors:i},O.createElement(df,{animationId:p,begin:o,duration:s,isActive:a,easing:c,onAnimationStart:v,onAnimationEnd:_,key:p},e=>{var a=[],o=(i&&i[0])?.startAngle??0;return i?.forEach((t,n)=>{var r=m&&m[n],i=n>0?(0,Xt.default)(t,`paddingAngle`,0):0;if(r){var s=on(r.endAngle-r.startAngle,t.endAngle-t.startAngle,e),c=Q(Q({},t),{},{startAngle:o+i,endAngle:o+s+i});a.push(c),o=c.endAngle}else{var{endAngle:l,startAngle:u}=t,d=on(0,l-u,e),f=Q(Q({},t),{},{startAngle:o+i,endAngle:o+d+i});a.push(f),o=f.endAngle}}),n.current=a,O.createElement(he,null,O.createElement(jk,{sectors:a,activeShape:l,inactiveShape:u,allOtherPieProps:t,shape:t.shape,id:r}))}),O.createElement(Ak,{showLabels:!h,sectors:i,props:t}),t.children)}var Fk={animationBegin:400,animationDuration:1500,animationEasing:`ease`,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:`#fff`,zIndex:qp.area};function Ik(e){var{id:t}=e,n=mk(e,dk),{hide:r,className:i,rootTabIndex:a}=e,o=(0,O.useMemo)(()=>dO(e.children,VT),[e.children]),s=z(e=>iO(e,t,o)),c=(0,O.useRef)(null),l=h(`recharts-pie`,i);return r||s==null?(c.current=null,O.createElement(he,{tabIndex:a,className:l})):O.createElement(qw,{zIndex:e.zIndex},O.createElement(Sk,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),O.createElement(he,{tabIndex:a,className:l},O.createElement(Pk,{props:Q(Q({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function Lk(e){var t=Fn(e,Fk),{id:n}=t,r=mk(t,fk),i=ie(r);return O.createElement(QO,{id:n,type:`pie`},e=>O.createElement(O.Fragment,null,O.createElement(ck,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),O.createElement(bk,pk({},r,{id:e})),O.createElement(Ik,pk({},r,{id:e}))))}var Rk=Lk;Rk.displayName=`Pie`;function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bk(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Ms,Ns],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),rA=()=>z(nA),iA=(e,t,n)=>{var r=n??e;if(!L(r))return rn(r,t,0)},aA=(e,t,n)=>{var r={},i=e.filter(_m),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:iA(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:iA(t,n,e.barSize)}));return[...s,...c]};function oA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sA(e){for(var t=1;te+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=rn(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=H(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var fA=(e,t,n,r,i,a,o)=>{var s=L(o)?t:o,c=dA(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>sA(sA({},e),{},{position:sA(sA({},e.position),{},{offset:e.position.offset-i/2})}))),c},pA=(e,t)=>{var n=hm(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},mA=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function hA(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&H(e.zIndex)?e.zIndex:t}var gA=e=>{var{chartData:t}=e,n=R(),r=$s();return(0,O.useEffect)(()=>r?()=>{}:(n(hT(t)),()=>{n(hT(void 0))}),[t,n,r]),null},_A={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},vA=uo({name:`brush`,initialState:_A,reducers:{setBrushSettings(e,t){return t.payload==null?_A:t.payload}}}),{setBrushSettings:yA}=vA.actions,bA=vA.reducer;function xA(e){return(e%180+180)%180}var SA=function(e){var{width:t,height:n}=e,r=xA(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=La(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=La(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(K(t.payload))},removeLine:(e,t)=>{var n=La(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:wA,removeDot:TA,addArea:EA,removeArea:DA,addLine:OA,removeLine:kA}=CA.actions,AA=CA.reducer,jA=(0,O.createContext)(void 0),MA=e=>{var{children:t}=e,[n]=(0,O.useState)(`${nn(`recharts`)}-clip`),r=rA();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return O.createElement(jA.Provider,{value:n},O.createElement(`defs`,null,O.createElement(`clipPath`,{id:n},O.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function NA(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;re*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function LA(e,t){return NA(e,t+1)}function RA(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:s}=t,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:NA(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||IA(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function zA(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var{start:o,end:s}=t,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||IA(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=VA(VA({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=VA(VA({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&IA(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=VA(VA({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function KA(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,{start:c,end:l}=t;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=VA(VA({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&IA(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=VA(VA({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=VA(VA({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=VA(VA({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&IA(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=VA(VA({},a),{},{isShow:!0}))},h=0;h{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?PA(rE(i,{fontSize:t,letterSpacing:n}),m,d):rE(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?Zt(_.coordinate-g.coordinate):1,y=FA(a,v,p);return c===`equidistantPreserveStart`?RA(v,y,h,i,o):c===`equidistantPreserveEnd`?zA(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?KA(v,y,h,i,o,c===`preserveStartEnd`):GA(v,y,h,i,o),f.filter(e=>e.isShow))}var JA=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>o&&(o=t.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,l=o+c+s+(n?r:0);return Math.round(l)}return 0},YA=uo({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=K(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:XA,removeRenderedTicks:ZA}=YA.actions,QA=YA.reducer,$A=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function ej(e,t){if(e==null)return{};var n,r,i=tj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;rr==null||n==null?un:(i(XA({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(ZA({axisId:r,axisType:n}))}),[i,t,r,n]),null}var mj=(0,O.forwardRef)((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:s,padding:c,tickTextProps:l,orientation:u,mirror:d,x:f,y:p,width:m,height:g,tickSize:_,tickMargin:v,fontSize:y,letterSpacing:b,getTicksConfig:x,events:S,axisType:C,axisId:w}=e,T=qA($($({},x),{},{ticks:n}),y,b),E=ie(x),D=ae(r),k=jE(E.textAnchor)?E.textAnchor:uj(u,d),ee=dj(u,d),A={};typeof i==`object`&&(A=i);var j=$($({},E),{},{fill:`none`},A),M=T.map(e=>$({entry:e},lj(e,f,p,m,g,u,_,d,v))),te=M.map(e=>{var{entry:t,line:n}=e;return O.createElement(he,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},i&&O.createElement(`line`,nj({},j,n,{className:h(`recharts-cartesian-axis-tick-line`,(0,Xt.default)(i,`className`))})))}),ne=M.map((e,t)=>{var{entry:n,tick:i}=e,u=$($({},$($($($({verticalAnchor:ee},E),{},{textAnchor:k,stroke:`none`,fill:a},i),{},{index:t,payload:n,visibleTicksCount:T.length,tickFormatter:o,padding:c},l),{},{angle:l?.angle??E.angle??0})),D);return O.createElement(he,nj({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},kn(S,n,t)),r&&O.createElement(fj,{option:r,tickProps:u,value:`${typeof o==`function`?o(n.value,t):n.value}${s||``}`}))});return O.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${C}-ticks`},O.createElement(pj,{ticks:T,axisId:w,axisType:C}),ne.length>0&&O.createElement(qw,{zIndex:qp.label},O.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${C}-tick-labels`,ref:t},ne)),te.length>0&&O.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${C}-tick-lines`},te))}),hj=(0,O.forwardRef)((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:s,axisType:c,axisId:l}=e,u=ej(e,$A),[d,f]=(0,O.useState)(``),[p,m]=(0,O.useState)(``),g=(0,O.useRef)(null);(0,O.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>JA({ticks:g.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var _=(0,O.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);g.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==d||a!==p)&&(f(i),m(a))}}},[d,p]);return o||r!=null&&r<=0||i!=null&&i<=0?null:O.createElement(qw,{zIndex:e.zIndex},O.createElement(he,{className:h(`recharts-cartesian-axis`,a)},O.createElement(cj,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ie(e)}),O.createElement(mj,{ref:_,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),O.createElement(oD,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},O.createElement(bD,{label:e.label,labelRef:e.labelRef}),e.children)))}),gj=O.forwardRef((e,t)=>{var n=Fn(e,sj);return O.createElement(hj,nj({},n,{ref:t}))});gj.displayName=`CartesianAxis`;var _j=[`x1`,`y1`,`x2`,`y2`,`key`],vj=[`offset`],yj=[`xAxisId`,`yAxisId`],bj=[`xAxisId`,`yAxisId`];function xj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sj(e){for(var t=1;t{var{fill:t}=e;if(!t||t===`none`)return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:s}=e;return O.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function Aj(e){var{option:t,lineItemProps:n}=e,r;if(O.isValidElement(t))r=O.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var{x1:i,y1:a,x2:o,y2:s,key:c}=n,l=ie(Dj(n,_j))??{},{offset:u}=l,d=Dj(l,vj);r=O.createElement(`line`,Ej({},d,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function jj(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=Dj(e,yj),c=i.map((e,i)=>{var a=Sj(Sj({},s),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${i}`,index:i});return O.createElement(Aj,{key:`line-${i}`,option:r,lineItemProps:a})});return O.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},c)}function Mj(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=Dj(e,bj),c=i.map((e,i)=>{var a=Sj(Sj({},s),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${i}`,index:i});return O.createElement(Aj,{option:r,lineItemProps:a,key:`line-${i}`})});return O.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},c)}function Nj(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return O.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return O.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function Pj(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var l=c.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,t)=>{var c=l[t+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=t%n.length;return O.createElement(`rect`,{key:`react-${t}`,x:e,y:a,width:u,height:s,stroke:`none`,fill:n[d],fillOpacity:r,className:`recharts-cartesian-grid-bg`})});return O.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},u)}var Fj=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return ms(qA(Sj(Sj(Sj({},sj),n),{},{ticks:hs(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Ij=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return ms(qA(Sj(Sj(Sj({},sj),n),{},{ticks:hs(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Lj={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:qp.grid};function Rj(e){var t=Mc(),n=Nc(),r=jc(),i=Sj(Sj({},Fn(e,Lj)),{},{x:I(e.x)?e.x:r.left,y:I(e.y)?e.y:r.top,width:I(e.width)?e.width:r.width,height:I(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:s,y:c,width:l,height:u,syncWithTicks:d,horizontalValues:f,verticalValues:p}=i,m=$s(),h=z(e=>bS(e,`xAxis`,a,m)),g=z(e=>bS(e,`yAxis`,o,m));if(!os(l)||!os(u)||!I(s)||!I(c))return null;var _=i.verticalCoordinatesGenerator||Fj,v=i.horizontalCoordinatesGenerator||Ij,{horizontalPoints:y,verticalPoints:b}=i;if((!y||!y.length)&&typeof v==`function`){var x=f&&f.length,S=v({yAxis:g?Sj(Sj({},g),{},{ticks:x?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},x?!0:d);oc(Array.isArray(S),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof S}]`),Array.isArray(S)&&(y=S)}if((!b||!b.length)&&typeof _==`function`){var C=p&&p.length,w=_({xAxis:h?Sj(Sj({},h),{},{ticks:C?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},C?!0:d);oc(Array.isArray(w),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof w}]`),Array.isArray(w)&&(b=w)}return O.createElement(qw,{zIndex:i.zIndex},O.createElement(`g`,{className:`recharts-cartesian-grid`},O.createElement(kj,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),O.createElement(Nj,Ej({},i,{horizontalPoints:y})),O.createElement(Pj,Ej({},i,{verticalPoints:b})),O.createElement(jj,Ej({},i,{offset:r,horizontalPoints:y,xAxis:h,yAxis:g})),O.createElement(Mj,Ej({},i,{offset:r,verticalPoints:b,xAxis:h,yAxis:g}))))}Rj.displayName=`CartesianGrid`;var zj=uo({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:Bj,replaceErrorBar:Vj,removeErrorBar:Hj}=zj.actions,Uj=zj.reducer,Wj=[`children`];function Gj(e,t){if(e==null)return{};var n,r,i=Kj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0});function Jj(e){var{children:t}=e,n=Gj(e,Wj);return O.createElement(qj.Provider,{value:n},t)}function Yj(e,t){var n=z(t=>Sb(t,e)),r=z(e=>Tb(e,t)),i=n?.allowDataOverflow??bb.allowDataOverflow,a=r?.allowDataOverflow??Cb.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function Xj(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=rA(),{needClipX:a,needClipY:o,needClip:s}=Yj(t,n);if(!s||!i)return null;var{x:c,y:l,width:u,height:d}=i;return O.createElement(`clipPath`,{id:`clipPath-${r}`},O.createElement(`rect`,{x:a?c:c-u/2,y:o?l:l-d/2,width:a?u:u*2,height:o?d:d*2}))}function Zj(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function Qj(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var $j=`Invariant failed`;function eM(e,t){if(!e)throw Error($j)}function tM(){return tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(I(e))return e;var i=I(n)||L(n);return i?e(n,r):(!i&&eM(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},iM=(e,t,n)=>n,aM=B([Mb,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),oM=B([aM],e=>e?.maxBarSize),sM=(e,t,n,r)=>r,cM=B([G,Mb,Zj,Qj,iM],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),lM=(e,t,n)=>{var r=G(e),i=Zj(e,t),a=Qj(e,t);if(!(i==null||a==null))return r===`horizontal`?ix(e,`yAxis`,a,n):ix(e,`xAxis`,i,n)},uM=B([cM,Bp,(e,t)=>{var n=G(e),r=Zj(e,t),i=Qj(e,t);if(!(r==null||i==null))return n===`horizontal`?_S(e,`xAxis`,r):_S(e,`yAxis`,i)}],aA),dM=(e,t,n)=>{var r=aM(e,t);if(r==null)return 0;var i=Zj(e,t),a=Qj(e,t);if(i==null||a==null)return 0;var o=G(e),s=Lp(e),{maxBarSize:c}=r,l=L(c)?s:c,u,d;return o===`horizontal`?(u=CS(e,`xAxis`,i,n),d=SS(e,`xAxis`,i,n)):(u=CS(e,`yAxis`,a,n),d=SS(e,`yAxis`,a,n)),Ds(u,d,!0)??l??0},fM=(e,t,n)=>{var r=G(e),i=Zj(e,t),a=Qj(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=CS(e,`xAxis`,i,n),s=SS(e,`xAxis`,i,n)):(o=CS(e,`yAxis`,a,n),s=SS(e,`yAxis`,a,n)),Ds(o,s)}},pM=B([W,Zs,(e,t,n)=>{var r=Zj(e,t);if(r!=null)return CS(e,`xAxis`,r,n)},(e,t,n)=>{var r=Qj(e,t);if(r!=null)return CS(e,`yAxis`,r,n)},(e,t,n)=>{var r=Zj(e,t);if(r!=null)return SS(e,`xAxis`,r,n)},(e,t,n)=>{var r=Qj(e,t);if(r!=null)return SS(e,`yAxis`,r,n)},B([B([uM,Lp,Rp,zp,dM,fM,oM],fA),aM],mA),G,bp,fM,B([lM,aM],pA),aM,sM],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return YM({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),mM=[`index`];function hM(){return hM=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=(0,O.useContext)(vM);if(t!=null)return t.stackId;if(e!=null)return ys(e)},bM=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,xM=e=>{var t=(0,O.useContext)(vM);if(t!=null){var{stackId:n}=t;return`url(#${bM(n,e)})`}},SM=e=>{var{index:t}=e,n=gM(e,mM),r=xM(t);return O.createElement(he,hM({className:`recharts-bar-stack-layer`,clipPath:r},n))},CM=[`onMouseEnter`,`onMouseLeave`,`onClick`],wM=[`value`,`background`,`tooltipPosition`],TM=[`id`],EM=[`onMouseEnter`,`onClick`,`onMouseLeave`];function DM(){return DM=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:ks(n,t),payload:e}]},IM=O.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:un,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:ks(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return O.createElement(KO,{tooltipEntrySettings:u})});function LM(e){var t=z(GC),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=NM(a,CM),u=UO(o,r,a.id),d=WO(s),f=GO(c,r,a.id);if(!i||n==null)return null;var p=ae(i);return O.createElement(qw,{zIndex:hA(i,qp.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=NM(e,wM);if(!o)return null;var m=u(e,n),h=d(e,n),g=f(e,n),_=kM(kM(kM(kM(kM({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),p),kn(l,e,n)),{},{onMouseEnter:m,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return O.createElement(nM,DM({key:`background-bar-${n}`},_))}))}function RM(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return kM(kM({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return O.createElement(OD,{value:t?i:void 0},n)}function zM(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=z(GC),c=z(qC),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(!1);(0,O.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,O.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,_=l?n===!0?t:n:t,v=O.createElement(nM,DM({},r,{name:String(r.name)},i,{isActive:h,option:_,index:a,dataKey:o,onTransitionEnd:m}));return g?O.createElement(qw,{zIndex:qp.activeBar},O.createElement(SM,{index:i.originalDataIndex},v)):v}function BM(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return O.createElement(nM,DM({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function VM(e){var{data:t,props:n}=e,r=ie(n)??{},{id:i}=r,a=NM(r,TM),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=NM(n,EM),p=UO(l,s,i),m=WO(d),h=GO(u,s,i);return t?O.createElement(O.Fragment,null,t.map((e,t)=>O.createElement(SM,DM({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},kn(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?O.createElement(zM,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):O.createElement(BM,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function HM(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=ff(t,`recharts-bar-`),[p,m]=(0,O.useState)(!1),h=!p,g=(0,O.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,O.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return O.createElement(RM,{showLabels:h,rects:r},O.createElement(df,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return kM(kM({},t),{},{x:on(r.x,t.x,e),y:on(r.y,t.y,e),width:on(r.width,t.width,e),height:on(r.height,t.height,e)});if(i===`horizontal`){var a=on(0,t.height,e),o=on(t.stackedBarStart,t.y,e);return kM(kM({},t),{},{y:o,height:a})}var s=on(0,t.width,e),c=on(t.stackedBarStart,t.x,e);return kM(kM({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:O.createElement(he,null,O.createElement(VM,{props:t,data:a}))}),O.createElement(PD,{label:t.label}),t.children)}function UM(e){var t=(0,O.useRef)(null);return O.createElement(HM,{previousRectanglesRef:t,props:e})}var WM=0,GM=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:U(e,t)}},KM=class extends O.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=h(`recharts-bar`,r),u=c;return O.createElement(he,{className:l,id:c},o&&O.createElement(`defs`,null,O.createElement(Xj,{clipPathId:u,xAxisId:i,yAxisId:a})),O.createElement(he,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},O.createElement(LM,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),O.createElement(UM,this.props)))}},qM={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:WM,xAxisId:0,yAxisId:0,zIndex:qp.bar};function JM(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=Yj(t,n),f=Fc(),p=$s(),m=dO(e.children,VT),h=z(t=>pM(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,O.createElement(Jj,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:GM,errorBarOffset:g},O.createElement(KM,DM({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function YM(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:h,dataStartIndex:g}=e,_=t===`horizontal`?c:s,v=d?_.scale.domain():null,y=xs({numericAxis:_}),b=_.scale.map(y);return f.map((e,f)=>{var _,x,S,C,w,T;if(d){var E=d[f+g];if(E==null)return null;_=gs(E,v)}else _=U(e,n),Array.isArray(_)||(_=[y,_]);var D=rM(r,WM)(_[1],f);if(t===`horizontal`){var O=c.scale.map(_[0]),k=c.scale.map(_[1]);if(O==null||k==null)return null;x=bs({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),S=k??O??void 0,C=a.size;var ee=O-k;if(w=Qt(ee)?0:ee,T={x,y:p.top,width:C,height:p.height},Math.abs(D)>0&&Math.abs(w)0&&Math.abs(C)O.createElement(O.Fragment,null,O.createElement(qO,{legendPayload:FM(t)}),O.createElement(IM,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),O.createElement(sk,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),O.createElement(qw,{zIndex:t.zIndex},O.createElement(JM,DM({},t,{id:e})))))}var ZM=O.memo(XM,ou);ZM.displayName=`Bar`;var QM=[`domain`,`range`],$M=[`domain`,`range`];function eN(e,t){if(e==null)return{};var n,r,i=tN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{if(o!=null)return lN(lN({},a),{},{type:o})},[a,o]);return(0,O.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(Gk(s)):n.current!==s&&t(Kk({prev:n.current,next:s})),n.current=s)},[s,t]),(0,O.useLayoutEffect)(()=>()=>{n.current&&=(t(qk(n.current)),null)},[t]),null}var gN=e=>{var{xAxisId:t,className:n}=e,r=z(Zs),i=$s(),a=`xAxis`,o=z(e=>xS(e,a,t,i)),s=z(e=>lS(e,t)),c=z(e=>mS(e,t)),l=z(e=>xb(e,t));if(s==null||c==null||l==null)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:f}=e,p=pN(e,aN),{id:m,scale:g}=l,_=pN(l,oN);return O.createElement(gj,sN({},p,_,{x:c.x,y:c.y,width:s.width,height:s.height,className:h(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},_N={allowDataOverflow:bb.allowDataOverflow,allowDecimals:bb.allowDecimals,allowDuplicatedCategory:bb.allowDuplicatedCategory,angle:bb.angle,axisLine:sj.axisLine,height:bb.height,hide:!1,includeHidden:bb.includeHidden,interval:bb.interval,label:!1,minTickGap:bb.minTickGap,mirror:bb.mirror,orientation:bb.orientation,padding:bb.padding,reversed:bb.reversed,scale:bb.scale,tick:bb.tick,tickCount:bb.tickCount,tickLine:sj.tickLine,tickSize:sj.tickSize,type:bb.type,niceTicks:bb.niceTicks,xAxisId:0},vN=O.memo(e=>{var t=Fn(e,_N);return O.createElement(O.Fragment,null,O.createElement(hN,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),O.createElement(gN,t))},rN);vN.displayName=`XAxis`;var yN=[`type`],bN=[`dangerouslySetInnerHTML`,`ticks`,`scale`],xN=[`id`,`scale`];function SN(){return SN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(o!=null)return wN(wN({},a),{},{type:o})},[o,a]);return(0,O.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(Jk(s)):n.current!==s&&t(Yk({prev:n.current,next:s})),n.current=s)},[s,t]),(0,O.useLayoutEffect)(()=>()=>{n.current&&=(t(Xk(n.current)),null)},[t]),null}function jN(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=(0,O.useRef)(null),o=(0,O.useRef)(null),s=z(Zs),c=$s(),l=R(),u=`yAxis`,d=z(e=>gS(e,t)),f=z(e=>hS(e,t)),p=z(e=>xS(e,u,t,c)),m=z(e=>wb(e,t));if((0,O.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||dD(i)||(0,O.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(eA({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:_,scale:v}=e,y=ON(e,bN),{id:b,scale:x}=m,S=ON(m,xN);return O.createElement(gj,SN({},y,S,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:h(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var MN={allowDataOverflow:Cb.allowDataOverflow,allowDecimals:Cb.allowDecimals,allowDuplicatedCategory:Cb.allowDuplicatedCategory,angle:Cb.angle,axisLine:sj.axisLine,hide:!1,includeHidden:Cb.includeHidden,interval:Cb.interval,label:!1,minTickGap:Cb.minTickGap,mirror:Cb.mirror,orientation:Cb.orientation,padding:Cb.padding,reversed:Cb.reversed,scale:Cb.scale,tick:Cb.tick,tickCount:Cb.tickCount,tickLine:sj.tickLine,tickSize:sj.tickSize,type:Cb.type,niceTicks:Cb.niceTicks,width:Cb.width,yAxisId:0},NN=O.memo(e=>{var t=Fn(e,MN);return O.createElement(O.Fragment,null,O.createElement(AN,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),O.createElement(jN,t))},rN);NN.displayName=`YAxis`;var PN=B([(e,t)=>t,G,pm,xm,RC,BC,vw,W],Aw);function FN(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function IN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(FN(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var LN=Wa(`mouseClick`),RN=Zo();RN.startListening({actionCreator:LN,effect:(e,t)=>{var n=e.payload,r=PN(t.getState(),IN(n));r?.activeIndex!=null&&t.dispatch(US({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var zN=Wa(`mouseMove`),BN=Zo(),VN=null,HN=null,UN=null;BN.startListening({actionCreator:zN,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);VN!==null&&(cancelAnimationFrame(VN),VN=null),HN!==null&&(typeof r!=`number`||!a)&&(clearTimeout(HN),HN=null),UN=IN(n);var o=()=>{var e=t.getState(),n=OS(e,e.tooltip.settings.shared);if(!UN){VN=null,HN=null;return}if(n===`axis`){var r=PN(e,UN);r?.activeIndex==null?t.dispatch(BS()):t.dispatch(HS({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}VN=null,HN=null};if(!a){o();return}r===`raf`?VN=requestAnimationFrame(o):typeof r==`number`&&HN===null&&(HN=setTimeout(o,r))}});function WN(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<>`:t}var GN={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},KN=uo({name:`rootProps`,initialState:GN,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??GN.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),qN=KN.reducer,{updateOptions:JN}=KN.actions,YN=uo({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:XN}=YN.actions,ZN=YN.reducer,QN=Wa(`keyDown`),$N=Wa(`focus`),eP=Wa(`blur`),tP=Zo(),nP=null,rP=null,iP=null;tP.startListening({actionCreator:QN,effect:(e,t)=>{iP=e.payload,nP!==null&&(cancelAnimationFrame(nP),nP=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);rP!==null&&(typeof n!=`number`||!i)&&(clearTimeout(rP),rP=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=iP;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=iC(n,EC(e),tx(e),FC(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=BC(e),c=EC(e),l=OS(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=Cw(e,l,`hover`,String(n.index));t.dispatch(GS({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=wS(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=tx(e),h=FC(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v=0;y--)if(iC(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=Cw(e,l,`hover`,String(p));t.dispatch(GS({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{nP=null,rP=null}};if(!i){a();return}n===`raf`?nP=requestAnimationFrame(a):typeof n==`number`&&rP===null&&(a(),iP=null,rP=setTimeout(()=>{iP?a():(rP=null,nP=null)},n))}}),tP.startListening({actionCreator:$N,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=Cw(n,OS(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(GS({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),tP.startListening({actionCreator:eP,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(GS({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function aP(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var oP=Wa(`externalEvent`),sP=Zo(),cP=new Map,lP=new Map,uP=new Map;sP.startListening({actionCreator:oP,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=aP(r);uP.set(i,{handler:n,reactEvent:a});var o=cP.get(i);o!==void 0&&(cancelAnimationFrame(o),cP.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=lP.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),lP.delete(i));var f=()=>{var e=uP.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:XC(a),activeDataKey:qC(a),activeIndex:GC(a),activeLabel:KC(a),activeTooltipIndex:GC(a),isTooltipActive:ZC(a)};n&&n(o,r)}finally{cP.delete(i),lP.delete(i),uP.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);cP.set(i,p)}else if(typeof s==`number`){if(!lP.has(i)){f();var m=setTimeout(f,s);lP.set(i,m)}}else f()}}});var dP=B([B([cC],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),fP=Wa(`touchMove`),pP=Zo(),mP=null,hP=null,gP=null,_P=null;pP.startListening({actionCreator:fP,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){_P=aP(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);mP!==null&&(cancelAnimationFrame(mP),mP=null),hP!==null&&(typeof r!=`number`||!a)&&(clearTimeout(hP),hP=null),gP=Array.from(n.touches).map(e=>IN({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(_P!=null){var e=t.getState(),n=OS(e,e.tooltip.settings.shared);if(n===`axis`){var r=gP?.[0];if(r==null){mP=null,hP=null;return}var i=PN(e,r);i?.activeIndex!=null&&t.dispatch(HS({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=_P.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(Rs),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=SC(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=dP(e,s,c);t.dispatch(RS({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}mP=null,hP=null}};if(!a){o();return}r===`raf`?mP=requestAnimationFrame(o):typeof r==`number`&&hP===null&&(o(),_P=null,hP=setTimeout(()=>{_P?o():(hP=null,mP=null)},r))}}});var vP={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},yP=uo({name:`eventSettings`,initialState:vP,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=K(t.payload.throttledEvents))}}}),{setEventSettings:bP}=yP.actions,xP=yP.reducer,SP=hi({brush:bA,cartesianAxis:tA,chartData:vT,errorBars:Uj,eventSettings:xP,graphicalItems:ok,layout:is,legend:Vl,options:dT,polarAxis:KD,polarOptions:ZN,referenceElements:AA,renderedTicks:QA,rootProps:qN,tooltip:KS,zIndex:Kw}),CP=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return eo({reducer:SP,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([RN.middleware,BN.middleware,tP.middleware,sP.middleware,pP.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(Qa({type:`raf`}))},devTools:Hu.devToolsEnabled&&{serialize:{replacer:WN},name:`recharts-${t}`}})};function wP(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=$s(),a=(0,O.useRef)(null);if(i)return n;a.current??=CP(t,r);var o=Or;return O.createElement(ru,{context:o,store:a.current},n)}function TP(e){var{layout:t,margin:n}=e,r=R(),i=$s();return(0,O.useEffect)(()=>{i||(r(ts(t)),r(es(n)))},[r,i,t,n]),null}var EP=(0,O.memo)(TP,ou);function DP(e){var t=R();return(0,O.useEffect)(()=>{t(JN(e))},[t,e]),null}var OP=(0,O.memo)(e=>{var t=R();return(0,O.useEffect)(()=>{t(bP(e))},[t,e]),null},ou);function kP(e){var{zIndex:t,isPanorama:n}=e,r=(0,O.useRef)(null),i=R();return(0,O.useLayoutEffect)(()=>(r.current&&i(Ww({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Gw({zIndex:t,isPanorama:n}))}),[i,t,n]),O.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function AP(e){var{children:t,isPanorama:n}=e,r=z(Mw);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return O.createElement(O.Fragment,null,i.map(e=>O.createElement(kP,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>O.createElement(kP,{key:e,zIndex:e,isPanorama:n})))}var jP=[`children`];function MP(e,t){if(e==null)return{};var n,r,i=NP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=Mc(),r=Nc(),i=Qu();if(!os(n)||!os(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),O.createElement(ue,PP({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:FP,ref:t}),a)}),LP=e=>{var{children:t}=e,n=z(tc);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return O.createElement(ue,{width:r,height:i,x:o,y:a},t)},RP=(0,O.forwardRef)((e,t)=>{var{children:n}=e,r=MP(e,jP);return $s()?O.createElement(LP,null,O.createElement(AP,{isPanorama:!0},n)):O.createElement(IP,PP({ref:t},r),O.createElement(AP,{isPanorama:!1},n))});function zP(){var e=R(),[t,n]=(0,O.useState)(null),r=z(Ps);return(0,O.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;H(n)&&n!==r&&e(rs(n))}},[t,e,r]),n}function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VP(e){for(var t=1;t(kT(),null);function qP(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var JP=(0,O.forwardRef)((e,t)=>{var n=(0,O.useRef)(null),[r,i]=(0,O.useState)({containerWidth:qP(e.style?.width),containerHeight:qP(e.style?.height)}),a=(0,O.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,O.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,O.useEffect)(()=>()=>{n.current?.disconnect()},[a]),O.createElement(O.Fragment,null,O.createElement(zc,{width:r.containerWidth,height:r.containerHeight}),O.createElement(`div`,GP({ref:o},e)))}),YP=(0,O.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,O.useState)({containerWidth:qP(n),containerHeight:qP(r)}),o=(0,O.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,O.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return O.createElement(O.Fragment,null,O.createElement(zc,{width:i.containerWidth,height:i.containerHeight}),O.createElement(`div`,GP({ref:s},e)))}),XP=(0,O.forwardRef)((e,t)=>{var{width:n,height:r}=e;return O.createElement(O.Fragment,null,O.createElement(zc,{width:n,height:r}),O.createElement(`div`,GP({ref:t},e)))}),ZP=(0,O.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?O.createElement(YP,GP({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?O.createElement(XP,GP({},e,{width:n,height:r,ref:t})):O.createElement(O.Fragment,null,O.createElement(zc,{width:n,height:r}),O.createElement(`div`,GP({ref:t},e)))});function QP(e){return e?JP:ZP}var $P=(0,O.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:_,width:v,responsive:y,dispatchTouchEvents:b=!0}=e,x=(0,O.useRef)(null),S=R(),[C,w]=(0,O.useState)(null),[T,E]=(0,O.useState)(null),D=zP(),k=Tc(),ee=k?.width>0?k.width:v,A=k?.height>0?k.height:i,j=(0,O.useCallback)(e=>{D(e),typeof t==`function`&&t(e),w(e),E(e),e!=null&&(x.current=e)},[D,t,w,E]),M=(0,O.useCallback)(e=>{S(LN(e)),S(oP({handler:a,reactEvent:e}))},[S,a]),te=(0,O.useCallback)(e=>{S(zN(e)),S(oP({handler:l,reactEvent:e}))},[S,l]),ne=(0,O.useCallback)(e=>{S(BS()),S(oP({handler:u,reactEvent:e}))},[S,u]),re=(0,O.useCallback)(e=>{S(zN(e)),S(oP({handler:d,reactEvent:e}))},[S,d]),ie=(0,O.useCallback)(()=>{S($N())},[S]),ae=(0,O.useCallback)(()=>{S(eP())},[S]),N=(0,O.useCallback)(e=>{S(QN(e.key))},[S]),oe=(0,O.useCallback)(e=>{S(oP({handler:o,reactEvent:e}))},[S,o]),se=(0,O.useCallback)(e=>{S(oP({handler:s,reactEvent:e}))},[S,s]),ce=(0,O.useCallback)(e=>{S(oP({handler:c,reactEvent:e}))},[S,c]),le=(0,O.useCallback)(e=>{S(oP({handler:f,reactEvent:e}))},[S,f]),ue=(0,O.useCallback)(e=>{S(oP({handler:g,reactEvent:e}))},[S,g]),de=(0,O.useCallback)(e=>{b&&S(fP(e)),S(oP({handler:m,reactEvent:e}))},[S,b,m]),fe=(0,O.useCallback)(e=>{S(oP({handler:p,reactEvent:e}))},[S,p]),pe=QP(y);return O.createElement(rT.Provider,{value:C},O.createElement(ge.Provider,{value:T},O.createElement(pe,{width:ee??_?.width,height:A??_?.height,className:h(`recharts-wrapper`,r),style:VP({position:`relative`,cursor:`default`,width:ee,height:A},_),onClick:M,onContextMenu:oe,onDoubleClick:se,onFocus:ie,onBlur:ae,onKeyDown:N,onMouseDown:ce,onMouseEnter:te,onMouseLeave:ne,onMouseMove:re,onMouseUp:le,onTouchEnd:fe,onTouchMove:de,onTouchStart:ue,ref:j},O.createElement(KP,null),n)))}),eF=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function tF(e,t){if(e==null)return{};var n,r,i=nF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=ie(tF(e,eF));return c?O.createElement(O.Fragment,null,O.createElement(zc,{width:n,height:r}),O.createElement(RP,{otherAttributes:d,title:l,desc:u},a)):O.createElement($P,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},O.createElement(RP,{otherAttributes:d,title:l,desc:u,ref:t},O.createElement(MA,null,a)))});function iF(){return iF=Object.assign?Object.assign.bind():function(e){for(var t=1;tO.createElement(dF,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:fF,tooltipPayloadSearcher:lT,categoricalChartProps:e,ref:t}));function mF(e){var t=R();return(0,O.useEffect)(()=>{t(XN(e))},[t,e]),null}var hF=[`layout`];function gF(){return gF=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Fn(e,MF);return O.createElement(TF,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:jF,tooltipPayloadSearcher:lT,categoricalChartProps:n,ref:t})}),PF={Critical:`#ef4444`,High:`#f59e0b`,Medium:`#3b82f6`,Low:`#10b981`};function FF({stats:e}){if(!e)return null;let t=[{name:`Critical`,value:e.critical_alerts},{name:`High`,value:e.high_alerts},{name:`Medium`,value:e.medium_alerts},{name:`Low`,value:e.low_alerts}].filter(e=>e.value>0);return t.length===0?(0,k.jsx)(`p`,{className:`text-surface-500 text-center py-8`,children:`No alerts yet`}):(0,k.jsx)(Dc,{width:`100%`,height:250,children:(0,k.jsxs)(NF,{children:[(0,k.jsx)(Rk,{data:t,cx:`50%`,cy:`50%`,innerRadius:60,outerRadius:90,paddingAngle:4,dataKey:`value`,children:t.map(e=>(0,k.jsx)(VT,{fill:PF[e.name]},e.name))}),(0,k.jsx)(BT,{contentStyle:{backgroundColor:`#1e293b`,border:`1px solid #334155`,borderRadius:`8px`},labelStyle:{color:`#f1f5f9`}}),(0,k.jsx)(Tu,{formatter:e=>(0,k.jsx)(`span`,{className:`text-surface-300 text-sm`,children:e})})]})})}function IF({alerts:e}){return(0,k.jsx)(Dc,{width:`100%`,height:250,children:(0,k.jsxs)(pF,{data:(0,O.useMemo)(()=>{let t={},n=new Date;for(let e=6;e>=0;e--){let r=new Date(n);r.setDate(r.getDate()-e);let i=r.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`});t[i]={critical:0,high:0,medium:0,low:0}}for(let r of e){let e=new Date(r.created_at),i=Math.floor((n.getTime()-e.getTime())/(1e3*60*60*24));if(i>=0&&i<7){let n=e.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`});if(t[n]){let e=r.severity;e in t[n]&&t[n][e]++}}}return Object.entries(t).map(([e,t])=>({date:e,...t,total:t.critical+t.high+t.medium+t.low}))},[e]),children:[(0,k.jsx)(Rj,{strokeDasharray:`3 3`,stroke:`#334155`}),(0,k.jsx)(vN,{dataKey:`date`,stroke:`#94a3b8`,fontSize:11}),(0,k.jsx)(NN,{stroke:`#94a3b8`,fontSize:12,allowDecimals:!1}),(0,k.jsx)(BT,{contentStyle:{backgroundColor:`#1e293b`,border:`1px solid #334155`,borderRadius:`8px`},labelStyle:{color:`#f1f5f9`}}),(0,k.jsx)(ZM,{dataKey:`critical`,stackId:`a`,fill:`#ef4444`,name:`Critical`}),(0,k.jsx)(ZM,{dataKey:`high`,stackId:`a`,fill:`#f59e0b`,name:`High`}),(0,k.jsx)(ZM,{dataKey:`medium`,stackId:`a`,fill:`#3b82f6`,name:`Medium`}),(0,k.jsx)(ZM,{dataKey:`low`,stackId:`a`,fill:`#10b981`,name:`Low`})]})})}function LF(){let[e,t]=(0,O.useState)([]);(0,O.useEffect)(()=>{l.get(`/ot/devices-by-zone`).then(e=>{t(e.data.zones||[])}).catch(()=>{})},[]);let n=[{level:5,label:`Enterprise`,description:`Internet/DMZ`},{level:4,label:`Business`,description:`ERP, Email`},{level:3,label:`Operations`,description:`Historians, SCADA servers`},{level:2,label:`Control`,description:`HMI, Engineering workstations`},{level:1,label:`Basic Control`,description:`PLCs, RTUs, DCS`},{level:0,label:`Process`,description:`Sensors, Actuators`}],r={enterprise:5,dmz:5,internet:5,business:4,corporate:4,operations:3,supervisory:3,scada:3,control:2,hmi:2,field:1,basic_control:1,plc:1,process:0,safety_system:0,sensor:0},i=t=>{let n=0;for(let i of e)(r[i.zone]??(i.zone===`level_${t}`||i.zone===String(t)?t:-1))===t&&(n+=i.count);return n},a=e=>e===0?`bg-surface-700/50 border-surface-600`:e<=2?`bg-success/10 border-success/30`:e<=5?`bg-warning/10 border-warning/30`:`bg-danger/10 border-danger/30`;return(0,k.jsxs)(`div`,{className:`space-y-2`,children:[n.map(e=>{let t=i(e.level);return(0,k.jsxs)(`div`,{className:h(`flex items-center justify-between p-3 rounded-lg border`,a(t)),children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,k.jsxs)(`span`,{className:`text-xs font-mono text-surface-400 w-8`,children:[`L`,e.level]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{className:`text-sm font-medium text-white`,children:e.label}),(0,k.jsx)(`p`,{className:`text-xs text-surface-500`,children:e.description})]})]}),(0,k.jsxs)(`span`,{className:`text-sm font-semibold text-surface-300`,children:[t,` devices`]})]},e.level)}),e.length===0&&(0,k.jsx)(`p`,{className:`text-center text-surface-500 py-4 text-sm`,children:`No OT zone data. Add assets with network zones to populate.`})]})}function RF(){let[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(null),[c,u]=(0,O.useState)(null),[p,h]=(0,O.useState)(null),[ee,j]=(0,O.useState)({}),[M,te]=(0,O.useState)(!0),[ne,re]=(0,O.useState)(0),[ie,ae]=(0,O.useState)(null),N=(0,O.useCallback)(()=>{re(e=>e+1)},[]);(0,O.useEffect)(()=>{let e=!0;return(async()=>{te(!0),j({});let t=[l.get(`/alerts/stats/overview`),l.get(`/assets/`,{params:{size:1}}),l.get(`/ot/discovered-devices`,{params:{size:1}}),l.get(`/alerts/`,{params:{size:50}})],n=await Promise.allSettled(t);if(!e)return;let r={};n[0].status===`fulfilled`?a(n[0].value.data):r.stats=v(n[0].reason,`Alert statistics are unavailable`),n[1].status===`fulfilled`?s(n[1].value.data.total??0):r.assets=v(n[1].reason,`Asset inventory is unavailable`),n[2].status===`fulfilled`?u(n[2].value.data.total??0):r.devices=v(n[2].reason,`Discovery telemetry is unavailable`),n[3].status===`fulfilled`?h(n[3].value.data.alerts??[]):r.alerts=v(n[3].reason,`Recent alert activity is unavailable`),j(r),ae(new Date),te(!1)})(),()=>{e=!1}},[ne]);let oe=i!==null||o!==null||c!==null||p!==null,se=Object.values(ee);if(M&&!oe)return(0,k.jsx)(t,{rows:7,label:`Loading security operations dashboard`});if(!oe&&se.length>0)return(0,k.jsx)(n,{title:`Command data could not be loaded`,description:se.join(` · `),action:(0,k.jsx)(e,{onClick:N})});let ce=i?.total_alerts,le=i?.critical_alerts,ue=i?.high_alerts,de=i?i.pending_alerts+i.acknowledged_alerts:null,fe=i&&i.total_alerts>0?Math.max(54,Math.round((i.total_alerts-i.critical_alerts)/i.total_alerts*100)):i?96:null,pe=(p??[]).filter(e=>e.severity===`critical`||e.severity===`high`).slice(0,4),me=[{label:`Detect`,value:c!==null&&o!==null?c+o:null,status:`online`,icon:T},{label:`Triage`,value:de,status:de===null?`unknown`:de>0?`queued`:`clear`,icon:C},{label:`Hunt`,value:ue!==void 0&&le!==void 0?ue+le:null,status:`ready`,icon:w},{label:`Respond`,value:0,status:`approval gated`,icon:g}];return(0,k.jsxs)(`div`,{className:`space-y-5`,children:[(0,k.jsx)(y,{eyebrow:`OneAlert command`,title:`Security Operations`,description:`A prioritized view of OT exposure, live telemetry, investigations, and governed agent readiness.`,meta:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(x,{tone:`success`,children:`Monitoring active`}),(0,k.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[`Updated `,ie?.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})??`—`]})]}),actions:(0,k.jsxs)(_,{to:`/cases`,className:`inline-flex min-h-9 items-center gap-2 rounded-md bg-primary-500 px-3.5 text-sm font-semibold text-surface-950 hover:bg-primary-400`,children:[`Open investigations `,(0,k.jsx)(S,{className:`h-4 w-4`})]})}),se.length>0&&(0,k.jsx)(r,{messages:se,onRetry:N}),(0,k.jsxs)(`section`,{"aria-label":`Security posture metrics`,className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,k.jsx)(A,{title:`Total alerts`,value:ce??`—`,icon:E,color:`info`,detail:i?`${de} unresolved`:`Data unavailable`}),(0,k.jsx)(A,{title:`Critical exposure`,value:le??`—`,icon:f,color:`danger`,detail:i?`${ue} high severity`:`Data unavailable`}),(0,k.jsx)(A,{title:`Managed assets`,value:o??`—`,icon:m,color:`success`,detail:`Inventory scope`}),(0,k.jsx)(A,{title:`Discovered devices`,value:c??`—`,icon:d,color:`warning`,detail:`Passive telemetry`})]}),(0,k.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-[minmax(0,1.35fr)_minmax(20rem,0.65fr)]`,children:[(0,k.jsx)(b,{title:`Priority insight hub`,description:`Highest-severity items requiring analyst attention.`,action:(0,k.jsx)(_,{to:`/alerts`,className:`text-xs font-semibold text-primary-300 hover:text-primary-200`,children:`View all alerts`}),children:(0,k.jsx)(`div`,{className:`divide-y divide-surface-800`,children:pe.length>0?pe.map(e=>(0,k.jsxs)(_,{to:`/alerts`,className:`grid gap-3 px-5 py-3.5 hover:bg-surface-800/45 sm:grid-cols-[6rem_minmax(0,1fr)_8rem] sm:items-center`,children:[(0,k.jsx)(x,{tone:e.severity===`critical`?`danger`:`warning`,children:e.severity}),(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`p`,{className:`truncate text-sm font-semibold text-surface-100`,children:e.title}),(0,k.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-surface-500`,children:[e.cve_id||e.source,` · `,e.asset_name]})]}),(0,k.jsx)(`span`,{className:`text-right text-xs text-surface-500`,children:e.status})]},e.id)):(0,k.jsx)(`div`,{className:`px-5 py-8 text-center text-sm text-surface-400`,children:p===null?`Recent alert activity is unavailable.`:`No critical or high alerts require prioritization.`})})}),(0,k.jsxs)(b,{title:`Agent operations`,description:`Readiness across governed analysis lanes.`,children:[(0,k.jsx)(`div`,{className:`grid grid-cols-2 gap-px bg-surface-800`,children:me.map(e=>(0,k.jsxs)(`div`,{className:`bg-surface-900 px-4 py-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(e.icon,{className:`h-4 w-4 text-primary-300`}),(0,k.jsx)(`span`,{className:`text-[9px] font-bold uppercase tracking-wider text-surface-500`,children:e.status})]}),(0,k.jsx)(`p`,{className:`mt-3 text-2xl font-bold tabular-nums text-surface-50`,children:e.value??`—`}),(0,k.jsx)(`p`,{className:`mt-0.5 text-xs text-surface-400`,children:e.label})]},e.label))}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-t border-surface-800 px-4 py-3 text-xs`,children:[(0,k.jsxs)(`span`,{className:`flex items-center gap-2 text-surface-400`,children:[(0,k.jsx)(D,{className:`h-4 w-4 text-success`}),` Human approval enforced`]}),(0,k.jsxs)(`strong`,{className:`text-primary-200`,children:[fe??`—`,fe===null?``:`%`]})]})]})]}),(0,k.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,k.jsx)(b,{title:`Severity distribution`,description:`Current alert inventory by operational severity.`,children:(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(FF,{stats:i})})}),(0,k.jsx)(b,{title:`Alert activity · 7 days`,description:`Daily volume grouped by severity.`,children:(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(IF,{alerts:p??[]})})})]}),(0,k.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-[minmax(0,1.35fr)_minmax(20rem,0.65fr)]`,children:[(0,k.jsx)(b,{title:`OT zone risk`,description:`Concentration of exposure across industrial network zones.`,children:(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(LF,{})})}),(0,k.jsx)(b,{title:`Telemetry health`,description:`Coverage signals from managed and discovered infrastructure.`,children:(0,k.jsx)(`div`,{className:`space-y-4 p-5`,children:[{label:`Managed assets`,value:o,tone:`bg-primary-400`},{label:`Discovered devices`,value:c,tone:`bg-success`},{label:`Open investigations`,value:de,tone:`bg-warning`},{label:`Critical exposure`,value:le??null,tone:`bg-danger`}].map(e=>(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,k.jsx)(`span`,{className:`text-surface-400`,children:e.label}),(0,k.jsx)(`strong`,{className:`tabular-nums text-surface-100`,children:e.value??`—`})]}),(0,k.jsx)(`div`,{className:`mt-2 h-1.5 overflow-hidden rounded-full bg-surface-800`,children:(0,k.jsx)(`div`,{className:`h-full ${e.tone}`,style:{width:e.value===null?`0%`:`${Math.min(100,Math.max(e.value>0?8:0,e.value*9))}%`}})})]},e.label))})})]})]})}export{RF as Dashboard}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Events-Cp2M2z7v.js b/frontend-v2/dist/assets/Events-Cp2M2z7v.js new file mode 100644 index 0000000..28651d3 --- /dev/null +++ b/frontend-v2/dist/assets/Events-Cp2M2z7v.js @@ -0,0 +1 @@ +import{a as e,i as t,r as n,t as r}from"./AsyncState-CuK4jvuL.js";import{E as i,_ as a,b as o,h as s,k as c,n as l,y as u}from"./index-CjOT90JS.js";import{t as d}from"./PageHeader-BCt4-hcp.js";var f=c(i(),1),p=a(),m={critical:`text-red-400`,high:`text-orange-400`,medium:`text-yellow-400`,low:`text-blue-400`,info:`text-surface-500`};function h(){let[i,a]=(0,f.useState)([]),[c,h]=(0,f.useState)(null),[g,_]=(0,f.useState)(!0),[v,y]=(0,f.useState)(1),[b,x]=(0,f.useState)(0),[S,C]=(0,f.useState)(``),[w,T]=(0,f.useState)([]),E=(0,f.useCallback)(async()=>{_(!0),T([]);try{let e={page:v,size:50};S&&(e.severity=S);let[t,n]=await Promise.allSettled([o.get(`/events/`,{params:e}),o.get(`/events/stats`)]),r=[];t.status===`fulfilled`?(a(t.value.data.events),x(t.value.data.total)):r.push(u(t.reason,`Event stream is unavailable`)),n.status===`fulfilled`?h(n.value.data.data):r.push(u(n.reason,`Event statistics are unavailable`)),T(r)}catch(e){T([u(e,`Security events could not be loaded.`)])}finally{_(!1)}},[v,S]);return(0,f.useEffect)(()=>{E()},[E]),(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsx)(d,{eyebrow:`Observe`,title:`Security Events`,description:`${b} events${c?` from ${c.source_count} telemetry sources`:``}.`}),w.length>0&&(i.length>0||c)&&(0,p.jsx)(r,{messages:w,onRetry:()=>void E()}),c&&(0,p.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-3`,children:[`critical`,`high`,`medium`,`low`,`info`].map(e=>(0,p.jsxs)(`button`,{onClick:()=>C(S===e?``:e),className:l(`bg-surface-800/50 border rounded-xl p-4 text-left transition-colors`,S===e?`border-primary-500`:`border-surface-700 hover:border-surface-600`),children:[(0,p.jsx)(`p`,{className:l(`text-xs uppercase`,m[e]),children:e}),(0,p.jsx)(`p`,{className:`text-xl font-bold text-white mt-1`,children:c.by_severity[e]||0})]},e))}),g?(0,p.jsx)(t,{rows:5,label:`Loading security events`}):w.length>0&&i.length===0?(0,p.jsx)(n,{title:`Event stream unavailable`,description:w.join(` · `),action:(0,p.jsx)(e,{onClick:()=>void E()})}):i.length===0?(0,p.jsxs)(`div`,{className:`text-center py-20`,children:[(0,p.jsx)(s,{className:`w-16 h-16 text-surface-600 mx-auto mb-4`}),(0,p.jsx)(`h3`,{className:`text-lg font-medium text-surface-300`,children:`No events ingested yet`}),(0,p.jsx)(`p`,{className:`text-surface-500 mt-2 max-w-md mx-auto`,children:`Upload Suricata EVE JSON or Zeek logs, or configure a webhook receiver for real-time ingestion.`})]}):(0,p.jsxs)(`div`,{className:`oa-panel overflow-hidden`,children:[(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b border-surface-700`,children:[(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Time`}),(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Severity`}),(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Type`}),(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Source`}),(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Destination`}),(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Signature`}),(0,p.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Source`})]})}),(0,p.jsx)(`tbody`,{children:i.map(e=>(0,p.jsxs)(`tr`,{className:`border-b border-surface-800 hover:bg-surface-800/50`,children:[(0,p.jsx)(`td`,{className:`p-3 text-surface-400 whitespace-nowrap text-xs`,children:new Date(e.timestamp).toLocaleString()}),(0,p.jsx)(`td`,{className:`p-3`,children:(0,p.jsx)(`span`,{className:l(`text-xs font-medium`,m[e.severity]),children:e.severity})}),(0,p.jsx)(`td`,{className:`p-3 text-surface-300`,children:e.event_type}),(0,p.jsxs)(`td`,{className:`p-3 text-surface-300 font-mono text-xs`,children:[e.source_ip,e.source_port?`:${e.source_port}`:``]}),(0,p.jsxs)(`td`,{className:`p-3 text-surface-300 font-mono text-xs`,children:[e.dest_ip,e.dest_port?`:${e.dest_port}`:``]}),(0,p.jsx)(`td`,{className:`p-3 text-surface-300 truncate max-w-xs`,children:e.signature||e.category||`—`}),(0,p.jsx)(`td`,{className:`p-3 text-surface-500 text-xs`,children:e.source_type})]},e.id))})]})}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between p-3 border-t border-surface-700`,children:[(0,p.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[`Page `,v,` of `,Math.ceil(b/50)]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsx)(`button`,{onClick:()=>y(Math.max(1,v-1)),disabled:v===1,className:`px-3 py-1 text-xs bg-surface-700 text-surface-300 rounded disabled:opacity-30`,children:`Prev`}),(0,p.jsx)(`button`,{onClick:()=>y(v+1),disabled:v>=Math.ceil(b/50),className:`px-3 py-1 text-xs bg-surface-700 text-surface-300 rounded disabled:opacity-30`,children:`Next`})]})]})]})]})}export{h as Events}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/HuntLab-DhSfhJ9v.js b/frontend-v2/dist/assets/HuntLab-DhSfhJ9v.js new file mode 100644 index 0000000..379c02f --- /dev/null +++ b/frontend-v2/dist/assets/HuntLab-DhSfhJ9v.js @@ -0,0 +1 @@ +import{t as e}from"./clock-COi0udmh.js";import{a as t,i as n,n as r,r as i}from"./AsyncState-CuK4jvuL.js";import{t as a}from"./play-C2dygcG1.js";import{E as o,_ as s,b as c,g as l,k as u,n as d,t as f,y as p}from"./index-CjOT90JS.js";import{t as m}from"./PageHeader-BCt4-hcp.js";var h=l(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),g=u(o(),1),_=s();function v(){let[o,s]=(0,g.useState)(``),[l,u]=(0,g.useState)([]),[v,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(!0),[w,T]=(0,g.useState)(``),E=async()=>{try{let e=await c.get(`/hunt/`);u(e.data),T(``)}catch(e){T(p(e,`Hunt history could not be loaded.`))}finally{C(!1)}},D=async()=>{if(o.trim()){x(!0),y(null);try{let e=await c.post(`/hunt/`,{hypothesis:o});y(e.data.data),await E()}catch(e){f(p(e,`The hunt could not be completed.`),`error`)}finally{x(!1)}}};return(0,g.useEffect)(()=>{E()},[]),(0,_.jsxs)(`div`,{className:`space-y-6`,children:[(0,_.jsx)(m,{eyebrow:`Analyze`,title:`Threat Hunt Lab`,description:`Turn an investigation hypothesis into reviewable queries, evidence, and detection content.`}),(0,_.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,_.jsx)(`label`,{htmlFor:`hunt-hypothesis`,className:`block text-sm font-medium text-surface-300 mb-2`,children:`Hunting Hypothesis`}),(0,_.jsxs)(`div`,{className:`flex gap-3`,children:[(0,_.jsx)(`input`,{type:`text`,id:`hunt-hypothesis`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&D(),placeholder:`e.g. Look for lateral movement from engineering workstation to PLC subnet`,className:`flex-1 px-4 py-3 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`}),(0,_.jsxs)(`button`,{onClick:D,disabled:b||!o.trim(),className:`flex items-center gap-2 px-6 py-3 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg font-medium transition-colors`,children:[(0,_.jsx)(a,{className:`w-4 h-4`}),b?`Hunting...`:`Hunt`]})]}),(0,_.jsx)(`div`,{className:`flex flex-wrap gap-2 mt-3`,children:[`Port scan from 10.0.0.0/24`,`DNS tunneling to external domains`,`Modbus write commands to PLCs`,`Failed auth attempts across multiple hosts`].map(e=>(0,_.jsx)(`button`,{onClick:()=>s(e),className:`px-3 py-1 text-xs bg-surface-700 text-surface-400 rounded-full hover:bg-surface-600 hover:text-surface-300 transition-colors`,children:e},e))})]}),v&&(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,_.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-3`,children:`Hunt Results`}),v.explanation&&(0,_.jsx)(`p`,{className:`text-surface-300 text-sm mb-4`,children:v.explanation}),v.query_results?.map((e,t)=>(0,_.jsxs)(`div`,{className:`mb-4 last:mb-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,_.jsx)(h,{className:`w-4 h-4 text-primary-400`}),(0,_.jsx)(`span`,{className:`text-sm font-medium text-white`,children:e.query?.description}),(0,_.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[e.row_count,` results`]})]}),(0,_.jsx)(`pre`,{className:`bg-surface-900 p-3 rounded-lg text-xs text-surface-400 overflow-x-auto mb-2`,children:e.query?.sql}),(e.rows?.length??0)>0&&(0,_.jsx)(`div`,{className:`overflow-x-auto`,children:(0,_.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsx)(`tr`,{className:`border-b border-surface-700`,children:Object.keys(e.rows?.[0]??{}).map(e=>(0,_.jsx)(`th`,{className:`text-left p-2 text-surface-500`,children:e},e))})}),(0,_.jsx)(`tbody`,{children:(e.rows??[]).slice(0,20).map((e,t)=>(0,_.jsx)(`tr`,{className:`border-b border-surface-800`,children:Object.values(e).map((e,t)=>(0,_.jsx)(`td`,{className:`p-2 text-surface-300 truncate max-w-xs`,children:String(e??`—`)},t))},t))})]})}),e.error&&(0,_.jsx)(`p`,{className:`text-red-400 text-xs mt-1`,children:e.error})]},t))]}),v.sigma_rule&&(0,_.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,_.jsxs)(`h3`,{className:`text-sm font-semibold text-white mb-2 flex items-center gap-2`,children:[(0,_.jsx)(h,{className:`w-4 h-4 text-primary-400`}),`Generated Sigma Rule`]}),(0,_.jsx)(`pre`,{className:`bg-surface-900 p-4 rounded-lg text-xs text-green-400 overflow-x-auto whitespace-pre-wrap`,children:v.sigma_rule})]})]}),S?(0,_.jsx)(n,{label:`Loading hunt history`}):w?(0,_.jsx)(i,{title:`Hunt history unavailable`,description:w,action:(0,_.jsx)(t,{onClick:E})}):(0,_.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,_.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Hunt History`}),l.length===0?(0,_.jsx)(r,{title:`No hunts yet`,description:`Enter a hypothesis above to start the first investigation.`}):(0,_.jsx)(`div`,{className:`space-y-2`,children:l.map(t=>(0,_.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-surface-900/50 rounded-lg`,children:[(0,_.jsx)(e,{className:`w-4 h-4 text-surface-500 shrink-0`}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-sm text-white truncate`,children:t.hypothesis}),(0,_.jsxs)(`p`,{className:`text-xs text-surface-500`,children:[t.queries_run,` queries · `,t.findings_count,` findings · `,new Date(t.created_at).toLocaleDateString()]})]}),(0,_.jsx)(`span`,{className:d(`text-xs px-2 py-0.5 rounded`,t.status===`completed`?`bg-green-500/20 text-green-400`:`bg-yellow-500/20 text-yellow-400`),children:t.status})]},t.id))})]})]})}export{v as HuntLab}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Login-CWbAzOYO.js b/frontend-v2/dist/assets/Login-CWbAzOYO.js new file mode 100644 index 0000000..183892a --- /dev/null +++ b/frontend-v2/dist/assets/Login-CWbAzOYO.js @@ -0,0 +1 @@ +import{C as e,E as t,S as n,_ as r,g as i,h as a,k as o,o as s,s as c,v as l,x as u}from"./index-CjOT90JS.js";var d=i(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),f=o(t(),1),p=r();function m(){let[t,r]=(0,f.useState)(``),[i,o]=(0,f.useState)(``),{login:m,isLoading:h,error:g,clearError:_}=l(),v=e(),y=n();return(0,p.jsxs)(`main`,{className:`grid min-h-screen bg-surface-950 lg:grid-cols-[minmax(0,1fr)_minmax(28rem,0.72fr)]`,children:[(0,p.jsxs)(`section`,{className:`relative hidden overflow-hidden border-r border-surface-800 p-12 lg:flex lg:flex-col lg:justify-between`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-[radial-gradient(circle_at_25%_20%,oklch(68.5%_0.126_210/0.13),transparent_32%)]`}),(0,p.jsxs)(`div`,{className:`relative flex items-center gap-3`,children:[(0,p.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-md border border-primary-500/30 bg-primary-500/10 text-primary-300`,children:(0,p.jsx)(s,{className:`h-6 w-6`,"aria-hidden":`true`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`p`,{className:`font-bold text-surface-50`,children:`OneAlert`}),(0,p.jsx)(`p`,{className:`text-[10px] font-bold uppercase tracking-[0.18em] text-surface-500`,children:`AI Security OS`})]})]}),(0,p.jsxs)(`div`,{className:`relative max-w-2xl`,children:[(0,p.jsx)(`p`,{className:`text-xs font-bold uppercase tracking-[0.18em] text-primary-300`,children:`Industrial defense, governed`}),(0,p.jsxs)(`h1`,{className:`mt-4 text-4xl font-bold leading-tight tracking-tight text-surface-50 xl:text-5xl`,children:[`See the signal.`,(0,p.jsx)(`br`,{}),`Protect the process.`]}),(0,p.jsx)(`p`,{className:`mt-5 max-w-xl text-base leading-7 text-surface-400`,children:`A dense operations workspace for OT visibility, investigation, and human-approved response.`}),(0,p.jsx)(`div`,{className:`mt-10 grid max-w-xl grid-cols-3 gap-px overflow-hidden rounded-md border border-surface-800 bg-surface-800`,children:[[`Passive`,`Asset discovery`],[`Gated`,`Response actions`],[`Audited`,`Agent decisions`]].map(([e,t])=>(0,p.jsxs)(`div`,{className:`bg-surface-900 p-4`,children:[(0,p.jsx)(`p`,{className:`text-sm font-bold text-primary-200`,children:e}),(0,p.jsx)(`p`,{className:`mt-1 text-xs text-surface-500`,children:t})]},e))})]}),(0,p.jsxs)(`div`,{className:`relative flex items-center gap-2 text-xs text-surface-500`,children:[(0,p.jsx)(a,{className:`h-4 w-4 text-success`,"aria-hidden":`true`}),` Secure operator workspace`]})]}),(0,p.jsx)(`section`,{className:`flex items-center justify-center px-5 py-10 sm:px-10`,children:(0,p.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,p.jsx)(s,{className:`mb-5 h-9 w-9 text-primary-300 lg:hidden`,"aria-hidden":`true`}),(0,p.jsx)(`p`,{className:`text-xs font-bold uppercase tracking-[0.16em] text-primary-300`,children:`Operator access`}),(0,p.jsx)(`h2`,{className:`mt-2 text-3xl font-bold tracking-tight text-surface-50`,children:`Welcome back`}),(0,p.jsx)(`p`,{className:`mt-2 text-sm text-surface-400`,children:`Sign in to OneAlert`}),(0,p.jsxs)(`div`,{className:`oa-panel mt-7 p-5 sm:p-6`,children:[g&&(0,p.jsxs)(`div`,{id:`login-error`,className:`mb-4 flex items-start gap-3 rounded-md border border-danger/30 bg-danger/10 p-3 text-sm text-danger`,role:`alert`,children:[(0,p.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,p.jsx)(`span`,{className:`flex-1`,children:g}),(0,p.jsx)(`button`,{type:`button`,onClick:_,"aria-label":`Dismiss sign-in error`,className:`text-danger/70 hover:text-danger`,children:`×`})]}),(0,p.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();try{await m(t,i);let e=y.state?.from,n=e?.pathname?.startsWith(`/`)?`${e.pathname}${e.search??``}`:`/`;v(n,{replace:!0})}catch{}},className:`space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`login-email`,className:`mb-1.5 block text-sm font-medium text-surface-300`,children:`Email`}),(0,p.jsx)(`input`,{id:`login-email`,type:`email`,autoComplete:`username`,value:t,onChange:e=>r(e.target.value),"aria-describedby":g?`login-error`:void 0,className:`w-full rounded-md border border-surface-600 bg-surface-950 px-3.5 py-2.5 text-surface-50 placeholder-surface-500 transition focus:border-primary-500 focus:outline-none`,placeholder:`you@company.com`,required:!0})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`login-password`,className:`mb-1.5 block text-sm font-medium text-surface-300`,children:`Password`}),(0,p.jsx)(`input`,{id:`login-password`,type:`password`,autoComplete:`current-password`,value:i,onChange:e=>o(e.target.value),"aria-describedby":g?`login-error`:void 0,className:`w-full rounded-md border border-surface-600 bg-surface-950 px-3.5 py-2.5 text-surface-50 placeholder-surface-500 transition focus:border-primary-500 focus:outline-none`,placeholder:`Enter your password`,required:!0})]}),(0,p.jsx)(`button`,{type:`submit`,disabled:h,className:`w-full rounded-md bg-primary-500 px-4 py-2.5 font-semibold text-surface-950 transition-colors hover:bg-primary-400 disabled:opacity-50`,children:h?`Signing in…`:`Sign In`})]}),(0,p.jsxs)(`div`,{className:`my-5 flex items-center gap-3 text-xs text-surface-500`,children:[(0,p.jsx)(`span`,{className:`h-px flex-1 bg-surface-700`}),`or`,(0,p.jsx)(`span`,{className:`h-px flex-1 bg-surface-700`})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>{window.location.href=`/api/v1/auth/github/login`},className:`flex w-full items-center justify-center gap-2 rounded-md border border-surface-600 bg-surface-800 px-4 py-2.5 font-semibold text-surface-100 hover:border-surface-500 hover:bg-surface-700`,children:[(0,p.jsx)(`svg`,{className:`h-5 w-5`,"aria-hidden":`true`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,p.jsx)(`path`,{d:`M12 .5a12 12 0 0 0-3.79 23.38c.6.11.82-.26.82-.58v-2.1c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.09 1.84 1.24 1.84 1.24 1.07 1.83 2.81 1.3 3.5.99.11-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23A11.5 11.5 0 0 1 12 6.4c1.02 0 2.05.14 3.01.4 2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18.77.84 1.23 1.91 1.23 3.22 0 4.61-2.81 5.62-5.49 5.92.43.37.82 1.1.82 2.22v3.29c0 .32.22.7.83.58A12 12 0 0 0 12 .5Z`})}),` Continue with GitHub`]}),(0,p.jsxs)(`p`,{className:`mt-6 text-center text-sm text-surface-400`,children:[`Don't have an account? `,(0,p.jsx)(u,{to:`/register`,className:`font-semibold text-primary-300 hover:text-primary-200`,children:`Sign up`})]})]}),(0,p.jsxs)(`div`,{className:`mt-5 flex items-center justify-center gap-2 text-[11px] text-surface-500`,children:[(0,p.jsx)(c,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),` Session protected with an HttpOnly cookie`]})]})})]})}export{m as Login}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/MitreMap-CJAZWQjH.js b/frontend-v2/dist/assets/MitreMap-CJAZWQjH.js new file mode 100644 index 0000000..8d31a3c --- /dev/null +++ b/frontend-v2/dist/assets/MitreMap-CJAZWQjH.js @@ -0,0 +1 @@ +import{a as e,i as t,r as n,t as r}from"./AsyncState-CuK4jvuL.js";import{E as i,_ as a,b as o,k as s,n as c,u as l,y as u}from"./index-CjOT90JS.js";import{t as d}from"./PageHeader-BCt4-hcp.js";var f=s(i(),1),p=a();function m(){let[i,a]=(0,f.useState)(null),[s,m]=(0,f.useState)([]),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(!0),[y,b]=(0,f.useState)([]),x=async()=>{v(!0),b([]);let[e,t]=await Promise.allSettled([o.get(`/mitre/coverage`),o.get(`/mitre/techniques`)]),n=[];e.status===`fulfilled`?a(e.value.data.data):n.push(u(e.reason,`Coverage data is unavailable`)),t.status===`fulfilled`?m(t.value.data):n.push(u(t.reason,`Technique catalog is unavailable`)),b(n),v(!1)};(0,f.useEffect)(()=>{x()},[]);let S=h?s.filter(e=>e.name.toLowerCase().includes(h.toLowerCase())||e.id.toLowerCase().includes(h.toLowerCase())):s;return _?(0,p.jsx)(t,{rows:6,label:`Loading MITRE ATT&CK coverage`}):!i&&s.length===0&&y.length>0?(0,p.jsx)(n,{title:`ATT&CK coverage unavailable`,description:y.join(` · `),action:(0,p.jsx)(e,{onClick:()=>void x()})}):(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsx)(d,{eyebrow:`Analyze`,title:`MITRE ATT&CK Coverage`,description:`Detection coverage mapped to enterprise and industrial ATT&CK techniques.`}),y.length>0&&(0,p.jsx)(r,{messages:y,onRetry:()=>void x()}),i&&(0,p.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,p.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Overall Coverage`}),(0,p.jsxs)(`span`,{className:`text-3xl font-bold text-primary-400`,children:[i.coverage_percentage,`%`]})]}),(0,p.jsx)(`div`,{className:`w-full h-3 bg-surface-700 rounded-full overflow-hidden`,children:(0,p.jsx)(`div`,{className:`h-full bg-primary-500 rounded-full transition-all`,style:{width:`${i.coverage_percentage}%`}})}),(0,p.jsxs)(`p`,{className:`text-sm text-surface-400 mt-2`,children:[i.covered_techniques,` of `,i.total_techniques,` techniques detected`]})]}),i&&(0,p.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3`,children:Object.entries(i.by_tactic).map(([e,t])=>(0,p.jsxs)(`div`,{className:c(`border rounded-xl p-4 transition-colors`,t.covered>0?`bg-primary-600/10 border-primary-500/30`:`bg-surface-800/50 border-surface-700`),children:[(0,p.jsx)(`p`,{className:`text-xs text-surface-500 font-mono`,children:e}),(0,p.jsx)(`p`,{className:`text-sm font-medium text-white mt-1`,children:t.name}),(0,p.jsxs)(`div`,{className:`mt-2`,children:[(0,p.jsx)(`div`,{className:`w-full h-1.5 bg-surface-700 rounded-full overflow-hidden`,children:(0,p.jsx)(`div`,{className:`h-full bg-primary-500 rounded-full`,style:{width:`${t.percentage}%`}})}),(0,p.jsxs)(`p`,{className:`text-xs text-surface-400 mt-1`,children:[t.covered,`/`,t.total]})]})]},e))}),(0,p.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,p.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Techniques`}),(0,p.jsxs)(`div`,{className:`relative`,children:[(0,p.jsx)(l,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,p.jsx)(`input`,{type:`text`,value:h,onChange:e=>g(e.target.value),placeholder:`Search techniques...`,className:`pl-9 pr-4 py-2 bg-surface-900 border border-surface-600 rounded-lg text-white text-sm placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]})]}),(0,p.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2 max-h-96 overflow-y-auto`,children:S.map(e=>(0,p.jsxs)(`div`,{className:`p-3 bg-surface-900/50 rounded-lg`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-xs font-mono text-primary-400`,children:e.id}),(0,p.jsx)(`span`,{className:`text-sm text-white`,children:e.name})]}),(0,p.jsx)(`p`,{className:`text-xs text-surface-500 mt-1`,children:e.description})]},e.id))})]})]})}export{m as MitreMap}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/OTDiscovery-CQFYbo-6.js b/frontend-v2/dist/assets/OTDiscovery-CQFYbo-6.js new file mode 100644 index 0000000..50a1cb5 --- /dev/null +++ b/frontend-v2/dist/assets/OTDiscovery-CQFYbo-6.js @@ -0,0 +1 @@ +import{a as e,i as t,r as n,t as r}from"./AsyncState-CuK4jvuL.js";import{E as i,_ as a,b as o,d as s,g as c,i as l,k as u,n as d,t as f,y as p}from"./index-CjOT90JS.js";import{t as m}from"./PageHeader-BCt4-hcp.js";var h=c(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),g=c(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),_=u(i(),1),v=a();function y(){let[i,a]=(0,_.useState)(null),[c,u]=(0,_.useState)([]),[y,b]=(0,_.useState)([]),[x,S]=(0,_.useState)(!0),[C,w]=(0,_.useState)([]),[T,E]=(0,_.useState)(new Set),D=async()=>{S(!0),w([]);let[e,t,n]=await Promise.allSettled([o.get(`/ot/summary`),o.get(`/ot/discovered-devices`,{params:{size:20}}),o.get(`/ot/devices-by-protocol`)]),r=[];e.status===`fulfilled`?a(e.value.data):r.push(p(e.reason,`OT summary is unavailable`)),t.status===`fulfilled`?u(t.value.data.devices||[]):r.push(p(t.reason,`Discovered devices are unavailable`)),n.status===`fulfilled`?b(n.value.data.protocols||[]):r.push(p(n.reason,`Protocol telemetry is unavailable`)),w(r),S(!1)};(0,_.useEffect)(()=>{D()},[]);let O=async e=>{if(!T.has(e)){E(t=>new Set(t).add(e));try{await o.post(`/ot/discovered-devices/${e}/promote-to-asset`);let t=await o.get(`/ot/discovered-devices`,{params:{size:20}});u(t.data.devices||[]),f(`Device promoted to the managed asset inventory.`,`success`)}catch(e){f(p(e,`Device could not be promoted.`),`error`)}finally{E(t=>{let n=new Set(t);return n.delete(e),n})}}};return x?(0,v.jsx)(t,{rows:6,label:`Loading OT discovery`}):!i&&c.length===0&&y.length===0&&C.length>0?(0,v.jsx)(n,{title:`OT discovery unavailable`,description:C.join(` · `),action:(0,v.jsx)(e,{onClick:()=>void D()})}):(0,v.jsxs)(`div`,{className:`space-y-8`,children:[(0,v.jsx)(m,{eyebrow:`Observe`,title:`OT Discovery`,description:`Passive network device discovery, protocol visibility, and inventory correlation.`}),C.length>0&&(0,v.jsx)(r,{messages:C,onRetry:()=>void D()}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,v.jsx)(s,{className:`w-5 h-5 text-primary-400 mb-2`}),(0,v.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:i?.managed_ot_assets??0}),(0,v.jsx)(`p`,{className:`text-xs text-surface-400`,children:`Managed OT Assets`})]}),(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,v.jsx)(g,{className:`w-5 h-5 text-info mb-2`}),(0,v.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:i?.discovered_ot_devices??0}),(0,v.jsx)(`p`,{className:`text-xs text-surface-400`,children:`Discovered Devices`})]}),(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,v.jsx)(l,{className:`w-5 h-5 text-danger mb-2`}),(0,v.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:i?.high_risk_devices??0}),(0,v.jsx)(`p`,{className:`text-xs text-surface-400`,children:`High Risk`})]}),(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,v.jsx)(h,{className:`w-5 h-5 text-warning mb-2`}),(0,v.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:i?.uncorrelated_devices??0}),(0,v.jsx)(`p`,{className:`text-xs text-surface-400`,children:`Uncorrelated`})]})]}),y.length>0&&(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,v.jsx)(`h3`,{className:`text-lg font-semibold text-white mb-4`,children:`Protocols Detected`}),(0,v.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:y.map(e=>(0,v.jsxs)(`div`,{className:`px-3 py-2 bg-surface-700/50 border border-surface-600 rounded-lg`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium text-white`,children:e.protocol}),(0,v.jsxs)(`span`,{className:`ml-2 text-xs text-surface-400`,children:[`(`,e.count,`)`]})]},e.protocol))})]}),(0,v.jsxs)(`div`,{className:`oa-panel overflow-hidden`,children:[(0,v.jsx)(`div`,{className:`px-6 py-4 border-b border-surface-700`,children:(0,v.jsx)(`h3`,{className:`text-lg font-semibold text-white`,children:`Discovered Devices`})}),c.length===0?(0,v.jsx)(`div`,{className:`p-8 text-center text-surface-500`,children:`No devices discovered yet. Deploy a network sensor to start scanning.`}):(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`w-full min-w-[760px] text-sm`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-400`,children:[(0,v.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`IP Address`}),(0,v.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Hostname`}),(0,v.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Manufacturer`}),(0,v.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Risk`}),(0,v.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Status`}),(0,v.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Actions`})]})}),(0,v.jsx)(`tbody`,{children:c.map(e=>(0,v.jsxs)(`tr`,{className:`border-b border-surface-700/50 hover:bg-surface-800 transition-colors`,children:[(0,v.jsx)(`td`,{className:`px-4 py-3 font-mono text-surface-200`,children:e.ip_address}),(0,v.jsx)(`td`,{className:`px-4 py-3 text-surface-300`,children:e.hostname||`-`}),(0,v.jsx)(`td`,{className:`px-4 py-3 text-surface-300`,children:e.manufacturer||`Unknown`}),(0,v.jsx)(`td`,{className:`px-4 py-3`,children:(0,v.jsx)(`span`,{className:d(`text-xs font-medium`,e.risk_score>=70?`text-danger`:e.risk_score>=40?`text-warning`:`text-success`),children:e.risk_score.toFixed(0)})}),(0,v.jsx)(`td`,{className:`px-4 py-3`,children:e.is_correlated?(0,v.jsx)(`span`,{className:`text-xs text-success`,children:`Correlated`}):(0,v.jsx)(`span`,{className:`text-xs text-surface-500`,children:`Unmatched`})}),(0,v.jsx)(`td`,{className:`px-4 py-3`,children:!e.is_correlated&&(0,v.jsx)(`button`,{disabled:T.has(e.id),onClick:()=>O(e.id),className:`text-xs text-primary-400 hover:text-primary-300 font-medium`,children:T.has(e.id)?`Promoting…`:`Promote to asset`})})]},e.id))})]})})]})]})}export{y as OTDiscovery}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/PageHeader-BCt4-hcp.js b/frontend-v2/dist/assets/PageHeader-BCt4-hcp.js new file mode 100644 index 0000000..76bd3d6 --- /dev/null +++ b/frontend-v2/dist/assets/PageHeader-BCt4-hcp.js @@ -0,0 +1 @@ +import{_ as e}from"./index-CjOT90JS.js";var t=e();function n({eyebrow:e,title:n,description:r,actions:i,meta:a}){return(0,t.jsxs)(`header`,{className:`flex flex-col gap-4 border-b border-surface-800 pb-5 xl:flex-row xl:items-end xl:justify-between`,children:[(0,t.jsxs)(`div`,{className:`min-w-0`,children:[e&&(0,t.jsx)(`p`,{className:`text-[11px] font-bold uppercase tracking-[0.16em] text-primary-300`,children:e}),(0,t.jsx)(`h1`,{className:`mt-1.5 text-2xl font-bold tracking-tight text-surface-50 sm:text-[1.75rem]`,children:n}),(0,t.jsx)(`p`,{className:`mt-1.5 max-w-3xl text-sm leading-6 text-surface-400`,children:r}),a&&(0,t.jsx)(`div`,{className:`mt-3`,children:a})]}),i&&(0,t.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:i})]})}export{n as t}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Register-DVdAPoMX.js b/frontend-v2/dist/assets/Register-DVdAPoMX.js new file mode 100644 index 0000000..6429aa0 --- /dev/null +++ b/frontend-v2/dist/assets/Register-DVdAPoMX.js @@ -0,0 +1 @@ +import{C as e,E as t,_ as n,k as r,o as i,v as a,x as o}from"./index-CjOT90JS.js";var s=r(t(),1),c=n();function l(){let[t,n]=(0,s.useState)(``),[r,l]=(0,s.useState)(``),[u,d]=(0,s.useState)(``),[f,p]=(0,s.useState)(``),{register:m,isLoading:h,error:g,clearError:_}=a(),v=e();return(0,c.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gradient-to-br from-surface-950 via-surface-900 to-primary-900/20 px-4`,children:(0,c.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,c.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,c.jsx)(i,{className:`w-12 h-12 text-primary-400 mx-auto mb-4`}),(0,c.jsx)(`h1`,{className:`text-3xl font-bold text-white`,children:`Create account`}),(0,c.jsx)(`p`,{className:`text-surface-400 mt-2`,children:`Start monitoring your OT assets`})]}),(0,c.jsxs)(`div`,{className:`bg-surface-800/50 backdrop-blur border border-surface-700 rounded-2xl p-8`,children:[g&&(0,c.jsxs)(`div`,{id:`register-error`,role:`alert`,className:`mb-4 p-3 rounded-lg bg-danger/10 border border-danger/20 text-danger text-sm`,children:[g,(0,c.jsx)(`button`,{onClick:_,className:`float-right text-danger/70 hover:text-danger`,children:`×`})]}),(0,c.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();try{await m(t,r,u,f),v(`/login`)}catch{}},className:`space-y-4`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`register-name`,className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Full Name`}),(0,c.jsx)(`input`,{id:`register-name`,type:`text`,autoComplete:`name`,value:u,onChange:e=>d(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Jane Doe`,required:!0})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`register-email`,className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Email`}),(0,c.jsx)(`input`,{id:`register-email`,type:`email`,autoComplete:`email`,value:t,onChange:e=>n(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`you@company.com`,required:!0})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`register-company`,className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Company`}),(0,c.jsx)(`input`,{id:`register-company`,type:`text`,autoComplete:`organization`,value:f,onChange:e=>p(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Acme Manufacturing`})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`register-password`,className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Password`}),(0,c.jsx)(`input`,{id:`register-password`,type:`password`,autoComplete:`new-password`,value:r,onChange:e=>l(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Minimum 8 characters`,minLength:8,required:!0})]}),(0,c.jsx)(`button`,{type:`submit`,disabled:h,className:`w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white font-medium rounded-lg transition-colors`,children:h?`Creating account...`:`Create Account`})]}),(0,c.jsxs)(`p`,{className:`mt-6 text-center text-sm text-surface-400`,children:[`Already have an account?`,` `,(0,c.jsx)(o,{to:`/login`,className:`text-primary-400 hover:text-primary-300 font-medium`,children:`Sign in`})]})]})]})})}export{l as Register}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/ResponsePlans-CriMCUJ8.js b/frontend-v2/dist/assets/ResponsePlans-CriMCUJ8.js new file mode 100644 index 0000000..e5e869a --- /dev/null +++ b/frontend-v2/dist/assets/ResponsePlans-CriMCUJ8.js @@ -0,0 +1 @@ +import{t as e}from"./clock-COi0udmh.js";import{a as t,i as n,n as r,r as i}from"./AsyncState-CuK4jvuL.js";import{t as a}from"./play-C2dygcG1.js";import{E as o,_ as s,b as c,f as l,k as u,n as d,o as f,p,t as m,y as h}from"./index-CjOT90JS.js";import{t as g}from"./PageHeader-BCt4-hcp.js";var _=u(o(),1),v=s(),y={draft:`bg-surface-600/20 text-surface-400`,pending_approval:`bg-amber-500/20 text-amber-400`,approved:`bg-green-500/20 text-green-400`,executing:`bg-blue-500/20 text-blue-400`,completed:`bg-emerald-500/20 text-emerald-400`,rejected:`bg-red-500/20 text-red-400`,partial:`bg-orange-500/20 text-orange-400`};function b(){let[o,s]=(0,_.useState)([]),[u,b]=(0,_.useState)([]),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(!0),[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(null),k=async()=>{try{let e=await c.get(`/response-plans/`);s(e.data.data||[]),E(``)}catch(e){E(h(e,`Response plans could not be loaded.`))}finally{w(!1)}},A=async()=>{try{let e=await c.get(`/response-plans/pending-approvals`);b(e.data.data||[])}catch(e){E(h(e,`Pending approvals could not be loaded.`))}},j=async e=>{if(D===null){O(e);try{await c.post(`/response-plans/${e}/approve`),m(`Plan approved`,`success`),await Promise.all([k(),A()])}catch(e){m(h(e,`Failed to approve plan.`),`error`)}finally{O(null)}}},M=async e=>{if(!(D!==null||!window.confirm(`Reject this response plan?`))){O(e);try{await c.post(`/response-plans/${e}/reject`,{reason:`Manual rejection`}),m(`Plan rejected`,`warning`),await Promise.all([k(),A()])}catch(e){m(h(e,`Failed to reject plan.`),`error`)}finally{O(null)}}},N=async e=>{if(!(D!==null||!window.confirm(`Execute this approved response plan now?`))){O(e);try{await c.post(`/response-plans/${e}/execute`),m(`Plan executed successfully`,`success`),await k()}catch(e){m(h(e,`Execution failed.`),`error`)}finally{O(null)}}};return(0,_.useEffect)(()=>{k(),A()},[]),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[(0,v.jsx)(g,{eyebrow:`Act`,title:`Response Plans`,description:`Review, approve, and execute guarded response actions with a durable human decision trail.`}),T&&o.length===0?(0,v.jsx)(i,{title:`Response plans unavailable`,description:T,action:(0,v.jsx)(t,{onClick:()=>{k(),A()}})}):null,C&&(0,v.jsx)(n,{label:`Loading response plans`}),u.length>0&&(0,v.jsxs)(`div`,{className:`bg-amber-500/5 border border-amber-500/30 rounded-xl p-6`,children:[(0,v.jsxs)(`h2`,{className:`text-lg font-semibold text-amber-400 mb-4 flex items-center gap-2`,children:[(0,v.jsx)(e,{className:`w-5 h-5`}),`Pending Approvals (`,u.length,`)`]}),(0,v.jsx)(`div`,{className:`space-y-3`,children:u.map(e=>(0,v.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-4 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3`,children:[(0,v.jsxs)(`div`,{className:`flex-1`,children:[(0,v.jsxs)(`p`,{className:`text-sm text-white font-medium`,children:[`Plan #`,e.plan_id,` — Case #`,e.case_id]}),(0,v.jsx)(`p`,{className:`text-xs text-surface-400 mt-1`,children:e.reason}),(0,v.jsxs)(`p`,{className:`text-xs text-surface-500 mt-1`,children:[e.actions?.length||0,` actions · Level `,e.autonomy_level]})]}),(0,v.jsxs)(`div`,{className:`flex gap-2`,children:[(0,v.jsxs)(`button`,{disabled:D===e.plan_id,onClick:()=>j(e.plan_id),className:`flex items-center gap-1 px-3 py-1.5 bg-green-600 hover:bg-green-700 text-white rounded text-xs font-medium transition-colors`,children:[(0,v.jsx)(p,{className:`w-3.5 h-3.5`}),` Approve`]}),(0,v.jsxs)(`button`,{disabled:D===e.plan_id,onClick:()=>M(e.plan_id),className:`flex items-center gap-1 px-3 py-1.5 bg-red-600 hover:bg-red-700 text-white rounded text-xs font-medium transition-colors`,children:[(0,v.jsx)(l,{className:`w-3.5 h-3.5`}),` Reject`]})]})]},e.id))})]}),(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,v.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`All Response Plans`}),o.length===0?(0,v.jsx)(r,{title:`No response plans`,description:`Run the agent pipeline to generate a guarded response plan.`}):(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-500 text-xs`,children:[(0,v.jsx)(`th`,{className:`text-left p-3`,children:`ID`}),(0,v.jsx)(`th`,{className:`text-left p-3`,children:`Case`}),(0,v.jsx)(`th`,{className:`text-left p-3`,children:`Actions`}),(0,v.jsx)(`th`,{className:`text-left p-3`,children:`Level`}),(0,v.jsx)(`th`,{className:`text-left p-3`,children:`Status`}),(0,v.jsx)(`th`,{className:`text-left p-3`,children:`Created`}),(0,v.jsx)(`th`,{className:`text-left p-3`,children:`Actions`})]})}),(0,v.jsx)(`tbody`,{children:o.map(e=>(0,v.jsxs)(`tr`,{tabIndex:0,className:`border-b border-surface-800 hover:bg-surface-800/50 cursor-pointer focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary-500`,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),S(x?.id===e.id?null:e))},onClick:()=>S(x?.id===e.id?null:e),children:[(0,v.jsxs)(`td`,{className:`p-3 text-surface-300`,children:[`#`,e.id]}),(0,v.jsxs)(`td`,{className:`p-3 text-surface-300`,children:[`Case #`,e.case_id]}),(0,v.jsx)(`td`,{className:`p-3 text-surface-300`,children:e.actions?.length||0}),(0,v.jsx)(`td`,{className:`p-3`,children:(0,v.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded bg-primary-500/20 text-primary-400`,children:e.autonomy_level})}),(0,v.jsx)(`td`,{className:`p-3`,children:(0,v.jsx)(`span`,{className:d(`text-xs px-2 py-0.5 rounded`,y[e.status]||y.draft),children:e.status})}),(0,v.jsx)(`td`,{className:`p-3 text-surface-500 text-xs`,children:new Date(e.created_at).toLocaleString()}),(0,v.jsx)(`td`,{className:`p-3`,children:e.status===`approved`&&(0,v.jsxs)(`button`,{disabled:D===e.id,onClick:t=>{t.stopPropagation(),N(e.id)},className:`flex items-center gap-1 px-2 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded text-xs transition-colors`,children:[(0,v.jsx)(a,{className:`w-3 h-3`}),` Execute`]})})]},e.id))})]})})]}),x&&(0,v.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,v.jsxs)(`h2`,{className:`text-lg font-semibold text-white mb-4 flex items-center gap-2`,children:[(0,v.jsx)(f,{className:`w-5 h-5 text-primary-400`}),`Plan #`,x.id,` Actions`]}),(0,v.jsx)(`div`,{className:`space-y-2`,children:x.actions?.map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-surface-900/50 rounded-lg`,children:[(0,v.jsxs)(`span`,{className:`text-xs font-mono text-surface-500 w-6`,children:[`#`,e.priority||t+1]}),(0,v.jsx)(`span`,{className:d(`text-xs px-2 py-0.5 rounded font-medium`,e.policy_check?.approved?`bg-green-500/20 text-green-400`:`bg-amber-500/20 text-amber-400`),children:e.action_type}),(0,v.jsx)(`span`,{className:`text-sm text-surface-300 flex-1`,children:e.target}),(0,v.jsx)(`span`,{className:`text-xs text-surface-500`,children:e.reason}),e.execution_result&&(0,v.jsx)(`span`,{className:d(`text-xs px-2 py-0.5 rounded`,e.execution_result.status===`completed`?`bg-emerald-500/20 text-emerald-400`:`bg-red-500/20 text-red-400`),children:e.execution_result.status})]},t))})]})]})}export{b as ResponsePlans}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Settings-BcCRTAIN.js b/frontend-v2/dist/assets/Settings-BcCRTAIN.js new file mode 100644 index 0000000..46ab949 --- /dev/null +++ b/frontend-v2/dist/assets/Settings-BcCRTAIN.js @@ -0,0 +1 @@ +import{E as e,_ as t,b as n,c as r,g as i,k as a,m as o,o as s,v as c,y as l}from"./index-CjOT90JS.js";import{t as u}from"./PageHeader-BCt4-hcp.js";import{n as d,t as f}from"./StatusBadge-Cza7NGb-.js";var p=i(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),m=i(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),h=a(e(),1),g=t();function _(){let{user:e}=c(),[t,i]=(0,h.useState)(``),[a,_]=(0,h.useState)(``),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(!1),[S,C]=(0,h.useState)(null),w=async()=>{if(!t&&!a){C({text:`Enter at least one HTTPS webhook URL to update.`,error:!0});return}x(!0),C(null);try{await n.patch(`/auth/me/integrations`,{slack_webhook_url:t||null,webhook_url:a||null}),i(``),_(``),C({text:`Integration credentials updated and hidden.`,error:!1})}catch(e){C({text:l(e,`Integration settings could not be saved.`),error:!0})}finally{x(!1)}};return(0,g.jsxs)(`div`,{className:`space-y-5`,children:[(0,g.jsx)(u,{eyebrow:`Govern`,title:`Settings`,description:`Account security and write-only notification credentials for this operator workspace.`}),S&&(0,g.jsx)(`div`,{role:S.error?`alert`:`status`,className:`rounded-md border px-4 py-3 text-sm ${S.error?`border-danger/30 bg-danger/10 text-danger`:`border-success/30 bg-success/10 text-success`}`,children:S.text}),(0,g.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,0.8fr)_minmax(28rem,1.2fr)]`,children:[(0,g.jsxs)(`div`,{className:`space-y-4`,children:[(0,g.jsx)(d,{title:`Operator profile`,description:`Identity and access context for the active session.`,action:(0,g.jsx)(m,{className:`h-4 w-4 text-primary-300`}),children:(0,g.jsxs)(`dl`,{className:`divide-y divide-surface-800 px-5`,children:[[[`Email`,e?.email||`Unavailable`],[`Name`,e?.full_name||`Not set`],[`Company`,e?.company||`Not set`]].map(([e,t])=>(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-3 text-sm`,children:[(0,g.jsx)(`dt`,{className:`text-surface-400`,children:e}),(0,g.jsx)(`dd`,{className:`truncate text-right font-medium text-surface-200`,children:t})]},e)),(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-3 text-sm`,children:[(0,g.jsx)(`dt`,{className:`text-surface-400`,children:`Role`}),(0,g.jsx)(`dd`,{children:(0,g.jsx)(f,{tone:`info`,children:e?.role||`analyst`})})]})]})}),(0,g.jsx)(d,{title:`Multi-factor authentication`,description:`TOTP adds a second verification step to password sign-in.`,action:(0,g.jsx)(s,{className:`h-4 w-4 text-success`}),children:(0,g.jsxs)(`div`,{className:`p-5`,children:[e?.mfa_enabled?(0,g.jsx)(f,{tone:`success`,children:`MFA enabled`}):(0,g.jsxs)(`button`,{type:`button`,onClick:async()=>{C(null);try{let e=await n.post(`/auth/me/mfa/setup`);y(e.data.provisioning_uri)}catch(e){C({text:l(e,`MFA setup could not be started.`),error:!0})}},className:`inline-flex min-h-9 items-center gap-2 rounded-md bg-primary-500 px-3.5 text-sm font-semibold text-surface-950 hover:bg-primary-400`,children:[(0,g.jsx)(p,{className:`h-4 w-4`}),` Enable MFA`]}),v&&(0,g.jsxs)(`div`,{className:`mt-4 rounded-md border border-surface-700 bg-surface-950 p-4`,children:[(0,g.jsx)(`p`,{className:`mb-2 text-xs text-surface-400`,children:`Add this provisioning URI to your authenticator, then finish verification.`}),(0,g.jsx)(`code`,{className:`block break-all text-xs text-primary-300`,children:v})]})]})})]}),(0,g.jsx)(d,{title:`Notification integrations`,description:`Credentials are write-only. Existing values are never returned to the browser.`,action:(0,g.jsx)(o,{className:`h-4 w-4 text-warning`}),children:(0,g.jsxs)(`form`,{className:`space-y-5 p-5`,onSubmit:e=>{e.preventDefault(),w()},children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`label`,{htmlFor:`slack-webhook`,className:`mb-1.5 block text-sm font-medium text-surface-300`,children:`Slack webhook URL`}),(0,g.jsx)(`input`,{id:`slack-webhook`,type:`url`,inputMode:`url`,autoComplete:`off`,value:t,onChange:e=>i(e.target.value),placeholder:`https://hooks.slack.com/services/…`,className:`w-full rounded-md border border-surface-600 bg-surface-950 px-3 py-2.5 text-sm text-surface-100 placeholder-surface-500`}),(0,g.jsx)(`p`,{className:`mt-1.5 text-xs text-surface-500`,children:`Must use HTTPS. The credential is cleared from this form after saving.`})]}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`label`,{htmlFor:`custom-webhook`,className:`mb-1.5 block text-sm font-medium text-surface-300`,children:`Custom webhook URL`}),(0,g.jsx)(`input`,{id:`custom-webhook`,type:`url`,inputMode:`url`,autoComplete:`off`,value:a,onChange:e=>_(e.target.value),placeholder:`https://security.example.com/onealert`,className:`w-full rounded-md border border-surface-600 bg-surface-950 px-3 py-2.5 text-sm text-surface-100 placeholder-surface-500`})]}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-surface-800 pt-4`,children:[(0,g.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-surface-500`,children:[(0,g.jsx)(r,{className:`h-3.5 w-3.5`}),` Sent in an encrypted request body`]}),(0,g.jsx)(`button`,{type:`submit`,disabled:b,className:`min-h-9 rounded-md bg-primary-500 px-4 text-sm font-semibold text-surface-950 hover:bg-primary-400 disabled:opacity-50`,children:b?`Saving…`:`Save integrations`})]})]})})]})]})}export{_ as Settings}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/StatusBadge-Cza7NGb-.js b/frontend-v2/dist/assets/StatusBadge-Cza7NGb-.js new file mode 100644 index 0000000..d8bd8cb --- /dev/null +++ b/frontend-v2/dist/assets/StatusBadge-Cza7NGb-.js @@ -0,0 +1 @@ +import{_ as e,n as t}from"./index-CjOT90JS.js";var n=e();function r({title:e,description:r,action:i,children:a,className:o,...s}){return(0,n.jsxs)(`section`,{className:t(`oa-panel`,o),...s,children:[(e||r||i)&&(0,n.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-surface-800 px-5 py-4`,children:[(0,n.jsxs)(`div`,{children:[e&&(0,n.jsx)(`h2`,{className:`text-sm font-semibold text-surface-100`,children:e}),r&&(0,n.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-surface-400`,children:r})]}),i]}),a]})}var i={neutral:`border-surface-600 bg-surface-700/35 text-surface-300`,info:`border-info/30 bg-info/10 text-info`,success:`border-success/30 bg-success/10 text-success`,warning:`border-warning/30 bg-warning/10 text-warning`,danger:`border-danger/30 bg-danger/10 text-danger`};function a({children:e,tone:r=`neutral`}){return(0,n.jsx)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wide border`,i[r]),children:e})}export{r as n,a as t}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/Validation-UtB4LE5v.js b/frontend-v2/dist/assets/Validation-UtB4LE5v.js new file mode 100644 index 0000000..f12272f --- /dev/null +++ b/frontend-v2/dist/assets/Validation-UtB4LE5v.js @@ -0,0 +1 @@ +import{a as e,i as t,n,r}from"./AsyncState-CuK4jvuL.js";import{t as i}from"./play-C2dygcG1.js";import{t as a}from"./plus-B6elnz9I.js";import{E as o,_ as s,a as c,b as l,f as u,k as d,n as f,p,s as m,t as h,y as g}from"./index-CjOT90JS.js";import{t as _}from"./PageHeader-BCt4-hcp.js";var v=d(o(),1),y=s(),b=[{id:`T1059`,name:`Command and Scripting Interpreter`},{id:`T1071`,name:`Application Layer Protocol`},{id:`T1110`,name:`Brute Force`},{id:`T1190`,name:`Exploit Public-Facing Application`},{id:`T1078`,name:`Valid Accounts`},{id:`T1021`,name:`Remote Services`},{id:`T1046`,name:`Network Service Discovery`},{id:`T1486`,name:`Data Encrypted for Impact`}],x={pending:`bg-surface-600/20 text-surface-400`,running:`bg-blue-500/20 text-blue-400`,completed:`bg-green-500/20 text-green-400`,failed:`bg-red-500/20 text-red-400`};function S(){let[o,s]=(0,v.useState)([]),[d,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)({name:``,description:``,techniques:[]}),[D,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(!0),[N,P]=(0,v.useState)(``),F=async()=>{try{let e=await l.get(`/validation/runs`);s(e.data.data||[]),P(``)}catch(e){P(g(e,`Validation runs could not be loaded.`))}finally{M(!1)}},I=async()=>{if(!(!T.name.trim()||T.techniques.length===0)){O(!0);try{await l.post(`/validation/runs`,{name:T.name,description:T.description,mode:`dry_run`,mitre_techniques:T.techniques}),S(!1),E({name:``,description:``,techniques:[]}),h(`Validation run created`,`success`),await F()}catch(e){h(g(e,`Failed to create run.`),`error`)}finally{O(!1)}}},L=async e=>{if(!(k!==null||!window.confirm(`Run this detection validation now?`))){A(e);try{await l.post(`/validation/runs/${e}/execute`),h(`Validation complete`,`success`),await F(),await R(e)}catch(e){h(g(e,`Execution failed.`),`error`)}finally{A(null)}}},R=async e=>{try{let t=await l.get(`/validation/runs/${e}`);w(t.data.data)}catch(e){h(g(e,`Run details could not be loaded.`),`error`)}},z=e=>{E(t=>({...t,techniques:t.techniques.includes(e)?t.techniques.filter(t=>t!==e):[...t.techniques,e]}))};return(0,v.useEffect)(()=>{F()},[]),(0,y.jsxs)(`div`,{className:`space-y-6`,children:[(0,y.jsx)(_,{eyebrow:`Analyze`,title:`Purple-Team Validation`,description:`Test detection controls against simulated ATT&CK techniques and expose measurable coverage gaps.`,actions:(0,y.jsxs)(`button`,{onClick:()=>S(!d),className:`flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors`,children:[(0,y.jsx)(a,{className:`w-4 h-4`}),` New Validation`]})}),d&&(0,y.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,y.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Create Validation Run`}),(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`label`,{htmlFor:`validation-name`,className:`block text-sm font-medium text-surface-300 mb-1`,children:`Name`}),(0,y.jsx)(`input`,{id:`validation-name`,type:`text`,value:T.name,onChange:e=>E({...T,name:e.target.value}),placeholder:`e.g. Weekly Detection Coverage Test`,className:`w-full px-4 py-2 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-2`,children:`ATT&CK Techniques`}),(0,y.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-2`,children:b.map(e=>(0,y.jsxs)(`button`,{onClick:()=>z(e.id),className:f(`p-2 rounded-lg text-left text-xs border transition-colors`,T.techniques.includes(e.id)?`border-primary-500 bg-primary-500/10 text-primary-300`:`border-surface-700 bg-surface-900/50 text-surface-400 hover:border-surface-600`),children:[(0,y.jsx)(`span`,{className:`font-mono font-medium`,children:e.id}),(0,y.jsx)(`p`,{className:`text-xs mt-0.5 truncate`,children:e.name})]},e.id))})]}),(0,y.jsx)(`button`,{onClick:I,disabled:D||!T.name.trim()||T.techniques.length===0,className:`px-6 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg text-sm font-medium transition-colors`,children:D?`Creating...`:`Create Run`})]})]}),j?(0,y.jsx)(t,{label:`Loading validation runs`}):N?(0,y.jsx)(r,{title:`Validation unavailable`,description:N,action:(0,y.jsx)(e,{onClick:F})}):(0,y.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,y.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Validation Runs`}),o.length===0?(0,y.jsx)(n,{title:`No validation runs`,description:`Create one to test current detection coverage.`}):(0,y.jsx)(`div`,{className:`space-y-3`,children:o.map(e=>(0,y.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-4 p-4 bg-surface-900/50 rounded-lg cursor-pointer hover:bg-surface-900/80 transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500`,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e.id))},onClick:()=>R(e.id),children:[(0,y.jsx)(m,{className:`w-5 h-5 text-primary-400 shrink-0`}),(0,y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,y.jsx)(`p`,{className:`text-sm text-white font-medium`,children:e.name}),(0,y.jsxs)(`p`,{className:`text-xs text-surface-500`,children:[e.mitre_techniques?.length||0,` techniques · `,e.mode,` · `,new Date(e.created_at).toLocaleDateString()]})]}),e.results_summary&&(0,y.jsxs)(`div`,{className:`text-right`,children:[(0,y.jsxs)(`p`,{className:f(`text-lg font-bold`,e.results_summary.detection_rate>=70?`text-green-400`:e.results_summary.detection_rate>=40?`text-amber-400`:`text-red-400`),children:[e.results_summary.detection_rate,`%`]}),(0,y.jsxs)(`p`,{className:`text-xs text-surface-500`,children:[e.results_summary.detected,`/`,e.results_summary.tested,` detected`]})]}),(0,y.jsx)(`span`,{className:f(`text-xs px-2 py-0.5 rounded`,x[e.status]||x.pending),children:e.status}),e.status===`pending`&&(0,y.jsxs)(`button`,{disabled:k===e.id,onClick:t=>{t.stopPropagation(),L(e.id)},className:`flex items-center gap-1 px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded text-xs font-medium transition-colors`,children:[(0,y.jsx)(i,{className:`w-3 h-3`}),` Run`]})]},e.id))})]}),C&&(0,y.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,y.jsxs)(`h2`,{className:`text-lg font-semibold text-white mb-4 flex items-center gap-2`,children:[(0,y.jsx)(c,{className:`w-5 h-5 text-primary-400`}),C.name,` — Results`]}),C.results_summary&&(0,y.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6`,children:[(0,y.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,y.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:C.results_summary.tested}),(0,y.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Tests Run`})]}),(0,y.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,y.jsx)(`p`,{className:`text-2xl font-bold text-green-400`,children:C.results_summary.detected}),(0,y.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Detected`})]}),(0,y.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,y.jsx)(`p`,{className:`text-2xl font-bold text-red-400`,children:C.results_summary.missed}),(0,y.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Missed`})]}),(0,y.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,y.jsxs)(`p`,{className:f(`text-2xl font-bold`,C.results_summary.detection_rate>=70?`text-green-400`:`text-amber-400`),children:[C.results_summary.detection_rate,`%`]}),(0,y.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Detection Rate`})]})]}),C.steps?.length>0&&(0,y.jsx)(`div`,{className:`space-y-2`,children:C.steps.map(e=>(0,y.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-surface-900/30 rounded-lg`,children:[e.actual_result===`detected`?(0,y.jsx)(p,{className:`w-4 h-4 text-green-400 shrink-0`}):(0,y.jsx)(u,{className:`w-4 h-4 text-red-400 shrink-0`}),(0,y.jsx)(`span`,{className:`font-mono text-xs text-primary-400 w-12`,children:e.technique_id}),(0,y.jsx)(`span`,{className:`text-sm text-surface-300 flex-1`,children:e.test_name}),(0,y.jsx)(`span`,{className:f(`text-xs px-2 py-0.5 rounded`,e.actual_result===`detected`?`bg-green-500/20 text-green-400`:`bg-red-500/20 text-red-400`),children:e.actual_result}),(0,y.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[e.duration_ms,`ms`]})]},e.id))})]})]})}export{S as Validation}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/clock-COi0udmh.js b/frontend-v2/dist/assets/clock-COi0udmh.js new file mode 100644 index 0000000..5989585 --- /dev/null +++ b/frontend-v2/dist/assets/clock-COi0udmh.js @@ -0,0 +1 @@ +import{g as e}from"./index-CjOT90JS.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]);export{t}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/index-CjOT90JS.js b/frontend-v2/dist/assets/index-CjOT90JS.js new file mode 100644 index 0000000..858ba2a --- /dev/null +++ b/frontend-v2/dist/assets/index-CjOT90JS.js @@ -0,0 +1,18 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DzWggTdy.js","assets/AsyncState-CuK4jvuL.js","assets/PageHeader-BCt4-hcp.js","assets/StatusBadge-Cza7NGb-.js","assets/Cases--uF5onG8.js","assets/play-C2dygcG1.js","assets/CaseDetail-DQUd0l6u.js","assets/clock-COi0udmh.js","assets/Alerts-DCdbzOXS.js","assets/Events-Cp2M2z7v.js","assets/Assets-CS6iCC1b.js","assets/plus-B6elnz9I.js","assets/OTDiscovery-CQFYbo-6.js","assets/MitreMap-CJAZWQjH.js","assets/HuntLab-DhSfhJ9v.js","assets/Settings-BcCRTAIN.js","assets/AuditLog-D7hVaLQG.js","assets/ResponsePlans-CriMCUJ8.js","assets/Validation-UtB4LE5v.js"])))=>i.map(i=>d[i]); +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-eet&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():S=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1fe||(e.current=de[fe],de[fe]=null,fe--)}function O(e,t){fe++,de[fe]=e.current,e.current=t}var he=pe(null),ge=pe(null),_e=pe(null),ve=pe(null);function ye(e,t){switch(O(_e,t),O(ge,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(he),O(he,e)}function be(){me(he),me(ge),me(_e)}function xe(e){e.memoizedState!==null&&O(ve,e);var t=he.current,n=Hd(t,e.type);t!==n&&(O(ge,e),O(he,n))}function Se(e){ge.current===e&&(me(he),me(ge)),ve.current===e&&(me(ve),Qf._currentValue=ue)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ee=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Te(n):``}function Oe(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te(`Lazy`);case 13:return e.child!==t&&t!==null?Te(`Suspense Fallback`):Te(`Suspense`);case 19:return Te(`SuspenseList`);case 0:case 15:return De(e.type,!1);case 11:return De(e.type.render,!1);case 1:return De(e.type,!0);case 31:return Te(`Activity`);default:return``}}function ke(e){try{var t=``,n=null;do t+=Oe(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Ae=Object.prototype.hasOwnProperty,je=t.unstable_scheduleCallback,Me=t.unstable_cancelCallback,Ne=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Fe=t.unstable_now,Ie=t.unstable_getCurrentPriorityLevel,Le=t.unstable_ImmediatePriority,Re=t.unstable_UserBlockingPriority,ze=t.unstable_NormalPriority,Be=t.unstable_LowPriority,Ve=t.unstable_IdlePriority,He=t.log,Ue=t.unstable_setDisableYieldValue,We=null,Ge=null;function Ke(e){if(typeof He==`function`&&Ue(e),Ge&&typeof Ge.setStrictMode==`function`)try{Ge.setStrictMode(We,e)}catch{}}var qe=Math.clz32?Math.clz32:Xe,Je=Math.log,Ye=Math.LN2;function Xe(e){return e>>>=0,e===0?32:31-(Je(e)/Ye|0)|0}var Ze=256,Qe=262144,$e=4194304;function et(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function tt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=et(n))):i=et(o):i=et(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=et(n))):i=et(o)):i=et(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function nt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function it(){var e=$e;return $e<<=1,!($e&62914560)&&($e=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.textContent,a=i.length;for(e=0;e=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var lr=!1;function A(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function ur(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=wn(),Cn=Sn=xn=null,lr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gt(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=vn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Gt(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Ar(zr,r)||(zr=r,r=Ed(Rr,`onSelect`),0>=o,i-=o,Ni=1<<32-qe(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),N&&Fi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),N&&Fi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return N&&Fi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),N&&Fi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Aa(l)===r.type){n(e,r.sibling),c=a(r,o.props),La(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=bi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=yi(o.type,o.key,o.props,null,e.mode,c),La(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Ci(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Aa(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ia(o),c);if(o.$$typeof===C)return b(e,r,oa(e,o),c);Ra(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=xi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Fa=0;var i=b(e,t,n,r);return Pa=null,i}catch(t){if(t===wa||t===Ea)throw t;var a=hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ba=za(!0),Va=za(!1),Ha=!1;function Ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=fi(e),di(e,null,n),t}return ci(e,r,t,n),fi(e)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}function Ja(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ya=!1;function Xa(){if(Ya){var e=ha;if(e!==null)throw e}}function Za(e,t,n,r){Ya=!1;var i=e.updateQueue;Ha=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===L&&(Ya=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ha=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function $a(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};E.T=s,Fs(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,va(c,r),pu(e)):Ps(e,t,r,pu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,ue,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},pu())}function Os(){return F(Qf)}function ks(){return H().memoizedState}function As(){return H().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ga(n);var r=Ka(t,e,n);r!==null&&(hu(r,t,n),qa(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=li(e,t,n,r),n!==null&&(hu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,pu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o))return ci(e,t,i,0),K===null&&si(),!1}catch{}if(n=li(e,t,i,r),n!==null)return hu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=li(e,n,r,2),t!==null&&hu(t,e,2)}function Is(e){var t=e.alternate;return e===z||t!==null&&t===z}function Ls(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var zs={readContext:F,use:Po,useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useLayoutEffect:V,useInsertionEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V,useDeferredValue:V,useTransition:V,useSyncExternalStore:V,useId:V,useHostTransitionStatus:V,useFormState:V,useActionState:V,useOptimistic:V,useMemoCache:V,useCacheRefresh:V};zs.useEffectEvent=V;var Bs={readContext:F,use:Po,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:F,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(vo){Ke(!0);try{e()}finally{Ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(vo){Ke(!0);try{n(t)}finally{Ke(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(jo(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,z,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,a=jo();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=K.identifierPrefix;if(N){var n=Pi,r=Ni;n=(r&~(1<<32-qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[gt]=t,o[_t]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return U(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=_e.current,qi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Bi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Wi(t,!0)}else e=Bd(e).createTextNode(r),e[gt]=t,t.stateNode=e}return U(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=qi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[gt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),e=!1}else n=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fo(t),t):(fo(t),null);if(t.flags&128)throw Error(i(558))}return U(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[gt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),a=!1}else a=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(fo(t),t):(fo(t),null)}return fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),U(t),null);case 4:return be(),e===null&&Sd(t.stateNode.containerInfo),U(t),null;case 10:return ea(t.type),U(t),null;case 19:if(me(R),r=t.memoizedState,r===null)return U(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vi(n,e),n=n.sibling;return O(R,R.current&1|2),N&&Fi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Fe()>tu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!N)return U(t),null}else 2*Fe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(U(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Fe(),e.sibling=null,n=R.current,O(R,a?n&1|2:n&1),N&&Fi(t,r.treeForkCount),e);case 22:case 23:return fo(t),io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(U(t),t.subtreeFlags&6&&(t.flags|=8192)):U(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ea(I),U(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Ri(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(I),be(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(fo(t),t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(R),null;case 4:return be(),null;case 10:return ea(t.type),null;case 22:case 23:return fo(t),io(),e!==null&&me(ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(I),null;case 25:return null;default:return null}}function Vc(e,t){switch(Ri(t),t.tag){case 3:ea(I),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 31:t.memoizedState!==null&&fo(t);break;case 13:fo(t);break;case 19:me(R);break;case 10:ea(t.type);break;case 22:case 23:fo(t),io(),e!==null&&me(ba);break;case 24:ea(I)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$a(t,n)}catch(t){Z(e,e.return,t)}}}function Gc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[_t]=t}catch(t){Z(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[gt]=e,t[_t]=n}catch(t){Z(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[gt]=e,Ot(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,E.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot==`function`)try{Ge.onPostCommitFiberRoot(We,o)}catch{}return!0}finally{D.p=a,E.T=r,Vu(e,t)}}function Wu(e,t,n){t=Ti(n,t),t=$s(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(ot(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=Ti(n,e),n=ec(2),r=Ka(t,n,2),r!==null&&(tc(n,r,t,e),ot(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>Fe()-$l?!(G&2)&&Su(e,0):ql|=n,Yl===J&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=it()),e=ui(e,t),e!==null&&(ot(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return je(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=tt(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||nt(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Fe(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Dt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ot(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ot(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ot(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=_e.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Dt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+qt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Ot(t),e.head.appendChild(t))}function Pf(e){return`[src="`+qt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Ot(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ot(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d()),y=_();h();function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ae(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=x.Pop,c=null,l=u();l??(l=0,o.replaceState(b({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=x.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=x.Push;let r=T(h.location,e,t);n&&n(r,e),l=u()+1;let d=ne(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=x.Replace;let r=T(h.location,e,t);n&&n(r,e),l=u();let i=ne(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:re(e);return n=n.replace(/ $/,`%20`),w(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(S,d),c=e,()=>{i.removeEventListener(S,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var oe;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(oe||={});function se(e,t,n){return n===void 0&&(n=`/`),ce(e,t,n,!1)}function ce(e,t,n,r){let i=Se((typeof t==`string`?ie(t):t).pathname||`/`,n);if(i==null)return null;let a=le(e);D(a);let o=null,s=xe(i);for(let e=0;o==null&&e{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(w(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Me([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),le(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:ge(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of E(e.path))i(e,t,n)}),t}function E(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=E(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function D(e){e.sort((e,t)=>e.score===t.score?_e(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ue=/^:[\w-]+$/,de=3,fe=2,pe=1,me=10,O=-2,he=e=>e===`*`;function ge(e,t){let n=e.split(`/`),r=n.length;return n.some(he)&&(r+=O),t&&(r+=fe),n.filter(e=>!he(e)).reduce((e,t)=>e+(ue.test(t)?de:t===``?pe:me),r)}function _e(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ve(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function be(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ee(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,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function xe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return ee(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Se(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 Ce=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=e=>Ce.test(e);function Te(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ie(e):e,a;if(n)if(we(n))a=n;else{if(n.includes(`//`)){let e=n;n=je(n),ee(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?Ee(n.substring(1),`/`):Ee(n,t)}else a=t;return{pathname:a,search:Pe(r),hash:Fe(i)}}function Ee(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function De(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 Oe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ke(e,t){let n=Oe(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Ae(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=ie(e):(i=b({},e),w(!i.pathname||!i.pathname.includes(`?`),De(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),De(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),De(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Te(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var je=e=>e.replace(/\/\/+/g,`/`),Me=e=>je(e.join(`/`)),Ne=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Pe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Fe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function Ie(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Le=[`post`,`put`,`patch`,`delete`];new Set(Le);var Re=[`get`,...Le];new Set(Re);function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),v.useCallback(function(n,i){if(i===void 0&&(i={}),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ae(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Me([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}var Qe=v.createContext(null);function $e(e){let t=v.useContext(We).outlet;return t&&v.createElement(Qe.Provider,{value:e},t)}function et(){let{matches:e}=v.useContext(We),t=e[e.length-1];return t?t.params:{}}function tt(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(He),{matches:i}=v.useContext(We),{pathname:a}=Je(),o=JSON.stringify(ke(i,r.v7_relativeSplatPath));return v.useMemo(()=>Ae(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}function nt(e,t){return rt(e,t)}function rt(e,t,n,r){!qe()&&w(!1);let{navigator:i}=v.useContext(He),{matches:a}=v.useContext(We),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Je(),u;if(t){let e=typeof t==`string`?ie(t):t;!(c===`/`||e.pathname?.startsWith(c))&&w(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=se(e,{pathname:f}),m=ct(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Me([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Me([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?v.createElement(Ue.Provider,{value:{location:ze({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:x.Pop}},m):m}function it(){let e=ht(),t=Ie(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var at=v.createElement(it,null),ot=class extends v.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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:v.createElement(We.Provider,{value:this.props.routeContext},v.createElement(Ge.Provider,{value:this.state.error,children:this.props.component}))}};function st(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(Be);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(We.Provider,{value:t},r)}function ct(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&w(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||at,s&&(c<0&&i===0?(vt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?v.createElement(r.route.Component,null):r.route.element?r.route.element:e,v.createElement(st,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?v.createElement(ot,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var lt=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(lt||{}),ut=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(ut||{});function dt(e){let t=v.useContext(Be);return!t&&w(!1),t}function ft(e){let t=v.useContext(Ve);return!t&&w(!1),t}function pt(e){let t=v.useContext(We);return!t&&w(!1),t}function mt(e){let t=pt(e),n=t.matches[t.matches.length-1];return!n.route.id&&w(!1),n.route.id}function ht(){let e=v.useContext(Ge),t=ft(ut.UseRouteError),n=mt(ut.UseRouteError);return e===void 0?t.errors?.[n]:e}function gt(){let{router:e}=dt(lt.UseNavigateStable),t=mt(ut.UseNavigateStable),n=v.useRef(!1);return Ye(()=>{n.current=!0}),v.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,ze({fromRouteId:t},i)))},[e,t])}var _t={};function vt(e,t,n){!t&&!_t[e]&&(_t[e]=!0)}var yt=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function bt(e,t){e?.v7_startTransition===void 0&&yt(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&yt(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&yt(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&yt(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&yt(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&yt(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}function xt(e){let{to:t,replace:n,state:r,relative:i}=e;!qe()&&w(!1);let{future:a,static:o}=v.useContext(He),{matches:s}=v.useContext(We),{pathname:c}=Je(),l=Xe(),u=Ae(t,ke(s,a.v7_relativeSplatPath),c,i===`path`),d=JSON.stringify(u);return v.useEffect(()=>l(JSON.parse(d),{replace:n,state:r,relative:i}),[l,d,i,n,r]),null}function St(e){return $e(e.context)}function k(e){w(!1)}function Ct(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=x.Pop,navigator:a,static:o=!1,future:s}=e;qe()&&w(!1);let c=t.replace(/^\/*/,`/`),l=v.useMemo(()=>({basename:c,navigator:a,static:o,future:ze({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=ie(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=v.useMemo(()=>{let e=Se(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:v.createElement(He.Provider,{value:l},v.createElement(Ue.Provider,{children:n,value:h}))}function wt(e){let{children:t,location:n}=e;return nt(Et(t),n)}var Tt=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Tt||{});new Promise(()=>{}),v.Component;function Et(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,Et(e.props.children,i));return}e.type!==k&&w(!1),!(!e.props.index||!e.props.children)&&w(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Et(e.props.children,i)),n.push(a)}),n}function Dt(){return Dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l&&Ft?Ft(()=>c(e)):c(e)},[c,l]);return v.useLayoutEffect(()=>o.listen(u),[o,u]),v.useEffect(()=>bt(r),[r]),v.createElement(Ct,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Lt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Rt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zt=v.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u}=e,d=Ot(e,jt),{basename:f}=v.useContext(He),p,m=!1;if(typeof c==`string`&&Rt.test(c)&&(p=c,Lt))try{let e=new URL(window.location.href),t=c.startsWith(`//`)?new URL(e.protocol+c):new URL(c),n=Se(t.pathname,f);t.origin===e.origin&&n!=null?c=n+t.search+t.hash:m=!0}catch{}let h=Ke(c,{relative:r}),g=Wt(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u});function _(e){n&&n(e),e.defaultPrevented||g(e)}return v.createElement(`a`,Dt({},d,{href:p||h,onClick:m||i?n:_,ref:t,target:s}))}),Bt=v.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:r=!1,className:i=``,end:a=!1,style:o,to:s,viewTransition:c,children:l}=e,u=Ot(e,Mt),d=tt(s,{relative:u.relative}),f=Je(),p=v.useContext(Ve),{navigator:m,basename:h}=v.useContext(He),g=p!=null&&Gt(d)&&c===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,y=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;r||(y=y.toLowerCase(),b=b?b.toLowerCase():null,_=_.toLowerCase()),b&&h&&(b=Se(b,h)||b);let x=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,S=y===_||!a&&y.startsWith(_)&&y.charAt(x)===`/`,C=b!=null&&(b===_||!a&&b.startsWith(_)&&b.charAt(_.length)===`/`),w={isActive:S,isPending:C,isTransitioning:g},ee=S?n:void 0,te;te=typeof i==`function`?i(w):[i,S?`active`:null,C?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ne=typeof o==`function`?o(w):o;return v.createElement(zt,Dt({},u,{"aria-current":ee,className:te,ref:t,style:ne,to:s,viewTransition:c}),typeof l==`function`?l(w):l)}),Vt;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(Vt||={});var Ht;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(Ht||={});function Ut(e){let t=v.useContext(Be);return!t&&w(!1),t}function Wt(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,c=Xe(),l=Je(),u=tt(e,{relative:o});return v.useCallback(t=>{if(At(t,n)){t.preventDefault();let n=r===void 0?re(l)===re(u):r;c(e,{replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[l,c,u,r,i,n,e,a,o,s])}function Gt(e,t){t===void 0&&(t={});let n=v.useContext(Pt);n??w(!1);let{basename:r}=Ut(Vt.useViewTransitionState),i=tt(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Se(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Se(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ye(i.pathname,o)!=null||ye(i.pathname,a)!=null}var Kt=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},qt=(e=>e?Kt(e):Kt),Jt=e=>e;function Yt(e,t=Jt){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var Xt=e=>{let t=qt(e),n=e=>Yt(t,e);return Object.assign(n,t),n},Zt=(e=>e?Xt(e):Xt);function Qt(e,t){return function(){return e.apply(t,arguments)}}var{toString:$t}=Object.prototype,{getPrototypeOf:en}=Object,{iterator:tn,toStringTag:nn}=Symbol,rn=(e=>t=>{let n=$t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),an=e=>(e=e.toLowerCase(),t=>rn(t)===e),on=e=>t=>typeof t===e,{isArray:sn}=Array,cn=on(`undefined`);function ln(e){return e!==null&&!cn(e)&&e.constructor!==null&&!cn(e.constructor)&&pn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var un=an(`ArrayBuffer`);function dn(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&un(e.buffer),t}var fn=on(`string`),pn=on(`function`),mn=on(`number`),hn=e=>typeof e==`object`&&!!e,gn=e=>e===!0||e===!1,_n=e=>{if(rn(e)!==`object`)return!1;let t=en(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(nn in e)&&!(tn in e)},vn=e=>{if(!hn(e)||ln(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},yn=an(`Date`),bn=an(`File`),xn=e=>!!(e&&e.uri!==void 0),Sn=e=>e&&e.getParts!==void 0,Cn=an(`Blob`),wn=an(`FileList`),Tn=e=>hn(e)&&pn(e.pipe);function En(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var Dn=En(),On=Dn.FormData===void 0?void 0:Dn.FormData,kn=e=>{if(!e)return!1;if(On&&e instanceof On)return!0;let t=en(e);if(!t||t===Object.prototype||!pn(e.append))return!1;let n=rn(e);return n===`formdata`||n===`object`&&pn(e.toString)&&e.toString()===`[object FormData]`},An=an(`URLSearchParams`),[jn,Mn,Nn,Pn]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(an),Fn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function In(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),sn(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Rn=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,zn=e=>!cn(e)&&e!==Rn;function Bn(...e){let{caseless:t,skipUndefined:n}=zn(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&Ln(r,i)||i,o=Qn(r,a)?r[a]:void 0;_n(o)&&_n(e)?r[a]=Bn(o,e):_n(e)?r[a]=Bn({},e):sn(e)?r[a]=e.slice():(!n||!cn(e))&&(r[a]=e)};for(let t=0,n=e.length;t(In(t,(t,r)=>{n&&pn(t)?Object.defineProperty(e,r,{__proto__:null,value:Qt(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Hn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Un=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Wn=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-->0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&en(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Gn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Kn=e=>{if(!e)return null;if(sn(e))return e;let t=e.length;if(!mn(t))return null;let n=Array(t);for(;t-->0;)n[t]=e[t];return n},qn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&en(Uint8Array)),Jn=(e,t)=>{let n=(e&&e[tn]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Yn=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Xn=an(`HTMLFormElement`),Zn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Qn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),$n=an(`RegExp`),er=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};In(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},tr=e=>{er(e,(t,n)=>{if(pn(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(pn(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},nr=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return sn(e)?r(e):r(String(e).split(t)),n},rr=()=>{},ir=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ar(e){return!!(e&&pn(e.append)&&e[nn]===`FormData`&&e[tn])}var or=e=>{let t=Array(10),n=(e,r)=>{if(hn(e)){if(t.indexOf(e)>=0)return;if(ln(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=sn(e)?[]:{};return In(e,(e,t)=>{let a=n(e,r+1);!cn(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},sr=an(`AsyncFunction`),cr=e=>e&&(hn(e)||pn(e))&&pn(e.then)&&pn(e.catch),lr=((e,t)=>e?setImmediate:t?((e,t)=>(Rn.addEventListener(`message`,({source:n,data:r})=>{n===Rn&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Rn.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,pn(Rn.postMessage)),A={isArray:sn,isArrayBuffer:un,isBuffer:ln,isFormData:kn,isArrayBufferView:dn,isString:fn,isNumber:mn,isBoolean:gn,isObject:hn,isPlainObject:_n,isEmptyObject:vn,isReadableStream:jn,isRequest:Mn,isResponse:Nn,isHeaders:Pn,isUndefined:cn,isDate:yn,isFile:bn,isReactNativeBlob:xn,isReactNative:Sn,isBlob:Cn,isRegExp:$n,isFunction:pn,isStream:Tn,isURLSearchParams:An,isTypedArray:qn,isFileList:wn,forEach:In,merge:Bn,extend:Vn,trim:Fn,stripBOM:Hn,inherits:Un,toFlatObject:Wn,kindOf:rn,kindOfTest:an,endsWith:Gn,toArray:Kn,forEachEntry:Jn,matchAll:Yn,isHTMLForm:Xn,hasOwnProperty:Qn,hasOwnProp:Qn,reduceDescriptors:er,freezeMethods:tr,toObjectSet:nr,toCamelCase:Zn,noop:rr,toFiniteNumber:ir,findKey:Ln,global:Rn,isContextDefined:zn,isSpecCompliantForm:ar,toJSONObject:or,isAsyncFn:sr,isThenable:cr,setImmediate:lr,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Rn):typeof process<`u`&&process.nextTick||lr,isIterable:e=>e!=null&&pn(e[tn])},ur=A.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),dr=e=>{let t={},n,r,i;return e&&e.split(` +`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&ur[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},fr=Symbol(`internals`),pr=/[^\x09\x20-\x7E\x80-\xFF]/g;function mr(e){let t=0,n=e.length;for(;tt;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function hr(e){return e&&String(e).trim().toLowerCase()}function gr(e){return mr(e.replace(pr,``))}function _r(e){return e===!1||e==null?e:A.isArray(e)?e.map(_r):gr(String(e))}function vr(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var yr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function br(e,t,n,r,i){if(A.isFunction(r))return r.call(this,t,n);if(i&&(t=n),A.isString(t)){if(A.isString(r))return t.indexOf(r)!==-1;if(A.isRegExp(r))return r.test(t)}}function xr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Sr(e,t){let n=A.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Cr=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=hr(t);if(!i)throw Error(`header name must be a non-empty string`);let a=A.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=_r(e))}let a=(e,t)=>A.forEach(e,(e,n)=>i(e,n,t));if(A.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(A.isString(e)&&(e=e.trim())&&!yr(e))a(dr(e),t);else if(A.isObject(e)&&A.isIterable(e)){let n={},r,i;for(let t of e){if(!A.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?A.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=hr(e),e){let n=A.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return vr(e);if(A.isFunction(t))return t.call(this,e,n);if(A.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=hr(e),e){let n=A.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||br(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=hr(e),e){let i=A.findKey(n,e);i&&(!t||br(n,n[i],i,t))&&(delete n[i],r=!0)}}return A.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||br(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return A.forEach(this,(r,i)=>{let a=A.findKey(n,i);if(a){t[a]=_r(r),delete t[i];return}let o=e?xr(i):String(i).trim();o!==i&&delete t[i],t[o]=_r(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return A.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&A.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` +`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[fr]=this[fr]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=hr(e);t[r]||(Sr(n,e),t[r]=!0)}return A.isArray(e)?e.forEach(r):r(e),this}};Cr.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),A.reduceDescriptors(Cr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),A.freezeMethods(Cr);var wr=`[REDACTED ****]`;function Tr(e){if(A.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(A.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function Er(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||A.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof Cr&&(e=e.toJSON()),r.push(e);let t;if(A.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);A.isUndefined(r)||(t[n]=r)});else{if(!A.isPlainObject(e)&&Tr(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?wr:i(a);A.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var j=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&A.hasOwnProp(e,`redact`)?e.redact:void 0,n=A.isArray(t)&&t.length>0?Er(e,t):A.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};j.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,j.ERR_BAD_OPTION=`ERR_BAD_OPTION`,j.ECONNABORTED=`ECONNABORTED`,j.ETIMEDOUT=`ETIMEDOUT`,j.ECONNREFUSED=`ECONNREFUSED`,j.ERR_NETWORK=`ERR_NETWORK`,j.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,j.ERR_DEPRECATED=`ERR_DEPRECATED`,j.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,j.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,j.ERR_CANCELED=`ERR_CANCELED`,j.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,j.ERR_INVALID_URL=`ERR_INVALID_URL`,j.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function Dr(e){return A.isPlainObject(e)||A.isArray(e)}function Or(e){return A.endsWith(e,`[]`)?e.slice(0,-2):e}function kr(e,t,n){return e?e.concat(t).map(function(e,t){return e=Or(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Ar(e){return A.isArray(e)&&!e.some(Dr)}var jr=A.toFlatObject(A,{},null,function(e){return/^is[A-Z]/.test(e)});function Mr(e,t,n){if(!A.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=A.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!A.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(A.isDate(e))return e.toISOString();if(A.isBoolean(e))return e.toString();if(!l&&A.isBlob(e))throw new j(`Blob is not supported. Use a Buffer instead.`);return A.isArrayBuffer(e)||A.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(A.isReactNative(t)&&A.isReactNativeBlob(e))return t.append(kr(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(A.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(A.isArray(e)&&Ar(e)||(A.isFileList(e)||A.endsWith(n,`[]`))&&(s=A.toArray(e)))return n=Or(n),s.forEach(function(e,r){!(A.isUndefined(e)||e===null)&&t.append(o===!0?kr([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return Dr(e)?!0:(t.append(kr(i,n,a),u(e)),!1)}let f=[],p=Object.assign(jr,{defaultVisitor:d,convertValue:u,isVisitable:Dr});function m(e,n,r=0){if(!A.isUndefined(e)){if(r>c)throw new j(`Object is too deeply nested (`+r+` levels). Max depth: `+c,j.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),A.forEach(e,function(e,a){(!(A.isUndefined(e)||e===null)&&i.call(t,e,A.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!A.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function Nr(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Pr(e,t){this._pairs=[],e&&Mr(e,this,t)}var Fr=Pr.prototype;Fr.append=function(e,t){this._pairs.push([e,t])},Fr.toString=function(e){let t=e?function(t){return e.call(this,t,Nr)}:Nr;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function Ir(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Lr(e,t,n){if(!t)return e;let r=n&&n.encode||Ir,i=A.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):A.isURLSearchParams(t)?t.toString():new Pr(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Rr=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){A.forEach(this.handlers,function(t){t!==null&&e(t)})}},zr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Br={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Pr,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Vr=s({hasBrowserEnv:()=>Hr,hasStandardBrowserEnv:()=>Wr,hasStandardBrowserWebWorkerEnv:()=>Gr,navigator:()=>Ur,origin:()=>Kr}),Hr=typeof window<`u`&&typeof document<`u`,Ur=typeof navigator==`object`&&navigator||void 0,Wr=Hr&&(!Ur||[`ReactNative`,`NativeScript`,`NS`].indexOf(Ur.product)<0),Gr=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Kr=Hr&&window.location.href||`http://localhost`,qr={...Vr,...Br};function Jr(e,t){return Mr(e,new qr.classes.URLSearchParams,{visitor:function(e,t,n,r){return qr.isNode&&A.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Yr(e){return A.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Xr(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r=e.length;return a=!a&&A.isArray(r)?r.length:a,s?(A.hasOwnProp(r,a)?r[a]=A.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!r[a]||!A.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&A.isArray(r[a])&&(r[a]=Xr(r[a])),!o)}if(A.isFormData(e)&&A.isFunction(e.entries)){let n={};return A.forEachEntry(e,(e,r)=>{t(Yr(e),r,n,0)}),n}return null}var Qr=(e,t)=>e!=null&&A.hasOwnProp(e,t)?e[t]:void 0;function $r(e,t,n){if(A.isString(e))try{return(t||JSON.parse)(e),A.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var ei={transitional:zr,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=A.isObject(e);if(i&&A.isHTMLForm(e)&&(e=new FormData(e)),A.isFormData(e))return r?JSON.stringify(Zr(e)):e;if(A.isArrayBuffer(e)||A.isBuffer(e)||A.isStream(e)||A.isFile(e)||A.isBlob(e)||A.isReadableStream(e))return e;if(A.isArrayBufferView(e))return e.buffer;if(A.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Qr(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Jr(e,t).toString();if((a=A.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Qr(this,`env`),r=n&&n.FormData;return Mr(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),$r(e)):e}],transformResponse:[function(e){let t=Qr(this,`transitional`)||ei.transitional,n=t&&t.forcedJSONParsing,r=Qr(this,`responseType`),i=r===`json`;if(A.isResponse(e)||A.isReadableStream(e))return e;if(e&&A.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Qr(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?j.from(e,j.ERR_BAD_RESPONSE,this,null,Qr(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:qr.classes.FormData,Blob:qr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};A.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{ei.headers[e]={}});function ti(e,t){let n=this||ei,r=t||n,i=Cr.from(r.headers),a=r.data;return A.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function ni(e){return!!(e&&e.__CANCEL__)}var ri=class extends j{constructor(e,t,n){super(e??`canceled`,j.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function ii(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new j(`Request failed with status code `+n.status,n.status>=400&&n.status<500?j.ERR_BAD_REQUEST:j.ERR_BAD_RESPONSE,n.config,n.request,n))}function ai(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function oi(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var ci=(e,t,n=3)=>{let r=0,i=oi(50,250);return si(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},li=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ui=e=>(...t)=>A.asap(()=>e(...t)),di=qr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,qr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qr.origin),qr.navigator&&/(msie|trident)/i.test(qr.navigator.userAgent)):()=>!0,fi=qr.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];A.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),A.isString(r)&&s.push(`path=${r}`),A.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),A.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;ne instanceof Cr?{...e}:e;function _i(e,t){t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return A.isPlainObject(e)&&A.isPlainObject(t)?A.merge.call({caseless:r},e,t):A.isPlainObject(t)?A.merge({},t):A.isArray(t)?t.slice():t}function i(e,t,n,i){if(!A.isUndefined(t))return r(e,t,n,i);if(!A.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!A.isUndefined(t))return r(void 0,t)}function o(e,t){if(!A.isUndefined(t))return r(void 0,t);if(!A.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(A.hasOwnProp(t,a))return r(n,i);if(A.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(gi(e),gi(t),n,!0)};return A.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=A.hasOwnProp(c,r)?c[r]:i,o=a(A.hasOwnProp(e,r)?e[r]:void 0,A.hasOwnProp(t,r)?t[r]:void 0,r);A.isUndefined(o)&&a!==s||(n[r]=o)}),n}var vi=[`content-type`,`content-length`];function yi(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t).forEach(([t,n])=>{vi.includes(t.toLowerCase())&&e.set(t,n)})}var bi=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),xi=e=>{let t=_i({},e),n=e=>A.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=Cr.from(s),t.url=Lr(hi(l,d,u),e.params,e.paramsSerializer),c&&s.set(`Authorization`,`Basic `+btoa((c.username||``)+`:`+(c.password?bi(c.password):``))),A.isFormData(r)&&(qr.hasStandardBrowserEnv||qr.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):A.isFunction(r.getHeaders)&&yi(s,r.getHeaders(),n(`formDataHeaderPolicy`))),qr.hasStandardBrowserEnv&&(A.isFunction(i)&&(i=i(t)),i===!0||i==null&&di(t.url))){let e=a&&o&&fi.read(o);e&&s.set(a,e)}return t},Si=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=xi(e),i=r.data,a=Cr.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=Cr.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());ii(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new j(`Request aborted`,j.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new j(t&&t.message?t.message:`Network Error`,j.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||zr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new j(t,i.clarifyTimeoutError?j.ETIMEDOUT:j.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&A.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),A.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=ci(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=ci(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new ri(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=ai(r.url);if(_&&!qr.protocols.includes(_)){n(new j(`Unsupported protocol `+_+`:`,j.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Ci=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof j?t:new ri(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new j(`timeout of ${t}ms exceeded`,j.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>A.asap(o),s}},wi=function*(e,t){let n=e.byteLength;if(!t||n{let i=Ti(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};function Oi(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}if(typeof Buffer<`u`&&typeof Buffer.byteLength==`function`)return Buffer.byteLength(r,`utf8`);let i=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var ki=`1.16.0`,Ai=64*1024,{isFunction:ji}=A,Mi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ni=e=>{let t=A.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=A.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?ji(i):typeof fetch==`function`,c=ji(a),l=ji(o);if(!s)return!1;let u=s&&ji(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Mi(()=>{let e=!1,t=new a(qr.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Mi(()=>A.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new j(`Response type '${e}' is not supported`,j.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(A.isBlob(e))return e.size;if(A.isSpecCompliantForm(e))return(await new a(qr.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(A.isArrayBufferView(e)||A.isArrayBuffer(e))return e.byteLength;if(A.isURLSearchParams(e)&&(e+=``),A.isString(e))return(await d(e)).byteLength},g=async(e,t)=>A.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:d,onDownloadProgress:h,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x,maxContentLength:S,maxBodyLength:C}=xi(e),w=A.isNumber(S)&&S>-1,ee=A.isNumber(C)&&C>-1,te=i||fetch;v=v?(v+``).toLowerCase():`text`;let ne=Ci([l,u&&u.toAbortSignal()],d),T=null,re=ne&&ne.unsubscribe&&(()=>{ne.unsubscribe()}),ie;try{if(w&&typeof t==`string`&&t.startsWith(`data:`)&&Oi(t)>S)throw new j(`maxContentLength size of `+S+` exceeded`,j.ERR_BAD_RESPONSE,e,T);if(ee&&n!==`get`&&n!==`head`){let t=await g(y,s);if(typeof t==`number`&&isFinite(t)&&t>C)throw new j(`Request body larger than maxBodyLength limit`,j.ERR_BAD_REQUEST,e,T)}if(_&&f&&n!==`get`&&n!==`head`&&(ie=await g(y,s))!==0){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(A.isFormData(s)&&(n=e.headers.get(`content-type`))&&y.setContentType(n),e.body){let[t,n]=li(ie,ci(ui(_)));s=Di(e.body,Ai,t,n)}}A.isString(b)||(b=b?`include`:`omit`);let i=c&&`credentials`in a.prototype;if(A.isFormData(s)){let e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete(`content-type`)}y.set(`User-Agent`,`axios/`+ki,!1);let l={...x,signal:ne,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:`half`,credentials:i?b:void 0};T=c&&new a(t,l);let u=await(c?te(T,x):te(t,l));if(w){let t=A.toFiniteNumber(u.headers.get(`content-length`));if(t!=null&&t>S)throw new j(`maxContentLength size of `+S+` exceeded`,j.ERR_BAD_RESPONSE,e,T)}let d=p&&(v===`stream`||v===`response`);if(p&&u.body&&(h||w||d&&re)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=u[e]});let n=A.toFiniteNumber(u.headers.get(`content-length`)),[r,i]=h&&li(n,ci(ui(h),!0))||[],a=0;u=new o(Di(u.body,Ai,t=>{if(w&&(a=t,a>S))throw new j(`maxContentLength size of `+S+` exceeded`,j.ERR_BAD_RESPONSE,e,T);r&&r(t)},()=>{i&&i(),re&&re()}),t)}v||=`text`;let ae=await m[A.findKey(m,v)||`text`](u,e);if(w&&!p&&!d){let t;if(ae!=null&&(typeof ae.byteLength==`number`?t=ae.byteLength:typeof ae.size==`number`?t=ae.size:typeof ae==`string`&&(t=typeof r==`function`?new r().encode(ae).byteLength:ae.length)),typeof t==`number`&&t>S)throw new j(`maxContentLength size of `+S+` exceeded`,j.ERR_BAD_RESPONSE,e,T)}return!d&&re&&re(),await new Promise((t,n)=>{ii(t,n,{data:ae,headers:Cr.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:T})})}catch(t){if(re&&re(),ne&&ne.aborted&&ne.reason instanceof j){let n=ne.reason;throw n.config=e,T&&(n.request=T),t!==n&&(n.cause=t),n}throw t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new j(`Network Error`,j.ERR_NETWORK,e,T,t&&t.response),{cause:t.cause||t}):j.from(t,t&&t.code,e,T,t&&t.response)}}},Pi=new Map,Fi=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Pi;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Ni(t)),l=c;return c};Fi();var Ii={http:null,xhr:Si,fetch:{get:Fi}};A.forEach(Ii,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Li=e=>`- ${e}`,Ri=e=>A.isFunction(e)||e===null||e===!1;function zi(e,t){e=A.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new j(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since : +`+e.map(Li).join(` +`):` `+Li(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Bi={getAdapter:zi,adapters:Ii};function M(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ri(null,e)}function N(e){return M(e),e.headers=Cr.from(e.headers),e.data=ti.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Bi.getAdapter(e.adapter||ei.adapter,e)(e).then(function(t){M(e),e.response=t;try{t.data=ti.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Cr.from(t.headers),t},function(t){if(!ni(t)&&(M(e),t&&t.response)){e.response=t.response;try{t.response.data=ti.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Cr.from(t.response.headers)}return Promise.reject(t)})}var Vi={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Vi[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Hi={};Vi.transitional=function(e,t,n){function r(e,t){return`[Axios v`+ki+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new j(r(i,` has been removed`+(t?` in `+t:``)),j.ERR_DEPRECATED);return t&&!Hi[i]&&(Hi[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),!e||e(n,i,a)}},Vi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ui(e,t,n){if(typeof e!=`object`)throw new j(`options must be an object`,j.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-->0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new j(`option `+a+` must be `+n,j.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new j(`Unknown option `+a,j.ERR_BAD_OPTION)}}var Wi={assertOptions:Ui,validators:Vi},Gi=Wi.validators,Ki=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Rr,response:new Rr}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(` +`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(` +`),r=t===-1?-1:n.indexOf(` +`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=` +`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=_i(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Wi.assertOptions(n,{silentJSONParsing:Gi.transitional(Gi.boolean),forcedJSONParsing:Gi.transitional(Gi.boolean),clarifyTimeoutError:Gi.transitional(Gi.boolean),legacyInterceptorReqResOrdering:Gi.transitional(Gi.boolean)},!1),r!=null&&(A.isFunction(r)?t.paramsSerializer={serialize:r}:Wi.assertOptions(r,{encode:Gi.function,serialize:Gi.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Wi.assertOptions(t,{baseUrl:Gi.spelling(`baseURL`),withXsrfToken:Gi.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&A.merge(i.common,i[t.method]);i&&A.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=Cr.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||zr;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[N.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new ri(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Ji(e){return function(t){return e.apply(null,t)}}function Yi(e){return A.isObject(e)&&e.isAxiosError===!0}var Xi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Xi).forEach(([e,t])=>{Xi[t]=e});function Zi(e){let t=new Ki(e),n=Qt(Ki.prototype.request,t);return A.extend(n,Ki.prototype,t,{allOwnKeys:!0}),A.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Zi(_i(e,t))},n}var P=Zi(ei);P.Axios=Ki,P.CanceledError=ri,P.CancelToken=qi,P.isCancel=ni,P.VERSION=ki,P.toFormData=Mr,P.AxiosError=j,P.Cancel=P.CanceledError,P.all=function(e){return Promise.all(e)},P.spread=Ji,P.isAxiosError=Yi,P.mergeConfig=_i,P.AxiosHeaders=Cr,P.formToJSON=e=>Zr(A.isHTMLForm(e)?new FormData(e):e),P.getAdapter=Bi.getAdapter,P.HttpStatusCode=Xi,P.default=P;var Qi=`/api/v1`,$i=`onealert:session-expired`,ea=P.create({baseURL:Qi,headers:{"Content-Type":`application/json`},withCredentials:!0});ea.interceptors.response.use(e=>e,e=>{let t=String(e.config?.url??``),n=t.includes(`/auth/login`)||t.includes(`/auth/register`);return e.response?.status===401&&!n&&window.dispatchEvent(new CustomEvent($i)),Promise.reject(e)});function ta(e,t){if(!P.isAxiosError(e))return e instanceof Error&&e.message?e.message:t;let n=e.response?.data;return typeof n?.error?.message==`string`&&n.error.message.trim()?n.error.message:typeof n?.detail==`string`&&n.detail.trim()?n.detail:typeof n?.detail==`object`&&typeof n.detail?.message==`string`?n.detail.message:typeof n?.message==`string`&&n.message.trim()?n.message:e.response?t:`OneAlert could not reach the service. Check your connection and try again.`}var na={user:null,isAuthenticated:!1,hasCheckedSession:!0,isLoading:!1},ra=Zt(e=>({...na,hasCheckedSession:!1,error:null,login:async(t,n)=>{e({isLoading:!0,error:null});try{let r=new URLSearchParams({username:t,password:n});await ea.post(`/auth/login`,r,{headers:{"Content-Type":`application/x-www-form-urlencoded`}}),e({user:(await ea.get(`/auth/me`)).data,isAuthenticated:!0,hasCheckedSession:!0,isLoading:!1})}catch(t){throw e({...na,error:ta(t,`Sign-in failed. Check your credentials and try again.`)}),t}},register:async(t,n,r,i)=>{e({isLoading:!0,error:null});try{await ea.post(`/auth/register`,{email:t,password:n,full_name:r,company:i||null}),e({isLoading:!1})}catch(t){throw e({error:ta(t,`Registration failed. Review your details and try again.`),isLoading:!1}),t}},logout:async()=>{e({...na,error:null});try{await ea.post(`/auth/logout`)}catch{}},fetchUser:async()=>{try{e({user:(await ea.get(`/auth/me`)).data,isAuthenticated:!0,hasCheckedSession:!0,error:null})}catch{e({...na})}},clearError:()=>e({error:null})}));typeof window<`u`&&window.addEventListener($i,()=>ra.setState({...na}));var ia=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),aa=o(((e,t)=>{t.exports=ia()})),F=aa();function oa({children:e}){let{isAuthenticated:t,hasCheckedSession:n}=ra(),r=Je();return n?t?(0,F.jsx)(F.Fragment,{children:e}):(0,F.jsx)(xt,{to:`/login`,state:{from:r},replace:!0}):(0,F.jsx)(`div`,{className:`grid min-h-screen place-items-center bg-surface-950`,role:`status`,"aria-label":`Checking session`,children:(0,F.jsxs)(`div`,{className:`space-y-3 text-center`,children:[(0,F.jsx)(`div`,{className:`oa-skeleton mx-auto h-10 w-10 rounded-md`}),(0,F.jsx)(`p`,{className:`text-sm text-surface-400`,children:`Checking secure session…`})]})})}var sa=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ca=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),la=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ua=e=>{let t=la(e);return t.charAt(0).toUpperCase()+t.slice(1)},I={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},da=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},fa=(0,v.createContext)({}),pa=()=>(0,v.useContext)(fa),ma=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=pa()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...I,width:t??l??I.width,height:t??l??I.height,stroke:e??f,strokeWidth:m,className:sa(`lucide`,p,i),...!a&&!da(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(ma,{ref:i,iconNode:t,className:sa(`lucide-${ca(ua(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ua(e),n},ha=L(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ga=L(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),_a=L(`briefcase-medical`,[[`path`,{d:`M12 11v4`,key:`a6ujw6`}],[`path`,{d:`M14 13h-4`,key:`1pl8zg`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M18 6v14`,key:`1mu4gy`}],[`path`,{d:`M6 6v14`,key:`1s15cj`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),va=L(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ya=L(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ba=L(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),xa=L(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),Sa=L(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ca=L(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),wa=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Ta=L(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Ea=L(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Da=L(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Oa=L(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ka=L(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Aa=L(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ja=L(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ma=L(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Na=L(`swords`,[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`,key:`1hfsw2`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`,key:`1vrmhu`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`,key:`1bron3`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`,key:`13pww6`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`,key:`hbey2j`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`,key:`1hf58s`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`,key:`pidxm4`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`,key:`1pehsh`}]]),Pa=L(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Fa=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ia=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),La=[{match:e=>/^\/cases\/\d+/.test(e),section:`Command / Investigations`,title:`Case workspace`},{match:e=>e===`/cases`,section:`Command`,title:`Investigations`},{match:e=>e===`/alerts`,section:`Observe`,title:`Alerts`},{match:e=>e===`/events`,section:`Observe`,title:`Security events`},{match:e=>e===`/assets`,section:`Observe`,title:`Asset inventory`},{match:e=>e===`/ot`,section:`Observe`,title:`OT discovery`},{match:e=>e===`/mitre`,section:`Analyze`,title:`MITRE ATT&CK`},{match:e=>e===`/hunt`,section:`Analyze`,title:`Hunt lab`},{match:e=>e===`/response-plans`,section:`Act`,title:`Response plans`},{match:e=>e===`/validation`,section:`Act`,title:`Purple-team validation`},{match:e=>e===`/audit-log`,section:`Govern`,title:`Audit log`},{match:e=>e===`/settings`,section:`Govern`,title:`Settings`},{match:e=>e===`/`,section:`Command`,title:`Security operations`}];function Ra({onOpenNavigation:e,menuButtonRef:t}){let{pathname:n}=Je(),r=La.find(e=>e.match(n))??La[La.length-1];return(0,F.jsxs)(`header`,{className:`fixed left-0 right-0 top-0 z-30 flex h-[var(--oa-command-height)] items-center justify-between border-b border-surface-800 bg-surface-950/92 px-3 backdrop-blur-md md:left-[var(--oa-sidebar-width)] md:px-6`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,F.jsx)(`button`,{ref:t,type:`button`,"aria-label":`Open navigation`,onClick:e,className:`grid h-10 w-10 shrink-0 place-items-center rounded-md text-surface-300 hover:bg-surface-800 md:hidden`,children:(0,F.jsx)(Ta,{className:`h-5 w-5`,"aria-hidden":`true`})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`p`,{className:`truncate text-[10px] font-bold uppercase tracking-[0.14em] text-surface-500`,children:r.section}),(0,F.jsx)(`p`,{className:`truncate text-sm font-semibold text-surface-100`,children:r.title})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3`,children:[(0,F.jsxs)(`div`,{className:`hidden items-center gap-2 rounded-md border border-surface-800 bg-surface-900 px-2.5 py-1.5 text-[11px] text-surface-400 sm:flex`,children:[(0,F.jsx)(Da,{className:`h-3.5 w-3.5 text-success`,"aria-hidden":`true`}),`Telemetry workspace`]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-success/20 bg-success/8 px-2.5 py-1.5 text-[11px] font-semibold text-success`,children:[(0,F.jsx)(ja,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`hidden sm:inline`,children:`Approval gates`}),(0,F.jsx)(`span`,{className:`sm:hidden`,children:`Gated`})]})]})]})}function za(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{t()},[Je().pathname,t]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{type:`button`,"aria-label":`Close navigation`,className:Ba(`fixed inset-0 z-40 bg-surface-950/75 backdrop-blur-sm transition md:hidden`,e?`opacity-100`:`pointer-events-none opacity-0`),onClick:t,tabIndex:e?0:-1}),(0,F.jsxs)(`aside`,{className:Ba(`fixed inset-y-0 left-0 z-50 flex w-[var(--oa-sidebar-width)] flex-col border-r border-surface-800 bg-surface-900 shadow-[var(--oa-shadow-float)] transition-[transform,visibility] duration-200 md:visible md:translate-x-0 md:shadow-none`,e?`visible translate-x-0`:`invisible -translate-x-full`),children:[(0,F.jsxs)(`div`,{className:`flex h-[var(--oa-command-height)] items-center justify-between border-b border-surface-800 px-4`,children:[(0,F.jsxs)(Bt,{to:`/`,className:`flex items-center gap-2.5`,"aria-label":`OneAlert overview`,children:[(0,F.jsx)(`span`,{className:`grid h-8 w-8 place-items-center rounded-md border border-primary-500/30 bg-primary-500/10 text-primary-300`,children:(0,F.jsx)(Ma,{className:`h-5 w-5`,"aria-hidden":`true`})}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`block text-sm font-bold tracking-tight text-surface-50`,children:`OneAlert`}),(0,F.jsx)(`span`,{className:`block text-[9px] font-bold uppercase tracking-[0.18em] text-surface-500`,children:`Security OS`})]})]}),(0,F.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close navigation`,className:`grid h-9 w-9 place-items-center rounded-md text-surface-400 hover:bg-surface-800 hover:text-surface-100 md:hidden`,children:(0,F.jsx)(Ia,{className:`h-5 w-5`,"aria-hidden":`true`})})]}),(0,F.jsx)(`nav`,{"aria-label":`Primary navigation`,className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:Va.map(e=>(0,F.jsxs)(`div`,{className:`mb-3`,children:[(0,F.jsx)(`p`,{className:`px-2 pb-1.5 pt-1 text-[10px] font-bold uppercase tracking-[0.16em] text-surface-500`,children:e.label}),(0,F.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(e=>(0,F.jsxs)(Bt,{to:e.to,end:e.to===`/`,className:({isActive:e})=>Ba(`group flex min-h-9 items-center gap-3 rounded-md border px-2.5 text-[13px] font-medium transition-colors`,e?`border-primary-500/25 bg-primary-500/10 text-primary-200`:`border-transparent text-surface-400 hover:border-surface-700 hover:bg-surface-800/70 hover:text-surface-100`),children:[(0,F.jsx)(e.icon,{className:`h-[17px] w-[17px] shrink-0`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to))})]},e.label))}),(0,F.jsx)(`div`,{className:`border-t border-surface-800 p-3`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-surface-800 bg-surface-950/40 px-2.5 py-2.5`,children:[(0,F.jsx)(`div`,{className:`grid h-8 w-8 shrink-0 place-items-center rounded-md bg-primary-600 text-xs font-bold text-surface-50`,children:(n?.full_name?.[0]||n?.email?.[0]||`?`).toUpperCase()}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`p`,{className:`truncate text-xs font-semibold text-surface-200`,children:n?.full_name||n?.email||`Operator`}),(0,F.jsx)(`p`,{className:`truncate text-[10px] uppercase tracking-wide text-surface-500`,children:n?.role||`analyst`})]}),(0,F.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Sign out of your account`,title:`Sign out`,className:`grid h-9 w-9 shrink-0 place-items-center rounded-md text-surface-400 hover:bg-danger/10 hover:text-danger`,children:(0,F.jsx)(wa,{className:`h-4 w-4`,"aria-hidden":`true`})})]})})]})]})}function Ua(){let[e,t]=(0,v.useState)(!1),n=(0,v.useRef)(null),r=(0,v.useCallback)(()=>t(!1),[]);return(0,v.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&(t(!1),requestAnimationFrame(()=>n.current?.focus()))};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),(0,F.jsxs)(`div`,{className:`min-h-screen bg-surface-950`,children:[(0,F.jsx)(`a`,{href:`#main-content`,className:`fixed left-3 top-3 z-[100] -translate-y-20 rounded-md bg-primary-500 px-3 py-2 text-sm font-semibold text-surface-950 transition focus:translate-y-0`,children:`Skip to content`}),(0,F.jsx)(Ha,{open:e,onClose:r}),(0,F.jsx)(Ra,{onOpenNavigation:()=>t(!0),menuButtonRef:n}),(0,F.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:`min-h-screen pt-[var(--oa-command-height)] md:ml-[var(--oa-sidebar-width)]`,children:(0,F.jsx)(`div`,{className:`mx-auto w-full max-w-[1920px] p-4 sm:p-5 lg:p-6 xl:p-7`,children:(0,F.jsx)(St,{})})})]})}var Wa={success:va,error:ya,warning:Fa,info:Sa},Ga={success:`bg-emerald-500/10 border-emerald-500/30 text-emerald-400`,error:`bg-red-500/10 border-red-500/30 text-red-400`,warning:`bg-amber-500/10 border-amber-500/30 text-amber-400`,info:`bg-blue-500/10 border-blue-500/30 text-blue-400`},Ka=0,qa=null;function Ja(e,t=`info`){qa?.(e,t)}function Ya(){let[e,t]=(0,v.useState)([]),n=(0,v.useCallback)((e,n)=>{let r=++Ka;t(t=>[...t,{id:r,message:e,type:n}]),setTimeout(()=>{t(e=>e.filter(e=>e.id!==r))},4e3)},[]),r=(0,v.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return(0,v.useEffect)(()=>(qa=n,()=>{qa=null}),[n]),e.length===0?null:(0,F.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm`,role:`status`,"aria-live":`polite`,children:e.map(e=>{let t=Wa[e.type];return(0,F.jsxs)(`div`,{className:Ba(`flex items-center gap-3 px-4 py-3 rounded-lg border text-sm animate-in slide-in-from-right`,Ga[e.type]),children:[(0,F.jsx)(t,{className:`w-4 h-4 shrink-0`}),(0,F.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,F.jsx)(`button`,{onClick:()=>r(e.id),"aria-label":`Dismiss notification`,className:`text-current opacity-60 hover:opacity-100 transition-opacity`,children:(0,F.jsx)(Ia,{className:`w-3.5 h-3.5`})})]},e.id)})})}var Xa=`modulepreload`,Za=function(e){return`/app/`+e},Qa={},$a=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Za(t,n),t=s(t),t in Qa)return;Qa[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Xa,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},eo=(0,v.lazy)(()=>$a(()=>import(`./Login-CWbAzOYO.js`).then(e=>({default:e.Login})),[])),to=(0,v.lazy)(()=>$a(()=>import(`./Register-DVdAPoMX.js`).then(e=>({default:e.Register})),[])),no=(0,v.lazy)(()=>$a(()=>import(`./Dashboard-DzWggTdy.js`).then(e=>({default:e.Dashboard})),__vite__mapDeps([0,1,2,3]))),ro=(0,v.lazy)(()=>$a(()=>import(`./Cases--uF5onG8.js`).then(e=>({default:e.Cases})),__vite__mapDeps([4,1,5,2]))),io=(0,v.lazy)(()=>$a(()=>import(`./CaseDetail-DQUd0l6u.js`).then(e=>({default:e.CaseDetail})),__vite__mapDeps([6,7,1]))),ao=(0,v.lazy)(()=>$a(()=>import(`./Alerts-DCdbzOXS.js`).then(e=>({default:e.Alerts})),__vite__mapDeps([8,1,2]))),oo=(0,v.lazy)(()=>$a(()=>import(`./Events-Cp2M2z7v.js`).then(e=>({default:e.Events})),__vite__mapDeps([9,1,2]))),so=(0,v.lazy)(()=>$a(()=>import(`./Assets-CS6iCC1b.js`).then(e=>({default:e.Assets})),__vite__mapDeps([10,1,11,2]))),co=(0,v.lazy)(()=>$a(()=>import(`./OTDiscovery-CQFYbo-6.js`).then(e=>({default:e.OTDiscovery})),__vite__mapDeps([12,1,2]))),lo=(0,v.lazy)(()=>$a(()=>import(`./MitreMap-CJAZWQjH.js`).then(e=>({default:e.MitreMap})),__vite__mapDeps([13,1,2]))),uo=(0,v.lazy)(()=>$a(()=>import(`./HuntLab-DhSfhJ9v.js`).then(e=>({default:e.HuntLab})),__vite__mapDeps([14,7,1,5,2]))),fo=(0,v.lazy)(()=>$a(()=>import(`./Settings-BcCRTAIN.js`).then(e=>({default:e.Settings})),__vite__mapDeps([15,2,3]))),R=(0,v.lazy)(()=>$a(()=>import(`./AuditLog-D7hVaLQG.js`).then(e=>({default:e.AuditLog})),__vite__mapDeps([16,1,2]))),po=(0,v.lazy)(()=>$a(()=>import(`./ResponsePlans-CriMCUJ8.js`).then(e=>({default:e.ResponsePlans})),__vite__mapDeps([17,7,1,5,2]))),mo=(0,v.lazy)(()=>$a(()=>import(`./Validation-UtB4LE5v.js`).then(e=>({default:e.Validation})),__vite__mapDeps([18,1,5,11,2])));function z(){let{isAuthenticated:e,hasCheckedSession:t,fetchUser:n}=ra();return(0,v.useEffect)(()=>{t||n()},[t,n]),(0,F.jsxs)(It,{basename:`/app`,children:[(0,F.jsx)(Ya,{}),(0,F.jsx)(v.Suspense,{fallback:(0,F.jsx)(`div`,{className:`grid min-h-screen place-items-center bg-surface-950 text-sm text-surface-400`,role:`status`,children:`Loading OneAlert…`}),children:(0,F.jsxs)(wt,{children:[(0,F.jsx)(k,{path:`/login`,element:e?(0,F.jsx)(xt,{to:`/`}):(0,F.jsx)(eo,{})}),(0,F.jsx)(k,{path:`/register`,element:e?(0,F.jsx)(xt,{to:`/`}):(0,F.jsx)(to,{})}),(0,F.jsxs)(k,{element:(0,F.jsx)(oa,{children:(0,F.jsx)(Ua,{})}),children:[(0,F.jsx)(k,{path:`/`,element:(0,F.jsx)(no,{})}),(0,F.jsx)(k,{path:`/cases`,element:(0,F.jsx)(ro,{})}),(0,F.jsx)(k,{path:`/cases/:caseId`,element:(0,F.jsx)(io,{})}),(0,F.jsx)(k,{path:`/alerts`,element:(0,F.jsx)(ao,{})}),(0,F.jsx)(k,{path:`/events`,element:(0,F.jsx)(oo,{})}),(0,F.jsx)(k,{path:`/assets`,element:(0,F.jsx)(so,{})}),(0,F.jsx)(k,{path:`/ot`,element:(0,F.jsx)(co,{})}),(0,F.jsx)(k,{path:`/mitre`,element:(0,F.jsx)(lo,{})}),(0,F.jsx)(k,{path:`/hunt`,element:(0,F.jsx)(uo,{})}),(0,F.jsx)(k,{path:`/response-plans`,element:(0,F.jsx)(po,{})}),(0,F.jsx)(k,{path:`/validation`,element:(0,F.jsx)(mo,{})}),(0,F.jsx)(k,{path:`/settings`,element:(0,F.jsx)(fo,{})}),(0,F.jsx)(k,{path:`/audit-log`,element:(0,F.jsx)(R,{})})]}),(0,F.jsx)(k,{path:`*`,element:(0,F.jsx)(xt,{to:`/`})})]})})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(v.StrictMode,{children:(0,F.jsx)(z,{})}));export{Xe as C,o as D,d as E,s as O,Je as S,h as T,aa as _,Pa as a,ea as b,Aa as c,Ea as d,ya as f,L as g,ha as h,Fa as i,l as k,ka as l,ga as m,Ba as n,Ma as o,va as p,Ia as r,ja as s,Ja as t,Oa as u,ra as v,et as w,zt as x,ta as y}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/index-DMnfsM7i.css b/frontend-v2/dist/assets/index-DMnfsM7i.css deleted file mode 100644 index 07a6972..0000000 --- a/frontend-v2/dist/assets/index-DMnfsM7i.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-ease:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-primary-300:#67e8f9;--color-primary-400:#22d3ee;--color-primary-500:#06b6d4;--color-primary-600:#0891b2;--color-primary-700:#0e7490;--color-primary-900:#164e63;--color-surface-100:#f4f4f5;--color-surface-200:#e4e4e7;--color-surface-300:#d4d4d8;--color-surface-400:#a1a1aa;--color-surface-500:#71717a;--color-surface-600:#52525b;--color-surface-700:#3f3f46;--color-surface-800:#27272a;--color-surface-900:#18181b;--color-surface-950:#09090b;--color-danger:#f43f5e;--color-warning:#f59e0b;--color-success:#10b981;--color-info:#38bdf8}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-3{left:calc(var(--spacing) * 3)}.z-50{z-index:50}.z-\[100\]{z-index:100}.col-span-full{grid-column:1/-1}.float-right{float:right}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-2{margin-left:calc(var(--spacing) * 2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-64{height:calc(var(--spacing) * 64)}.h-full{height:100%}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[90vh\]{max-height:90vh}.min-h-screen{min-height:100vh}.w-1\/3{width:33.3333%}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[500px\]{min-width:500px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/20{border-color:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/30{border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab, red, red)){.border-blue-500\/30{border-color:color-mix(in oklab, var(--color-blue-500) 30%, transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab, red, red)){.border-cyan-500\/30{border-color:color-mix(in oklab, var(--color-cyan-500) 30%, transparent)}}.border-danger\/20{border-color:#f43f5e33}@supports (color:color-mix(in lab, red, red)){.border-danger\/20{border-color:color-mix(in oklab, var(--color-danger) 20%, transparent)}}.border-danger\/30{border-color:#f43f5e4d}@supports (color:color-mix(in lab, red, red)){.border-danger\/30{border-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\/20{border-color:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\/30{border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.border-info\/20{border-color:#38bdf833}@supports (color:color-mix(in lab, red, red)){.border-info\/20{border-color:color-mix(in oklab, var(--color-info) 20%, transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab, red, red)){.border-orange-500\/30{border-color:color-mix(in oklab, var(--color-orange-500) 30%, transparent)}}.border-primary-400{border-color:var(--color-primary-400)}.border-primary-500{border-color:var(--color-primary-500)}.border-primary-500\/20{border-color:#06b6d433}@supports (color:color-mix(in lab, red, red)){.border-primary-500\/20{border-color:color-mix(in oklab, var(--color-primary-500) 20%, transparent)}}.border-primary-500\/30{border-color:#06b6d44d}@supports (color:color-mix(in lab, red, red)){.border-primary-500\/30{border-color:color-mix(in oklab, var(--color-primary-500) 30%, transparent)}}.border-primary-600\/20{border-color:#0891b233}@supports (color:color-mix(in lab, red, red)){.border-primary-600\/20{border-color:color-mix(in oklab, var(--color-primary-600) 20%, transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.border-red-500\/30{border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.border-rose-500\/20{border-color:#ff235733}@supports (color:color-mix(in lab, red, red)){.border-rose-500\/20{border-color:color-mix(in oklab, var(--color-rose-500) 20%, transparent)}}.border-success\/20{border-color:#10b98133}@supports (color:color-mix(in lab, red, red)){.border-success\/20{border-color:color-mix(in oklab, var(--color-success) 20%, transparent)}}.border-success\/30{border-color:#10b9814d}@supports (color:color-mix(in lab, red, red)){.border-success\/30{border-color:color-mix(in oklab, var(--color-success) 30%, transparent)}}.border-surface-500\/30{border-color:#71717a4d}@supports (color:color-mix(in lab, red, red)){.border-surface-500\/30{border-color:color-mix(in oklab, var(--color-surface-500) 30%, transparent)}}.border-surface-600{border-color:var(--color-surface-600)}.border-surface-700{border-color:var(--color-surface-700)}.border-surface-700\/50{border-color:#3f3f4680}@supports (color:color-mix(in lab, red, red)){.border-surface-700\/50{border-color:color-mix(in oklab, var(--color-surface-700) 50%, transparent)}}.border-surface-800{border-color:var(--color-surface-800)}.border-warning\/20{border-color:#f59e0b33}@supports (color:color-mix(in lab, red, red)){.border-warning\/20{border-color:color-mix(in oklab, var(--color-warning) 20%, transparent)}}.border-warning\/30{border-color:#f59e0b4d}@supports (color:color-mix(in lab, red, red)){.border-warning\/30{border-color:color-mix(in oklab, var(--color-warning) 30%, transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\/30{border-color:color-mix(in oklab, var(--color-yellow-500) 30%, transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/5{background-color:color-mix(in oklab, var(--color-amber-500) 5%, transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/20{background-color:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-500\/10{background-color:color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-500\/20{background-color:color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-cyan-400{background-color:var(--color-cyan-400)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab, red, red)){.bg-cyan-500\/10{background-color:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.bg-danger\/10{background-color:#f43f5e1a}@supports (color:color-mix(in lab, red, red)){.bg-danger\/10{background-color:color-mix(in oklab, var(--color-danger) 10%, transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/20{background-color:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab, red, red)){.bg-green-500\/20{background-color:color-mix(in oklab, var(--color-green-500) 20%, transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-info\/10{background-color:#38bdf81a}@supports (color:color-mix(in lab, red, red)){.bg-info\/10{background-color:color-mix(in oklab, var(--color-info) 10%, transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab, red, red)){.bg-orange-500\/20{background-color:color-mix(in oklab, var(--color-orange-500) 20%, transparent)}}.bg-primary-500{background-color:var(--color-primary-500)}.bg-primary-500\/10{background-color:#06b6d41a}@supports (color:color-mix(in lab, red, red)){.bg-primary-500\/10{background-color:color-mix(in oklab, var(--color-primary-500) 10%, transparent)}}.bg-primary-500\/20{background-color:#06b6d433}@supports (color:color-mix(in lab, red, red)){.bg-primary-500\/20{background-color:color-mix(in oklab, var(--color-primary-500) 20%, transparent)}}.bg-primary-600{background-color:var(--color-primary-600)}.bg-primary-600\/10{background-color:#0891b21a}@supports (color:color-mix(in lab, red, red)){.bg-primary-600\/10{background-color:color-mix(in oklab, var(--color-primary-600) 10%, transparent)}}.bg-primary-600\/20{background-color:#0891b233}@supports (color:color-mix(in lab, red, red)){.bg-primary-600\/20{background-color:color-mix(in oklab, var(--color-primary-600) 20%, transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/20{background-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab, red, red)){.bg-rose-500\/10{background-color:color-mix(in oklab, var(--color-rose-500) 10%, transparent)}}.bg-success\/10{background-color:#10b9811a}@supports (color:color-mix(in lab, red, red)){.bg-success\/10{background-color:color-mix(in oklab, var(--color-success) 10%, transparent)}}.bg-surface-500\/20{background-color:#71717a33}@supports (color:color-mix(in lab, red, red)){.bg-surface-500\/20{background-color:color-mix(in oklab, var(--color-surface-500) 20%, transparent)}}.bg-surface-600\/20{background-color:#52525b33}@supports (color:color-mix(in lab, red, red)){.bg-surface-600\/20{background-color:color-mix(in oklab, var(--color-surface-600) 20%, transparent)}}.bg-surface-700{background-color:var(--color-surface-700)}.bg-surface-700\/50{background-color:#3f3f4680}@supports (color:color-mix(in lab, red, red)){.bg-surface-700\/50{background-color:color-mix(in oklab, var(--color-surface-700) 50%, transparent)}}.bg-surface-800{background-color:var(--color-surface-800)}.bg-surface-800\/50{background-color:#27272a80}@supports (color:color-mix(in lab, red, red)){.bg-surface-800\/50{background-color:color-mix(in oklab, var(--color-surface-800) 50%, transparent)}}.bg-surface-900{background-color:var(--color-surface-900)}.bg-surface-900\/30{background-color:#18181b4d}@supports (color:color-mix(in lab, red, red)){.bg-surface-900\/30{background-color:color-mix(in oklab, var(--color-surface-900) 30%, transparent)}}.bg-surface-900\/50{background-color:#18181b80}@supports (color:color-mix(in lab, red, red)){.bg-surface-900\/50{background-color:color-mix(in oklab, var(--color-surface-900) 50%, transparent)}}.bg-surface-900\/70{background-color:#18181bb3}@supports (color:color-mix(in lab, red, red)){.bg-surface-900\/70{background-color:color-mix(in oklab, var(--color-surface-900) 70%, transparent)}}.bg-surface-950{background-color:var(--color-surface-950)}.bg-surface-950\/70{background-color:#09090bb3}@supports (color:color-mix(in lab, red, red)){.bg-surface-950\/70{background-color:color-mix(in oklab, var(--color-surface-950) 70%, transparent)}}.bg-warning\/10{background-color:#f59e0b1a}@supports (color:color-mix(in lab, red, red)){.bg-warning\/10{background-color:color-mix(in oklab, var(--color-warning) 10%, transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\/20{background-color:color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-surface-950{--tw-gradient-from:var(--color-surface-950);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-surface-900{--tw-gradient-via:var(--color-surface-900);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-primary-900\/20{--tw-gradient-to:#164e6333}@supports (color:color-mix(in lab, red, red)){.to-primary-900\/20{--tw-gradient-to:color-mix(in oklab, var(--color-primary-900) 20%, transparent)}}.to-primary-900\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-blue-400{color:var(--color-blue-400)}.text-current{color:currentColor}.text-cyan-200{color:var(--color-cyan-200)}.text-cyan-300{color:var(--color-cyan-300)}.text-danger{color:var(--color-danger)}.text-danger\/70{color:#f43f5eb3}@supports (color:color-mix(in lab, red, red)){.text-danger\/70{color:color-mix(in oklab, var(--color-danger) 70%, transparent)}}.text-emerald-200{color:var(--color-emerald-200)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-green-400{color:var(--color-green-400)}.text-info{color:var(--color-info)}.text-orange-400{color:var(--color-orange-400)}.text-primary-300{color:var(--color-primary-300)}.text-primary-400{color:var(--color-primary-400)}.text-primary-500{color:var(--color-primary-500)}.text-red-400{color:var(--color-red-400)}.text-rose-200{color:var(--color-rose-200)}.text-rose-300{color:var(--color-rose-300)}.text-success{color:var(--color-success)}.text-surface-200{color:var(--color-surface-200)}.text-surface-300{color:var(--color-surface-300)}.text-surface-400{color:var(--color-surface-400)}.text-surface-500{color:var(--color-surface-500)}.text-surface-600{color:var(--color-surface-600)}.text-warning{color:var(--color-warning)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.placeholder-surface-500::placeholder{color:var(--color-surface-500)}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (hover:hover){.group-hover\:text-primary-400:is(:where(.group):hover *){color:var(--color-primary-400)}}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing) * 0)}@media (hover:hover){.hover\:border-primary-500\/30:hover{border-color:#06b6d44d}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary-500\/30:hover{border-color:color-mix(in oklab, var(--color-primary-500) 30%, transparent)}}.hover\:border-surface-600:hover{border-color:var(--color-surface-600)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-primary-700:hover{background-color:var(--color-primary-700)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-surface-600:hover{background-color:var(--color-surface-600)}.hover\:bg-surface-700:hover{background-color:var(--color-surface-700)}.hover\:bg-surface-800:hover{background-color:var(--color-surface-800)}.hover\:bg-surface-800\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-800\/50:hover{background-color:color-mix(in oklab, var(--color-surface-800) 50%, transparent)}}.hover\:bg-surface-900\/80:hover{background-color:#18181bcc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-900\/80:hover{background-color:color-mix(in oklab, var(--color-surface-900) 80%, transparent)}}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-primary-300:hover{color:var(--color-primary-300)}.hover\:text-primary-400:hover{color:var(--color-primary-400)}.hover\:text-surface-200:hover{color:var(--color-surface-200)}.hover\:text-surface-300:hover{color:var(--color-surface-300)}.hover\:text-white:hover{color:var(--color-white)}.hover\:opacity-100:hover{opacity:1}}.focus\:border-transparent:focus{border-color:#0000}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-primary-500:focus{--tw-ring-color:var(--color-primary-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:table-cell{display:table-cell}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}}@media (width>=48rem){.md\:fixed{position:fixed}.md\:top-0{top:calc(var(--spacing) * 0)}.md\:left-0{left:calc(var(--spacing) * 0)}.md\:ml-64{margin-left:calc(var(--spacing) * 64)}.md\:block{display:block}.md\:table-cell{display:table-cell}.md\:h-screen{height:100vh}.md\:w-64{width:calc(var(--spacing) * 64)}.md\:flex-1{flex:1}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:gap-0{gap:calc(var(--spacing) * 0)}:where(.md\:space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.md\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.md\:border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.md\:p-4{padding:calc(var(--spacing) * 4)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:p-8{padding:calc(var(--spacing) * 8)}}@media (width>=64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (width>=80rem){.xl\:w-\[560px\]{width:560px}.xl\:grid-cols-\[1\.35fr_0\.65fr\]{grid-template-columns:1.35fr .65fr}.xl\:flex-row{flex-direction:row}.xl\:items-end{align-items:flex-end}.xl\:justify-between{justify-content:space-between}}}body{background-color:var(--color-surface-950);color:var(--color-surface-100);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}@keyframes slide-in-from-right{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}.animate-in{animation:.3s cubic-bezier(.16,1,.3,1) slide-in-from-right}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}:focus-visible{outline:2px solid var(--color-primary-500);outline-offset:2px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/frontend-v2/dist/assets/index-dcOl4BfQ.css b/frontend-v2/dist/assets/index-dcOl4BfQ.css new file mode 100644 index 0000000..9b3f74a --- /dev/null +++ b/frontend-v2/dist/assets/index-dcOl4BfQ.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-black:oklch(12.5% .018 235);--color-white:oklch(97% .006 235);--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-primary-200:oklch(89.5% .08 205);--color-primary-300:oklch(83.2% .112 205);--color-primary-400:oklch(76.5% .13 205);--color-primary-500:oklch(68.5% .126 210);--color-primary-600:oklch(58.5% .109 214);--color-primary-700:oklch(49% .088 216);--color-primary-900:oklch(30% .05 220);--color-surface-50:oklch(97% .006 235);--color-surface-100:oklch(93.5% .007 235);--color-surface-200:oklch(86.5% .009 235);--color-surface-300:oklch(77% .011 235);--color-surface-400:oklch(67% .014 235);--color-surface-500:oklch(57% .016 235);--color-surface-600:oklch(45% .018 235);--color-surface-700:oklch(34% .021 235);--color-surface-800:oklch(24% .022 235);--color-surface-900:oklch(17% .02 235);--color-surface-950:oklch(12.5% .018 235);--color-danger:oklch(65% .205 22);--color-warning:oklch(78% .165 77);--color-success:oklch(72% .145 160);--color-info:oklch(74% .13 225)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:calc(var(--spacing) * 0)}.left-3{left:calc(var(--spacing) * 3)}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.col-span-full{grid-column:1/-1}.float-right{float:right}.mx-auto{margin-inline:auto}.my-5{margin-block:calc(var(--spacing) * 5)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-2{margin-left:calc(var(--spacing) * 2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-32{height:calc(var(--spacing) * 32)}.h-\[17px\]{height:17px}.h-\[var\(--oa-command-height\)\]{height:var(--oa-command-height)}.h-full{height:100%}.h-px{height:1px}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-44{min-height:calc(var(--spacing) * 44)}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-\[17px\]{width:17px}.w-\[var\(--oa-sidebar-width\)\]{width:var(--oa-sidebar-width)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[1920px\]{max-width:1920px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[500px\]{min-width:500px}.min-w-\[760px\]{min-width:760px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-20{--tw-translate-y:calc(var(--spacing) * -20);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-surface-800>:not(:last-child)){border-color:var(--color-surface-800)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/30{border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab, red, red)){.border-blue-500\/30{border-color:color-mix(in oklab, var(--color-blue-500) 30%, transparent)}}.border-danger\/20{border-color:#f3495333}@supports (color:color-mix(in lab, red, red)){.border-danger\/20{border-color:color-mix(in oklab, var(--color-danger) 20%, transparent)}}.border-danger\/30{border-color:#f349534d}@supports (color:color-mix(in lab, red, red)){.border-danger\/30{border-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\/30{border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.border-info\/20{border-color:#2ebbe833}@supports (color:color-mix(in lab, red, red)){.border-info\/20{border-color:color-mix(in oklab, var(--color-info) 20%, transparent)}}.border-info\/30{border-color:#2ebbe84d}@supports (color:color-mix(in lab, red, red)){.border-info\/30{border-color:color-mix(in oklab, var(--color-info) 30%, transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab, red, red)){.border-orange-500\/30{border-color:color-mix(in oklab, var(--color-orange-500) 30%, transparent)}}.border-primary-400{border-color:var(--color-primary-400)}.border-primary-500{border-color:var(--color-primary-500)}.border-primary-500\/20{border-color:#00adc333}@supports (color:color-mix(in lab, red, red)){.border-primary-500\/20{border-color:color-mix(in oklab, var(--color-primary-500) 20%, transparent)}}.border-primary-500\/25{border-color:#00adc340}@supports (color:color-mix(in lab, red, red)){.border-primary-500\/25{border-color:color-mix(in oklab, var(--color-primary-500) 25%, transparent)}}.border-primary-500\/30{border-color:#00adc34d}@supports (color:color-mix(in lab, red, red)){.border-primary-500\/30{border-color:color-mix(in oklab, var(--color-primary-500) 30%, transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.border-red-500\/30{border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.border-success\/20{border-color:#38c08533}@supports (color:color-mix(in lab, red, red)){.border-success\/20{border-color:color-mix(in oklab, var(--color-success) 20%, transparent)}}.border-success\/30{border-color:#38c0854d}@supports (color:color-mix(in lab, red, red)){.border-success\/30{border-color:color-mix(in oklab, var(--color-success) 30%, transparent)}}.border-surface-500\/30{border-color:#6f79804d}@supports (color:color-mix(in lab, red, red)){.border-surface-500\/30{border-color:color-mix(in oklab, var(--color-surface-500) 30%, transparent)}}.border-surface-600{border-color:var(--color-surface-600)}.border-surface-700{border-color:var(--color-surface-700)}.border-surface-700\/50{border-color:#2e3a4180}@supports (color:color-mix(in lab, red, red)){.border-surface-700\/50{border-color:color-mix(in oklab, var(--color-surface-700) 50%, transparent)}}.border-surface-800{border-color:var(--color-surface-800)}.border-transparent{border-color:#0000}.border-warning\/20{border-color:#f1a70033}@supports (color:color-mix(in lab, red, red)){.border-warning\/20{border-color:color-mix(in oklab, var(--color-warning) 20%, transparent)}}.border-warning\/30{border-color:#f1a7004d}@supports (color:color-mix(in lab, red, red)){.border-warning\/30{border-color:color-mix(in oklab, var(--color-warning) 30%, transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\/30{border-color:color-mix(in oklab, var(--color-yellow-500) 30%, transparent)}}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/5{background-color:color-mix(in oklab, var(--color-amber-500) 5%, transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/20{background-color:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.bg-black\/50{background-color:#02070c80}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-500\/10{background-color:color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-500\/20{background-color:color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-danger{background-color:var(--color-danger)}.bg-danger\/10{background-color:#f349531a}@supports (color:color-mix(in lab, red, red)){.bg-danger\/10{background-color:color-mix(in oklab, var(--color-danger) 10%, transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/20{background-color:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab, red, red)){.bg-green-500\/20{background-color:color-mix(in oklab, var(--color-green-500) 20%, transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-info\/10{background-color:#2ebbe81a}@supports (color:color-mix(in lab, red, red)){.bg-info\/10{background-color:color-mix(in oklab, var(--color-info) 10%, transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab, red, red)){.bg-orange-500\/20{background-color:color-mix(in oklab, var(--color-orange-500) 20%, transparent)}}.bg-primary-400{background-color:var(--color-primary-400)}.bg-primary-500{background-color:var(--color-primary-500)}.bg-primary-500\/10{background-color:#00adc31a}@supports (color:color-mix(in lab, red, red)){.bg-primary-500\/10{background-color:color-mix(in oklab, var(--color-primary-500) 10%, transparent)}}.bg-primary-500\/20{background-color:#00adc333}@supports (color:color-mix(in lab, red, red)){.bg-primary-500\/20{background-color:color-mix(in oklab, var(--color-primary-500) 20%, transparent)}}.bg-primary-600{background-color:var(--color-primary-600)}.bg-primary-600\/10{background-color:#008ba21a}@supports (color:color-mix(in lab, red, red)){.bg-primary-600\/10{background-color:color-mix(in oklab, var(--color-primary-600) 10%, transparent)}}.bg-primary-600\/20{background-color:#008ba233}@supports (color:color-mix(in lab, red, red)){.bg-primary-600\/20{background-color:color-mix(in oklab, var(--color-primary-600) 20%, transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/20{background-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-success{background-color:var(--color-success)}.bg-success\/8{background-color:#38c08514}@supports (color:color-mix(in lab, red, red)){.bg-success\/8{background-color:color-mix(in oklab, var(--color-success) 8%, transparent)}}.bg-success\/10{background-color:#38c0851a}@supports (color:color-mix(in lab, red, red)){.bg-success\/10{background-color:color-mix(in oklab, var(--color-success) 10%, transparent)}}.bg-surface-500\/20{background-color:#6f798033}@supports (color:color-mix(in lab, red, red)){.bg-surface-500\/20{background-color:color-mix(in oklab, var(--color-surface-500) 20%, transparent)}}.bg-surface-600\/20{background-color:#4c575e33}@supports (color:color-mix(in lab, red, red)){.bg-surface-600\/20{background-color:color-mix(in oklab, var(--color-surface-600) 20%, transparent)}}.bg-surface-700{background-color:var(--color-surface-700)}.bg-surface-700\/35{background-color:#2e3a4159}@supports (color:color-mix(in lab, red, red)){.bg-surface-700\/35{background-color:color-mix(in oklab, var(--color-surface-700) 35%, transparent)}}.bg-surface-700\/50{background-color:#2e3a4180}@supports (color:color-mix(in lab, red, red)){.bg-surface-700\/50{background-color:color-mix(in oklab, var(--color-surface-700) 50%, transparent)}}.bg-surface-800{background-color:var(--color-surface-800)}.bg-surface-800\/50{background-color:#15212880}@supports (color:color-mix(in lab, red, red)){.bg-surface-800\/50{background-color:color-mix(in oklab, var(--color-surface-800) 50%, transparent)}}.bg-surface-900{background-color:var(--color-surface-900)}.bg-surface-900\/30{background-color:#0711174d}@supports (color:color-mix(in lab, red, red)){.bg-surface-900\/30{background-color:color-mix(in oklab, var(--color-surface-900) 30%, transparent)}}.bg-surface-900\/50{background-color:#07111780}@supports (color:color-mix(in lab, red, red)){.bg-surface-900\/50{background-color:color-mix(in oklab, var(--color-surface-900) 50%, transparent)}}.bg-surface-950{background-color:var(--color-surface-950)}.bg-surface-950\/40{background-color:#02070c66}@supports (color:color-mix(in lab, red, red)){.bg-surface-950\/40{background-color:color-mix(in oklab, var(--color-surface-950) 40%, transparent)}}.bg-surface-950\/75{background-color:#02070cbf}@supports (color:color-mix(in lab, red, red)){.bg-surface-950\/75{background-color:color-mix(in oklab, var(--color-surface-950) 75%, transparent)}}.bg-surface-950\/92{background-color:#02070ceb}@supports (color:color-mix(in lab, red, red)){.bg-surface-950\/92{background-color:color-mix(in oklab, var(--color-surface-950) 92%, transparent)}}.bg-warning{background-color:var(--color-warning)}.bg-warning\/8{background-color:#f1a70014}@supports (color:color-mix(in lab, red, red)){.bg-warning\/8{background-color:color-mix(in oklab, var(--color-warning) 8%, transparent)}}.bg-warning\/10{background-color:#f1a7001a}@supports (color:color-mix(in lab, red, red)){.bg-warning\/10{background-color:color-mix(in oklab, var(--color-warning) 10%, transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\/20{background-color:color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[radial-gradient\(circle_at_25\%_20\%\,oklch\(68\.5\%_0\.126_210\/0\.13\)\,transparent_32\%\)\]{background-image:radial-gradient(circle at 25% 20%,oklch(68.5% .126 210/.13),#0000 32%)}.from-surface-950{--tw-gradient-from:var(--color-surface-950);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-surface-900{--tw-gradient-via:var(--color-surface-900);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-primary-900\/20{--tw-gradient-to:#07333f33}@supports (color:color-mix(in lab, red, red)){.to-primary-900\/20{--tw-gradient-to:color-mix(in oklab, var(--color-primary-900) 20%, transparent)}}.to-primary-900\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-12{padding:calc(var(--spacing) * 12)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-9{padding-block:calc(var(--spacing) * 9)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-\[var\(--oa-command-height\)\]{padding-top:var(--oa-command-height)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-400{color:var(--color-amber-400)}.text-blue-400{color:var(--color-blue-400)}.text-current{color:currentColor}.text-danger{color:var(--color-danger)}.text-danger\/70{color:#f34953b3}@supports (color:color-mix(in lab, red, red)){.text-danger\/70{color:color-mix(in oklab, var(--color-danger) 70%, transparent)}}.text-emerald-400{color:var(--color-emerald-400)}.text-green-400{color:var(--color-green-400)}.text-info{color:var(--color-info)}.text-orange-400{color:var(--color-orange-400)}.text-primary-200{color:var(--color-primary-200)}.text-primary-300{color:var(--color-primary-300)}.text-primary-400{color:var(--color-primary-400)}.text-primary-500{color:var(--color-primary-500)}.text-red-400{color:var(--color-red-400)}.text-success{color:var(--color-success)}.text-surface-50{color:var(--color-surface-50)}.text-surface-100{color:var(--color-surface-100)}.text-surface-200{color:var(--color-surface-200)}.text-surface-300{color:var(--color-surface-300)}.text-surface-400{color:var(--color-surface-400)}.text-surface-500{color:var(--color-surface-500)}.text-surface-600{color:var(--color-surface-600)}.text-surface-950{color:var(--color-surface-950)}.text-warning{color:var(--color-warning)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.placeholder-surface-500::placeholder{color:var(--color-surface-500)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow-\[var\(--oa-shadow-float\)\]{--tw-shadow:var(--oa-shadow-float);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,visibility\]{transition-property:transform,visibility;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (hover:hover){.group-hover\:text-primary-400:is(:where(.group):hover *){color:var(--color-primary-400)}}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing) * 0)}@media (hover:hover){.hover\:border-primary-500\/40:hover{border-color:#00adc366}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary-500\/40:hover{border-color:color-mix(in oklab, var(--color-primary-500) 40%, transparent)}}.hover\:border-primary-500\/60:hover{border-color:#00adc399}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary-500\/60:hover{border-color:color-mix(in oklab, var(--color-primary-500) 60%, transparent)}}.hover\:border-surface-500:hover{border-color:var(--color-surface-500)}.hover\:border-surface-600:hover{border-color:var(--color-surface-600)}.hover\:border-surface-700:hover{border-color:var(--color-surface-700)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-danger\/10:hover{background-color:#f349531a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-danger\/10:hover{background-color:color-mix(in oklab, var(--color-danger) 10%, transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-primary-400:hover{background-color:var(--color-primary-400)}.hover\:bg-primary-700:hover{background-color:var(--color-primary-700)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-surface-600:hover{background-color:var(--color-surface-600)}.hover\:bg-surface-700:hover{background-color:var(--color-surface-700)}.hover\:bg-surface-800:hover{background-color:var(--color-surface-800)}.hover\:bg-surface-800\/45:hover{background-color:#15212873}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-800\/45:hover{background-color:color-mix(in oklab, var(--color-surface-800) 45%, transparent)}}.hover\:bg-surface-800\/50:hover{background-color:#15212880}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-800\/50:hover{background-color:color-mix(in oklab, var(--color-surface-800) 50%, transparent)}}.hover\:bg-surface-800\/55:hover{background-color:#1521288c}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-800\/55:hover{background-color:color-mix(in oklab, var(--color-surface-800) 55%, transparent)}}.hover\:bg-surface-800\/70:hover{background-color:#152128b3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-800\/70:hover{background-color:color-mix(in oklab, var(--color-surface-800) 70%, transparent)}}.hover\:bg-surface-900\/80:hover{background-color:#071117cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-900\/80:hover{background-color:color-mix(in oklab, var(--color-surface-900) 80%, transparent)}}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-primary-200:hover{color:var(--color-primary-200)}.hover\:text-primary-300:hover{color:var(--color-primary-300)}.hover\:text-primary-400:hover{color:var(--color-primary-400)}.hover\:text-surface-100:hover{color:var(--color-surface-100)}.hover\:text-surface-300:hover{color:var(--color-surface-300)}.hover\:text-white:hover{color:var(--color-white)}.hover\:opacity-100:hover{opacity:1}}.focus\:translate-y-0:focus{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.focus\:border-primary-500:focus{border-color:var(--color-primary-500)}.focus\:border-transparent:focus{border-color:#0000}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-primary-500:focus{--tw-ring-color:var(--color-primary-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus\:ring-inset:focus{--tw-ring-inset:inset}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:table-cell{display:table-cell}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[6rem_minmax\(0\,1fr\)_8rem\]{grid-template-columns:6rem minmax(0,1fr) 8rem}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-10{padding-inline:calc(var(--spacing) * 10)}.sm\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.sm\:text-\[1\.75rem\]{font-size:1.75rem}}@media (width>=48rem){.md\:visible{visibility:visible}.md\:left-\[var\(--oa-sidebar-width\)\]{left:var(--oa-sidebar-width)}.md\:ml-\[var\(--oa-sidebar-width\)\]{margin-left:var(--oa-sidebar-width)}.md\:hidden{display:none}.md\:table-cell{display:table-cell}.md\:translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}@media (width>=64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(28rem\,0\.72fr\)\]{grid-template-columns:minmax(0,1fr) minmax(28rem,.72fr)}.lg\:flex-col{flex-direction:column}.lg\:justify-between{justify-content:space-between}.lg\:p-6{padding:calc(var(--spacing) * 6)}}@media (width>=80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,0\.8fr\)_minmax\(28rem\,1\.2fr\)\]{grid-template-columns:minmax(0,.8fr) minmax(28rem,1.2fr)}.xl\:grid-cols-\[minmax\(0\,1\.35fr\)_minmax\(20rem\,0\.65fr\)\]{grid-template-columns:minmax(0,1.35fr) minmax(20rem,.65fr)}.xl\:flex-row{flex-direction:row}.xl\:items-end{align-items:flex-end}.xl\:justify-between{justify-content:space-between}.xl\:p-7{padding:calc(var(--spacing) * 7)}.xl\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--oa-command-height:3.5rem;--oa-sidebar-width:15.5rem;--oa-radius-sm:.25rem;--oa-radius-md:.5rem;--oa-radius-lg:.75rem;--oa-shadow-float:0 18px 50px oklch(5% .02 235/.5)}*{box-sizing:border-box}html{background:var(--color-surface-950)}body{background-color:var(--color-surface-950);color:var(--color-surface-100);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-image:linear-gradient(oklch(70% .06 215/.025) 1px,#0000 1px),linear-gradient(90deg,oklch(70% .06 215/.025) 1px,#0000 1px);background-size:32px 32px;min-width:320px;margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}::selection{background:oklch(68.5% .126 210/.3)}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button:not(:disabled),[role=button]:not([aria-disabled=true]){cursor:pointer}button:disabled{cursor:not-allowed}table{border-collapse:collapse}thead{background:oklch(17% .02 235/.88)}th{letter-spacing:.055em;text-transform:uppercase;font-size:.6875rem}tbody tr{transition:background-color .15s,border-color .15s}code,pre,kbd,.font-mono{font-variant-ligatures:none}.oa-panel{border:1px solid var(--color-surface-700);border-radius:var(--oa-radius-md);background:oklch(17% .02 235/.86);box-shadow:inset 0 1px oklch(90% .02 220/.025)}.oa-panel-muted{border-radius:var(--oa-radius-md);background:oklch(12.5% .018 235/.52);border:1px solid oklch(34% .021 235/.75)}.oa-skeleton{background:linear-gradient(90deg, var(--color-surface-800), var(--color-surface-700), var(--color-surface-800));background-size:200% 100%;animation:1.4s ease-in-out infinite oa-shimmer}@keyframes oa-shimmer{to{background-position-x:-200%}}@keyframes slide-in-from-right{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}.animate-in{animation:.3s cubic-bezier(.16,1,.3,1) slide-in-from-right}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}:focus-visible{outline:2px solid var(--color-primary-500);outline-offset:2px}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/frontend-v2/dist/assets/index-pKqHCNrE.js b/frontend-v2/dist/assets/index-pKqHCNrE.js deleted file mode 100644 index 3ccb6b9..0000000 --- a/frontend-v2/dist/assets/index-pKqHCNrE.js +++ /dev/null @@ -1,52 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){e.memoizedState!==null&&ue(me,e);var t=de.current,n=Wd(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),ep._currentValue=ae)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,`passive`,{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.textContent,a=i.length;for(e=0;e=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function N(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function P(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=xn(),bn=yn=vn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ht(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Nr=hn&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function Rr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==Ht(r)||(r=Pr,`selectionStart`in r&&Mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ir&&Dr(Ir,r)||(Ir=r,r=Dd(Fr,`onSelect`),0>=o,i-=o,Ai=1<<32-Ue(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),F&&Mi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),F&&Mi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&Mi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),F&&Mi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=_i(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=gi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=bi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ka(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(ne(o)){if(l=ne(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,ia(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function z(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=li(e),ci(e,null,n),t}return ai(e,r,t,n),li(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=ma;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===pa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Va=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};j.T=s,Is(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,_a(c,r),mu(e)):Fs(e,t,r,mu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;ws(e,a,t,ae,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},mu())}function ks(){return ra(ep)}function As(){return Mo().memoizedState}function js(){return Mo().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Wa(n);var r=z(t,e,n);r!==null&&(gu(r,t,n),Ga(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=oi(e,t,n,r),n!==null&&(gu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,mu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o))return ai(e,t,i,0),Bl===null&&ii(),!1}catch{}if(n=oi(e,t,i,r),n!==null)return gu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=oi(e,n,r,2),t!==null&&gu(t,e,2)}function Ls(e){var t=e.alternate;return e===B||t!==null&&t===B}function Rs(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}var Bs={readContext:ra,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Bs.useEffectEvent=So;var Vs={readContext:ra,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,B,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=jo();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));q&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=Bl.identifierPrefix;if(F){var n=ji,r=Ai;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ft]=t,o[pt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Nc(t)}}return Rc(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Gi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Li,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Hi(t,!0)}else e=Hd(e).createTextNode(r),e[ft]=t,t.stateNode=e}return Rc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Gi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ft]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),e=!1}else n=I(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Rc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Gi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ft]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),a=!1}else a=I(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ic(t,t.updateQueue),Rc(t),null);case 4:return ge(),e===null&&Cd(t.stateNode.containerInfo),Rc(t),null;case 10:return Zi(t.type),Rc(t),null;case 19:if(le(uo),r=t.memoizedState,r===null)return Rc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Lc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hi(n,e),n=n.sibling;return ue(uo,uo.current&1|2),F&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>ru&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!F)return Rc(t),null}else 2*je()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Rc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=uo.current,ue(uo,a?n&1|2:n&1),F&&Mi(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Rc(t),t.subtreeFlags&6&&(t.flags|=8192)):Rc(t),n=t.updateQueue,n!==null&&Ic(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(ca),Rc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(ca),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(uo),null;case 4:return ge(),null;case 10:return Zi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&le(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(ca),null;case 25:return null;default:return null}}function Vc(e,t){switch(Fi(t),t.tag){case 3:Zi(ca),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:le(uo);break;case 10:Zi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&le(ya);break;case 24:Zi(ca)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){X(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){X(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){X(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){X(e,e.return,t)}}}function Gc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){X(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){X(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){X(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){X(e,t,n)}else n.current=null}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){X(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[pt]=t}catch(t){X(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&$d(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[ft]=e,t[pt]=n}catch(t){X(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Bd=cp,e=jr(e),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Vd={focusedElem:e,selectionRange:n},cp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Id(o,r,n),o[ft]=e,Tt(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=kr(s,h),v=kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,j.T=null,n=uu,uu=null;var o=ou,s=cu;if(Y=0,su=ou=null,cu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),Ol(o,o.current,s,n),zl=c,ad(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{M.p=a,j.T=r,Hu(e,t)}}function Gu(e,t,n){t=Si(n,t),t=ec(e.stateNode,t,2),e=z(e,t,2),e!==null&&(nt(e,2),id(e))}function X(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=Si(n,e),n=H(2),r=z(t,n,2),r!==null&&(tc(n,r,t,e),nt(r,2),id(r));break}}t=t.return}}function Ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(J=!0,i.add(n),e=qu.bind(null,e,t,n),t.then(e,e))}function qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(Kl===4||Kl===3&&(q&62914560)===q&&300>je()-tu?!(zl&2)&&Cu(e,0):Yl|=n,Zl===q&&(Zl=0)),id(e)}function Ju(e,t){t===0&&(t=et()),e=si(e,t),e!==null&&(nt(e,t),id(e))}function Yu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function Xu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ju(e,n)}function Zu(e,t){return De(e,t)}var Qu=null,$u=null,ed=!1,td=!1,nd=!1,rd=0;function id(e){e!==$u&&e.next===null&&($u===null?Qu=$u=e:$u=$u.next=e),td=!0,ed||(ed=!0,dd())}function ad(e,t){if(!nd&&td){nd=!0;do for(var n=!1,r=Qu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ud(r,a))}else a=q,a=Ze(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,ud(r,a));r=r.next}while(n);nd=!1}}function od(){sd()}function sd(){td=ed=!1;var e=0;rd!==0&&qd()&&(e=rd);for(var t=je(),n=null,r=Qu;r!==null;){var i=r.next,a=cd(r,t);a===0?(r.next=null,n===null?Qu=i:n.next=i,i===null&&($u=n)):(n=r,(e!==0||a&3)&&(td=!0)),r=i}Y!==0&&Y!==5||ad(e,!1),rd!==0&&(rd=0)}function cd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Rd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=wt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);Tt(c),Id(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=wt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),Tt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=wt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),Tt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=pe.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=wt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var o=wt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=wt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+Wt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),Tt(t),e.head.appendChild(t))}function If(e){return`[src="`+Wt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Tt(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,Tt(a),a):(r=n,(a=gf.get(o))&&(r=m({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Tt(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Gf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d()),y=_(),b=l(h());function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ne(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=S.Pop,c=null,l=u();l??(l=0,o.replaceState(x({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=S.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=S.Push;let r=k(h.location,e,t);n&&n(r,e),l=u()+1;let d=O(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=S.Replace;let r=k(h.location,e,t);n&&n(r,e),l=u();let i=O(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:ee(e);return n=n.replace(/ $/,`%20`),T(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(C,d),c=e,()=>{i.removeEventListener(C,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var A;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(A||={});function re(e,t,n){return n===void 0&&(n=`/`),ie(e,t,n,!1)}function ie(e,t,n,r){let i=ye((typeof t==`string`?te(t):t).pathname||`/`,n);if(i==null)return null;let a=j(e);ae(a);let o=null;for(let e=0;o==null&&e{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(T(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Oe([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(T(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),j(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:pe(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of M(e.path))i(e,t,n)}),t}function M(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=M(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ae(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var oe=/^:[\w-]+$/,se=3,ce=2,le=1,ue=10,de=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=de),t&&(r+=ce),n.filter(e=>!fe(e)).reduce((e,t)=>e+(oe.test(t)?se:t===``?le:ue),r)}function me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function he(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),E(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,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return E(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function ye(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 be=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xe=e=>be.test(e);function Se(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?te(e):e,a;if(n)if(xe(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),E(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?Ce(n.substring(1),`/`):Ce(n,t)}else a=t;return{pathname:a,search:Ae(r),hash:je(i)}}function Ce(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function we(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 Te(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ee(e,t){let n=Te(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function De(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=te(e):(i=x({},e),T(!i.pathname||!i.pathname.includes(`?`),we(`?`,`pathname`,`search`,i)),T(!i.pathname||!i.pathname.includes(`#`),we(`#`,`pathname`,`hash`,i)),T(!i.search||!i.search.includes(`#`),we(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Se(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Oe=e=>e.join(`/`).replace(/\/\/+/g,`/`),ke=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function Me(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Ne=[`post`,`put`,`patch`,`delete`];new Set(Ne);var Pe=[`get`,...Ne];new Set(Pe);function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),v.useCallback(function(n,i){if(i===void 0&&(i={}),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=De(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Oe([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}var Je=v.createContext(null);function Ye(e){let t=v.useContext(Be).outlet;return t&&v.createElement(Je.Provider,{value:e},t)}function Xe(){let{matches:e}=v.useContext(Be),t=e[e.length-1];return t?t.params:{}}function Ze(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Re),{matches:i}=v.useContext(Be),{pathname:a}=We(),o=JSON.stringify(Ee(i,r.v7_relativeSplatPath));return v.useMemo(()=>De(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}function Qe(e,t){return $e(e,t)}function $e(e,t,n,r){!Ue()&&T(!1);let{navigator:i}=v.useContext(Re),{matches:a}=v.useContext(Be),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=We(),u;if(t){let e=typeof t==`string`?te(t):t;!(c===`/`||e.pathname?.startsWith(c))&&T(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=re(e,{pathname:f}),m=it(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Oe([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Oe([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?v.createElement(ze.Provider,{value:{location:Fe({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:S.Pop}},m):m}function et(){let e=dt(),t=Me(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var tt=v.createElement(et,null),nt=class extends v.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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:v.createElement(Be.Provider,{value:this.props.routeContext},v.createElement(Ve.Provider,{value:this.state.error,children:this.props.component}))}};function rt(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(Ie);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Be.Provider,{value:t},r)}function it(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&T(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||tt,s&&(c<0&&i===0?(mt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?v.createElement(r.route.Component,null):r.route.element?r.route.element:e,v.createElement(rt,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?v.createElement(nt,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var at=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(at||{}),ot=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(ot||{});function st(e){let t=v.useContext(Ie);return!t&&T(!1),t}function ct(e){let t=v.useContext(Le);return!t&&T(!1),t}function lt(e){let t=v.useContext(Be);return!t&&T(!1),t}function ut(e){let t=lt(e),n=t.matches[t.matches.length-1];return!n.route.id&&T(!1),n.route.id}function dt(){let e=v.useContext(Ve),t=ct(ot.UseRouteError),n=ut(ot.UseRouteError);return e===void 0?t.errors?.[n]:e}function ft(){let{router:e}=st(at.UseNavigateStable),t=ut(ot.UseNavigateStable),n=v.useRef(!1);return Ge(()=>{n.current=!0}),v.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,Fe({fromRouteId:t},i)))},[e,t])}var pt={};function mt(e,t,n){!t&&!pt[e]&&(pt[e]=!0)}var ht=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function gt(e,t){e?.v7_startTransition===void 0&&ht(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&ht(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&ht(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&ht(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&ht(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&ht(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}function _t(e){let{to:t,replace:n,state:r,relative:i}=e;!Ue()&&T(!1);let{future:a,static:o}=v.useContext(Re),{matches:s}=v.useContext(Be),{pathname:c}=We(),l=Ke(),u=De(t,Ee(s,a.v7_relativeSplatPath),c,i===`path`),d=JSON.stringify(u);return v.useEffect(()=>l(JSON.parse(d),{replace:n,state:r,relative:i}),[l,d,i,n,r]),null}function vt(e){return Ye(e.context)}function yt(e){T(!1)}function bt(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=S.Pop,navigator:a,static:o=!1,future:s}=e;Ue()&&T(!1);let c=t.replace(/^\/*/,`/`),l=v.useMemo(()=>({basename:c,navigator:a,static:o,future:Fe({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=te(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=v.useMemo(()=>{let e=ye(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:v.createElement(Re.Provider,{value:l},v.createElement(ze.Provider,{children:n,value:h}))}function xt(e){let{children:t,location:n}=e;return Qe(Ct(t),n)}var St=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(St||{});new Promise(()=>{}),v.Component;function Ct(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,Ct(e.props.children,i));return}e.type!==yt&&T(!1),!(!e.props.index||!e.props.children)&&T(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ct(e.props.children,i)),n.push(a)}),n}function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Et(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Dt(e,t){return e.button===0&&(!t||t===`_self`)&&!Et(e)}var Ot=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],kt=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`viewTransition`,`children`],At=`6`;try{window.__reactRouterVersion=At}catch{}var jt=v.createContext({isTransitioning:!1}),Mt=v.startTransition;function Nt(e){let{basename:t,children:n,future:r,window:i}=e,a=v.useRef();a.current??=w({window:i,v5Compat:!0});let o=a.current,[s,c]=v.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=v.useCallback(e=>{l&&Mt?Mt(()=>c(e)):c(e)},[c,l]);return v.useLayoutEffect(()=>o.listen(u),[o,u]),v.useEffect(()=>gt(r),[r]),v.createElement(bt,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Pt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ft=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,It=v.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u}=e,d=Tt(e,Ot),{basename:f}=v.useContext(Re),p,m=!1;if(typeof c==`string`&&Ft.test(c)&&(p=c,Pt))try{let e=new URL(window.location.href),t=c.startsWith(`//`)?new URL(e.protocol+c):new URL(c),n=ye(t.pathname,f);t.origin===e.origin&&n!=null?c=n+t.search+t.hash:m=!0}catch{}let h=He(c,{relative:r}),g=Vt(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u});function _(e){n&&n(e),e.defaultPrevented||g(e)}return v.createElement(`a`,wt({},d,{href:p||h,onClick:m||i?n:_,ref:t,target:s}))}),Lt=v.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:r=!1,className:i=``,end:a=!1,style:o,to:s,viewTransition:c,children:l}=e,u=Tt(e,kt),d=Ze(s,{relative:u.relative}),f=We(),p=v.useContext(Le),{navigator:m,basename:h}=v.useContext(Re),g=p!=null&&Ht(d)&&c===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,y=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;r||(y=y.toLowerCase(),b=b?b.toLowerCase():null,_=_.toLowerCase()),b&&h&&(b=ye(b,h)||b);let x=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,S=y===_||!a&&y.startsWith(_)&&y.charAt(x)===`/`,C=b!=null&&(b===_||!a&&b.startsWith(_)&&b.charAt(_.length)===`/`),w={isActive:S,isPending:C,isTransitioning:g},T=S?n:void 0,E;E=typeof i==`function`?i(w):[i,S?`active`:null,C?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let D=typeof o==`function`?o(w):o;return v.createElement(It,wt({},u,{"aria-current":T,className:E,ref:t,style:D,to:s,viewTransition:c}),typeof l==`function`?l(w):l)}),Rt;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(Rt||={});var zt;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(zt||={});function Bt(e){let t=v.useContext(Ie);return!t&&T(!1),t}function Vt(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,c=Ke(),l=We(),u=Ze(e,{relative:o});return v.useCallback(t=>{Dt(t,n)&&(t.preventDefault(),c(e,{replace:r===void 0?ee(l)===ee(u):r,state:i,preventScrollReset:a,relative:o,viewTransition:s}))},[l,c,u,r,i,n,e,a,o,s])}function Ht(e,t){t===void 0&&(t={});let n=v.useContext(jt);n??T(!1);let{basename:r}=Bt(Rt.useViewTransitionState),i=Ze(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=ye(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ye(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ge(i.pathname,o)!=null||ge(i.pathname,a)!=null}var Ut=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Wt=(e=>e?Ut(e):Ut),Gt=e=>e;function Kt(e,t=Gt){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var qt=e=>{let t=Wt(e),n=e=>Kt(t,e);return Object.assign(n,t),n},Jt=(e=>e?qt(e):qt);function Yt(e,t){return function(){return e.apply(t,arguments)}}var{toString:Xt}=Object.prototype,{getPrototypeOf:Zt}=Object,{iterator:Qt,toStringTag:$t}=Symbol,en=(e=>t=>{let n=Xt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),tn=e=>(e=e.toLowerCase(),t=>en(t)===e),nn=e=>t=>typeof t===e,{isArray:rn}=Array,an=nn(`undefined`);function on(e){return e!==null&&!an(e)&&e.constructor!==null&&!an(e.constructor)&&un(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var sn=tn(`ArrayBuffer`);function cn(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sn(e.buffer),t}var ln=nn(`string`),un=nn(`function`),dn=nn(`number`),fn=e=>typeof e==`object`&&!!e,pn=e=>e===!0||e===!1,mn=e=>{if(en(e)!==`object`)return!1;let t=Zt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!($t in e)&&!(Qt in e)},hn=e=>{if(!fn(e)||on(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},gn=tn(`Date`),_n=tn(`File`),vn=e=>!!(e&&e.uri!==void 0),yn=e=>e&&e.getParts!==void 0,bn=tn(`Blob`),xn=tn(`FileList`),Sn=e=>fn(e)&&un(e.pipe);function Cn(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var wn=Cn(),Tn=wn.FormData===void 0?void 0:wn.FormData,En=e=>{if(!e)return!1;if(Tn&&e instanceof Tn)return!0;let t=Zt(e);if(!t||t===Object.prototype||!un(e.append))return!1;let n=en(e);return n===`formdata`||n===`object`&&un(e.toString)&&e.toString()===`[object FormData]`},Dn=tn(`URLSearchParams`),[On,kn,An,jn]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(tn),Mn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Nn(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),rn(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Fn=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,In=e=>!an(e)&&e!==Fn;function Ln(){let{caseless:e,skipUndefined:t}=In(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&Pn(n,i)||i;mn(n[a])&&mn(r)?n[a]=Ln(n[a],r):mn(r)?n[a]=Ln({},r):rn(r)?n[a]=r.slice():(!t||!an(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e(Nn(t,(t,r)=>{n&&un(t)?Object.defineProperty(e,r,{value:Yt(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),zn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Bn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vn=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Zt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Hn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Un=e=>{if(!e)return null;if(rn(e))return e;let t=e.length;if(!dn(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},Wn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Zt(Uint8Array)),Gn=(e,t)=>{let n=(e&&e[Qt]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Kn=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},qn=tn(`HTMLFormElement`),Jn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Yn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Xn=tn(`RegExp`),Zn=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Nn(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Qn=e=>{Zn(e,(t,n)=>{if(un(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(un(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},$n=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return rn(e)?r(e):r(String(e).split(t)),n},er=()=>{},tr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function nr(e){return!!(e&&un(e.append)&&e[$t]===`FormData`&&e[Qt])}var rr=e=>{let t=Array(10),n=(e,r)=>{if(fn(e)){if(t.indexOf(e)>=0)return;if(on(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=rn(e)?[]:{};return Nn(e,(e,t)=>{let a=n(e,r+1);!an(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},ir=tn(`AsyncFunction`),ar=e=>e&&(fn(e)||un(e))&&un(e.then)&&un(e.catch),or=((e,t)=>e?setImmediate:t?((e,t)=>(Fn.addEventListener(`message`,({source:n,data:r})=>{n===Fn&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Fn.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,un(Fn.postMessage)),N={isArray:rn,isArrayBuffer:sn,isBuffer:on,isFormData:En,isArrayBufferView:cn,isString:ln,isNumber:dn,isBoolean:pn,isObject:fn,isPlainObject:mn,isEmptyObject:hn,isReadableStream:On,isRequest:kn,isResponse:An,isHeaders:jn,isUndefined:an,isDate:gn,isFile:_n,isReactNativeBlob:vn,isReactNative:yn,isBlob:bn,isRegExp:Xn,isFunction:un,isStream:Sn,isURLSearchParams:Dn,isTypedArray:Wn,isFileList:xn,forEach:Nn,merge:Ln,extend:Rn,trim:Mn,stripBOM:zn,inherits:Bn,toFlatObject:Vn,kindOf:en,kindOfTest:tn,endsWith:Hn,toArray:Un,forEachEntry:Gn,matchAll:Kn,isHTMLForm:qn,hasOwnProperty:Yn,hasOwnProp:Yn,reduceDescriptors:Zn,freezeMethods:Qn,toObjectSet:$n,toCamelCase:Jn,noop:er,toFiniteNumber:tr,findKey:Pn,global:Fn,isContextDefined:In,isSpecCompliantForm:nr,toJSONObject:rr,isAsyncFn:ir,isThenable:ar,setImmediate:or,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Fn):typeof process<`u`&&process.nextTick||or,isIterable:e=>e!=null&&un(e[Qt])},P=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.status}}};P.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,P.ERR_BAD_OPTION=`ERR_BAD_OPTION`,P.ECONNABORTED=`ECONNABORTED`,P.ETIMEDOUT=`ETIMEDOUT`,P.ERR_NETWORK=`ERR_NETWORK`,P.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,P.ERR_DEPRECATED=`ERR_DEPRECATED`,P.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,P.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,P.ERR_CANCELED=`ERR_CANCELED`,P.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,P.ERR_INVALID_URL=`ERR_INVALID_URL`,P.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function sr(e){return N.isPlainObject(e)||N.isArray(e)}function cr(e){return N.endsWith(e,`[]`)?e.slice(0,-2):e}function lr(e,t,n){return e?e.concat(t).map(function(e,t){return e=cr(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function ur(e){return N.isArray(e)&&!e.some(sr)}var dr=N.toFlatObject(N,{},null,function(e){return/^is[A-Z]/.test(e)});function fr(e,t,n){if(!N.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=N.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!N.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&N.isSpecCompliantForm(t);if(!N.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(N.isDate(e))return e.toISOString();if(N.isBoolean(e))return e.toString();if(!l&&N.isBlob(e))throw new P(`Blob is not supported. Use a Buffer instead.`);return N.isArrayBuffer(e)||N.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(N.isReactNative(t)&&N.isReactNativeBlob(e))return t.append(lr(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(N.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(N.isArray(e)&&ur(e)||(N.isFileList(e)||N.endsWith(n,`[]`))&&(s=N.toArray(e)))return n=cr(n),s.forEach(function(e,r){!(N.isUndefined(e)||e===null)&&t.append(o===!0?lr([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return sr(e)?!0:(t.append(lr(i,n,a),u(e)),!1)}let f=[],p=Object.assign(dr,{defaultVisitor:d,convertValue:u,isVisitable:sr});function m(e,n,r=0){if(!N.isUndefined(e)){if(r>c)throw new P(`Object is too deeply nested (`+r+` levels). Max depth: `+c,P.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),N.forEach(e,function(e,a){(!(N.isUndefined(e)||e===null)&&i.call(t,e,N.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!N.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function pr(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function mr(e,t){this._pairs=[],e&&fr(e,this,t)}var hr=mr.prototype;hr.append=function(e,t){this._pairs.push([e,t])},hr.toString=function(e){let t=e?function(t){return e.call(this,t,pr)}:pr;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function gr(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function _r(e,t,n){if(!t)return e;let r=n&&n.encode||gr,i=N.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):N.isURLSearchParams(t)?t.toString():new mr(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var vr=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){N.forEach(this.handlers,function(t){t!==null&&e(t)})}},yr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},br={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:mr,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},xr=s({hasBrowserEnv:()=>Sr,hasStandardBrowserEnv:()=>wr,hasStandardBrowserWebWorkerEnv:()=>Tr,navigator:()=>Cr,origin:()=>Er}),Sr=typeof window<`u`&&typeof document<`u`,Cr=typeof navigator==`object`&&navigator||void 0,wr=Sr&&(!Cr||[`ReactNative`,`NativeScript`,`NS`].indexOf(Cr.product)<0),Tr=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Er=Sr&&window.location.href||`http://localhost`,Dr={...xr,...br};function Or(e,t){return fr(e,new Dr.classes.URLSearchParams,{visitor:function(e,t,n,r){return Dr.isNode&&N.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function kr(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Ar(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r=e.length;return a=!a&&N.isArray(r)?r.length:a,s?(N.hasOwnProp(r,a)?r[a]=N.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!r[a]||!N.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&N.isArray(r[a])&&(r[a]=Ar(r[a])),!o)}if(N.isFormData(e)&&N.isFunction(e.entries)){let n={};return N.forEachEntry(e,(e,r)=>{t(kr(e),r,n,0)}),n}return null}var Mr=(e,t)=>e!=null&&N.hasOwnProp(e,t)?e[t]:void 0;function Nr(e,t,n){if(N.isString(e))try{return(t||JSON.parse)(e),N.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var Pr={transitional:yr,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=N.isObject(e);if(i&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return r?JSON.stringify(jr(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e)||N.isReadableStream(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Mr(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Or(e,t).toString();if((a=N.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Mr(this,`env`),r=n&&n.FormData;return fr(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Nr(e)):e}],transformResponse:[function(e){let t=Mr(this,`transitional`)||Pr.transitional,n=t&&t.forcedJSONParsing,r=Mr(this,`responseType`),i=r===`json`;if(N.isResponse(e)||N.isReadableStream(e))return e;if(e&&N.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Mr(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?P.from(e,P.ERR_BAD_RESPONSE,this,null,Mr(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};N.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{Pr.headers[e]={}});var Fr=N.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Ir=e=>{let t={},n,r,i;return e&&e.split(` -`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Fr[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},Lr=Symbol(`internals`),Rr=/[^\x09\x20-\x7E\x80-\xFF]/g;function zr(e){let t=0,n=e.length;for(;tt;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function Br(e){return e&&String(e).trim().toLowerCase()}function Vr(e){return zr(e.replace(Rr,``))}function Hr(e){return e===!1||e==null?e:N.isArray(e)?e.map(Hr):Vr(String(e))}function Ur(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var Wr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Gr(e,t,n,r,i){if(N.isFunction(r))return r.call(this,t,n);if(i&&(t=n),N.isString(t)){if(N.isString(r))return t.indexOf(r)!==-1;if(N.isRegExp(r))return r.test(t)}}function Kr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function qr(e,t){let n=N.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Jr=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=Br(t);if(!i)throw Error(`header name must be a non-empty string`);let a=N.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Hr(e))}let a=(e,t)=>N.forEach(e,(e,n)=>i(e,n,t));if(N.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(N.isString(e)&&(e=e.trim())&&!Wr(e))a(Ir(e),t);else if(N.isObject(e)&&N.isIterable(e)){let n={},r,i;for(let t of e){if(!N.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?N.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Br(e),e){let n=N.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Ur(e);if(N.isFunction(t))return t.call(this,e,n);if(N.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=Br(e),e){let n=N.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Gr(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=Br(e),e){let i=N.findKey(n,e);i&&(!t||Gr(n,n[i],i,t))&&(delete n[i],r=!0)}}return N.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Gr(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return N.forEach(this,(r,i)=>{let a=N.findKey(n,i);if(a){t[a]=Hr(r),delete t[i];return}let o=e?Kr(i):String(i).trim();o!==i&&delete t[i],t[o]=Hr(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return N.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&N.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` -`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[Lr]=this[Lr]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=Br(e);t[r]||(qr(n,e),t[r]=!0)}return N.isArray(e)?e.forEach(r):r(e),this}};Jr.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),N.reduceDescriptors(Jr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),N.freezeMethods(Jr);function Yr(e,t){let n=this||Pr,r=t||n,i=Jr.from(r.headers),a=r.data;return N.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Xr(e){return!!(e&&e.__CANCEL__)}var Zr=class extends P{constructor(e,t,n){super(e??`canceled`,P.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Qr(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new P(`Request failed with status code `+n.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $r(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function ei(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var ni=(e,t,n=3)=>{let r=0,i=ei(50,250);return ti(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},ri=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ii=e=>(...t)=>N.asap(()=>e(...t)),ai=Dr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Dr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,oi=Dr.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];N.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),N.isString(r)&&s.push(`path=${r}`),N.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),N.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function si(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function ci(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function li(e,t,n){let r=!si(t);return e&&(r||n===!1)?ci(e,t):t}var ui=e=>e instanceof Jr?{...e}:e;function di(e,t){t||={};let n={};function r(e,t,n,r){return N.isPlainObject(e)&&N.isPlainObject(t)?N.merge.call({caseless:r},e,t):N.isPlainObject(t)?N.merge({},t):N.isArray(t)?t.slice():t}function i(e,t,n,i){if(!N.isUndefined(t))return r(e,t,n,i);if(!N.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!N.isUndefined(t))return r(void 0,t)}function o(e,t){if(!N.isUndefined(t))return r(void 0,t);if(!N.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(N.hasOwnProp(t,a))return r(n,i);if(N.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(ui(e),ui(t),n,!0)};return N.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=N.hasOwnProp(c,r)?c[r]:i,o=a(N.hasOwnProp(e,r)?e[r]:void 0,N.hasOwnProp(t,r)?t[r]:void 0,r);N.isUndefined(o)&&a!==s||(n[r]=o)}),n}var fi=e=>{let t=di({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=Jr.from(o),t.url=_r(li(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),N.isFormData(n)){if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(N.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(Dr.hasStandardBrowserEnv&&(N.isFunction(r)&&(r=r(t)),r===!0||r==null&&ai(t.url))){let e=i&&a&&oi.read(a);e&&o.set(i,e)}return t},pi=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=fi(e),i=r.data,a=Jr.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=Jr.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Qr(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new P(`Request aborted`,P.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new P(t&&t.message?t.message:`Network Error`,P.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||yr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new P(t,i.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&N.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),N.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=ni(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=ni(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new Zr(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=$r(r.url);if(_&&Dr.protocols.indexOf(_)===-1){n(new P(`Unsupported protocol `+_+`:`,P.ERR_BAD_REQUEST,e));return}h.send(i||null)})},mi=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof P?t:new Zr(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new P(`timeout of ${t}ms exceeded`,P.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>N.asap(o),s}},hi=function*(e,t){let n=e.byteLength;if(!t||n{let i=gi(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},yi=64*1024,{isFunction:bi}=N,xi=(({Request:e,Response:t})=>({Request:e,Response:t}))(N.global),{ReadableStream:Si,TextEncoder:Ci}=N.global,wi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ti=e=>{e=N.merge.call({skipUndefined:!0},xi,e);let{fetch:t,Request:n,Response:r}=e,i=t?bi(t):typeof fetch==`function`,a=bi(n),o=bi(r);if(!i)return!1;let s=i&&bi(Si),c=i&&(typeof Ci==`function`?(e=>t=>e.encode(t))(new Ci):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&wi(()=>{let e=!1,t=new n(Dr.origin,{body:new Si,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),u=o&&s&&wi(()=>N.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new P(`Response type '${e}' is not supported`,P.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if(N.isBlob(e))return e.size;if(N.isSpecCompliantForm(e))return(await new n(Dr.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(N.isArrayBufferView(e)||N.isArrayBuffer(e))return e.byteLength;if(N.isURLSearchParams(e)&&(e+=``),N.isString(e))return(await c(e)).byteLength},p=async(e,t)=>N.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:b}=fi(e),x=t||fetch;_=_?(_+``).toLowerCase():`text`;let S=mi([c,f&&f.toAbortSignal()],m),C=null,w=S&&S.unsubscribe&&(()=>{S.unsubscribe()}),T;try{if(g&&l&&o!==`get`&&o!==`head`&&(T=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if(N.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=ri(T,ni(ii(g)));s=vi(e.body,yi,t,n)}}N.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype;if(N.isFormData(s)){let e=v.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&v.delete(`content-type`)}let c={...b,signal:S,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};C=a&&new n(i,c);let f=await(a?x(C,b):x(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&w)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=N.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&ri(t,ni(ii(h),!0))||[];f=new r(vi(f.body,yi,n,()=>{i&&i(),w&&w()}),e)}_||=`text`;let E=await d[N.findKey(d,_)||`text`](f,e);return!m&&w&&w(),await new Promise((t,n)=>{Qr(t,n,{data:E,headers:Jr.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:C})})}catch(t){throw w&&w(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new P(`Network Error`,P.ERR_NETWORK,e,C,t&&t.response),{cause:t.cause||t}):P.from(t,t&&t.code,e,C,t&&t.response)}}},Ei=new Map,Di=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Ei;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Ti(t)),l=c;return c};Di();var Oi={http:null,xhr:pi,fetch:{get:Di}};N.forEach(Oi,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var ki=e=>`- ${e}`,Ai=e=>N.isFunction(e)||e===null||e===!1;function ji(e,t){e=N.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new P(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since : -`+e.map(ki).join(` -`):` `+ki(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Mi={getAdapter:ji,adapters:Oi};function Ni(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Zr(null,e)}function Pi(e){return Ni(e),e.headers=Jr.from(e.headers),e.data=Yr.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Mi.getAdapter(e.adapter||Pr.adapter,e)(e).then(function(t){return Ni(e),t.data=Yr.call(e,e.transformResponse,t),t.headers=Jr.from(t.headers),t},function(t){return Xr(t)||(Ni(e),t&&t.response&&(t.response.data=Yr.call(e,e.transformResponse,t.response),t.response.headers=Jr.from(t.response.headers))),Promise.reject(t)})}var Fi=`1.15.1`,Ii={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Ii[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Li={};Ii.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Fi+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new P(r(i,` has been removed`+(t?` in `+t:``)),P.ERR_DEPRECATED);return t&&!Li[i]&&(Li[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Ii.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ri(e,t,n){if(typeof e!=`object`)throw new P(`options must be an object`,P.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new P(`option `+a+` must be `+n,P.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new P(`Unknown option `+a,P.ERR_BAD_OPTION)}}var F={assertOptions:Ri,validators:Ii},zi=F.validators,Bi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new vr,response:new vr}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(` -`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(` -`),r=t===-1?-1:n.indexOf(` -`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=` -`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=di(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&F.assertOptions(n,{silentJSONParsing:zi.transitional(zi.boolean),forcedJSONParsing:zi.transitional(zi.boolean),clarifyTimeoutError:zi.transitional(zi.boolean),legacyInterceptorReqResOrdering:zi.transitional(zi.boolean)},!1),r!=null&&(N.isFunction(r)?t.paramsSerializer={serialize:r}:F.assertOptions(r,{encode:zi.function,serialize:zi.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),F.assertOptions(t,{baseUrl:zi.spelling(`baseURL`),withXsrfToken:zi.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&N.merge(i.common,i[t.method]);i&&N.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=Jr.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||yr;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Pi.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Zr(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Hi(e){return function(t){return e.apply(null,t)}}function Ui(e){return N.isObject(e)&&e.isAxiosError===!0}var Wi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Wi).forEach(([e,t])=>{Wi[t]=e});function Gi(e){let t=new Bi(e),n=Yt(Bi.prototype.request,t);return N.extend(n,Bi.prototype,t,{allOwnKeys:!0}),N.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Gi(di(e,t))},n}var Ki=Gi(Pr);Ki.Axios=Bi,Ki.CanceledError=Zr,Ki.CancelToken=Vi,Ki.isCancel=Xr,Ki.VERSION=Fi,Ki.toFormData=fr,Ki.AxiosError=P,Ki.Cancel=Ki.CanceledError,Ki.all=function(e){return Promise.all(e)},Ki.spread=Hi,Ki.isAxiosError=Ui,Ki.mergeConfig=di,Ki.AxiosHeaders=Jr,Ki.formToJSON=e=>jr(N.isHTMLForm(e)?new FormData(e):e),Ki.getAdapter=Mi.getAdapter,Ki.HttpStatusCode=Wi,Ki.default=Ki;var I=Ki.create({baseURL:`/api/v1`,headers:{"Content-Type":`application/json`},withCredentials:!0});I.interceptors.request.use(e=>{let t=localStorage.getItem(`access_token`);return t&&(e.headers.Authorization=`Bearer ${t}`),e}),I.interceptors.response.use(e=>e,e=>(e.response?.status===401&&localStorage.getItem(`access_token`)&&(localStorage.removeItem(`access_token`),window.location.href=`/app/login`),Promise.reject(e)));var qi=Jt(e=>({user:null,token:localStorage.getItem(`access_token`),isAuthenticated:!!localStorage.getItem(`access_token`),isLoading:!1,error:null,login:async(t,n)=>{e({isLoading:!0,error:null});try{let r=new URLSearchParams;r.append(`username`,t),r.append(`password`,n);let{access_token:i}=(await I.post(`/auth/login`,r,{headers:{"Content-Type":`application/x-www-form-urlencoded`}})).data;localStorage.setItem(`access_token`,i),e({token:i,isAuthenticated:!0,isLoading:!1}),e({user:(await I.get(`/auth/me`)).data})}catch(t){throw e({error:t.response?.data?.detail||`Login failed`,isLoading:!1}),t}},register:async(t,n,r,i)=>{e({isLoading:!0,error:null});try{await I.post(`/auth/register`,{email:t,password:n,full_name:r,company:i||null}),e({isLoading:!1})}catch(t){throw e({error:t.response?.data?.detail||`Registration failed`,isLoading:!1}),t}},logout:()=>{localStorage.removeItem(`access_token`),e({user:null,token:null,isAuthenticated:!1})},fetchUser:async()=>{try{e({user:(await I.get(`/auth/me`)).data,isAuthenticated:!0})}catch{localStorage.removeItem(`access_token`),e({user:null,token:null,isAuthenticated:!1})}},clearError:()=>e({error:null})})),Ji=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),L=o(((e,t)=>{t.exports=Ji()}))();function Yi({children:e}){let t=qi(e=>e.isAuthenticated),n=We();return t?(0,L.jsx)(L.Fragment,{children:e}):(0,L.jsx)(_t,{to:`/login`,state:{from:n},replace:!0})}var Xi=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Zi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Qi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),$i=e=>{let t=Qi(e);return t.charAt(0).toUpperCase()+t.slice(1)},ea={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ta=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},na=(0,v.createContext)({}),ra=()=>(0,v.useContext)(na),ia=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ra()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...ea,width:t??l??ea.width,height:t??l??ea.height,stroke:e??f,strokeWidth:m,className:Xi(`lucide`,p,i),...!a&&!ta(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),R=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(ia,{ref:i,iconNode:t,className:Xi(`lucide-${Zi($i(e))}`,`lucide-${e}`,n),...r}));return n.displayName=$i(e),n},aa=R(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),oa=R(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),sa=R(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),ca=R(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),la=R(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),ua=R(`briefcase-medical`,[[`path`,{d:`M12 11v4`,key:`a6ujw6`}],[`path`,{d:`M14 13h-4`,key:`1pl8zg`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M18 6v14`,key:`1mu4gy`}],[`path`,{d:`M6 6v14`,key:`1s15cj`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),da=R(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),fa=R(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),pa=R(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ma=R(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),ha=R(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ga=R(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),_a=R(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),va=R(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),ya=R(`file-clock`,[[`path`,{d:`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85`,key:`ryk6xj`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 14v2.2l1.6 1`,key:`6m4bie`}],[`circle`,{cx:`8`,cy:`16`,r:`6`,key:`10v15b`}]]),ba=R(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),xa=R(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Sa=R(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ca=R(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),wa=R(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Ta=R(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Ea=R(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Da=R(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Oa=R(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ka=R(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Aa=R(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),ja=R(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ma=R(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Na=R(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Pa=R(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Fa=R(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ia=R(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),La=R(`swords`,[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`,key:`1hfsw2`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`,key:`1vrmhu`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`,key:`1bron3`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`,key:`13pww6`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`,key:`hbey2j`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`,key:`1hf58s`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`,key:`pidxm4`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`,key:`1pehsh`}]]),Ra=R(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),za=R(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ba=R(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Va=R(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),Ha=R(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Ua=R(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Wa(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(0,L.jsxs)(Lt,{to:e.to,end:e.to===`/`,className:({isActive:e})=>z(`flex shrink-0 items-center gap-3 px-3 py-2.5 text-sm font-medium transition-colors`,e?`bg-primary-600/20 text-primary-300`:`text-surface-400 hover:bg-surface-800 hover:text-surface-200`),children:[(0,L.jsx)(e.icon,{className:`w-5 h-5`}),e.label]},e.to))}),(0,L.jsxs)(`div`,{className:`hidden border-t border-surface-800 p-4 md:block`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2 mb-2`,children:[(0,L.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-primary-600 flex items-center justify-center text-white text-sm font-medium`,children:e?.full_name?.[0]||e?.email?.[0]||`?`}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-surface-200 truncate`,children:e?.full_name||e?.email}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500 truncate`,children:e?.role})]})]}),(0,L.jsxs)(`button`,{onClick:t,"aria-label":`Sign out of your account`,className:`flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium text-surface-400 hover:bg-surface-800 hover:text-danger w-full transition-colors`,children:[(0,L.jsx)(Ta,{className:`w-5 h-5`}),`Sign Out`]})]})]})}function qa(){return(0,L.jsxs)(`div`,{className:`min-h-screen bg-surface-950`,children:[(0,L.jsx)(Ka,{}),(0,L.jsx)(`main`,{className:`p-4 md:ml-64 md:p-8`,children:(0,L.jsx)(vt,{})})]})}function Ja(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),{login:i,isLoading:a,error:o,clearError:s}=qi(),c=Ke();return(0,L.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gradient-to-br from-surface-950 via-surface-900 to-primary-900/20 px-4`,children:(0,L.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,L.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,L.jsx)(Ia,{className:`w-12 h-12 text-primary-400 mx-auto mb-4`}),(0,L.jsx)(`h1`,{className:`text-3xl font-bold text-white`,children:`Welcome back`}),(0,L.jsx)(`p`,{className:`text-surface-400 mt-2`,children:`Sign in to OneAlert`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 backdrop-blur border border-surface-700 rounded-2xl p-8`,children:[o&&(0,L.jsxs)(`div`,{className:`mb-4 p-3 rounded-lg bg-danger/10 border border-danger/20 text-danger text-sm`,children:[o,(0,L.jsx)(`button`,{onClick:s,className:`float-right text-danger/70 hover:text-danger`,children:`×`})]}),(0,L.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();try{await i(e,n),c(`/`)}catch{}},className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Email`}),(0,L.jsx)(`input`,{type:`email`,value:e,onChange:e=>t(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`you@company.com`,required:!0})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Password`}),(0,L.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Enter your password`,required:!0})]}),(0,L.jsx)(`button`,{type:`submit`,disabled:a,className:`w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white font-medium rounded-lg transition-colors`,children:a?`Signing in...`:`Sign In`})]}),(0,L.jsxs)(`div`,{className:`mt-6`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,L.jsx)(`div`,{className:`w-full border-t border-surface-600`})}),(0,L.jsx)(`div`,{className:`relative flex justify-center text-sm`,children:(0,L.jsx)(`span`,{className:`px-2 bg-surface-800/50 text-surface-400`,children:`or`})})]}),(0,L.jsxs)(`button`,{onClick:()=>{window.location.href=`/api/v1/auth/github/login`},className:`mt-4 w-full py-2.5 px-4 bg-surface-700 hover:bg-surface-600 text-white font-medium rounded-lg transition-colors flex items-center justify-center gap-2`,children:[(0,L.jsx)(`svg`,{className:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,L.jsx)(`path`,{d:`M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z`})}),`Continue with GitHub`]})]}),(0,L.jsxs)(`p`,{className:`mt-6 text-center text-sm text-surface-400`,children:[`Don't have an account?`,` `,(0,L.jsx)(It,{to:`/register`,className:`text-primary-400 hover:text-primary-300 font-medium`,children:`Sign up`})]})]})]})})}function Ya(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),{register:c,isLoading:l,error:u,clearError:d}=qi(),f=Ke();return(0,L.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gradient-to-br from-surface-950 via-surface-900 to-primary-900/20 px-4`,children:(0,L.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,L.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,L.jsx)(Ia,{className:`w-12 h-12 text-primary-400 mx-auto mb-4`}),(0,L.jsx)(`h1`,{className:`text-3xl font-bold text-white`,children:`Create account`}),(0,L.jsx)(`p`,{className:`text-surface-400 mt-2`,children:`Start monitoring your OT assets`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 backdrop-blur border border-surface-700 rounded-2xl p-8`,children:[u&&(0,L.jsxs)(`div`,{className:`mb-4 p-3 rounded-lg bg-danger/10 border border-danger/20 text-danger text-sm`,children:[u,(0,L.jsx)(`button`,{onClick:d,className:`float-right text-danger/70 hover:text-danger`,children:`×`})]}),(0,L.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();try{await c(e,n,i,o),f(`/login`)}catch{}},className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Full Name`}),(0,L.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Jane Doe`,required:!0})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Email`}),(0,L.jsx)(`input`,{type:`email`,value:e,onChange:e=>t(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`you@company.com`,required:!0})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Company`}),(0,L.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Acme Manufacturing`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1.5`,children:`Password`}),(0,L.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),className:`w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent`,placeholder:`Minimum 8 characters`,minLength:8,required:!0})]}),(0,L.jsx)(`button`,{type:`submit`,disabled:l,className:`w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white font-medium rounded-lg transition-colors`,children:l?`Creating account...`:`Create Account`})]}),(0,L.jsxs)(`p`,{className:`mt-6 text-center text-sm text-surface-400`,children:[`Already have an account?`,` `,(0,L.jsx)(It,{to:`/login`,className:`text-primary-400 hover:text-primary-300 font-medium`,children:`Sign in`})]})]})]})})}var Xa={info:`text-info bg-info/10 border-info/20`,danger:`text-danger bg-danger/10 border-danger/20`,success:`text-success bg-success/10 border-success/20`,warning:`text-warning bg-warning/10 border-warning/20`};function Za({title:e,value:t,icon:n,color:r}){return(0,L.jsx)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-5`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm text-surface-400`,children:e}),(0,L.jsx)(`p`,{className:`text-3xl font-bold text-white mt-1`,children:t})]}),(0,L.jsx)(`div`,{className:z(`p-3 rounded-lg border`,Xa[r]),children:(0,L.jsx)(n,{className:`w-6 h-6`})})]})})}var Qa=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function $a(e){return typeof e==`string`?Qa.includes(e):!1}var eo=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function to(e){return typeof e==`string`?eo.has(e):!1}function no(e){return typeof e==`string`&&e.startsWith(`data-`)}function ro(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(to(n)||no(n))&&(t[n]=e[n]);return t}function io(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return ro(t)}return typeof e==`object`&&!Array.isArray(e)?ro(e):null}function ao(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(to(n)||no(n)||$a(n))&&(t[n]=e[n]);return t}var oo=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=co(e,oo),d=a||{width:r,height:i,x:0,y:0},f=z(`recharts-surface`,o);return v.createElement(`svg`,so({},ao(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),v.createElement(`title`,null,c),v.createElement(`desc`,null,l),n)}),fo=[`children`,`className`];function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,i=B(e,fo),a=z(`recharts-layer`,r);return v.createElement(`g`,po({className:a},ao(i),{ref:t}),n)}),ho=(0,v.createContext)(null),go=()=>(0,v.useContext)(ho);function _o(e){return function(){return e}}var vo=Math.cos,yo=Math.sin,bo=Math.sqrt,xo=Math.PI;xo/2;var So=2*xo,Co=Math.PI,wo=2*Co,To=1e-6,Eo=wo-To;function Do(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return Do;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tTo)if(!(Math.abs(u*s-c*l)>To)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Co-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>To&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>To||Math.abs(this._y1-l)>To)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%wo+wo),d>Eo?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>To&&this._append`A${n},${n},0,${+(d>=Co)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Ao(){return new ko}Ao.prototype=ko.prototype;function jo(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new ko(t)}Array.prototype.slice;function Mo(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function No(e){this._context=e}No.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Po(e){return new No(e)}function Fo(e){return e[0]}function Io(e){return e[1]}function Lo(e,t){var n=_o(!0),r=null,i=Po,a=null,o=jo(s);e=typeof e==`function`?e:e===void 0?Fo:_o(e),t=typeof t==`function`?t:t===void 0?Io:_o(t);function s(s){var c,l=(s=Mo(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Lo().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:_o(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:_o(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:_o(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:_o(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:_o(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:_o(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:_o(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var zo=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function Bo(e){return new zo(e,!0)}function Vo(e){return new zo(e,!1)}var Ho={draw(e,t){let n=bo(t/xo);e.moveTo(n,0),e.arc(0,0,n,0,So)}},Uo={draw(e,t){let n=bo(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Wo=bo(1/3),Go=Wo*2,Ko={draw(e,t){let n=bo(t/Go),r=n*Wo;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},qo={draw(e,t){let n=bo(t),r=-n/2;e.rect(r,r,n,n)}},Jo=.8908130915292852,Yo=yo(xo/10)/yo(7*xo/10),Xo=yo(So/10)*Yo,Zo=-vo(So/10)*Yo,Qo={draw(e,t){let n=bo(t*Jo),r=Xo*n,i=Zo*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=So*t/5,o=vo(a),s=yo(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},$o=bo(3),es={draw(e,t){let n=-bo(t/($o*3));e.moveTo(0,n*2),e.lineTo(-$o*n,-n),e.lineTo($o*n,-n),e.closePath()}},ts=-.5,ns=bo(3)/2,rs=1/bo(12),is=(rs/2+1)*3,as={draw(e,t){let n=bo(t/is),r=n/2,i=n*rs,a=r,o=n*rs+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(ts*r-ns*i,ns*r+ts*i),e.lineTo(ts*a-ns*o,ns*a+ts*o),e.lineTo(ts*s-ns*c,ns*s+ts*c),e.lineTo(ts*r+ns*i,ts*i-ns*r),e.lineTo(ts*a+ns*o,ts*o-ns*a),e.lineTo(ts*s+ns*c,ts*c-ns*s),e.closePath()}};function os(e,t){let n=null,r=jo(i);e=typeof e==`function`?e:_o(e||Ho),t=typeof t==`function`?t:_o(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:_o(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:_o(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function ss(){}function cs(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ls(e){this._context=e}ls.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:cs(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:cs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function us(e){return new ls(e)}function ds(e){this._context=e}ds.prototype={areaStart:ss,areaEnd:ss,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:cs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fs(e){return new ds(e)}function ps(e){this._context=e}ps.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:cs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ms(e){return new ps(e)}function hs(e){this._context=e}hs.prototype={areaStart:ss,areaEnd:ss,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function gs(e){return new hs(e)}function _s(e){return e<0?-1:1}function vs(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(_s(a)+_s(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ys(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bs(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function xs(e){this._context=e}xs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:bs(this,this._t0,ys(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,bs(this,ys(this,n=vs(this,e,t)),n);break;default:bs(this,this._t0,n=vs(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ss(e){this._context=new Cs(e)}(Ss.prototype=Object.create(xs.prototype)).point=function(e,t){xs.prototype.point.call(this,t,e)};function Cs(e){this._context=e}Cs.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function ws(e){return new xs(e)}function Ts(e){return new Ss(e)}function Es(e){this._context=e}Es.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Ds(e),i=Ds(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function As(e){return new ks(e,.5)}function js(e){return new ks(e,0)}function Ms(e){return new ks(e,1)}function Ns(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n=0;)n[t]=t;return n}function Fs(e,t){return e[t]}function Is(e){let t=[];return t.key=e,t}function Ls(){var e=_o([]),t=Ps,n=Ns,r=Fs;function i(i){var a=Array.from(e.apply(this,arguments),Is),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),Hs=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),Us=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),Ws=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),Gs=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Ws(),n=Us();function r(e){if(Array.isArray(e))return e.map(n.toKey);if(typeof e==`symbol`)return[e];e=t.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Vs(),n=Hs(),r=Us(),i=Gs();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e{t.exports=Ks().get})),Js=4;function Ys(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Js),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function Xs(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Ys(i)+n},``)}var Zs=l(qs()),Qs=e=>e===0?0:e>0?1:-1,$s=e=>typeof e==`number`&&e!=+e,ec=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,H=e=>(typeof e==`number`||e instanceof Number)&&!$s(e),tc=e=>H(e)||typeof e==`string`,nc=0,rc=e=>{var t=++nc;return`${e||``}${t}`},U=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!H(e)&&typeof e!=`string`)return n;var i;if(ec(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return $s(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},ic=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;re&&(typeof t==`function`?t(e):(0,Zs.default)(e,t))===n)}var sc=e=>e==null,cc=e=>sc(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function lc(e){return e!=null}function uc(){}var dc=[`type`,`size`,`sizeType`];function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;tbc[`symbol${cc(e)}`]||Ho,Cc=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*xc;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},wc=(e,t)=>{bc[`symbol${cc(e)}`]=t},Tc=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=mc(mc({},vc(e,dc)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=Sc(a),t=os().type(e).size(Cc(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=ao(i);return H(c)&&H(l)&&H(n)?v.createElement(`path`,fc({},u,{className:z(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};Tc.registerSymbol=wc;var Ec=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Dc=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,v.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{$a(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},Oc=(e,t,n)=>r=>(e(t,n,r),null),kc=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];$a(i)&&typeof a==`function`&&(r||={},r[i]=Oc(a,t,n))}),r};function Ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jc(e){for(var t=1;t(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Ic(){return Ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var d=t.formatter||i,f=z({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?Rc({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return v.createElement(`li`,Ic({className:f,style:l,key:`legend-item-${r}`},kc(e,t,r)),v.createElement(uo,{width:n,height:n,viewBox:c,style:u,"aria-label":`${t.value} legend icon`},v.createElement(Gc,{data:t,iconType:o,inactiveColor:a})),v.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var qc=e=>{var t=Fc(e,Uc),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return v.createElement(`ul`,{className:`recharts-default-legend`,style:a},v.createElement(Kc,Ic({},t,{payload:n})))},Jc=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){let n=new Map;for(let r=0;r{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),Xc=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e}e.identity=t})),Zc=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),Qc=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Zc();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),$c=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),el=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Qc(),n=$c();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),tl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Ks();function n(e){return function(n){return t.get(n,e)}}e.property=n})),nl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),rl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),il=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),al=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=nl(),n=rl(),r=il();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,n,i,s){if(n===e)return!0;switch(typeof n){case`object`:return o(e,n,i,s);case`function`:return Object.keys(n).length>0?a(e,{...n},i,s):r.isEqualsSameValueZero(e,n);default:return t.isObject(e)?typeof n==`string`?n===``:!0:r.isEqualsSameValueZero(e,n)}}function o(e,t,r,i){if(t==null)return!0;if(Array.isArray(t))return c(e,t,r,i);if(t instanceof Map)return s(e,t,r,i);if(t instanceof Set)return l(e,t,r,i);let a=Object.keys(t);if(e==null||n.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let o=0;o{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=al();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),sl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),cl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),ll=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),ul=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),dl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=sl(),n=cl(),r=ll(),i=rl(),a=ul();function o(e,t){return s(e,void 0,e,new Map,t)}function s(e,t,n,r=new Map,o=void 0){let u=o?.(e,t,n,r);if(u!==void 0)return u;if(i.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let i=0;i{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=dl();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),pl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ol(),n=fl();function r(e){return e=n.cloneDeep(e),n=>t.isMatch(n,e)}e.matches=r})),ml=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=dl(),n=cl(),r=ll();function i(e,i){return t.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(n.getTag(e)===r.objectTag&&typeof e.constructor!=`function`){let n={};return c.set(e,n),t.copyProperties(n,e,s,c),n}switch(Object.prototype.toString.call(e)){case r.numberTag:case r.stringTag:case r.booleanTag:{let n=new e.constructor(e?.valueOf());return t.copyProperties(n,e),n}case r.argumentsTag:{let n={};return t.copyProperties(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}e.cloneDeepWith=i})),hl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ml();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),gl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cl();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),vl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Hs(),n=gl(),r=_l(),i=Gs();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?i.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ol(),n=Us(),r=hl(),i=Ks(),a=vl();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=n.toKey(e);break}return o=r.cloneDeep(o),function(n){let r=i.get(n,e);return r===void 0?a.has(n,e):o===void 0?r===void 0:t.isMatch(r,o)}}e.matchesProperty=o})),bl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Xc(),n=tl(),r=pl(),i=yl();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),xl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Jc(),n=Yc(),r=Xc(),i=el(),a=bl();function o(e,o=r.identity){return i.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(a.iteratee(o),1)):[]}e.uniqBy=o})),Sl=l(o(((e,t)=>{t.exports=xl().uniqBy}))());function Cl(e,t,n){return t===!0?(0,Sl.default)(e,n):typeof t==`function`?(0,Sl.default)(e,t):e}var wl=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Tl=o(((e,t)=>{t.exports=wl()})),El=o((e=>{var t=d(),n=Tl();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Dl=o(((e,t)=>{t.exports=El()})),Ol=(0,v.createContext)(null),kl=Dl(),Al=e=>e,W=()=>{var e=(0,v.useContext)(Ol);return e?e.store.dispatch:Al},jl=()=>{},Ml=()=>jl,Nl=(e,t)=>e===t;function G(e){var t=(0,v.useContext)(Ol),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:jl,[t,e]);return(0,kl.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Ml,t?t.store.getState:jl,t?t.store.getState:jl,n,Nl)}function Pl(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Fl(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Il(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Ll=e=>Array.isArray(e)?e:[e];function Rl(e){let t=Array.isArray(e[0])?e[0]:e;return Il(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function zl(e,t){let n=[],{length:r}=e;for(let i=0;i{n=Hl(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Wl(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Pl(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Ul,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Ll(c),p=Ll(u),m=Rl(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=zl(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var J=Wl(Ul),Gl=Object.assign((e,t=J)=>{Fl(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Gl}),Kl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(en)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),ql=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),Jl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ql(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),Yl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Kl(),n=Jl(),r=Gs();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;et==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||n.isKey(e)?e:{key:e,path:r.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,n)=>{for(let r=0;re.original)}e.orderBy=i})),Xl=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=gl(),n=Qc(),r=nl(),i=il();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&t.isIndex(a)&&a{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Yl(),n=Xl(),r=Zl();function i(e,...i){let a=i.length;return a>1&&r.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&r.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),t.orderBy(e,n.flatten(i),[`asc`])}e.sortBy=i})),$l=l(o(((e,t)=>{t.exports=Ql().sortBy}))()),eu=e=>e.legend.settings,tu=e=>e.legend.size,nu=J([e=>e.legend.payload,eu],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?(0,$l.default)(r,n):r});function ru(){return G(nu)}var iu=1;function au(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,v.useState)({height:0,left:0,top:0,width:0});return[t,(0,v.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>iu||Math.abs(i.left-t.left)>iu||Math.abs(i.top-t.top)>iu||Math.abs(i.width-t.width)>iu)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function Y(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ou=typeof Symbol==`function`&&Symbol.observable||`@@observable`,su=()=>Math.random().toString(36).substring(7).split(``).join(`.`),cu={INIT:`@@redux/INIT${su()}`,REPLACE:`@@redux/REPLACE${su()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${su()}`};function lu(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function uu(e,t,n){if(typeof e!=`function`)throw Error(Y(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Y(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Y(1));return n(uu)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Y(3));return i}function d(e){if(typeof e!=`function`)throw Error(Y(4));if(c)throw Error(Y(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Y(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!lu(e))throw Error(Y(7));if(e.type===void 0)throw Error(Y(8));if(typeof e.type!=`string`)throw Error(Y(17));if(c)throw Error(Y(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Y(10));r=e,f({type:cu.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Y(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[ou](){return this}}}return f({type:cu.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[ou]:m}}function du(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:cu.INIT})===void 0)throw Error(Y(12));if(n(void 0,{type:cu.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Y(13))})}function fu(e){let t=Object.keys(e),n={};for(let r=0;re:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function mu(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Y(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=pu(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function hu(e){return lu(e)&&`type`in e&&typeof e.type==`string`}var gu=Symbol.for(`immer-nothing`),_u=Symbol.for(`immer-draftable`),vu=Symbol.for(`immer-state`);function yu(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var bu=Object,xu=bu.getPrototypeOf,Su=`constructor`,Cu=`prototype`,wu=`configurable`,Tu=`enumerable`,Eu=`writable`,Du=`value`,Ou=e=>!!e&&!!e[vu];function ku(e){return e?Mu(e)||zu(e)||!!e[_u]||!!e[Su]?.[_u]||Bu(e)||Vu(e):!1}var Au=bu[Cu][Su].toString(),ju=new WeakMap;function Mu(e){if(!e||!Hu(e))return!1;let t=xu(e);if(t===null||t===bu[Cu])return!0;let n=bu.hasOwnProperty.call(t,Su)&&t[Su];if(n===Object)return!0;if(!Uu(n))return!1;let r=ju.get(n);return r===void 0&&(r=Function.toString.call(n),ju.set(n,r)),r===Au}function Nu(e,t,n=!0){Pu(e)===0?(n?Reflect.ownKeys(e):bu.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Pu(e){let t=e[vu];return t?t.type_:zu(e)?1:Bu(e)?2:Vu(e)?3:0}var Fu=(e,t,n=Pu(e))=>n===2?e.has(t):bu[Cu].hasOwnProperty.call(e,t),Iu=(e,t,n=Pu(e))=>n===2?e.get(t):e[t],Lu=(e,t,n,r=Pu(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Ru(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var zu=Array.isArray,Bu=e=>e instanceof Map,Vu=e=>e instanceof Set,Hu=e=>typeof e==`object`,Uu=e=>typeof e==`function`,Wu=e=>typeof e==`boolean`;function Gu(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var X=e=>e.copy_||e.base_,Ku=e=>e.modified_?e.copy_:e.base_;function qu(e,t){if(Bu(e))return new Map(e);if(Vu(e))return new Set(e);if(zu(e))return Array[Cu].slice.call(e);let n=Mu(e);if(t===!0||t===`class_only`&&!n){let t=bu.getOwnPropertyDescriptors(e);delete t[vu];let n=Reflect.ownKeys(t);for(let r=0;r1&&bu.defineProperties(e,{set:Xu,add:Xu,clear:Xu,delete:Xu}),bu.freeze(e),t&&Nu(e,(e,t)=>{Ju(t,!0)},!1),e)}function Yu(){yu(2)}var Xu={[Du]:Yu};function Zu(e){return e===null||!Hu(e)?!0:bu.isFrozen(e)}var Qu=`MapSet`,$u=`Patches`,ed=`ArrayMethods`,td={};function nd(e){let t=td[e];return t||yu(0,e),t}var rd=e=>!!td[e],id,ad=()=>id,od=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:rd(Qu)?nd(Qu):void 0,arrayMethodsPlugin_:rd(ed)?nd(ed):void 0});function sd(e,t){t&&(e.patchPlugin_=nd($u),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function cd(e){ld(e),e.drafts_.forEach(dd),e.drafts_=null}function ld(e){e===id&&(id=e.parent_)}var ud=e=>id=od(id,e);function dd(e){let t=e[vu];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fd(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[vu].modified_&&(cd(t),yu(4)),ku(e)&&(e=pd(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[vu].base_,e,t)}else e=pd(t,n);return md(t,e,!0),cd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===gu?void 0:e}function pd(e,t){if(Zu(t))return t;let n=t[vu];if(!n)return xd(t,e.handledSet_,e);if(!gd(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);bd(n,e)}return n.copy_}function md(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ju(t,n)}function hd(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gd=(e,t)=>e.scope_===t,_d=[];function vd(e,t,n,r){let i=X(e),a=e.type_;if(r!==void 0&&Iu(i,r,a)===t){Lu(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Nu(i,(e,n)=>{if(Ou(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??_d;for(let e of o)Lu(i,e,n,a)}function yd(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!gd(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Ku(i);vd(e,i.draft_??i,a,n),bd(i,r)})}function bd(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}hd(e)}}function Z(e,t,n){let{scope_:r}=e;if(Ou(n)){let i=n[vu];gd(i,r)&&i.callbacks_.push(function(){kd(e),vd(e,n,Ku(i),t)})}else ku(n)&&e.callbacks_.push(function(){let i=X(e);e.type_===3?i.has(n)&&xd(n,r.handledSet_,r):Iu(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&xd(Iu(e.copy_,t,e.type_),r.handledSet_,r)})}function xd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ou(e)||t.has(e)||!ku(e)||Zu(e)?e:(t.add(e),Nu(e,(r,i)=>{if(Ou(i)){let t=i[vu];gd(t,n)&&(Lu(e,r,Ku(t),e.type_),hd(t))}else ku(i)&&xd(i,t,n)}),e)}function Sd(e,t){let n=zu(e),r={type_:+!!n,scope_:t?t.scope_:ad(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Cd;n&&(i=[r],a=wd);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Cd={get(e,t){if(t===vu)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=X(e);if(!Fu(i,t,e.type_))return Ed(e,i,t);let a=i[t];if(e.finalized_||!ku(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Gu(t))return a;if(a===Td(e.base_,t)){kd(e);let n=e.type_===1?+t:t,r=jd(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in X(e)},ownKeys(e){return Reflect.ownKeys(X(e))},set(e,t,n){let r=Dd(X(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Td(X(e),t),i=r?.[vu];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Ru(n,r)&&(n!==void 0||Fu(e.base_,t,e.type_)))return!0;kd(e),Od(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),Z(e,t,n),!0)},deleteProperty(e,t){return kd(e),Td(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Od(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=X(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Eu]:!0,[wu]:e.type_!==1||t!==`length`,[Tu]:r[Tu],[Du]:n[t]}},defineProperty(){yu(11)},getPrototypeOf(e){return xu(e.base_)},setPrototypeOf(){yu(12)}},wd={};for(let e in Cd){let t=Cd[e];wd[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}wd.deleteProperty=function(e,t){return wd.set.call(this,e,t,void 0)},wd.set=function(e,t,n){return Cd.set.call(this,e[0],t,n,e[0])};function Td(e,t){let n=e[vu];return(n?X(n):e)[t]}function Ed(e,t,n){let r=Dd(t,n);return r?Du in r?r[Du]:r.get?.call(e.draft_):void 0}function Dd(e,t){if(!(t in e))return;let n=xu(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=xu(n)}}function Od(e){e.modified_||(e.modified_=!0,e.parent_&&Od(e.parent_))}function kd(e){e.copy_||=(e.assigned_=new Map,qu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ad=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Uu(e)&&!Uu(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Uu(t)||yu(6),n!==void 0&&!Uu(n)&&yu(7);let r;if(ku(e)){let i=ud(this),a=jd(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?cd(i):ld(i)}return sd(i,n),fd(r,i)}else if(!e||!Hu(e)){if(r=t(e),r===void 0&&(r=e),r===gu&&(r=void 0),this.autoFreeze_&&Ju(r,!0),n){let t=[],i=[];nd($u).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else yu(1,e)},this.produceWithPatches=(e,t)=>{if(Uu(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Wu(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Wu(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Wu(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ku(e)||yu(8),Ou(e)&&(e=Md(e));let t=ud(this),n=jd(t,e,void 0);return n[vu].isManual_=!0,ld(t),n}finishDraft(e,t){let n=e&&e[vu];(!n||!n.isManual_)&&yu(9);let{scope_:r}=n;return sd(r,t),fd(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=nd($u).applyPatches_;return Ou(e)?r(e,t):this.produce(e,e=>r(e,t))}};function jd(e,t,n,r){let[i,a]=Bu(t)?nd(Qu).proxyMap_(t,n):Vu(t)?nd(Qu).proxySet_(t,n):Sd(t,n);return(n?.scope_??ad()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?yd(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Md(e){return Ou(e)||yu(10,e),Nd(e)}function Nd(e){if(!ku(e)||Zu(e))return e;let t=e[vu],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=qu(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=qu(e,!0);return Nu(n,(e,t)=>{Lu(n,e,Nd(t))},r),t&&(t.finalized_=!1),n}var Pd=new Ad().produce;function Fd(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var Id=Fd(),Ld=Fd,Rd=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?pu:pu.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function zd(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Jf(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>hu(t)&&t.type===e,n}var Bd=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Vd(e){return ku(e)?Pd(e,()=>{}):e}function Hd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ud(e){return typeof e==`boolean`}var Wd=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Bd;return t&&(Ud(t)?a.push(Id):a.push(Ld(t.extraArgument))),a},Gd=`RTK_autoBatch`,Kd=()=>e=>({payload:e,meta:{[Gd]:!0}}),qd=e=>t=>{setTimeout(t,e)},Jd=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame:qd(10):e.type===`callback`?e.queueNotification:qd(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Gd],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Yd=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Bd(e);return n&&r.push(Jd(typeof n==`object`?n:void 0)),r};function Xd(e){let t=Wd(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(lu(n))c=fu(n);else throw Error(Jf(1));let l;l=typeof r==`function`?r(t):t();let u=pu;i&&(u=Rd({trace:!1,...typeof i==`object`&&i}));let d=Yd(mu(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return uu(c,o,p)}function Zd(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Jf(28));if(r in t)throw Error(Jf(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Qd(e){return typeof e==`function`}function $d(e,t){let[n,r,i]=Zd(t),a;if(Qd(e))a=()=>Vd(e());else{let t=Vd(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(Ou(e)){let r=n(e,t);return r===void 0?e:r}else if(ku(e))return Pd(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var ef=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,tf=(e=21)=>{let t=``,n=e;for(;n--;)t+=ef[Math.random()*64|0];return t},nf=Symbol.for(`rtk-slice-createasyncthunk`);function rf(e,t){return`${e}/${t}`}function af({creators:e}={}){let t=e?.asyncThunk?.[nf];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Jf(11));let i=(typeof e.reducers==`function`?e.reducers(cf()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Jf(12));if(n in o.sliceCaseReducersByType)throw Error(Jf(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:rf(n,r),createNotation:typeof e.reducers==`function`};uf(a)?ff(o,a,s,t):lf(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?Zd(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return $d(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Hd(d,r,m)),i}function i(t=l){return Hd(Hd(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=of(a,t,()=>Hd(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function of(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var sf=af();function cf(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function lf({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!df(r))throw Error(Jf(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?zd(e,o):zd(e))}function uf(e){return e._reducerDefinitionType===`asyncThunk`}function df(e){return e._reducerDefinitionType===`reducerWithPrepare`}function ff({type:e,reducerName:t},n,r,i){if(!i)throw Error(Jf(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||pf,pending:s||pf,rejected:c||pf,settled:l||pf})}function pf(){}var mf=`task`,hf=`listener`,gf=`completed`,_f=`cancelled`,vf=`task-${_f}`,yf=`task-${gf}`,bf=`${hf}-${_f}`,xf=`${hf}-${gf}`,Sf=class{constructor(e){this.code=e,this.message=`${mf} ${_f} (reason: ${e})`}name=`TaskAbortError`;message},Cf=(e,t)=>{if(typeof e!=`function`)throw TypeError(Jf(32))},wf=()=>{},Tf=(e,t=wf)=>(e.catch(t),e),Ef=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),Df=e=>{if(e.aborted)throw new Sf(e.reason)};function Of(e,t){let n=wf;return new Promise((r,i)=>{let a=()=>i(new Sf(e.reason));if(e.aborted){a();return}n=Ef(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=wf})}var kf=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof Sf?`cancelled`:`rejected`,error:e}}finally{t?.()}},Af=e=>t=>Tf(Of(e,t).then(t=>(Df(e),t))),jf=e=>{let t=Af(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:Mf}=Object,Nf={},Pf=`listenerMiddleware`,Ff=(e,t)=>{let n=t=>Ef(e,()=>t.abort(e.reason));return(r,i)=>{Cf(r,`taskExecutor`);let a=new AbortController;n(a);let o=kf(async()=>{Df(e),Df(a.signal);let t=await r({pause:Af(a.signal),delay:jf(a.signal),signal:a.signal});return Df(a.signal),t},()=>a.abort(yf));return i?.autoJoin&&t.push(o.catch(wf)),{result:Af(e)(o),cancel(){a.abort(vf)}}}},If=(e,t)=>{let n=async(n,r)=>{Df(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await Of(t,Promise.race(a));return Df(t),e}finally{i()}};return(e,t)=>Tf(n(e,t))},Lf=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=zd(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Jf(21));return Cf(a,`options.listener`),{predicate:i,type:t,effect:a}},Rf=Mf(e=>{let{type:t,predicate:n,effect:r}=Lf(e);return{id:tf(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Jf(22))}}},{withTypes:()=>Rf}),zf=(e,t)=>{let{type:n,effect:r,predicate:i}=Lf(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},Bf=e=>{e.pending.forEach(e=>{e.abort(bf)})},Vf=(e,t)=>()=>{for(let e of t.keys())Bf(e);e.clear()},Hf=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},Uf=Mf(zd(`${Pf}/add`),{withTypes:()=>Uf}),Wf=zd(`${Pf}/removeAll`),Gf=Mf(zd(`${Pf}/remove`),{withTypes:()=>Gf}),Kf=(...e)=>{console.error(`${Pf}/error`,...e)},qf=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=Kf}=e;Cf(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Bf(e)}),c=e=>s(zf(t,e)??Rf(e));Mf(c,{withTypes:()=>c});let l=e=>{let n=zf(t,e);return n&&(n.unsubscribe(),e.cancelActive&&Bf(n)),!!n};Mf(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=If(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,Mf({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:jf(u.signal),pause:Af(u.signal),extra:a,signal:u.signal,fork:Ff(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(bf),n.delete(e))})},cancel:()=>{u.abort(bf),e.pending.delete(u)},throwIfCancelled:()=>{Df(u.signal)}})))}catch(e){e instanceof Sf||Hf(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(xf),i(e),e.pending.delete(u)}},d=Vf(t,n);return{middleware:e=>n=>r=>{if(!hu(r))return n(r);if(Uf.match(r))return c(r.payload);if(Wf.match(r)){d();return}if(Gf.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===Nf)throw Error(Jf(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,Hf(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=Nf}return s},startListening:c,stopListening:l,clearListeners:d}};function Jf(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Yf=sf({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Xf,setLayout:Zf,setChartSize:Qf,setScale:$f}=Yf.actions,ep=Yf.reducer;function tp(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Q(e){return Number.isFinite(e)}function np(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ip(e){for(var t=1;t{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&H(e[a]))return ip(ip({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&H(e[o]))return ip(ip({},e),{},{[o]:e[o]+(i||0)})}return e},up=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,dp=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},fp=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Qs(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return Q(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(lc):c&&l?l.map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(lc):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(lc):o.domain().map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(lc)},pp=(e,t)=>{if(!t||t.length!==2||!H(t[0])||!H(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!H(e[0])||e[0]r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Rs,none:Ns,silhouette:zs,wiggle:Bs,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},hp=(e,t,n)=>{var r=mp[n]??Ns,i=Ls().keys(t).value((e,t)=>Number(cp(e,t,0))).order(Ps).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=cp(e[i],t[r],0);Array.isArray(a)&&a.length===2&&H(a[0])&&H(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function gp(e){return e==null?void 0:String(e)}var _p=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=cp(a,t.dataKey,t.scale.domain()[o]);if(sc(s))return null;var c=t.scale.map(s);return H(c)?c-i/2+r:null},vp=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},yp=e=>{var t=e.flat(2).filter(H);return[Math.min(...t),Math.max(...t)]},bp=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],xp=(e,t,n)=>{if(e!=null)return bp(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=yp(tp(r,t,n));return!Q(i[0])||!Q(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},Sp=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Cp=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wp=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,$l.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},Op=(e,t)=>t===`centric`?e.angle:e.radius,kp=e=>e.layout.width,Ap=e=>e.layout.height,jp=e=>e.layout.scale,Mp=e=>e.layout.margin,Np=J(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Pp=J(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Fp=`data-recharts-item-index`,Ip=`data-recharts-item-id`;function Lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rp(e){for(var t=1;te.brush.height;function Up(e){return Pp(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Wp(e){return Pp(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Gp(e){return Np(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function Kp(e){return Np(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var qp=J([kp,Ap,Mp,Hp,Up,Wp,Gp,Kp,eu,tu],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=Rp(Rp({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=lp(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return Rp(Rp({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Jp=J(qp,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Yp=J(kp,Ap,(e,t)=>({x:0,y:0,width:e,height:t})),Xp=(0,v.createContext)(null),Zp=()=>(0,v.useContext)(Xp)!=null,Qp=e=>e.brush,$p=J([Qp,qp,Mp],(e,t,n)=>({height:e.height,x:H(e.x)?e.x:t.left,y:H(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:H(e.width)?e.width:t.width})),em=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),tm=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=em();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),nm=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=tm();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),rm=o(((e,t)=>{t.exports=nm().throttle})),im=!0,am=function(e,t){var n=[...arguments].slice(2);if(im&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},om={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},sm=(e,t,n)=>{var{width:r=om.width,height:i=om.height,aspect:a,maxHeight:o}=n,s=ec(r)?e:Number(r),c=ec(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},cm={width:0,height:0,overflow:`visible`},lm={width:0,overflowX:`visible`},um={height:0,overflowY:`visible`},dm={},fm=e=>{var{width:t,height:n}=e,r=ec(t),i=ec(n);return r&&i?cm:r?lm:i?um:dm};function pm(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=om.width,a=om.height):i===void 0?i=r&&r>0?void 0:om.width:a===void 0&&(a=r&&r>0?void 0:om.height),{width:i,height:a}}var mm=l(rm());function hm(){return hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return Sm(i)?v.createElement(xm.Provider,{value:i},t):null}var wm=()=>(0,v.useContext)(xm),Tm=(0,v.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=om.initialDimension,width:i,height:a,minWidth:o=om.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=om.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,v.useRef)(null),g=(0,v.useRef)();g.current=p,(0,v.useImperativeHandle)(t,()=>h.current);var[_,y]=(0,v.useState)({containerWidth:r.width,containerHeight:r.height}),b=(0,v.useCallback)((e,t)=>{y(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,v.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return uc;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;b(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=(0,mm.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return b(n,r),t.observe(h.current),()=>{t.disconnect()}},[b,u]);var{containerWidth:x,containerHeight:S}=_;am(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:C,calculatedHeight:w}=sm(x,S,{width:i,height:a,aspect:n,maxHeight:c});return am(C!=null&&C>0||w!=null&&w>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,C,w,i,a,o,s,n),v.createElement(`div`,{id:d?`${d}`:void 0,className:z(`recharts-responsive-container`,f),style:_m(_m({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:h},v.createElement(`div`,{style:fm({width:i,height:a})},v.createElement(Cm,{width:C,height:w},l)))}),Em=(0,v.forwardRef)((e,t)=>{var n=wm();if(np(n.width)&&np(n.height))return e.children;var{width:r,height:i}=pm({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=sm(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return H(a)&&H(o)?v.createElement(Cm,{width:a,height:o},e.children):v.createElement(Tm,hm({},e,{width:r,height:i,ref:t}))});function Dm(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Om=()=>{var e=Zp(),t=G(Jp),n=G($p),r=G(Qp)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},km={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Am=()=>G(qp)??km,jm=()=>G(kp),Mm=()=>G(Ap),Nm=()=>G(e=>e.layout.margin),Pm=e=>e.layout.layoutType,Fm=()=>G(Pm),Im=()=>{var e=Fm();if(e===`horizontal`||e===`vertical`)return e},Lm=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},Rm=()=>Fm()!==void 0,zm=e=>{var t=W(),n=Zp(),{width:r,height:i}=e,a=wm(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&np(o)&&np(s)&&t(Qf({width:o,height:s}))},[t,n,o,s]),null},Bm=Symbol.for(`immer-nothing`),Vm=Symbol.for(`immer-draftable`),Hm=Symbol.for(`immer-state`);function Um(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wm=Object.getPrototypeOf;function Gm(e){return!!e&&!!e[Hm]}function Km(e){return e?Ym(e)||Array.isArray(e)||!!e[Vm]||!!e.constructor?.[Vm]||th(e)||nh(e):!1}var qm=Object.prototype.constructor.toString(),Jm=new WeakMap;function Ym(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;if(typeof n!=`function`)return!1;let r=Jm.get(n);return r===void 0&&(r=Function.toString.call(n),Jm.set(n,r)),r===qm}function Xm(e,t,n=!0){Zm(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Zm(e){let t=e[Hm];return t?t.type_:Array.isArray(e)?1:th(e)?2:nh(e)?3:0}function Qm(e,t){return Zm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function $m(e,t,n){let r=Zm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function eh(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function th(e){return e instanceof Map}function nh(e){return e instanceof Set}function rh(e){return e.copy_||e.base_}function ih(e,t){if(th(e))return new Map(e);if(nh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Ym(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[Hm];let n=Reflect.ownKeys(t);for(let r=0;r1&&Object.defineProperties(e,{set:sh,add:sh,clear:sh,delete:sh}),Object.freeze(e),t&&Object.values(e).forEach(e=>ah(e,!0)),e)}function oh(){Um(2)}var sh={value:oh};function ch(e){return typeof e!=`object`||!e?!0:Object.isFrozen(e)}var lh={};function uh(e){let t=lh[e];return t||Um(0,e),t}var dh;function fh(){return dh}function ph(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mh(e,t){t&&(uh(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function hh(e){gh(e),e.drafts_.forEach(vh),e.drafts_=null}function gh(e){e===dh&&(dh=e.parent_)}function _h(e){return dh=ph(dh,e)}function vh(e){let t=e[Hm];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yh(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[Hm].modified_&&(hh(t),Um(4)),Km(e)&&(e=bh(t,e),t.parent_||Sh(t,e)),t.patches_&&uh(`Patches`).generateReplacementPatches_(n[Hm].base_,e,t.patches_,t.inversePatches_)):e=bh(t,n,[]),hh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Bm?void 0:e}function bh(e,t,n){if(ch(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[Hm];if(!i)return Xm(t,(r,a)=>xh(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Sh(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),Xm(a,(r,a)=>xh(e,i,t,r,a,n,o),r),Sh(e,t,!1),n&&e.patches_&&uh(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function xh(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=ch(i);if(!(s&&!o)){if(Gm(i)){let o=bh(e,i,a&&t&&t.type_!==3&&!Qm(t.assigned_,r)?a.concat(r):void 0);if($m(n,r,o),Gm(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Km(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;bh(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(th(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Sh(e,i)}}}function Sh(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ah(t,n)}function Ch(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:fh(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=wh;n&&(i=[r],a=Th);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var wh={get(e,t){if(t===Hm)return e;let n=rh(e);if(!Qm(n,t))return Dh(e,n,t);let r=n[t];return e.finalized_||!Km(r)?r:r===Eh(e.base_,t)?(Ah(e),e.copy_[t]=Mh(r,e)):r},has(e,t){return t in rh(e)},ownKeys(e){return Reflect.ownKeys(rh(e))},set(e,t,n){let r=Oh(rh(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Eh(rh(e),t),i=r?.[Hm];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(eh(n,r)&&(n!==void 0||Qm(e.base_,t)))return!0;Ah(e),kh(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return Eh(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ah(e),kh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=rh(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){Um(11)},getPrototypeOf(e){return Wm(e.base_)},setPrototypeOf(){Um(12)}},Th={};Xm(wh,(e,t)=>{Th[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Th.deleteProperty=function(e,t){return Th.set.call(this,e,t,void 0)},Th.set=function(e,t,n){return wh.set.call(this,e[0],t,n,e[0])};function Eh(e,t){let n=e[Hm];return(n?rh(n):e)[t]}function Dh(e,t,n){let r=Oh(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function Oh(e,t){if(!(t in e))return;let n=Wm(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Wm(n)}}function kh(e){e.modified_||(e.modified_=!0,e.parent_&&kh(e.parent_))}function Ah(e){e.copy_||=ih(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var jh=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&Um(6),n!==void 0&&typeof n!=`function`&&Um(7);let r;if(Km(e)){let i=_h(this),a=Mh(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?hh(i):gh(i)}return mh(i,n),yh(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===Bm&&(r=void 0),this.autoFreeze_&&ah(r,!0),n){let t=[],i=[];uh(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else Um(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Km(e)||Um(8),Gm(e)&&(e=Nh(e));let t=_h(this),n=Mh(e,void 0);return n[Hm].isManual_=!0,gh(t),n}finishDraft(e,t){let n=e&&e[Hm];(!n||!n.isManual_)&&Um(9);let{scope_:r}=n;return mh(r,t),yh(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=uh(`Patches`).applyPatches_;return Gm(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Mh(e,t){let n=th(e)?uh(`MapSet`).proxyMap_(e,t):nh(e)?uh(`MapSet`).proxySet_(e,t):Ch(e,t);return(t?t.scope_:fh()).drafts_.push(n),n}function Nh(e){return Gm(e)||Um(10,e),Ph(e)}function Ph(e){if(!Km(e)||ch(e))return e;let t=e[Hm],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ih(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ih(e,!0);return Xm(n,(e,t)=>{$m(n,e,Ph(t))},r),t&&(t.finalized_=!1),n}new jh().produce;function Fh(e){return e}var Ih=sf({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(Fh(t.payload))},prepare:Kd()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Md(e).payload.indexOf(Fh(n));i>-1&&(e.payload[i]=Fh(r))},prepare:Kd()},removeLegendPayload:{reducer(e,t){var n=Md(e).payload.indexOf(Fh(t.payload));n>-1&&e.payload.splice(n,1)},prepare:Kd()}}}),{setLegendSize:Lh,setLegendSettings:Rh,addLegendPayload:zh,replaceLegendPayload:Bh,removeLegendPayload:Vh}=Ih.actions,Hh=Ih.reducer,Uh=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=Uh()}))();function Wh(e){e()}function Gh(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Wh(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Kh={notify(){},get:()=>[]};function qh(e,t){let n,r=Kh,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Gh())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Kh)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var Jh=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Yh=typeof navigator<`u`&&navigator.product===`ReactNative`,Xh=Jh||Yh?v.useLayoutEffect:v.useEffect;function Zh(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function Qh(e,t){if(Zh(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r({store:i,subscription:qh(i),getServerState:r?()=>r:void 0}),[i,r]),o=v.useMemo(()=>i.getState(),[i]);Xh(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||ng;return v.createElement(s.Provider,{value:a},t)}var ig=rg,ag=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function og(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function sg(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(ag.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Qh(e[n],t[n]))return!1}else if(!og(e[n],t[n]))return!1;return!0}var cg=[`contextPayload`];function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(Rh(e))},[t,e]),null}function xg(e){var t=W();return(0,v.useEffect)(()=>(t(Lh(e)),()=>{t(Lh({width:0,height:0}))}),[t,e]),null}function Sg(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var Cg={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function wg(e){var t=Fc(e,Cg),n=ru(),r=go(),i=Nm(),{width:a,height:o,wrapperStyle:s,portal:c}=t,[l,u]=au([n]),d=jm(),f=Mm();if(d==null||f==null)return null;var p=d-(i?.left||0)-(i?.right||0),m=Sg(t.layout,o,a,p),h=c?s:dg(dg({position:`absolute`,width:m?.width||a||`auto`,height:m?.height||o||`auto`},yg(s,t,i,d,f,l)),s),g=c??r;return g==null||n==null?null:(0,b.createPortal)(v.createElement(`div`,{className:`recharts-legend-wrapper`,style:h,ref:u},v.createElement(bg,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&v.createElement(xg,{width:l.width,height:l.height}),v.createElement(vg,lg({},t,m,{margin:i,chartWidth:d,chartHeight:f,contextPayload:n}))),g)}var Tg=v.memo(wg,sg);Tg.displayName=`Legend`;function Eg(){return Eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=Ng.separator,contentStyle:n,itemStyle:r,labelStyle:i=Ng.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:f=Ng.accessibilityLayer}=e,p=()=>{if(a&&a.length){var e={padding:0,margin:0},n=Pg(a,s).map((e,n)=>{if(!e||e.type===`none`)return null;var i=e.formatter||o||Mg,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var f=Og(Og({},Ng.itemStyle),{},{color:e.color||Ng.itemStyle.color},r);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:f},tc(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,tc(u)?v.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,v.createElement(`span`,{className:`recharts-tooltip-item-value`},l),v.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return v.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},m=Og(Og({},Ng.contentStyle),n),h=Og({margin:0},i),g=!sc(u),_=g?u:``,y=z(`recharts-default-tooltip`,c),b=z(`recharts-tooltip-label`,l);g&&d&&a!=null&&(_=d(u,a));var x=f?{role:`status`,"aria-live":`assertive`}:{};return v.createElement(`div`,Eg({className:y,style:m},x),v.createElement(`p`,{className:b,style:h},v.isValidElement(_)?_:`${_}`),p())},Ig=`recharts-tooltip-wrapper`,Lg={visibility:`hidden`};function Rg(e){var{coordinate:t,translateX:n,translateY:r}=e;return z(Ig,{[`${Ig}-right`]:H(n)&&t&&H(t.x)&&n>=t.x,[`${Ig}-left`]:H(n)&&t&&H(t.x)&&n=t.y,[`${Ig}-top`]:H(r)&&t&&H(t.y)&&r0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(uf+l?Math.max(u,f):Math.max(d,f)}function Bg(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Vg(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=zg({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=zg({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Bg({translateX:d,translateY:f,useTranslate3d:c})):u=Lg,{cssProperties:u,cssClasses:Rg({translateX:d,translateY:f,coordinate:n})}}var Hg={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Ug(){var[e,t]=(0,v.useState)(()=>Hg.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,v.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function Wg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gg(e){for(var t=1;t({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));v.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(Gg(Gg({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=Vg({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=Gg(Gg({},e.hasPortalFromProps?{}:Gg(Gg({transition:Yg({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return v.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var Zg=v.memo(Xg),Qg=()=>G(e=>e.rootProps.accessibilityLayer)??!0;function $g(){return $g=Object.assign?Object.assign.bind():function(e){for(var t=1;tQ(e.x)&&Q(e.y),s_=e=>e.base!=null&&o_(e.base)&&o_(e),c_=e=>e.x,l_=e=>e.y,u_=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${cc(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=a_[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return a_[n]||Po},d_={connectNulls:!1,type:`linear`},f_=e=>{var{type:t=d_.type,points:n=[],baseLine:r,layout:i,connectNulls:a=d_.connectNulls}=e,o=u_(t,i),s=a?n.filter(o_):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>t_(t_({},e),{},{base:r[t]}));return c=i===`vertical`?Ro().y(l_).x1(c_).x0(e=>e.base.x):Ro().x(c_).y1(l_).y0(e=>e.base.y),c.defined(s_).curve(o)(a?l.filter(s_):l)}return(i===`vertical`&&H(r)?Ro().y(l_).x1(c_).x0(r):H(r)?Ro().x(c_).y1(l_).y0(r):Lo().x(c_).y(l_)).defined(o_).curve(o)(s)},p_=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Fm();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?f_(o):r;return v.createElement(`path`,$g({},ro(e),Dc(e),{className:z(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},m_=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function h_(){return h_=Object.assign?Object.assign.bind():function(e){for(var t=1;t`M${e},${i}v${r}M${a},${t}h${n}`,w_=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=x_(e,m_),l=__({x:t,y:n,top:r,left:i,width:a,height:o},c);return!H(t)||!H(n)||!H(a)||!H(o)||!H(r)||!H(i)?null:v.createElement(`path`,h_({},ao(l),{className:z(`recharts-cross`,s),d:C_(t,n,a,o,r,i)}))};function T_(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function E_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function D_(e){for(var t=1;te.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),M_=(e,t,n)=>e.map(e=>`${j_(e)} ${t}ms ${n}`).join(`,`),N_=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),P_=(e,t)=>Object.keys(t).reduce((n,r)=>D_(D_({},n),{},{[r]:e(r,t[r])}),{});function F_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I_(e){for(var t=1;te+(t-e)*n,V_=e=>{var{from:t,to:n}=e;return t!==n},H_=(e,t,n)=>{var r=P_((t,n)=>{if(V_(n)){var[r,i]=e(n.from,n.to,n.velocity);return I_(I_({},n),{},{from:r,velocity:i})}return n},t);return n<1?P_((e,t)=>V_(t)&&r[e]!=null?I_(I_({},t),{},{velocity:B_(t.velocity,r[e].velocity,n),from:B_(t.from,r[e].from,n)}):t,t):H_(e,r,n-1)};function U_(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>I_(I_({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>P_((e,t)=>t.from,s),l=()=>!Object.values(s).filter(V_).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=H_(n,s,f),i(I_(I_(I_({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function W_(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:I_(I_({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=P_((e,t)=>B_(...t,n(d)),c);if(a(I_(I_(I_({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=P_((e,t)=>B_(...t,n(1)),c);a(I_(I_(I_({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var G_=(e,t,n,r,i,a)=>{var o=N_(e,t);return n==null?()=>(i(I_(I_({},e),t)),()=>{}):n.isStepper===!0?U_(e,t,n,o,i,a):W_(e,t,n,r,o,i,a)},K_=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],q_=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),J_=(e,t)=>n=>q_(K_(e,t),n),Y_=(e,t)=>n=>q_([...K_(e,t).map((e,t)=>e*t).slice(1),0],n),X_=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},Z_=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=X_(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},Q_=(e,t,n,r)=>{var i=J_(e,n),a=J_(t,r),o=Y_(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},$_=function(){return Q_(...Z_(...arguments))},ev=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},tv=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return $_(e);case`spring`:return ev();default:if(e.split(`(`)[0]===`cubic-bezier`)return $_(e)}return typeof e==`function`?e:null};function nv(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}var rv=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function iv(){return nv(new rv)}var av=(0,v.createContext)(iv);function ov(e,t){var n=(0,v.useContext)(av);return(0,v.useMemo)(()=>t??n(e),[e,t,n])}var sv={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},cv={t:0},lv={t:1};function uv(e){var t=Fc(e,sv),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=Ug(),d=n===`auto`?!Hg.isSsr&&!u:n,f=ov(t.animationId,t.animationManager),[p,m]=(0,v.useState)(d?cv:lv),h=(0,v.useRef)(null);return(0,v.useEffect)(()=>{d||m(lv)},[d]),(0,v.useEffect)(()=>{if(!d||!r)return uc;var e=G_(cv,lv,tv(a),i,m,f.getTimeoutController());return f.start([c,o,()=>{h.current=e()},i,s]),()=>{f.stop(),h.current&&h.current(),s()}},[d,r,i,a,o,c,s,f]),l(p.t)}function dv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,v.useRef)(rc(t)),r=(0,v.useRef)(e);return r.current!==e&&(n.current=rc(t),r.current=e),n.current}var fv=[`radius`],pv=[`radius`],mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv;function wv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tv(e){for(var t=1;t{var a=Ys(n),o=Ys(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;ps?s:h}d=Xs(mv||=Mv([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=Xs(hv||=Mv([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=Xs(gv||=Mv([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=Xs(_v||=Mv([`A `,`,`,`,0,0,`,`, - `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=Xs(vv||=Mv([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=Xs(yv||=Mv([`A `,`,`,`,0,0,`,`, - `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=Xs(bv||=Mv([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=Xs(xv||=Mv([`A `,`,`,`,0,0,`,`, - `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=Xs(Sv||=Mv(`M .,. - A .,.,0,0,.,.,. - L .,. - A .,.,0,0,.,.,. - L .,. - A .,.,0,0,.,.,. - L .,. - A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=Xs(Cv||=Mv([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},Pv={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Fv=e=>{var t=Fc(e,Pv),n=(0,v.useRef)(null),[r,i]=(0,v.useState)(-1);(0,v.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:h}=t,g=(0,v.useRef)(s),_=(0,v.useRef)(c),y=(0,v.useRef)(a),b=(0,v.useRef)(o),x=dv((0,v.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var S=z(`recharts-rectangle`,u);if(!h){var C=ao(t),{radius:w}=C,T=Av(C,fv);return v.createElement(`path`,kv({},T,{x:Ys(a),y:Ys(o),width:Ys(s),height:Ys(c),radius:typeof l==`number`?l:void 0,className:S,d:Nv(a,o,s,c,l)}))}var E=g.current,D=_.current,O=y.current,k=b.current,ee=`0px ${r===-1?1:r}px`,te=`${r}px ${r}px`,ne=M_([`strokeDasharray`],f,typeof d==`string`?d:Pv.animationEasing);return v.createElement(uv,{animationId:x,key:x,canBegin:r>0,duration:f,easing:d,isActive:h,begin:p},e=>{var r=ac(E,s,e),i=ac(D,c,e),u=ac(O,a,e),d=ac(k,o,e);n.current&&(g.current=r,_.current=i,y.current=u,b.current=d);var f=m?e>0?{transition:ne,strokeDasharray:te}:{strokeDasharray:ee}:{strokeDasharray:te},p=ao(t),{radius:h}=p,x=Av(p,pv);return v.createElement(`path`,kv({},x,{radius:typeof l==`number`?l:void 0,className:S,d:Nv(u,d,r,i,l),ref:n,style:Tv(Tv({},f),t.style)}))})};function Iv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lv(e){for(var t=1;te*180/Math.PI,Uv=(e,t,n,r)=>({x:e+Math.cos(-Vv*r)*n,y:t+Math.sin(-Vv*r)*n}),Wv=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},Gv=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Kv=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Gv({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:Hv(c),angleInRadian:c}},qv=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Jv=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},Yv=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Kv({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(is||i===0)return null;var{startAngle:c,endAngle:l}=qv(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u=c&&u<=l}else{for(;u>c;)u-=360;for(;u=l&&u<=c}return d?Lv(Lv({},t),{},{radius:i,angle:Jv(u,t)}):null};function Xv(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[Uv(t,n,r,i),Uv(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var Zv,Qv,$v,ey,ty,ny,ry;function iy(){return iy=Object.assign?Object.assign.bind():function(e){for(var t=1;tQs(t-e)*Math.min(Math.abs(t-e),359.999),sy=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/Vv,d=c?i:i+a*u,f=Uv(t,n,l,d),p=Uv(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:Uv(t,n,l*Math.cos(u*Vv),m),theta:u}},cy=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=oy(a,o),c=a+s,l=Uv(t,n,i,a),u=Uv(t,n,i,c),d=Xs(Zv||=ay([`M `,`,`,` - A `,`,`,`,0, - `,`,`,`, - `,`,`,` - `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=Uv(t,n,r,a),p=Uv(t,n,r,c);d+=Xs(Qv||=ay([`L `,`,`,` - A `,`,`,`,0, - `,`,`,`, - `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=Xs($v||=ay([`L `,`,`,` Z`]),t,n);return d},ly=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=Qs(l-c),{circleTangency:d,lineTangency:f,theta:p}=sy({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=sy({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?Xs(ey||=ay([`M `,`,`,` - a`,`,`,`,0,0,1,`,`,0 - a`,`,`,`,0,0,1,`,`,0 - `]),f.x,f.y,a,a,a*2,a,a,-a*2):cy({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=Xs(ty||=ay([`M `,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,` - A`,`,`,`,0,`,`,`,`,`,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,` - `]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=sy({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=sy({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=Xs(ny||=ay([`L`,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,` - A`,`,`,`,0,`,`,`,`,`,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=Xs(ry||=ay([`L`,`,`,`Z`]),t,n);return v},uy={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},dy=e=>{var t=Fc(e,uy),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a0&&Math.abs(l-u)<360?ly({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):cy({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return v.createElement(`path`,iy({},ao(t),{className:f,d:h}))};function fy(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Ec(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=Uv(r,i,a,s),l=Uv(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return Xv(t)}}var py=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ql();function n(e){return t.isSymbol(e)?NaN:Number(e)}e.toNumber=n})),my=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=py();function n(e){return e?(e=t.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}e.toFinite=n})),hy=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Zl(),n=my();function r(e,r,i){i&&typeof i!=`number`&&t.isIterateeCall(e,r,i)&&(r=i=void 0),e=n.toFinite(e),r===void 0?(r=e,e=0):r=n.toFinite(r),i=i===void 0?e{t.exports=hy().range})),_y=e=>e.chartData,vy=J([_y],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),yy=(e,t,n,r)=>r?vy(e):_y(e),by=(e,t,n)=>n?vy(e):_y(e),xy=J([yy],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)}),Sy=J([vy],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)}),Cy=J([_y],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});function wy(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Q(t)&&Q(n))return!0}return!1}function Ty(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Ey(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Q(n))i=n;else if(typeof n==`function`)return;if(Q(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(wy(o))return o}}function Dy(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(wy(r))return Ty(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(H(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&&Sp.test(i)){var c=Sp.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(H(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&Cp.test(a)){var u=Cp.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(wy(f))return t==null?f:Ty(f,t,n)}}}var $=l(o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),ee(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),ee(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||en)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;tr?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,ee=r.constructor,te=r.s==i.s?1:-1,ne=r.d,A=i.d;if(!r.s)return new ee(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=A.length,T=ne.length,g=new ee(te),_=g.d=[],u=0;A[u]==(ne[u]||0);)++u;if(A[u]>(ne[u]||0)&&--l,x=o==null?o=ee.precision:s?o+(S(r)-S(i))+1:o,x<0)return new ee(0);if(x=x/p+2|0,u=0,O==1)for(d=0,A=A[0],x++;(u1&&(A=e(A,d),ne=e(ne,d),O=A.length,T=ne.length),w=O,v=ne.slice(0,O),y=v.length;y=f/2&&++E;do d=0,c=t(A,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(A,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),rh||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function ee(e,t){if(e.length>t)return e.length=t,!0}function te(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=te,i.config=i.set=ne,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=te(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function Oy(e){return e===0?1:Math.floor(new $.default(e).abs().log(10).toNumber())+1}function ky(e,t,n){for(var r=new $.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var Ay=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},jy=(e,t,n)=>{if(e.lte(0))return new $.default(0);var r=Oy(e.toNumber()),i=new $.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new $.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new $.default(s.toNumber()):new $.default(Math.ceil(s.toNumber()))},My=(e,t,n)=>{if(e.lte(0))return new $.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new $.default(i).abs().log(10).toNumber()),o=new $.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new $.default(10).pow(l))}var u=new $.default(r[c]??1).mul(o);return t?u:new $.default(Math.ceil(u.toNumber()))},Ny=(e,t,n)=>{var r=new $.default(1),i=new $.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new $.default(10).pow(Oy(e)-1),i=new $.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new $.default(Math.floor(e)))}else e===0?i=new $.default(Math.floor((t-1)/2)):n||(i=new $.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:jy;if(!Number.isFinite((t-e)/(n-1)))return{step:new $.default(0),tickMin:new $.default(0),tickMax:new $.default(0)};var o=a(new $.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new $.default(0):(s=new $.default(e).add(t).div(2),s=s.sub(new $.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new $.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?Py(e,t,n,r,i+1,a):(u0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new $.default(c).mul(o)),tickMax:s.add(new $.default(l).mul(o))})},Fy=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=Ay([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return Ny(s,r,i);var{step:u,tickMin:d,tickMax:f}=Py(s,c,o,i,0,a===`snap125`?My:jy),p=ky(d,f.add(new $.default(.1).mul(u)),u);return t>n?p.reverse():p},Iy=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=Ay([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?My:jy,l=Math.max(t,2),u=c(new $.default(s).sub(o).div(l-1),i,0),d=[...ky(new $.default(o),new $.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},Ly=e=>e.rootProps.maxBarSize,Ry=e=>e.rootProps.barGap,zy=e=>e.rootProps.barCategoryGap,By=e=>e.rootProps.barSize,Vy=e=>e.rootProps.stackOffset,Hy=e=>e.rootProps.reverseStackOrder,Uy=e=>e.options.chartName,Wy=e=>e.rootProps.syncId,Gy=e=>e.rootProps.syncMethod,Ky=e=>e.options.eventEmitter,qy={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Jy={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:qy.axis},Yy={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:qy.axis},Xy=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Zy(e,t,n){if(n!==`auto`)return n;if(e!=null)return up(e,t)?`category`:`number`}function Qy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $y(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Lm],(e,t)=>{if(e!=null)return e;var n=Zy(t,`angleAxis`,rb.type)??`category`;return $y($y({},rb),{},{type:n})}),ob=J([(e,t)=>e.polarAxis.radiusAxis[t],Lm],(e,t)=>{if(e!=null)return e;var n=Zy(t,`radiusAxis`,ib.type)??`category`;return $y($y({},ib),{},{type:n})}),sb=e=>e.polarOptions,cb=J([kp,Ap,qp],Wv),lb=J([sb,cb],(e,t)=>{if(e!=null)return U(e.innerRadius,t,0)}),ub=J([sb,cb],(e,t)=>{if(e!=null)return U(e.outerRadius,t,t*.8)}),db=J([sb],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});J([ab,db],Xy);var fb=J([cb,lb,ub],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});J([ob,fb],Xy);var pb=J([Pm,sb,lb,ub,kp,Ap],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:U(o,i,i/2),cy:U(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),mb=(e,t)=>t,hb=(e,t,n)=>n;function gb(e){return e?.id}function _b(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(!(t==null||t.length===0)){var n=gb(e);t.forEach((t,r)=>{var s=a==null||i?r:String(cp(t,a,null)),c=cp(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function vb(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var yb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function bb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function xb(e,t){if(e.length===t.length){for(var n=0;n{var t=Pm(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},Cb=e=>e.tooltip.settings.axisId;function wb(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var Tb=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!wy(t)){for(var n,r,i=0;ir)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function Eb(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Db(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Ob(e){let t,n,r;e.length===2?(t=e===Eb||e===Db?e:kb,n=e,r=e):(t=Eb,n=(t,n)=>Eb(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function kb(){return 0}function Ab(e){return e===null?NaN:+e}function*jb(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var Mb=Ob(Eb),Nb=Mb.right;Mb.left,Ob(Ab).center;var Pb=class extends Map{constructor(e,t=Rb){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(Fb(this,e))}has(e){return super.has(Fb(this,e))}set(e,t){return super.set(Ib(this,e),t)}delete(e){return super.delete(Lb(this,e))}};function Fb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function Ib({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Lb({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rb(e){return typeof e==`object`&&e?e.valueOf():e}function zb(e=Eb){if(e===Eb)return Bb;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Bb(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et))}var Vb=Math.sqrt(50),Hb=Math.sqrt(10),Ub=Math.sqrt(2);function Wb(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Vb?10:a>=Hb?5:a>=Ub?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function Yb(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Xb(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Bb:zb(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));Xb(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Zb(e,n,t),i(e[r],a)>0&&Zb(e,n,r);o0;)--s}i(e[n],a)===0?Zb(e,n,s):(++s,Zb(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Zb(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Qb(e,t,n){if(e=Float64Array.from(jb(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Yb(e);if(t>=1)return Jb(e);var r,i=(r-1)*t,a=Math.floor(i),o=Jb(Xb(e,a).subarray(0,a+1));return o+(Yb(e.subarray(a+1))-o)*(i-a)}}function $b(e,t,n=Ab){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function ex(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ax(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ax(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_x.exec(e))?new Nx(t[1],t[2],t[3],1):(t=vx.exec(e))?new Nx(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yx.exec(e))?Ax(t[1],t[2],t[3],t[4]):(t=bx.exec(e))?Ax(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xx.exec(e))?Bx(t[1],t[2]/100,t[3]/100,1):(t=Sx.exec(e))?Bx(t[1],t[2]/100,t[3]/100,t[4]):Cx.hasOwnProperty(e)?kx(Cx[e]):e===`transparent`?new Nx(NaN,NaN,NaN,0):null}function kx(e){return new Nx(e>>16&255,e>>8&255,e&255,1)}function Ax(e,t,n,r){return r<=0&&(e=t=n=NaN),new Nx(e,t,n,r)}function jx(e){return e instanceof ux||(e=Ox(e)),e?(e=e.rgb(),new Nx(e.r,e.g,e.b,e.opacity)):new Nx}function Mx(e,t,n,r){return arguments.length===1?jx(e):new Nx(e,t,n,r??1)}function Nx(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cx(Nx,Mx,lx(ux,{brighter(e){return e=e==null?fx:fx**+e,new Nx(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?dx:dx**+e,new Nx(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nx(Rx(this.r),Rx(this.g),Rx(this.b),Lx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Px,formatHex:Px,formatHex8:Fx,formatRgb:Ix,toString:Ix}));function Px(){return`#${zx(this.r)}${zx(this.g)}${zx(this.b)}`}function Fx(){return`#${zx(this.r)}${zx(this.g)}${zx(this.b)}${zx((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ix(){let e=Lx(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Rx(this.r)}, ${Rx(this.g)}, ${Rx(this.b)}${e===1?`)`:`, ${e})`}`}function Lx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rx(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zx(e){return e=Rx(e),(e<16?`0`:``)+e.toString(16)}function Bx(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ux(e,t,n,r)}function Vx(e){if(e instanceof Ux)return new Ux(e.h,e.s,e.l,e.opacity);if(e instanceof ux||(e=Ox(e)),!e)return new Ux;if(e instanceof Ux)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new Ux(o,s,c,e.opacity)}function Hx(e,t,n,r){return arguments.length===1?Vx(e):new Ux(e,t,n,r??1)}function Ux(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cx(Ux,Hx,lx(ux,{brighter(e){return e=e==null?fx:fx**+e,new Ux(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?dx:dx**+e,new Ux(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Nx(Kx(e>=240?e-240:e+120,i,r),Kx(e,i,r),Kx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ux(Wx(this.h),Gx(this.s),Gx(this.l),Lx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Lx(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Wx(this.h)}, ${Gx(this.s)*100}%, ${Gx(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Wx(e){return e=(e||0)%360,e<0?e+360:e}function Gx(e){return Math.max(0,Math.min(1,e||0))}function Kx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var qx=e=>()=>e;function Jx(e,t){return function(n){return e+n*t}}function Yx(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Xx(e){return(e=+e)==1?Zx:function(t,n){return n-t?Yx(t,n,e):qx(isNaN(t)?n:t)}}function Zx(e,t){var n=t-e;return n?Jx(e,n):qx(isNaN(e)?t:e)}var Qx=(function e(t){var n=Xx(t);function r(e,t){var r=n((e=Mx(e)).r,(t=Mx(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Zx(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function $x(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:rS(r,i)})),n=oS.lastIndex;return nt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function yS(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?bS:yS,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),rS))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,mS),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=dS,u()},d.clamp=function(e){return arguments.length?(o=e?!0:gS,u()):o!==gS},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function CS(){return SS()(gS,gS)}function wS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function TS(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ES(e){return e=TS(Math.abs(e)),e?e[1]:NaN}function DS(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function OS(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var kS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AS(e){if(!(t=kS.exec(e)))throw Error(`invalid format: `+e);var t;return new jS({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}AS.prototype=jS.prototype;function jS(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}jS.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function MS(e){out:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var NS;function PS(e,t){var n=TS(e,t);if(!n)return NS=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(NS=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+TS(e,Math.max(0,t+a-1))[0]}function FS(e,t){var n=TS(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var IS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:wS,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>FS(e*100,t),r:FS,s:PS,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function LS(e){return e}var RS=Array.prototype.map,zS=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function BS(e){var t=e.grouping===void 0||e.thousands===void 0?LS:DS(RS.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?LS:OS(RS.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=AS(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):IS[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=IS[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=MS(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&NS!==void 0?zS[8+NS/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++op||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(ES(t)/3)))*3,r=10**-n,i=l((e=AS(e),e.type=`f`,e),{suffix:zS[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var VS,HS,US;WS({thousands:`,`,grouping:[3],currency:[`$`,``]});function WS(e){return VS=BS(e),HS=VS.format,US=VS.formatPrefix,VS}function GS(e){return Math.max(0,-ES(Math.abs(e)))}function KS(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ES(t)/3)))*3-ES(Math.abs(e)))}function qS(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ES(t)-ES(e))+1}function JS(e,t,n,r){var i=qb(e,t,n),a;switch(r=AS(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=KS(i,o))&&(r.precision=a),US(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=qS(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=GS(i))&&(r.precision=a-(r.type===`%`)*2);break}return HS(r)}function YS(e){var t=e.domain;return e.ticks=function(e){var n=t();return Gb(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return JS(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=Kb(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function XS(){var e=CS();return e.copy=function(){return xS(e,XS())},tx.apply(e,arguments),YS(e)}function ZS(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,mS),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return ZS(e).unknown(t)},e=arguments.length?Array.from(e,mS):[0,1],YS(n)}function QS(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return ae**+t}function aC(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function oC(e){return(t,n)=>-e(-t,n)}function sC(e){let t=e($S,eC),n=t.domain,r=10,i,a;function o(){return i=aC(r),a=iC(r),n()[0]<0?(i=oC(i),a=oC(a),e(tC,nC)):e($S,eC),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s0){for(;l<=u;++l)for(d=1;ds)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(fs)break;m.push(f)}m.length*2{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=AS(n)).precision==null&&(n.trim=!0),n=HS(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*rn(QS(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function cC(){let e=sC(SS()).domain([1,10]);return e.copy=()=>xS(e,cC()).base(e.base()),tx.apply(e,arguments),e}function lC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function uC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function dC(e){var t=1,n=e(lC(t),uC(t));return n.constant=function(n){return arguments.length?e(lC(t=+n),uC(t)):t},YS(n)}function fC(){var e=dC(SS());return e.copy=function(){return xS(e,fC()).constant(e.constant())},tx.apply(e,arguments)}function pC(e){return function(t){return t<0?-((-t)**+e):t**+e}}function mC(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function hC(e){return e<0?-e*e:e*e}function gC(e){var t=e(gS,gS),n=1;function r(){return n===1?e(gS,gS):n===.5?e(mC,hC):e(pC(n),pC(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},YS(t)}function _C(){var e=gC(SS());return e.copy=function(){return xS(e,_C()).exponent(e.exponent())},tx.apply(e,arguments),e}function vC(){return _C.apply(null,arguments).exponent(.5)}function yC(e){return Math.sign(e)*e*e}function bC(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xC(){var e=CS(),t=[0,1],n=!1,r;function i(t){var i=bC(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(yC(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,mS)).map(yC)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return xC(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},tx.apply(i,arguments),YS(i)}function SC(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return CC().domain([e,t]).range(i).unknown(a)},tx.apply(YS(o),arguments)}function wC(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[Nb(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return wC().domain(e).range(t).unknown(n)},tx.apply(i,arguments)}var TC=new Date,EC=new Date;function DC(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(sDC(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(TC.setTime(+t),EC.setTime(+r),e(TC),e(EC),Math.floor(n(TC,EC))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var OC=DC(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);OC.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?DC(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):OC),OC.range;var kC=1e3,AC=kC*60,jC=AC*60,MC=jC*24,NC=MC*7,PC=MC*30,FC=MC*365,IC=DC(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*kC)},(e,t)=>(t-e)/kC,e=>e.getUTCSeconds());IC.range;var LC=DC(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kC)},(e,t)=>{e.setTime(+e+t*AC)},(e,t)=>(t-e)/AC,e=>e.getMinutes());LC.range;var RC=DC(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*AC)},(e,t)=>(t-e)/AC,e=>e.getUTCMinutes());RC.range;var zC=DC(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kC-e.getMinutes()*AC)},(e,t)=>{e.setTime(+e+t*jC)},(e,t)=>(t-e)/jC,e=>e.getHours());zC.range;var BC=DC(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*jC)},(e,t)=>(t-e)/jC,e=>e.getUTCHours());BC.range;var VC=DC(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*AC)/MC,e=>e.getDate()-1);VC.range;var HC=DC(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/MC,e=>e.getUTCDate()-1);HC.range;var UC=DC(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/MC,e=>Math.floor(e/MC));UC.range;function WC(e){return DC(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*AC)/NC)}var GC=WC(0),KC=WC(1),qC=WC(2),JC=WC(3),YC=WC(4),XC=WC(5),ZC=WC(6);GC.range,KC.range,qC.range,JC.range,YC.range,XC.range,ZC.range;function QC(e){return DC(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/NC)}var $C=QC(0),ew=QC(1),tw=QC(2),nw=QC(3),rw=QC(4),iw=QC(5),aw=QC(6);$C.range,ew.range,tw.range,nw.range,rw.range,iw.range,aw.range;var ow=DC(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ow.range;var sw=DC(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());sw.range;var cw=DC(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());cw.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:DC(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),cw.range;var lw=DC(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());lw.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:DC(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),lw.range;function uw(e,t,n,r,i,a){let o=[[IC,1,kC],[IC,5,5*kC],[IC,15,15*kC],[IC,30,30*kC],[a,1,AC],[a,5,5*AC],[a,15,15*AC],[a,30,30*AC],[i,1,jC],[i,3,3*jC],[i,6,6*jC],[i,12,12*jC],[r,1,MC],[r,2,2*MC],[n,1,NC],[t,1,PC],[t,3,3*PC],[e,1,FC]];function s(e,t,n){let r=te).right(o,i);if(a===o.length)return e.every(qb(t/FC,n/FC,r));if(a===0)return OC.every(Math.max(qb(t,n,r),1));let[s,c]=o[i/o[a-1][2]53)return null;`w`in r||(r.w=1),`Z`in r?(a=gw(_w(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?ew.ceil(a):ew(a),a=HC.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=hw(_w(r.y,0,1)),o=a.getDay(),a=o>4||o===0?KC.ceil(a):KC(a),a=VC.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?gw(_w(r.y,0,1)).getUTCDay():hw(_w(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,gw(r)):hw(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in yw?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function ee(e,n,r){return w(e,t,n,r)}function te(e,t,r){return w(e,n,t,r)}function ne(e,t,n){return w(e,r,t,n)}function A(e){return o[e.getDay()]}function re(e){return a[e.getDay()]}function ie(e){return c[e.getMonth()]}function j(e){return s[e.getMonth()]}function M(e){return i[+(e.getHours()>=12)]}function ae(e){return 1+~~(e.getMonth()/3)}function oe(e){return o[e.getUTCDay()]}function se(e){return a[e.getUTCDay()]}function ce(e){return c[e.getUTCMonth()]}function le(e){return s[e.getUTCMonth()]}function ue(e){return i[+(e.getUTCHours()>=12)]}function de(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var yw={"-":``,_:` `,0:`0`},bw=/^\s*\d+/,xw=/^%/,Sw=/[\\^$*+?|[\]().{}]/g;function Cw(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a[e.toLowerCase(),t]))}function Dw(e,t,n){var r=bw.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ow(e,t,n){var r=bw.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function kw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Aw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function jw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Mw(e,t,n){var r=bw.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Nw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Pw(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Fw(e,t,n){var r=bw.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Iw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Lw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Rw(e,t,n){var r=bw.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function zw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Bw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vw(e,t,n){var r=bw.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Hw(e,t,n){var r=bw.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Uw(e,t,n){var r=bw.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ww(e,t,n){var r=xw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Gw(e,t,n){var r=bw.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Kw(e,t,n){var r=bw.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qw(e,t){return Cw(e.getDate(),t,2)}function Jw(e,t){return Cw(e.getHours(),t,2)}function Yw(e,t){return Cw(e.getHours()%12||12,t,2)}function Xw(e,t){return Cw(1+VC.count(cw(e),e),t,3)}function Zw(e,t){return Cw(e.getMilliseconds(),t,3)}function Qw(e,t){return Zw(e,t)+`000`}function $w(e,t){return Cw(e.getMonth()+1,t,2)}function eT(e,t){return Cw(e.getMinutes(),t,2)}function tT(e,t){return Cw(e.getSeconds(),t,2)}function nT(e){var t=e.getDay();return t===0?7:t}function rT(e,t){return Cw(GC.count(cw(e)-1,e),t,2)}function iT(e){var t=e.getDay();return t>=4||t===0?YC(e):YC.ceil(e)}function aT(e,t){return e=iT(e),Cw(YC.count(cw(e),e)+(cw(e).getDay()===4),t,2)}function oT(e){return e.getDay()}function sT(e,t){return Cw(KC.count(cw(e)-1,e),t,2)}function cT(e,t){return Cw(e.getFullYear()%100,t,2)}function lT(e,t){return e=iT(e),Cw(e.getFullYear()%100,t,2)}function uT(e,t){return Cw(e.getFullYear()%1e4,t,4)}function dT(e,t){var n=e.getDay();return e=n>=4||n===0?YC(e):YC.ceil(e),Cw(e.getFullYear()%1e4,t,4)}function fT(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Cw(t/60|0,`0`,2)+Cw(t%60,`0`,2)}function pT(e,t){return Cw(e.getUTCDate(),t,2)}function mT(e,t){return Cw(e.getUTCHours(),t,2)}function hT(e,t){return Cw(e.getUTCHours()%12||12,t,2)}function gT(e,t){return Cw(1+HC.count(lw(e),e),t,3)}function _T(e,t){return Cw(e.getUTCMilliseconds(),t,3)}function vT(e,t){return _T(e,t)+`000`}function yT(e,t){return Cw(e.getUTCMonth()+1,t,2)}function bT(e,t){return Cw(e.getUTCMinutes(),t,2)}function xT(e,t){return Cw(e.getUTCSeconds(),t,2)}function ST(e){var t=e.getUTCDay();return t===0?7:t}function CT(e,t){return Cw($C.count(lw(e)-1,e),t,2)}function wT(e){var t=e.getUTCDay();return t>=4||t===0?rw(e):rw.ceil(e)}function TT(e,t){return e=wT(e),Cw(rw.count(lw(e),e)+(lw(e).getUTCDay()===4),t,2)}function ET(e){return e.getUTCDay()}function DT(e,t){return Cw(ew.count(lw(e)-1,e),t,2)}function OT(e,t){return Cw(e.getUTCFullYear()%100,t,2)}function kT(e,t){return e=wT(e),Cw(e.getUTCFullYear()%100,t,2)}function AT(e,t){return Cw(e.getUTCFullYear()%1e4,t,4)}function jT(e,t){var n=e.getUTCDay();return e=n>=4||n===0?rw(e):rw.ceil(e),Cw(e.getUTCFullYear()%1e4,t,4)}function MT(){return`+0000`}function NT(){return`%`}function PT(e){return+e}function FT(e){return Math.floor(e/1e3)}var IT,LT,RT;zT({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function zT(e){return IT=vw(e),LT=IT.format,IT.parse,RT=IT.utcFormat,IT.utcParse,IT}function BT(e){return new Date(e)}function VT(e){return e instanceof Date?+e:+new Date(+e)}function HT(e,t,n,r,i,a,o,s,c,l){var u=CS(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>Qb(e,r/t))},n.copy=function(){return QT(t).domain(e)},nx.apply(n,arguments)}function $T(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=gS,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*eax,scaleDiverging:()=>eE,scaleDivergingLog:()=>tE,scaleDivergingPow:()=>rE,scaleDivergingSqrt:()=>iE,scaleDivergingSymlog:()=>nE,scaleIdentity:()=>ZS,scaleImplicit:()=>rx,scaleLinear:()=>XS,scaleLog:()=>cC,scaleOrdinal:()=>ix,scalePoint:()=>sx,scalePow:()=>_C,scaleQuantile:()=>SC,scaleQuantize:()=>CC,scaleRadial:()=>xC,scaleSequential:()=>qT,scaleSequentialLog:()=>JT,scaleSequentialPow:()=>XT,scaleSequentialQuantile:()=>QT,scaleSequentialSqrt:()=>ZT,scaleSequentialSymlog:()=>YT,scaleSqrt:()=>vC,scaleSymlog:()=>fC,scaleThreshold:()=>wC,scaleTime:()=>UT,scaleUtc:()=>WT,tickFormat:()=>JS});function oE(e){var t=aE;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${cc(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function sE(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=oE(e);if(r!=null)return r.domain(t).range(n),r}}function cE(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?sE(e.scale,n,r):sE(t,n,r)}function lE(e){return`scale${cc(e)}`}function uE(e){return lE(e)in aE}var dE=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return uE(r)?r:`point`}};function fE(e,t){for(var n=0,r=e.length,i=e[0]t)?n=a+1:r=a}return n}function pE(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=fE(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function mE(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):pE(e,void 0)}var hE=l(gy());function gE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _E(e){for(var t=1;te.cartesianAxis.xAxis[t],wE=(e,t)=>CE(e,t)??SE,TE={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:xE,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},EE=(e,t)=>e.cartesianAxis.yAxis[t],DE=(e,t)=>EE(e,t)??TE,OE={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},kE=(e,t)=>e.cartesianAxis.zAxis[t]??OE,AE=(e,t,n)=>{switch(t){case`xAxis`:return wE(e,n);case`yAxis`:return DE(e,n);case`zAxis`:return kE(e,n);case`angleAxis`:return ab(e,n);case`radiusAxis`:return ob(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},jE=(e,t,n)=>{switch(t){case`xAxis`:return wE(e,n);case`yAxis`:return DE(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},ME=(e,t,n)=>{switch(t){case`xAxis`:return wE(e,n);case`yAxis`:return DE(e,n);case`angleAxis`:return ab(e,n);case`radiusAxis`:return ob(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},NE=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function PE(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var FE=e=>e.graphicalItems.cartesianItems,IE=J([mb,hb],PE),LE=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),RE=J([FE,AE,IE],LE,{memoizeOptions:{resultEqualityCheck:bb}}),zE=J([RE],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(vb)),BE=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),VE=J([RE],BE),HE=e=>e.map(e=>e.data).filter(Boolean).flat(1),UE=J([RE],e=>e.some(e=>!e.data)),WE=J([RE],HE,{memoizeOptions:{resultEqualityCheck:bb}}),GE=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},KE=J([WE,yy],GE),qE=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:cp(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:cp(e,t.dataKey)})),JE=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:s,dataEndIndex:c}=r,l=qE(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...o.slice(s,c+1).map(e=>({value:cp(e,t.dataKey)})).filter(e=>e.value!=null),...l]:l},YE=J([KE,AE,RE,yy,UE,WE],JE);function XE(e){if(tc(e)||e instanceof Date){var t=Number(e);if(Q(t))return t}}function ZE(e){if(Array.isArray(e)){var t=[XE(e[0]),XE(e[1])];return wy(t)?t:void 0}var n=XE(e);if(n!=null)return[n,n]}function QE(e){return e.map(XE).filter(lc)}function $E(e,t){var n=XE(e),r=XE(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var eD=J([YE],e=>e?.map(e=>e.value).sort($E));function tD(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function nD(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!$s(t))r=t;else if(Array.isArray(t)){var i=QE(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:QE(n.flatMap(t=>{var n=cp(e,t.dataKey),i,a;if(Array.isArray(n)?[i,a]=n:i=a=n,!(!Q(i)||!Q(a)))return[r-i,r+a]}))}var rD=e=>ME(e,Sb(e),Cb(e)),iD=J([rD],e=>e?.dataKey),aD=J([zE,yy,rD],_b),oD=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:hp(e,o.map(gb),n),graphicalItems:o}]}))},sD=J([aD,zE,Vy,Hy],oD),cD=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=xp(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},lD=J([AE],e=>e.allowDataOverflow),uD=e=>{if(e==null||!(`domain`in e))return xE;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=QE(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??xE},dD=J([AE],uD),fD=J([dD,lD],Ey),pD=J([sD,_y,mb,fD],cD,{memoizeOptions:{resultEqualityCheck:yb}}),mD=e=>e.errorBars,hD=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>tD(n,e)),gD=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},_D=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>tD(i,e));n.forEach(n=>{var r=cp(n,t.dataKey??e.dataKey),i=nD(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||as)&&(s=l)}var u=ZE(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=ZE(cp(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),Q(o)&&Q(s))return[o,s]},vD=J([KE,AE,VE,mD,mb,xy],_D,{memoizeOptions:{resultEqualityCheck:yb}});function yD(e){var{value:t}=e;if(tc(t)||t instanceof Date)return t}var bD=(e,t,n)=>{var r=e.map(yD).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&ic(r))?(0,hE.default)(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},xD=e=>e.referenceElements.dots,SD=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),CD=J([xD,mb,hb],SD),wD=e=>e.referenceElements.areas,TD=J([wD,mb,hb],SD),ED=e=>e.referenceElements.lines,DD=J([ED,mb,hb],SD),OD=(e,t)=>{if(e!=null){var n=QE(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},kD=J(CD,mb,OD),AD=(e,t)=>{if(e!=null){var n=QE(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},jD=J([TD,mb],AD);function MD(e){if(e.x!=null)return QE([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:QE(t)}function ND(e){if(e.y!=null)return QE([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:QE(t)}var PD=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?MD(e):ND(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},FD=J(kD,J([DD,mb],PD),jD,(e,t,n)=>gD(e,n,t)),ID=(e,t,n,r,i,a,o,s)=>n??Dy(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?gD(r,a,i):gD(a,i),e.allowDataOverflow),LD=J([AE,dD,fD,pD,vD,FD,Pm,mb],ID,{memoizeOptions:{resultEqualityCheck:yb}}),RD=[0,1],zD=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:s,type:c}=e,l=up(t,a);return l&&s==null?(0,hE.default)(0,n?.length??0):c===`category`?bD(r,e,l):i===`expand`&&!l?RD:o}},BD=J([AE,Pm,KE,YE,Vy,mb,LD],zD),VD=J([AE,NE,Uy],dE),HD=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=uD(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&wy(e)){if(a)return Fy(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return Iy(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&wy(e))return Fy(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&wy(e))return Iy(e,t.tickCount,t.allowDecimals,`adaptive`)}}},UD=J([BD,ME,VD],HD),WD=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&wy(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},GD=J([AE,BD,UD,mb],WD),KD=J(J(YE,AE,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(QE(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;si,(e,t,n,r,i)=>{if(!Q(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=U(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),qD=(e,t,n)=>{var r=wE(e,t);return r==null||typeof r.padding!=`string`?0:KD(e,`xAxis`,t,n,r.padding)},JD=(e,t,n)=>{var r=DE(e,t);return r==null||typeof r.padding!=`string`?0:KD(e,`yAxis`,t,n,r.padding)},YD=J(wE,qD,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),XD=J(DE,JD,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),ZD=J([qp,YD,$p,Qp,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),QD=J([qp,Pm,XD,$p,Qp,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),$D=(e,t,n,r)=>{switch(t){case`xAxis`:return ZD(e,n,r);case`yAxis`:return QD(e,n,r);case`zAxis`:return kE(e,n)?.range;case`angleAxis`:return db(e);case`radiusAxis`:return fb(e,n);default:return}},eO=J([AE,$D],Xy),tO=J([AE,VD,J([VD,GD],Tb),eO],cE),nO=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n;if(up(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},rO=J([Pm,YE,ME,mb],nO),iO=J([tO],wb);J([tO],mE),J([tO,eD],pE),J([RE,mD,mb],hD);function aO(e,t){return e.idt.id)}var oO=(e,t)=>t,sO=(e,t,n)=>n,cO=J(Np,oO,sO,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(aO)),lO=J(Pp,oO,sO,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(aO)),uO=(e,t)=>({width:e.width,height:t.height}),dO=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),fO=J(qp,wE,uO),pO=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},mO=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},hO=J(Ap,qp,cO,oO,sO,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=uO(t,n);o??=pO(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),gO=J(kp,qp,lO,oO,sO,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=dO(t,n);o??=mO(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),_O=J([qp,wE,(e,t)=>{var n=wE(e,t);if(n!=null)return hO(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),vO=J([qp,DE,(e,t)=>{var n=DE(e,t);if(n!=null)return gO(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),yO=J(qp,DE,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),bO=(e,t,n)=>{switch(t){case`xAxis`:return fO(e,n).width;case`yAxis`:return yO(e,n).height;default:return}},xO=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=up(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&ic(l))return c}},SO=J([Pm,YE,AE,mb],xO),CO=J([Pm,jE,VD,iO,SO,rO,$D,UD,mb],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=up(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),wO=J([Pm,ME,VD,iO,UD,$D,SO,rO,mb],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=up(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?Qs(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return Q(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(lc):l&&s?s.map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(lc):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(lc):r.domain().map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(lc)}}),TO=J([Pm,ME,iO,$D,SO,rO,mb],(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=up(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?Qs(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return Q(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(lc):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return Q(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(lc):n.domain().map((e,t)=>{var r=n.map(e);return Q(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(lc)}}),EO=J(AE,iO,(e,t)=>{if(!(e==null||t==null))return _E(_E({},e),{},{scale:t})});J((e,t,n)=>kE(e,n),J([J([AE,VD,BD,eO],cE)],wb),(e,t)=>{if(!(e==null||t==null))return _E(_E({},e),{},{scale:t})});var DO=J([Pm,Np,Pp],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});J([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);ae.options.defaultTooltipEventType,kO=e=>e.options.validateTooltipEventTypes;function AO(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function jO(e,t){return AO(t,OO(e),kO(e))}function MO(e){return G(t=>jO(t,e))}var NO=(e,t)=>{var n,r=Number(t);if(!($s(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},PO=e=>e.tooltip.settings,FO={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},IO=sf({name:`tooltip`,initialState:{itemInteraction:{click:FO,hover:FO},axisInteraction:{click:FO,hover:FO},keyboardInteraction:FO,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(Fh(t.payload))},prepare:Kd()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Md(e).tooltipItemPayloads.indexOf(Fh(n));i>-1&&(e.tooltipItemPayloads[i]=Fh(r))},prepare:Kd()},removeTooltipEntrySettings:{reducer(e,t){var n=Md(e).tooltipItemPayloads.indexOf(Fh(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Kd()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:LO,replaceTooltipEntrySettings:RO,removeTooltipEntrySettings:zO,setTooltipSettingsState:BO,setActiveMouseOverItemIndex:VO,mouseLeaveItem:HO,mouseLeaveChart:UO,setActiveClickItemIndex:WO,setMouseOverAxisIndex:GO,setMouseClickAxisIndex:KO,setSyncInteraction:qO,setKeyboardInteraction:JO}=IO.actions,YO=IO.reducer;function XO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZO(e){for(var t=1;t{if(t==null)return FO;var i=tk(e,t,n);if(i==null)return FO;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(nk(i)){if(a)return ZO(ZO({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return ZO(ZO({},FO),{},{coordinate:i.coordinate})};function ik(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function ak(e,t){var n=ik(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function ok(e,t,n){if(n==null||t==null)return!0;var r=cp(e,t);return r==null||!wy(n)?!0:ak(r,n)}var sk=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Q(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||ok(l,n,r)?String(c):null},ck=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},lk=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},uk=e=>e.options.tooltipPayloadSearcher,dk=e=>e.tooltip;function fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pk(e){for(var t=1;te(t)}function bk(e){if(typeof e==`string`)return e}function xk(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?_k(e.name):void 0,unit:`unit`in e?vk(e.unit):void 0,dataKey:`dataKey`in e?yk(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?bk(e.color):void 0,fill:`fill`in e?bk(e.fill):void 0}}function Sk(e,t){return e??t}var Ck=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=Sk(d,s),m=Array.isArray(p)?tp(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?oc(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=xk(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=pk(pk({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(Tp({tooltipEntrySettings:o,dataKey:i,payload:a,value:cp(a,i),name:r==null?void 0:String(r)}))}):e.push(Tp({tooltipEntrySettings:f,dataKey:h,payload:_,value:cp(_,h),name:cp(_,g)??f?.name})),e},[])}},wk=J([rD,NE,Uy],dE),Tk=J([J([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),rD,J([Sb,Cb],PE)],LE,{memoizeOptions:{resultEqualityCheck:bb}}),Ek=J([Tk],e=>e.filter(vb)),Dk=J([Tk],HE,{memoizeOptions:{resultEqualityCheck:bb}}),Ok=J([Tk],e=>e.some(e=>!e.data)),kk=J([Dk,_y],GE),Ak=J([Ek,_y,rD],_b),jk=J([kk,rD,Tk,_y,Ok,Dk],JE),Mk=J([rD],uD),Nk=J([Mk,J([rD],e=>e.allowDataOverflow)],Ey),Pk=J([J([Ak,J([Tk],e=>e.filter(vb)),Vy,Hy],oD),_y,Sb,Nk],cD),Fk=J([kk,rD,J([Tk],BE),mD,Sb,Cy],_D,{memoizeOptions:{resultEqualityCheck:yb}}),Ik=J([J([xD,Sb,Cb],SD),Sb],OD),Lk=J([J([wD,Sb,Cb],SD),Sb],AD),Rk=J([rD,Pm,kk,jk,Vy,Sb,J([rD,Mk,Nk,Pk,Fk,J([Ik,J([J([ED,Sb,Cb],SD),Sb],PD),Lk],gD),Pm,Sb],ID)],zD),zk=J([rD,Rk,J([Rk,rD,wk],HD),Sb],WD),Bk=e=>$D(e,Sb(e),Cb(e),!1),Vk=J([rD,Bk],Xy),Hk=J([J([rD,wk,zk,Vk],cE)],wb),Uk=J([Pm,rD,wk,Hk,Bk,J([Pm,jk,rD,Sb],xO),J([Pm,jk,rD,Sb],nO),Sb],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=up(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?Qs(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(lc):r.domain().map((e,t)=>{var n=r.map(e);return Q(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(lc)}}}),Wk=J([OO,kO,PO],(e,t,n)=>AO(n.shared,e,t)),Gk=e=>e.tooltip.settings.trigger,Kk=e=>e.tooltip.settings.defaultIndex,qk=J([dk,Wk,Gk,Kk],rk),Jk=J([qk,kk,iD,Rk],sk),Yk=J([Uk,Jk],NO),Xk=J([qk],e=>{if(e)return e.dataKey}),Zk=J([qk],e=>{if(e)return e.graphicalItemId}),Qk=J([dk,Wk,Gk,Kk],lk),$k=J([qk,J([kp,Ap,Pm,qp,Uk,Kk,Qk],ck)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),eA=J([qk],e=>e?.active??!1);J([J([Qk,Jk,_y,iD,Yk,uk,Wk],Ck)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function tA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nA(e){for(var t=1;tG(rD),sA=()=>{var e=oA(),t=G(Uk),n=G(Hk);return wp(!e||!n?void 0:nA(nA({},e),{},{scale:n}),t)};function cA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lA(e){for(var t=1;t{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},mA=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return lA(lA(lA({},r),Uv(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return lA(lA(lA({},r),Uv(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function hA(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var gA=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(Qs(c-s)!==Qs(l-c)){var d=[];if(Qs(l-c)===Qs(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_(v.coordinate+b.coordinate)/2||_>0&&_(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},_A=()=>G(Uy),vA=(e,t)=>t,yA=(e,t,n)=>n,bA=(e,t,n,r)=>r,xA=J(Uk,e=>(0,$l.default)(e,e=>e.coordinate)),SA=J([dk,vA,yA,bA],rk),CA=J([SA,kk,iD,Rk],sk),wA=(e,t,n)=>{if(t!=null){var r=dk(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},TA=J([dk,vA,yA,bA],lk),EA=J([kp,Ap,Pm,qp,Uk,bA,TA],ck),DA=J([SA,EA],(e,t)=>e.coordinate??t),OA=J([Uk,CA],NO),kA=J([TA,CA,_y,iD,OA,uk,vA],Ck),AA=J([SA,CA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),jA=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&hA(e,o)){var s=gA(Dp(e,t),a,i,n,r),c=pA(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},MA=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=Yv(e,n);if(s){var c=gA(Op(s,t),o,a,r,i),l=mA(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},NA=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?jA(e,t,r,i,a,o,s):MA(e,t,n,r,i,a,o)},PA=J(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),FA=J(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(qy));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:xb}});function IA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LA(e){for(var t=1;tLA(LA({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},HA=new Set(Object.values(qy));function UA(e){return HA.has(e)}var WA=sf({name:`zIndex`,initialState:VA,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Kd()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!UA(n)&&delete e.zIndexMap[n])},prepare:Kd()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=Fh(r):e.zIndexMap[n].element=Fh(r):e.zIndexMap[n]={consumers:0,element:i?void 0:Fh(r),panoramaElement:i?Fh(r):void 0}},prepare:Kd()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Kd()}}}),{registerZIndexPortal:GA,unregisterZIndexPortal:KA,registerZIndexPortalElement:qA,unregisterZIndexPortalElement:JA}=WA.actions,YA=WA.reducer;function XA(e){var{zIndex:t,children:n}=e,r=Rm()&&t!==void 0&&t!==0,i=Zp(),a=(0,v.useRef)(void 0),o=(0,v.useRef)(new Set),s=W(),c=G(e=>PA(e,t,i));if((0,v.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(KA({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(GA({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(KA({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,v.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(KA({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,b.createPortal)(n,l):null}function ZA(){return ZA=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,v.useContext)(oj),cj=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!$s(n))return e[n]}},pj=sf({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),mj=pj.reducer,{createEventEmitter:hj}=pj.actions;function gj(e){return e.tooltip.syncInteraction}var _j=sf({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=Fh(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:vj,setDataStartEndIndexes:yj,setComputedData:bj}=_j.actions,xj=_j.reducer,Sj=[`x`,`y`];function Cj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wj(e){for(var t=1;t{if(e==null)return uc;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(qO({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=Oj(d,Sj),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=wj(wj({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(wj(wj({},c),{},{payload:wj(wj({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(x==null||o==null){n(qO({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(b==null){n(qO({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(qO({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return lj.on(uj,s),()=>{lj.off(uj,s)}},[G(e=>e.rootProps.className),n,t,e,r,i,a,o])}function jj(){var e=G(Wy),t=G(Ky),n=W();(0,v.useEffect)(()=>{if(e==null)return uc;var r=(r,i,a)=>{t!==a&&e===r&&n(yj(i))};return lj.on(dj,r),()=>{lj.off(dj,r)}},[n,t,e])}function Mj(){var e=W();(0,v.useEffect)(()=>{e(hj())},[e]),Aj(),jj()}function Nj(e,t,n,r,i,a){var o=G(n=>wA(n,e,t)),s=G(Zk),c=G(Ky),l=G(Wy),u=G(Gy),d=G(gj)?.sourceViewBox!=null,f=Om();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=qO({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});lj.emit(uj,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fj(e){for(var t=1;t{C(BO({shared:g,trigger:_,axisId:S,active:n,defaultIndex:w}))},[C,g,_,S,n,w]);var T=Om(),E=Qg(),D=MO(g),{activeIndex:O,isActive:k}=G(e=>AA(e,D,_,w))??{},ee=G(e=>kA(e,D,_,w)),te=G(e=>OA(e,D,_,w)),ne=G(e=>DA(e,D,_,w)),A=ee,re=sj(),ie=n??k??!1,[j,M]=au([A,ie]),ae=D===`axis`?te:void 0;Nj(D,_,ne,ae,O,ie);var oe=x??re;if(oe==null||T==null||D==null)return null;var se=A??Vj;ie||(se=Vj),s&&se.length&&(se=Cl(se.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,zj));var ce=se.length>0,le=Fj(Fj({},t),{},{payload:se,label:ae,active:ie,activeIndex:O,coordinate:ne,accessibilityLayer:E}),ue=v.createElement(Zg,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:ie,coordinate:ne,hasPayload:ce,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:T,wrapperStyle:m,lastBoundingBox:j,innerRef:M,hasPortalFromProps:!!x},Bj(o,le));return v.createElement(v.Fragment,null,(0,b.createPortal)(ue,oe),ie&&v.createElement(aj,{cursor:h,tooltipEventType:D,coordinate:ne,payload:se,index:O}))}var Wj=e=>null;Wj.displayName=`Cell`;function Gj(e,t,n){return(t=Kj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kj(e){var t=qj(e,`string`);return typeof t==`symbol`?t:t+``}function qj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Jj=class{constructor(e){Gj(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function Yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xj(e){for(var t=1;t{try{var n=document.getElementById(rM);n||(n=document.createElement(`span`),n.setAttribute(`id`,rM),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,nM,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},oM=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Hg.isSsr)return{width:0,height:0};if(!eM.enableCache)return aM(e,t);var n=iM(e,t),r=tM.get(n);if(r)return r;var i=aM(e,t);return tM.set(n,i),i},sM;function cM(e,t,n){return(t=lM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lM(e){var t=uM(e,`string`);return typeof t==`symbol`?t:t+``}function uM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,pM=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,mM=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,hM={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},gM=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function _M(e){return gM.includes(e)}var vM=`NaN`;function yM(e,t){return e*hM[t]}var bM=class e{static parse(t){var[,n,r]=mM.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,$s(e)&&(this.unit=``),t!==``&&!pM.test(t)&&(this.num=NaN,this.unit=``),_M(t)&&(this.num=yM(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return $s(this.num)}};sM=bM,cM(bM,`NaN`,new sM(NaN,``));function xM(e){if(e==null||e.includes(vM))return vM;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=dM.exec(t)??[],a=bM.parse(n??``),o=bM.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return vM;t=t.replace(dM,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=fM.exec(t)??[],d=bM.parse(c??``),f=bM.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return vM;t=t.replace(fM,p.toString())}return t}var SM=/\(([^()]*)\)/;function CM(e){for(var t=e,n;(n=SM.exec(t))!=null;){var[,r]=n;t=t.replace(SM,xM(r))}return t}function wM(e){var t=e.replace(/\s+/g,``);return t=CM(t),t=xM(t),t}function TM(e){try{return wM(e)}catch{return vM}}function EM(e){var t=TM(e.slice(5,-1));return t===vM?``:t}var DM=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],OM=[`dx`,`dy`,`angle`,`className`,`breakAll`];function kM(){return kM=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var i=[];return sc(t)||(i=n?t.toString().split(``):t.toString().split(MM)),{wordsWithComputedWidth:i.map(e=>({word:e,width:oM(e,r).width})),spaceWidth:n?0:oM(`\xA0`,r).width}}catch{return null}};function PM(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function FM(e){return sc(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var IM=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+ne.reduce((e,t)=>e.width>t.width?e:t),RM=`…`,zM=(e,t,n,r,i,a,o,s)=>{var c=NM({breakAll:n,style:r,children:e.slice(0,t)+RM});if(!c)return[!1,[]];var l=IM(c.wordsWithComputedWidth,a,o,s);return[l.length>i||LM(l).width>Number(a),l]},BM=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=H(a),u=String(o),d=IM(t,r,n,i);if(!l||i||!(d.length>a||LM(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=zM(u,g-1,c,s,a,r,n,i),[y]=zM(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},VM=e=>[{words:sc(e)?[]:e.toString().split(MM),width:void 0}],HM=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Hg.isSsr){var s,c,l=NM({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return VM(r);return BM({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return VM(r)},UM=`#808080`,WM={angle:0,breakAll:!1,capHeight:`0.71em`,fill:UM,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},GM=(0,v.forwardRef)((e,t)=>{var n=Fc(e,WM),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=AM(n,DM),f=(0,v.useMemo)(()=>HM({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:p,dy:m,angle:h,className:g,breakAll:_}=d,y=AM(d,OM);if(!tc(r)||!tc(i)||f.length===0)return null;var b=Number(r)+(H(p)?p:0),x=Number(i)+(H(m)?m:0);if(!Q(b)||!Q(x))return null;var S;switch(u){case`start`:S=EM(`calc(${o})`);break;case`middle`:S=EM(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=EM(`calc(${f.length-1} * -${a})`);break}var C=[],w=f[0];if(c&&w!=null){var T=w.width,{width:E}=d;C.push(`scale(${H(E)&&H(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,kM({},ao(y),{ref:t,x:b,y:x,className:z(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?UM:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return v.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});GM.displayName=`Text`;function KM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qM(e){for(var t=1;t{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=Dm(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?qM({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?qM({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?qM({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?qM({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?qM({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?qM({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?qM({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?qM({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v},k):n&&typeof n==`object`&&(H(n.x)||ec(n.x))&&(H(n.y)||ec(n.y))?qM({x:o+U(n.x,m),y:s+U(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):qM({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},QM=[`labelRef`],$M=[`content`];function eN(e,t){if(e==null)return{};var n,r,i=tN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,v.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return v.createElement(cN.Provider,{value:c},s)},uN=()=>{var e=(0,v.useContext)(cN),t=Om();return e||(t?Dm(t):void 0)},dN=(0,v.createContext)(null),fN=()=>{var e=(0,v.useContext)(dN),t=G(pb);return e||t},pN=e=>{var{value:t,formatter:n}=e,r=sc(e.children)?t:e.children;return typeof n==`function`?n(r):r},mN=e=>e!=null&&typeof e==`function`,hN=(e,t)=>Qs(t-e)*Math.min(Math.abs(t-e),360),gN=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:f,clockWise:p}=i,m=(l+u)/2,h=hN(d,f),g=h>=0?1:-1,_,y;switch(t){case`insideStart`:_=d+g*a,y=p;break;case`insideEnd`:_=f-g*a,y=!p;break;case`end`:_=f+g*a,y=p;break;default:throw Error(`Unsupported position ${t}`)}y=h<=0?y:!y;var b=Uv(s,c,m,_),x=Uv(s,c,m,_+(y?1:-1)*359),S=`M${b.x},${b.y} - A${m},${m},0,1,${+!y}, - ${x.x},${x.y}`,C=sc(e.id)?rc(`recharts-radial-line-`):e.id;return v.createElement(`text`,sN({},r,{dominantBaseline:`central`,className:z(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},_N=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=Uv(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=Uv(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},vN=e=>e!=null&&`cx`in e&&H(e.cx),yN={angle:0,offset:5,zIndex:qy.label,position:`middle`,textBreakAll:!1};function bN(e){if(!vN(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function xN(e){var t=Fc(e,yN),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=fN(),f=uN(),p=n==null?i===`center`?f:d??f:vN(n)?n:Dm(n),m,h,g=bN(p);if(!p||sc(a)&&sc(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var _=rN(rN({},t),{},{viewBox:p});if((0,v.isValidElement)(s)){var{labelRef:y}=_;return(0,v.cloneElement)(s,eN(_,QM))}if(typeof s==`function`){var{content:b}=_;if(m=(0,v.createElement)(s,eN(_,$M)),(0,v.isValidElement)(m))return m}else m=pN(t);var x=ao(t);if(vN(p)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return gN(t,i,m,x,p);h=_N(p,t.offset,t.position)}else{if(!g)return null;var S=ZM({viewBox:g,position:i,offset:t.offset,parentViewBox:vN(r)?void 0:r,clamp:!0});h=rN(rN({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width===void 0?{}:{width:S.width}),S.height===void 0?{}:{height:S.height})}return v.createElement(XA,{zIndex:t.zIndex},v.createElement(GM,sN({ref:u,className:z(`recharts-label`,c)},x,h,{textAnchor:PM(x.textAnchor)?x.textAnchor:h.textAnchor,breakAll:l}),m))}xN.displayName=`Label`;var SN=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(xN,sN({key:`label-implicit`},r)):tc(e)?v.createElement(xN,sN({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===xN?(0,v.cloneElement)(e,rN({key:`label-implicit`},r)):v.createElement(xN,sN({key:`label-implicit`,content:e},r)):mN(e)?v.createElement(xN,sN({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(xN,sN({},e,{key:`label-implicit`},r)):null};function CN(e){var{label:t,labelRef:n}=e;return SN(t,uN(),n)||null}var wN=[`valueAccessor`],TN=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function EN(){return EN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(FM(t))return t},AN=(0,v.createContext)(void 0),jN=AN.Provider,MN=(0,v.createContext)(void 0),NN=MN.Provider;function PN(){return(0,v.useContext)(AN)}function FN(){return(0,v.useContext)(MN)}function IN(e){var{valueAccessor:t=kN}=e,n=DN(e,wN),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=DN(n,TN),l=PN(),u=FN(),d=l||u;return!d||!d.length?null:v.createElement(XA,{zIndex:s??qy.label},v.createElement(V,{className:`recharts-label-list`},d.map((e,i)=>{var s=sc(r)?t(e,i):cp(e.payload,r),l=sc(a)?{}:{id:`${a}-${i}`};return v.createElement(xN,EN({key:`label-${i}`},ao(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}IN.displayName=`LabelList`;function LN(e){var{label:t}=e;return t?t===!0?v.createElement(IN,{key:`labelList-implicit`}):v.isValidElement(t)||mN(t)?v.createElement(IN,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(IN,EN({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}var RN=e=>e.graphicalItems.polarItems,zN=J([RN,AE,J([mb,hb],PE)],LE),BN=J([J([zN],HE),vy],GE),VN=J([BN,AE,zN],qE);J([BN,AE,zN],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:cp(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:cp(e,t.dataKey),errorDomain:[]})));var HN=()=>void 0,UN=J([AE,Pm,BN,VN,Vy,mb,J([AE,dD,fD,HN,J([BN,AE,zN,mD,mb,Sy],_D),HN,Pm,mb],ID)],zD);J([VD,J([AE,UN,J([UN,ME,VD],HD),mb],WD)],Tb);var WN=sf({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=Fh(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=Fh(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:GN,removeRadiusAxis:KN,addAngleAxis:qN,removeAngleAxis:JN}=WN.actions,YN=WN.reducer;function XN(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}function ZN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QN(e){for(var t=1;tt],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),rP=[],iP=(e,t,n)=>n?.length===0?rP:n,aP=J([vy,nP,iP],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>QN(QN({},t.presentationProps),e.props))),i!=null)return i}}),oP=J([aP,nP,iP],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=cp(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:Ep(a,t.dataKey),color:o,payload:e,type:t.legendType}})}),sP=J([aP,nP,iP,qp],(e,t,n,r)=>{if(!(t==null||e==null))return IF({offset:r,pieSettings:t,displayedData:e,cells:n})}),cP=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),lP=o(((e,t)=>{t.exports=cP()}))(),uP=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,dP=null,fP=null,pP=e=>{if(e===dP&&Array.isArray(fP))return fP;var t=[];return v.Children.forEach(e,e=>{sc(e)||((0,lP.isFragment)(e)?t=t.concat(pP(e.props.children)):t.push(e))}),fP=t,dP=e,t};function mP(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>uP(e)):[uP(t)],pP(e).forEach(e=>{var t=(0,Zs.default)(e,`type.displayName`)||(0,Zs.default)(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var hP=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),gP=o(((e,t)=>{t.exports=hP().isPlainObject})),_P,vP,yP,bP,xP;function SP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CP(e){for(var t=1;t{var a=n-r,o=Xs(_P||=OP([`M `,`,`,``]),e,t);return o+=Xs(vP||=OP([`L `,`,`,``]),e+n,t),o+=Xs(yP||=OP([`L `,`,`,``]),e+n-a/2,t+i),o+=Xs(bP||=OP([`L `,`,`,``]),e+n-a/2-r,t+i),o+=Xs(xP||=OP([`L `,`,`,` Z`]),e,t),o},AP={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},jP=e=>{var t=Fc(e,AP),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,f=(0,v.useRef)(null),[p,m]=(0,v.useState)(-1),h=(0,v.useRef)(i),g=(0,v.useRef)(a),_=(0,v.useRef)(o),y=(0,v.useRef)(n),b=(0,v.useRef)(r),x=dv(e,`trapezoid-`);if((0,v.useEffect)(()=>{if(f.current&&f.current.getTotalLength)try{var e=f.current.getTotalLength();e&&m(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var S=z(`recharts-trapezoid`,s);if(!d)return v.createElement(`g`,null,v.createElement(`path`,DP({},ao(t),{className:S,d:kP(n,r,i,a,o)})));var C=h.current,w=g.current,T=_.current,E=y.current,D=b.current,O=`0px ${p===-1?1:p}px`,k=`${p}px ${p}px`,ee=M_([`strokeDasharray`],l,c);return v.createElement(uv,{animationId:x,key:x,canBegin:p>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=ac(C,i,e),c=ac(w,a,e),l=ac(T,o,e),u=ac(E,n,e),d=ac(D,r,e);f.current&&(h.current=s,g.current=c,_.current=l,y.current=u,b.current=d);var p=e>0?{transition:ee,strokeDasharray:k}:{strokeDasharray:O};return v.createElement(`path`,DP({},ao(t),{className:S,d:kP(u,d,s,c,l),ref:f,style:CP(CP({},p),t.style)}))})},MP=l(gP()),NP=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function PP(e,t){if(e==null)return{};var n,r,i=FP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var r=W();return(i,a)=>o=>{e?.(i,a,o),r(VO({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},qP=e=>{var t=W();return(n,r)=>i=>{e?.(n,r,i),t(HO())}},JP=(e,t,n)=>{var r=W();return(i,a)=>o=>{e?.(i,a,o),r(WO({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function YP(e){var{tooltipEntrySettings:t}=e,n=W(),r=Zp(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(LO(t)):i.current!==t&&n(RO({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(zO(i.current)),null)},[n]),null}function XP(e){var{legendPayload:t}=e,n=W(),r=Zp(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(zh(t)):i.current!==t&&n(Bh({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(Vh(i.current)),null)},[n]),null}function ZP(e){var{legendPayload:t}=e,n=W(),r=G(Pm),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r!==`centric`&&r!==`radial`||(i.current===null?n(zh(t)):i.current!==t&&n(Bh({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(Vh(i.current)),null)},[n]),null}var QP=v.useId??(()=>{var[e]=v.useState(()=>rc(`uid-`));return e});function $P(e,t){var n=QP();return t||(e?`${e}-${n}`:n)}var eF=(0,v.createContext)(void 0),tF=e=>{var{id:t,type:n,children:r}=e,i=$P(`recharts-${n}`,t);return v.createElement(eF.Provider,{value:i},r(i))},nF=sf({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(Fh(t.payload))},prepare:Kd()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Md(e).cartesianItems.indexOf(Fh(n));i>-1&&(e.cartesianItems[i]=Fh(r))},prepare:Kd()},removeCartesianGraphicalItem:{reducer(e,t){var n=Md(e).cartesianItems.indexOf(Fh(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:Kd()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(Fh(t.payload))},prepare:Kd()},removePolarGraphicalItem:{reducer(e,t){var n=Md(e).polarItems.indexOf(Fh(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:Kd()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Md(e).polarItems.indexOf(Fh(n));i>-1&&(e.polarItems[i]=Fh(r))},prepare:Kd()}}}),{addCartesianGraphicalItem:rF,replaceCartesianGraphicalItem:iF,removeCartesianGraphicalItem:aF,addPolarGraphicalItem:oF,removePolarGraphicalItem:sF,replacePolarGraphicalItem:cF}=nF.actions,lF=nF.reducer,uF=(0,v.memo)(e=>{var t=W(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(rF(e)):n.current!==e&&t(iF({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(aF(n.current)),null)},[t]),null}),dF=(0,v.memo)(e=>{var t=W(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(oF(e)):n.current!==e&&t(cF({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(sF(n.current)),null)},[t]),null}),fF=[`key`],pF=[`onMouseEnter`,`onClick`,`onMouseLeave`],mF=[`id`],hF=[`id`];function gF(){return gF=Object.assign?Object.assign.bind():function(e){for(var t=1;tmP(e.children,Wj),[e.children]),n=G(n=>oP(n,e.id,t));return n==null?null:v.createElement(ZP,{legendPayload:n})}function TF(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(v.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var{fill:n}=e;return typeof n==`string`?n:void 0}}var EF=v.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:s,hide:c,tooltipType:l,id:u,activeShape:d}=e,f=TF(d),p={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return f==null||t==null?t:t.map(e=>bF(bF({},e),{},{color:f,fill:f}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Ep(s,t),hide:c,type:l,color:o,unit:``,graphicalItemId:u}};return v.createElement(YP,{tooltipEntrySettings:p})}),DF=(e,t)=>e>t?`start`:eU(typeof t==`function`?t(e):t,n,n*.8),kF=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,s=Wv(a,o);return{cx:i+U(e.cx,a,a/2),cy:r+U(e.cy,o,o/2),innerRadius:U(e.innerRadius,s,0),outerRadius:OF(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},AF=(e,t)=>Qs(t-e)*Math.min(Math.abs(t-e),360),jF=(e,t)=>{if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=z(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className),{key:r}=t,i=_F(t,fF);return v.createElement(p_,gF({},i,{type:`linear`,className:n}))},MF=(e,t,n)=>{if(v.isValidElement(e))return v.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),v.isValidElement(r)))return r;var i=z(`recharts-pie-label-text`,XN(e));return v.createElement(GM,gF({},t,{alignmentBaseline:`middle`,className:i}),r)};function NF(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var s=ro(n),c=io(i),l=io(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=Uv(e.cx,e.cy,e.outerRadius+u,n),d=bF(bF(bF(bF({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:DF(r.x,e.cx)},r),f=bF(bF(bF(bF({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[Uv(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return v.createElement(XA,{zIndex:qy.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},v.createElement(V,null,a&&jF(a,f),MF(i,d,cp(e,o))))});return v.createElement(V,{className:`recharts-pie-labels`},d)}function PF(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i==`object`&&i&&`position`in i?v.createElement(LN,{label:i}):v.createElement(NF,{sectors:t,props:n,showLabels:r})}function FF(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,s=G(Jk),c=G(Xk),l=G(Zk),{onMouseEnter:u,onClick:d,onMouseLeave:f}=i,p=_F(i,pF),m=KP(u,i.dataKey,o),h=qP(f),g=JP(d,i.dataKey,o);return t==null||t.length===0?null:v.createElement(v.Fragment,null,t.map((e,u)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var d=l==null||l===o,f=String(u)===s&&(c==null||i.dataKey===c)&&d,_=n&&f?n:s?r:null,y=bF(bF({},e),{},{stroke:e.stroke,tabIndex:-1,[Fp]:u,[Ip]:o});return v.createElement(V,gF({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${u}`,tabIndex:-1,className:`recharts-pie-sector`},kc(p,e,u),{onMouseEnter:m(e,u),onMouseLeave:h(e,u),onClick:g(e,u)}),v.createElement(GP,gF({option:a??_,index:u,shapeType:`sector`,isActive:f},y)))}))}function IF(e){var{pieSettings:t,displayedData:n,cells:r,offset:i}=e,{cornerRadius:a,startAngle:o,endAngle:s,dataKey:c,nameKey:l,tooltipType:u}=t,d=Math.abs(t.minAngle),f=AF(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>cp(e,c,0)!==0).length,g=(p>=360?h:h-1)*m,_=n.reduce((e,t)=>{var n=cp(t,c,0);return e+(H(n)?n:0)},0),v=d>0&&_>0&&n.some(e=>{var t=cp(e,c,0),n=(H(t)?t:0)/_;return t!==0&&n*p0){var x;b=n.map((e,n)=>{var s=cp(e,c,0),d=cp(e,l,n),p=kF(t,i,e),h=(H(s)?s:0)/_,g,b=bF(bF({},e),r&&r[n]&&r[n].props),S=b!=null&&`fill`in b&&typeof b.fill==`string`?b.fill:t.fill;g=n?x.endAngle+Qs(f)*m*(s===0?0:1):o;var C=g+Qs(f)*((s===0?0:v)+h*y),w=(g+C)/2,T=(p.innerRadius+p.outerRadius)/2,E=[{name:d,value:s,payload:b,dataKey:c,type:u,color:S,fill:S,graphicalItemId:t.id}],D=Uv(p.cx,p.cy,T,w);return x=bF(bF(bF(bF({},t.presentationProps),{},{percent:h,cornerRadius:typeof a==`string`?parseFloat(a):a,name:d,tooltipPayload:E,midAngle:w,middleRadius:T,tooltipPosition:D},b),p),{},{value:s,dataKey:c,startAngle:g,endAngle:C,payload:b,paddingAngle:s===0?0:Qs(f)*m}),x})}return b}function LF(e){var{showLabels:t,sectors:n,children:r}=e,i=(0,v.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return v.createElement(NN,{value:t?i:void 0},r)}function RF(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,activeShape:l,inactiveShape:u,onAnimationStart:d,onAnimationEnd:f}=t,p=dv(t,`recharts-pie-`),m=n.current,[h,g]=(0,v.useState)(!1),_=(0,v.useCallback)(()=>{typeof f==`function`&&f(),g(!1)},[f]),y=(0,v.useCallback)(()=>{typeof d==`function`&&d(),g(!0)},[d]);return v.createElement(LF,{showLabels:!h,sectors:i},v.createElement(uv,{animationId:p,begin:o,duration:s,isActive:a,easing:c,onAnimationStart:y,onAnimationEnd:_,key:p},e=>{var a=[],o=(i&&i[0])?.startAngle??0;return i?.forEach((t,n)=>{var r=m&&m[n],i=n>0?(0,Zs.default)(t,`paddingAngle`,0):0;if(r){var s=ac(r.endAngle-r.startAngle,t.endAngle-t.startAngle,e),c=bF(bF({},t),{},{startAngle:o+i,endAngle:o+s+i});a.push(c),o=c.endAngle}else{var{endAngle:l,startAngle:u}=t,d=ac(0,l-u,e),f=bF(bF({},t),{},{startAngle:o+i,endAngle:o+d+i});a.push(f),o=f.endAngle}}),n.current=a,v.createElement(V,null,v.createElement(FF,{sectors:a,activeShape:l,inactiveShape:u,allOtherPieProps:t,shape:t.shape,id:r}))}),v.createElement(PF,{showLabels:!h,sectors:i,props:t}),t.children)}var zF={animationBegin:400,animationDuration:1500,animationEasing:`ease`,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:`#fff`,zIndex:qy.area};function BF(e){var{id:t}=e,n=_F(e,mF),{hide:r,className:i,rootTabIndex:a}=e,o=(0,v.useMemo)(()=>mP(e.children,Wj),[e.children]),s=G(e=>sP(e,t,o)),c=(0,v.useRef)(null),l=z(`recharts-pie`,i);return r||s==null?(c.current=null,v.createElement(V,{tabIndex:a,className:l})):v.createElement(XA,{zIndex:e.zIndex},v.createElement(EF,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),v.createElement(V,{tabIndex:a,className:l},v.createElement(RF,{props:bF(bF({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function VF(e){var t=Fc(e,zF),{id:n}=t,r=_F(t,hF),i=ro(r);return v.createElement(tF,{id:n,type:`pie`},e=>v.createElement(v.Fragment,null,v.createElement(dF,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),v.createElement(wF,gF({},r,{id:e})),v.createElement(BF,gF({},r,{id:e}))))}var HF=VF;HF.displayName=`Pie`;function UF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WF(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),kp,Ap],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),sI=()=>G(oI),cI=(e,t,n)=>{var r=n??e;if(!sc(r))return U(r,t,0)},lI=(e,t,n)=>{var r={},i=e.filter(vb),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:cI(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:cI(t,n,e.barSize)}));return[...s,...c]};function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dI(e){for(var t=1;te+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=U(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=Q(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var gI=(e,t,n,r,i,a,o)=>{var s=sc(o)?t:o,c=hI(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>dI(dI({},e),{},{position:dI(dI({},e.position),{},{offset:e.position.offset-i/2})}))),c},_I=(e,t)=>{var n=gb(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},vI=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function yI(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&Q(e.zIndex)?e.zIndex:t}var bI=e=>{var{chartData:t}=e,n=W(),r=Zp();return(0,v.useEffect)(()=>r?()=>{}:(n(vj(t)),()=>{n(vj(void 0))}),[t,n,r]),null},xI={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},SI=sf({name:`brush`,initialState:xI,reducers:{setBrushSettings(e,t){return t.payload==null?xI:t.payload}}}),{setBrushSettings:CI}=SI.actions,wI=SI.reducer;function TI(e){return(e%180+180)%180}var EI=function(e){var{width:t,height:n}=e,r=TI(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Md(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Md(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(Fh(t.payload))},removeLine:(e,t)=>{var n=Md(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:OI,removeDot:kI,addArea:AI,removeArea:jI,addLine:MI,removeLine:NI}=DI.actions,PI=DI.reducer,FI=(0,v.createContext)(void 0),II=e=>{var{children:t}=e,[n]=(0,v.useState)(`${rc(`recharts`)}-clip`),r=sI();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return v.createElement(FI.Provider,{value:n},v.createElement(`defs`,null,v.createElement(`clipPath`,{id:n},v.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function LI(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;re*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function VI(e,t){return LI(e,t+1)}function HI(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:s}=t,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:LI(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||BI(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function UI(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var{start:o,end:s}=t,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||BI(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=GI(GI({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=GI(GI({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&BI(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=GI(GI({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function XI(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,{start:c,end:l}=t;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=GI(GI({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&BI(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=GI(GI({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=GI(GI({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=GI(GI({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&BI(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=GI(GI({},a),{},{isShow:!0}))},h=0;h{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?RI(oM(i,{fontSize:t,letterSpacing:n}),m,d):oM(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?Qs(_.coordinate-g.coordinate):1,y=zI(a,v,p);return c===`equidistantPreserveStart`?HI(v,y,h,i,o):c===`equidistantPreserveEnd`?UI(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?XI(v,y,h,i,o,c===`preserveStartEnd`):YI(v,y,h,i,o),f.filter(e=>e.isShow))}var QI=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>o&&(o=t.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,l=o+c+s+(n?r:0);return Math.round(l)}return 0},$I=sf({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=Fh(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:eL,removeRenderedTicks:tL}=$I.actions,nL=$I.reducer,rL=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function iL(e,t){if(e==null)return{};var n,r,i=aL(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;rr==null||n==null?uc:(i(eL({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(tL({axisId:r,axisType:n}))}),[i,t,r,n]),null}var yL=(0,v.forwardRef)((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:s,padding:c,tickTextProps:l,orientation:u,mirror:d,x:f,y:p,width:m,height:h,tickSize:g,tickMargin:_,fontSize:y,letterSpacing:b,getTicksConfig:x,events:S,axisType:C,axisId:w}=e,T=ZI(cL(cL({},x),{},{ticks:n}),y,b),E=ro(x),D=io(r),O=PM(E.textAnchor)?E.textAnchor:hL(u,d),k=gL(u,d),ee={};typeof i==`object`&&(ee=i);var te=cL(cL({},E),{},{fill:`none`},ee),ne=T.map(e=>cL({entry:e},mL(e,f,p,m,h,u,g,d,_))),A=ne.map(e=>{var{entry:t,line:n}=e;return v.createElement(V,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},i&&v.createElement(`line`,oL({},te,n,{className:z(`recharts-cartesian-axis-tick-line`,(0,Zs.default)(i,`className`))})))}),re=ne.map((e,t)=>{var{entry:n,tick:i}=e,u=cL(cL({},cL(cL(cL(cL({verticalAnchor:k},E),{},{textAnchor:O,stroke:`none`,fill:a},i),{},{index:t,payload:n,visibleTicksCount:T.length,tickFormatter:o,padding:c},l),{},{angle:l?.angle??E.angle??0})),D);return v.createElement(V,oL({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},kc(S,n,t)),r&&v.createElement(_L,{option:r,tickProps:u,value:`${typeof o==`function`?o(n.value,t):n.value}${s||``}`}))});return v.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${C}-ticks`},v.createElement(vL,{ticks:T,axisId:w,axisType:C}),re.length>0&&v.createElement(XA,{zIndex:qy.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${C}-tick-labels`,ref:t},re)),A.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${C}-tick-lines`},A))}),bL=(0,v.forwardRef)((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:s,axisType:c,axisId:l}=e,u=iL(e,rL),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>QI({ticks:h.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var g=(0,v.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);h.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==d||a!==p)&&(f(i),m(a))}}},[d,p]);return o||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(XA,{zIndex:e.zIndex},v.createElement(V,{className:z(`recharts-cartesian-axis`,a)},v.createElement(pL,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ro(e)}),v.createElement(yL,{ref:g,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),v.createElement(lN,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(CN,{label:e.label,labelRef:e.labelRef}),e.children)))}),xL=v.forwardRef((e,t)=>{var n=Fc(e,fL);return v.createElement(bL,oL({},n,{ref:t}))});xL.displayName=`CartesianAxis`;var SL=[`x1`,`y1`,`x2`,`y2`,`key`],CL=[`offset`],wL=[`xAxisId`,`yAxisId`],TL=[`xAxisId`,`yAxisId`];function EL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DL(e){for(var t=1;t{var{fill:t}=e;if(!t||t===`none`)return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:s}=e;return v.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function FL(e){var{option:t,lineItemProps:n}=e,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var{x1:i,y1:a,x2:o,y2:s,key:c}=n,l=ro(ML(n,SL))??{},{offset:u}=l,d=ML(l,CL);r=v.createElement(`line`,jL({},d,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function IL(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=ML(e,wL),c=i.map((e,i)=>{var a=DL(DL({},s),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${i}`,index:i});return v.createElement(FL,{key:`line-${i}`,option:r,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},c)}function LL(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=ML(e,TL),c=i.map((e,i)=>{var a=DL(DL({},s),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${i}`,index:i});return v.createElement(FL,{option:r,lineItemProps:a,key:`line-${i}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},c)}function RL(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return v.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function zL(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var l=c.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,t)=>{var c=l[t+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=t%n.length;return v.createElement(`rect`,{key:`react-${t}`,x:e,y:a,width:u,height:s,stroke:`none`,fill:n[d],fillOpacity:r,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},u)}var BL=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return dp(ZI(DL(DL(DL({},fL),n),{},{ticks:fp(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},VL=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return dp(ZI(DL(DL(DL({},fL),n),{},{ticks:fp(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},HL={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:qy.grid};function UL(e){var t=jm(),n=Mm(),r=Am(),i=DL(DL({},Fc(e,HL)),{},{x:H(e.x)?e.x:r.left,y:H(e.y)?e.y:r.top,width:H(e.width)?e.width:r.width,height:H(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:s,y:c,width:l,height:u,syncWithTicks:d,horizontalValues:f,verticalValues:p}=i,m=Zp(),h=G(e=>CO(e,`xAxis`,a,m)),g=G(e=>CO(e,`yAxis`,o,m));if(!np(l)||!np(u)||!H(s)||!H(c))return null;var _=i.verticalCoordinatesGenerator||BL,y=i.horizontalCoordinatesGenerator||VL,{horizontalPoints:b,verticalPoints:x}=i;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?DL(DL({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);am(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof _==`function`){var w=p&&p.length,T=_({xAxis:h?DL(DL({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);am(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(XA,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(PL,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(RL,jL({},i,{horizontalPoints:b})),v.createElement(zL,jL({},i,{verticalPoints:x})),v.createElement(IL,jL({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(LL,jL({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}UL.displayName=`CartesianGrid`;var WL=sf({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:GL,replaceErrorBar:KL,removeErrorBar:qL}=WL.actions,JL=WL.reducer,YL=[`children`];function XL(e,t){if(e==null)return{};var n,r,i=ZL(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0});function $L(e){var{children:t}=e,n=XL(e,YL);return v.createElement(QL.Provider,{value:n},t)}function eR(e,t){var n=G(t=>wE(t,e)),r=G(e=>DE(e,t)),i=n?.allowDataOverflow??SE.allowDataOverflow,a=r?.allowDataOverflow??TE.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function tR(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=sI(),{needClipX:a,needClipY:o,needClip:s}=eR(t,n);if(!s||!i)return null;var{x:c,y:l,width:u,height:d}=i;return v.createElement(`clipPath`,{id:`clipPath-${r}`},v.createElement(`rect`,{x:a?c:c-u/2,y:o?l:l-d/2,width:a?u:u*2,height:o?d:d*2}))}function nR(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function rR(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var iR=!0,aR=`Invariant failed`;function oR(e,t){if(!e){if(iR)throw Error(aR);var n=typeof t==`function`?t():t,r=n?`${aR}: ${n}`:aR;throw Error(r)}}function sR(){return sR=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(H(e))return e;var i=H(n)||sc(n);return i?e(n,r):(!i&&oR(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},uR=(e,t,n)=>n,dR=J([FE,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),fR=J([dR],e=>e?.maxBarSize),pR=(e,t,n,r)=>r,mR=J([Pm,FE,nR,rR,uR],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),hR=(e,t,n)=>{var r=Pm(e),i=nR(e,t),a=rR(e,t);if(!(i==null||a==null))return r===`horizontal`?sD(e,`yAxis`,a,n):sD(e,`xAxis`,i,n)},gR=J([mR,By,(e,t)=>{var n=Pm(e),r=nR(e,t),i=rR(e,t);if(!(r==null||i==null))return n===`horizontal`?bO(e,`xAxis`,r):bO(e,`yAxis`,i)}],lI),_R=(e,t,n)=>{var r=dR(e,t);if(r==null)return 0;var i=nR(e,t),a=rR(e,t);if(i==null||a==null)return 0;var o=Pm(e),s=Ly(e),{maxBarSize:c}=r,l=sc(c)?s:c,u,d;return o===`horizontal`?(u=EO(e,`xAxis`,i,n),d=TO(e,`xAxis`,i,n)):(u=EO(e,`yAxis`,a,n),d=TO(e,`yAxis`,a,n)),wp(u,d,!0)??l??0},vR=(e,t,n)=>{var r=Pm(e),i=nR(e,t),a=rR(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=EO(e,`xAxis`,i,n),s=TO(e,`xAxis`,i,n)):(o=EO(e,`yAxis`,a,n),s=TO(e,`yAxis`,a,n)),wp(o,s)}},yR=J([qp,Yp,(e,t,n)=>{var r=nR(e,t);if(r!=null)return EO(e,`xAxis`,r,n)},(e,t,n)=>{var r=rR(e,t);if(r!=null)return EO(e,`yAxis`,r,n)},(e,t,n)=>{var r=nR(e,t);if(r!=null)return TO(e,`xAxis`,r,n)},(e,t,n)=>{var r=rR(e,t);if(r!=null)return TO(e,`yAxis`,r,n)},J([J([gR,Ly,Ry,zy,_R,vR,fR],gI),dR],vI),Pm,by,vR,J([hR,dR],_I),dR,pR],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return tz({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),bR=[`index`];function xR(){return xR=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=(0,v.useContext)(wR);if(t!=null)return t.stackId;if(e!=null)return gp(e)},ER=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,DR=e=>{var t=(0,v.useContext)(wR);if(t!=null){var{stackId:n}=t;return`url(#${ER(n,e)})`}},OR=e=>{var{index:t}=e,n=SR(e,bR),r=DR(t);return v.createElement(V,xR({className:`recharts-bar-stack-layer`,clipPath:r},n))},kR=[`onMouseEnter`,`onMouseLeave`,`onClick`],AR=[`value`,`background`,`tooltipPosition`],jR=[`id`],MR=[`onMouseEnter`,`onClick`,`onMouseLeave`];function NR(){return NR=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ep(n,t),payload:e}]},HR=v.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:uc,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Ep(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return v.createElement(YP,{tooltipEntrySettings:u})});function UR(e){var t=G(Jk),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=zR(a,kR),u=KP(o,r,a.id),d=qP(s),f=JP(c,r,a.id);if(!i||n==null)return null;var p=io(i);return v.createElement(XA,{zIndex:yI(i,qy.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=zR(e,AR);if(!o)return null;var m=u(e,n),h=d(e,n),g=f(e,n),_=FR(FR(FR(FR(FR({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),p),kc(l,e,n)),{},{onMouseEnter:m,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return v.createElement(cR,NR({key:`background-bar-${n}`},_))}))}function WR(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return FR(FR({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return v.createElement(jN,{value:t?i:void 0},n)}function GR(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=G(Jk),c=G(Xk),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,v.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,_=l?n===!0?t:n:t,y=v.createElement(cR,NR({},r,{name:String(r.name)},i,{isActive:h,option:_,index:a,dataKey:o,onTransitionEnd:m}));return g?v.createElement(XA,{zIndex:qy.activeBar},v.createElement(OR,{index:i.originalDataIndex},y)):y}function KR(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return v.createElement(cR,NR({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function qR(e){var{data:t,props:n}=e,r=ro(n)??{},{id:i}=r,a=zR(r,jR),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=zR(n,MR),p=KP(l,s,i),m=qP(d),h=JP(u,s,i);return t?v.createElement(v.Fragment,null,t.map((e,t)=>v.createElement(OR,NR({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},kc(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?v.createElement(GR,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):v.createElement(KR,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function JR(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=dv(t,`recharts-bar-`),[p,m]=(0,v.useState)(!1),h=!p,g=(0,v.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,v.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return v.createElement(WR,{showLabels:h,rects:r},v.createElement(uv,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return FR(FR({},t),{},{x:ac(r.x,t.x,e),y:ac(r.y,t.y,e),width:ac(r.width,t.width,e),height:ac(r.height,t.height,e)});if(i===`horizontal`){var a=ac(0,t.height,e),o=ac(t.stackedBarStart,t.y,e);return FR(FR({},t),{},{y:o,height:a})}var s=ac(0,t.width,e),c=ac(t.stackedBarStart,t.x,e);return FR(FR({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:v.createElement(V,null,v.createElement(qR,{props:t,data:a}))}),v.createElement(LN,{label:t.label}),t.children)}function YR(e){var t=(0,v.useRef)(null);return v.createElement(JR,{previousRectanglesRef:t,props:e})}var XR=0,ZR=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:cp(e,t)}},QR=class extends v.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=z(`recharts-bar`,r),u=c;return v.createElement(V,{className:l,id:c},o&&v.createElement(`defs`,null,v.createElement(tR,{clipPathId:u,xAxisId:i,yAxisId:a})),v.createElement(V,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},v.createElement(UR,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),v.createElement(YR,this.props)))}},$R={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:XR,xAxisId:0,yAxisId:0,zIndex:qy.bar};function ez(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=eR(t,n),f=Fm(),p=Zp(),m=mP(e.children,Wj),h=G(t=>yR(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,v.createElement($L,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:ZR,errorBarOffset:g},v.createElement(QR,NR({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function tz(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:h,dataStartIndex:g}=e,_=t===`horizontal`?c:s,v=d?_.scale.domain():null,y=vp({numericAxis:_}),b=_.scale.map(y);return f.map((e,f)=>{var _,x,S,C,w,T;if(d){var E=d[f+g];if(E==null)return null;_=pp(E,v)}else _=cp(e,n),Array.isArray(_)||(_=[y,_]);var D=lR(r,XR)(_[1],f);if(t===`horizontal`){var O=c.scale.map(_[0]),k=c.scale.map(_[1]);if(O==null||k==null)return null;x=_p({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),S=k??O??void 0,C=a.size;var ee=O-k;if(w=$s(ee)?0:ee,T={x,y:p.top,width:C,height:p.height},Math.abs(D)>0&&Math.abs(w)0&&Math.abs(C)v.createElement(v.Fragment,null,v.createElement(XP,{legendPayload:VR(t)}),v.createElement(HR,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),v.createElement(uF,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),v.createElement(XA,{zIndex:t.zIndex},v.createElement(ez,NR({},t,{id:e})))))}var rz=v.memo(nz,sg);rz.displayName=`Bar`;var iz=[`domain`,`range`],az=[`domain`,`range`];function oz(e,t){if(e==null)return{};var n,r,i=sz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{if(o!=null)return hz(hz({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(YF(s)):n.current!==s&&t(XF({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(ZF(n.current)),null)},[t]),null}var Sz=e=>{var{xAxisId:t,className:n}=e,r=G(Yp),i=Zp(),a=`xAxis`,o=G(e=>wO(e,a,t,i)),s=G(e=>fO(e,t)),c=G(e=>_O(e,t)),l=G(e=>CE(e,t));if(s==null||c==null||l==null)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:f}=e,p=yz(e,dz),{id:m,scale:h}=l,g=yz(l,fz);return v.createElement(xL,pz({},p,g,{x:c.x,y:c.y,width:s.width,height:s.height,className:z(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},Cz={allowDataOverflow:SE.allowDataOverflow,allowDecimals:SE.allowDecimals,allowDuplicatedCategory:SE.allowDuplicatedCategory,angle:SE.angle,axisLine:fL.axisLine,height:SE.height,hide:!1,includeHidden:SE.includeHidden,interval:SE.interval,label:!1,minTickGap:SE.minTickGap,mirror:SE.mirror,orientation:SE.orientation,padding:SE.padding,reversed:SE.reversed,scale:SE.scale,tick:SE.tick,tickCount:SE.tickCount,tickLine:fL.tickLine,tickSize:fL.tickSize,type:SE.type,niceTicks:SE.niceTicks,xAxisId:0},wz=v.memo(e=>{var t=Fc(e,Cz);return v.createElement(v.Fragment,null,v.createElement(xz,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(Sz,t))},lz);wz.displayName=`XAxis`;var Tz=[`type`],Ez=[`dangerouslySetInnerHTML`,`ticks`,`scale`],Dz=[`id`,`scale`];function Oz(){return Oz=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(o!=null)return Az(Az({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(QF(s)):n.current!==s&&t($F({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(eI(n.current)),null)},[t]),null}function Lz(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=G(Yp),c=Zp(),l=W(),u=`yAxis`,d=G(e=>yO(e,t)),f=G(e=>vO(e,t)),p=G(e=>wO(e,u,t,c)),m=G(e=>EE(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||mN(i)||(0,v.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(iI({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;var{dangerouslySetInnerHTML:h,ticks:g,scale:_}=e,y=Pz(e,Ez),{id:b,scale:x}=m,S=Pz(m,Dz);return v.createElement(xL,Oz({},y,S,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:z(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var Rz={allowDataOverflow:TE.allowDataOverflow,allowDecimals:TE.allowDecimals,allowDuplicatedCategory:TE.allowDuplicatedCategory,angle:TE.angle,axisLine:fL.axisLine,hide:!1,includeHidden:TE.includeHidden,interval:TE.interval,label:!1,minTickGap:TE.minTickGap,mirror:TE.mirror,orientation:TE.orientation,padding:TE.padding,reversed:TE.reversed,scale:TE.scale,tick:TE.tick,tickCount:TE.tickCount,tickLine:fL.tickLine,tickSize:fL.tickSize,type:TE.type,niceTicks:TE.niceTicks,width:TE.width,yAxisId:0},zz=v.memo(e=>{var t=Fc(e,Rz);return v.createElement(v.Fragment,null,v.createElement(Iz,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(Lz,t))},lz);zz.displayName=`YAxis`;var Bz=J([(e,t)=>t,Pm,pb,Sb,Vk,Uk,xA,qp],NA);function Vz(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function Hz(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Vz(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var Uz=zd(`mouseClick`),Wz=qf();Wz.startListening({actionCreator:Uz,effect:(e,t)=>{var n=e.payload,r=Bz(t.getState(),Hz(n));r?.activeIndex!=null&&t.dispatch(KO({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Gz=zd(`mouseMove`),Kz=qf(),qz=null,Jz=null,Yz=null;Kz.startListening({actionCreator:Gz,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);qz!==null&&(cancelAnimationFrame(qz),qz=null),Jz!==null&&(typeof r!=`number`||!a)&&(clearTimeout(Jz),Jz=null),Yz=Hz(n);var o=()=>{var e=t.getState(),n=jO(e,e.tooltip.settings.shared);if(!Yz){qz=null,Jz=null;return}if(n===`axis`){var r=Bz(e,Yz);r?.activeIndex==null?t.dispatch(UO()):t.dispatch(GO({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}qz=null,Jz=null};if(!a){o();return}r===`raf`?qz=requestAnimationFrame(o):typeof r==`number`&&Jz===null&&(Jz=setTimeout(o,r))}});function Xz(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<>`:t}var Zz={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},Qz=sf({name:`rootProps`,initialState:Zz,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??Zz.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),$z=Qz.reducer,{updateOptions:eB}=Qz.actions,tB=sf({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:nB}=tB.actions,rB=tB.reducer,iB=zd(`keyDown`),aB=zd(`focus`),oB=zd(`blur`),sB=qf(),cB=null,lB=null,uB=null;sB.startListening({actionCreator:iB,effect:(e,t)=>{uB=e.payload,cB!==null&&(cancelAnimationFrame(cB),cB=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);lB!==null&&(typeof n!=`number`||!i)&&(clearTimeout(lB),lB=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=uB;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=sk(n,kk(e),iD(e),Rk(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=Uk(e),c=kk(e),l=jO(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=EA(e,l,`hover`,String(n.index));t.dispatch(JO({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=DO(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=iD(e),h=Rk(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v=0;y--)if(sk(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=EA(e,l,`hover`,String(p));t.dispatch(JO({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{cB=null,lB=null}};if(!i){a();return}n===`raf`?cB=requestAnimationFrame(a):typeof n==`number`&&lB===null&&(a(),uB=null,lB=setTimeout(()=>{uB?a():(lB=null,cB=null)},n))}}),sB.startListening({actionCreator:aB,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=EA(n,jO(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(JO({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),sB.startListening({actionCreator:oB,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(JO({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function dB(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var fB=zd(`externalEvent`),pB=qf(),mB=new Map,hB=new Map,gB=new Map;pB.startListening({actionCreator:fB,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=dB(r);gB.set(i,{handler:n,reactEvent:a});var o=mB.get(i);o!==void 0&&(cancelAnimationFrame(o),mB.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=hB.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),hB.delete(i));var f=()=>{var e=gB.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:$k(a),activeDataKey:Xk(a),activeIndex:Jk(a),activeLabel:Yk(a),activeTooltipIndex:Jk(a),isTooltipActive:eA(a)};n&&n(o,r)}finally{mB.delete(i),hB.delete(i),gB.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);mB.set(i,p)}else if(typeof s==`number`){if(!hB.has(i)){f();var m=setTimeout(f,s);hB.set(i,m)}}else f()}}});var _B=J([J([dk],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),vB=zd(`touchMove`),yB=qf(),bB=null,xB=null,SB=null,CB=null;yB.startListening({actionCreator:vB,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){CB=dB(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);bB!==null&&(cancelAnimationFrame(bB),bB=null),xB!==null&&(typeof r!=`number`||!a)&&(clearTimeout(xB),xB=null),SB=Array.from(n.touches).map(e=>Hz({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(CB!=null){var e=t.getState(),n=jO(e,e.tooltip.settings.shared);if(n===`axis`){var r=SB?.[0];if(r==null){bB=null,xB=null;return}var i=Bz(e,r);i?.activeIndex!=null&&t.dispatch(GO({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=CB.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(Fp),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=Tk(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=_B(e,s,c);t.dispatch(VO({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}bB=null,xB=null}};if(!a){o();return}r===`raf`?bB=requestAnimationFrame(o):typeof r==`number`&&xB===null&&(o(),CB=null,xB=setTimeout(()=>{CB?o():(xB=null,bB=null)},r))}}});var wB={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},TB=sf({name:`eventSettings`,initialState:wB,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=Fh(t.payload.throttledEvents))}}}),{setEventSettings:EB}=TB.actions,DB=TB.reducer,OB=fu({brush:wI,cartesianAxis:aI,chartData:xj,errorBars:JL,eventSettings:DB,graphicalItems:lF,layout:ep,legend:Hh,options:mj,polarAxis:YN,polarOptions:rB,referenceElements:PI,renderedTicks:nL,rootProps:$z,tooltip:YO,zIndex:YA}),kB=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Xd({reducer:OB,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([Wz.middleware,Kz.middleware,sB.middleware,pB.middleware,yB.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(Jd({type:`raf`}))},devTools:Hg.devToolsEnabled&&{serialize:{replacer:Xz},name:`recharts-${t}`}})};function AB(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Zp(),a=(0,v.useRef)(null);if(i)return n;a.current??=kB(t,r);var o=Ol;return v.createElement(ig,{context:o,store:a.current},n)}function jB(e){var{layout:t,margin:n}=e,r=W(),i=Zp();return(0,v.useEffect)(()=>{i||(r(Zf(t)),r(Xf(n)))},[r,i,t,n]),null}var MB=(0,v.memo)(jB,sg);function NB(e){var t=W();return(0,v.useEffect)(()=>{t(eB(e))},[t,e]),null}var PB=(0,v.memo)(e=>{var t=W();return(0,v.useEffect)(()=>{t(EB(e))},[t,e]),null},sg);function FB(e){var{zIndex:t,isPanorama:n}=e,r=(0,v.useRef)(null),i=W();return(0,v.useLayoutEffect)(()=>(r.current&&i(qA({zIndex:t,element:r.current,isPanorama:n})),()=>{i(JA({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function IB(e){var{children:t,isPanorama:n}=e,r=G(FA);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(FB,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(FB,{key:e,zIndex:e,isPanorama:n})))}var LB=[`children`];function RB(e,t){if(e==null)return{};var n,r,i=zB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=jm(),r=Mm(),i=Qg();if(!np(n)||!np(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),v.createElement(uo,BB({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:VB,ref:t}),a)}),UB=e=>{var{children:t}=e,n=G($p);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return v.createElement(uo,{width:r,height:i,x:o,y:a},t)},WB=(0,v.forwardRef)((e,t)=>{var{children:n}=e,r=RB(e,LB);return Zp()?v.createElement(UB,null,v.createElement(IB,{isPanorama:!0},n)):v.createElement(HB,BB({ref:t},r),v.createElement(IB,{isPanorama:!1},n))});function GB(){var e=W(),[t,n]=(0,v.useState)(null),r=G(jp);return(0,v.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;Q(n)&&n!==r&&e($f(n))}},[t,e,r]),n}function KB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qB(e){for(var t=1;t(Mj(),null);function $B(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var eV=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),[r,i]=(0,v.useState)({containerWidth:$B(e.style?.width),containerHeight:$B(e.style?.height)}),a=(0,v.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,v.useEffect)(()=>()=>{n.current?.disconnect()},[a]),v.createElement(v.Fragment,null,v.createElement(zm,{width:r.containerWidth,height:r.containerHeight}),v.createElement(`div`,ZB({ref:o},e)))}),tV=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,v.useState)({containerWidth:$B(n),containerHeight:$B(r)}),o=(0,v.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return v.createElement(v.Fragment,null,v.createElement(zm,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,ZB({ref:s},e)))}),nV=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e;return v.createElement(v.Fragment,null,v.createElement(zm,{width:n,height:r}),v.createElement(`div`,ZB({ref:t},e)))}),rV=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?v.createElement(tV,ZB({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(nV,ZB({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(zm,{width:n,height:r}),v.createElement(`div`,ZB({ref:t},e)))});function iV(e){return e?eV:rV}var aV=(0,v.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:m,onTouchStart:h,style:g,width:_,responsive:y,dispatchTouchEvents:b=!0}=e,x=(0,v.useRef)(null),S=W(),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)(null),D=GB(),O=wm(),k=O?.width>0?O.width:_,ee=O?.height>0?O.height:i,te=(0,v.useCallback)(e=>{D(e),typeof t==`function`&&t(e),w(e),E(e),e!=null&&(x.current=e)},[D,t,w,E]),ne=(0,v.useCallback)(e=>{S(Uz(e)),S(fB({handler:a,reactEvent:e}))},[S,a]),A=(0,v.useCallback)(e=>{S(Gz(e)),S(fB({handler:l,reactEvent:e}))},[S,l]),re=(0,v.useCallback)(e=>{S(UO()),S(fB({handler:u,reactEvent:e}))},[S,u]),ie=(0,v.useCallback)(e=>{S(Gz(e)),S(fB({handler:d,reactEvent:e}))},[S,d]),j=(0,v.useCallback)(()=>{S(aB())},[S]),M=(0,v.useCallback)(()=>{S(oB())},[S]),ae=(0,v.useCallback)(e=>{S(iB(e.key))},[S]),oe=(0,v.useCallback)(e=>{S(fB({handler:o,reactEvent:e}))},[S,o]),se=(0,v.useCallback)(e=>{S(fB({handler:s,reactEvent:e}))},[S,s]),ce=(0,v.useCallback)(e=>{S(fB({handler:c,reactEvent:e}))},[S,c]),le=(0,v.useCallback)(e=>{S(fB({handler:f,reactEvent:e}))},[S,f]),ue=(0,v.useCallback)(e=>{S(fB({handler:h,reactEvent:e}))},[S,h]),de=(0,v.useCallback)(e=>{b&&S(vB(e)),S(fB({handler:m,reactEvent:e}))},[S,b,m]),fe=(0,v.useCallback)(e=>{S(fB({handler:p,reactEvent:e}))},[S,p]),pe=iV(y);return v.createElement(oj.Provider,{value:C},v.createElement(ho.Provider,{value:T},v.createElement(pe,{width:k??g?.width,height:ee??g?.height,className:z(`recharts-wrapper`,r),style:qB({position:`relative`,cursor:`default`,width:k,height:ee},g),onClick:ne,onContextMenu:oe,onDoubleClick:se,onFocus:j,onBlur:M,onKeyDown:ae,onMouseDown:ce,onMouseEnter:A,onMouseLeave:re,onMouseMove:ie,onMouseUp:le,onTouchEnd:fe,onTouchMove:de,onTouchStart:ue,ref:te},v.createElement(QB,null),n)))}),oV=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function sV(e,t){if(e==null)return{};var n,r,i=cV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=ro(sV(e,oV));return c?v.createElement(v.Fragment,null,v.createElement(zm,{width:n,height:r}),v.createElement(WB,{otherAttributes:d,title:l,desc:u},a)):v.createElement(aV,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(WB,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(II,null,a)))});function uV(){return uV=Object.assign?Object.assign.bind():function(e){for(var t=1;tv.createElement(_V,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:vV,tooltipPayloadSearcher:fj,categoricalChartProps:e,ref:t}));function bV(e){var t=W();return(0,v.useEffect)(()=>{t(nB(e))},[t,e]),null}var xV=[`layout`];function SV(){return SV=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Fc(e,RV);return v.createElement(jV,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:LV,tooltipPayloadSearcher:fj,categoricalChartProps:n,ref:t})}),BV={Critical:`#ef4444`,High:`#f59e0b`,Medium:`#3b82f6`,Low:`#10b981`};function VV({stats:e}){if(!e)return null;let t=[{name:`Critical`,value:e.critical_alerts},{name:`High`,value:e.high_alerts},{name:`Medium`,value:e.medium_alerts},{name:`Low`,value:e.low_alerts}].filter(e=>e.value>0);return t.length===0?(0,L.jsx)(`p`,{className:`text-surface-500 text-center py-8`,children:`No alerts yet`}):(0,L.jsx)(Em,{width:`100%`,height:250,children:(0,L.jsxs)(zV,{children:[(0,L.jsx)(HF,{data:t,cx:`50%`,cy:`50%`,innerRadius:60,outerRadius:90,paddingAngle:4,dataKey:`value`,children:t.map(e=>(0,L.jsx)(Wj,{fill:BV[e.name]},e.name))}),(0,L.jsx)(Uj,{contentStyle:{backgroundColor:`#1e293b`,border:`1px solid #334155`,borderRadius:`8px`},labelStyle:{color:`#f1f5f9`}}),(0,L.jsx)(Tg,{formatter:e=>(0,L.jsx)(`span`,{className:`text-surface-300 text-sm`,children:e})})]})})}function HV({alerts:e}){return(0,L.jsx)(Em,{width:`100%`,height:250,children:(0,L.jsxs)(yV,{data:(0,v.useMemo)(()=>{let t={},n=new Date;for(let e=6;e>=0;e--){let r=new Date(n);r.setDate(r.getDate()-e);let i=r.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`});t[i]={critical:0,high:0,medium:0,low:0}}for(let r of e){let e=new Date(r.created_at),i=Math.floor((n.getTime()-e.getTime())/(1e3*60*60*24));if(i>=0&&i<7){let n=e.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`});if(t[n]){let e=r.severity;e in t[n]&&t[n][e]++}}}return Object.entries(t).map(([e,t])=>({date:e,...t,total:t.critical+t.high+t.medium+t.low}))},[e]),children:[(0,L.jsx)(UL,{strokeDasharray:`3 3`,stroke:`#334155`}),(0,L.jsx)(wz,{dataKey:`date`,stroke:`#94a3b8`,fontSize:11}),(0,L.jsx)(zz,{stroke:`#94a3b8`,fontSize:12,allowDecimals:!1}),(0,L.jsx)(Uj,{contentStyle:{backgroundColor:`#1e293b`,border:`1px solid #334155`,borderRadius:`8px`},labelStyle:{color:`#f1f5f9`}}),(0,L.jsx)(rz,{dataKey:`critical`,stackId:`a`,fill:`#ef4444`,name:`Critical`}),(0,L.jsx)(rz,{dataKey:`high`,stackId:`a`,fill:`#f59e0b`,name:`High`}),(0,L.jsx)(rz,{dataKey:`medium`,stackId:`a`,fill:`#3b82f6`,name:`Medium`}),(0,L.jsx)(rz,{dataKey:`low`,stackId:`a`,fill:`#10b981`,name:`Low`})]})})}function UV(){let[e,t]=(0,v.useState)([]);(0,v.useEffect)(()=>{I.get(`/ot/devices-by-zone`).then(e=>{t(e.data.zones||[])}).catch(()=>{})},[]);let n=[{level:5,label:`Enterprise`,description:`Internet/DMZ`},{level:4,label:`Business`,description:`ERP, Email`},{level:3,label:`Operations`,description:`Historians, SCADA servers`},{level:2,label:`Control`,description:`HMI, Engineering workstations`},{level:1,label:`Basic Control`,description:`PLCs, RTUs, DCS`},{level:0,label:`Process`,description:`Sensors, Actuators`}],r={enterprise:5,dmz:5,internet:5,business:4,corporate:4,operations:3,supervisory:3,scada:3,control:2,hmi:2,field:1,basic_control:1,plc:1,process:0,safety_system:0,sensor:0},i=t=>{let n=0;for(let i of e)(r[i.zone]??(i.zone===`level_${t}`||i.zone===String(t)?t:-1))===t&&(n+=i.count);return n},a=e=>e===0?`bg-surface-700/50 border-surface-600`:e<=2?`bg-success/10 border-success/30`:e<=5?`bg-warning/10 border-warning/30`:`bg-danger/10 border-danger/30`;return(0,L.jsxs)(`div`,{className:`space-y-2`,children:[n.map(e=>{let t=i(e.level);return(0,L.jsxs)(`div`,{className:z(`flex items-center justify-between p-3 rounded-lg border`,a(t)),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,L.jsxs)(`span`,{className:`text-xs font-mono text-surface-400 w-8`,children:[`L`,e.level]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-white`,children:e.label}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500`,children:e.description})]})]}),(0,L.jsxs)(`span`,{className:`text-sm font-semibold text-surface-300`,children:[t,` devices`]})]},e.level)}),e.length===0&&(0,L.jsx)(`p`,{className:`text-center text-surface-500 py-4 text-sm`,children:`No OT zone data. Add assets with network zones to populate.`})]})}function WV(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)(0),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!0);if((0,v.useEffect)(()=>{async function e(){try{let[e,n,i,o]=await Promise.all([I.get(`/alerts/stats/overview`),I.get(`/assets/`,{params:{size:1}}),I.get(`/ot/discovered-devices`,{params:{size:1}}),I.get(`/alerts/`,{params:{size:50}})]);t(e.data),r(n.data.total??0),a(i.data.total??0),s(o.data.alerts??[])}catch(e){console.error(`Failed to load dashboard data:`,e)}finally{l(!1)}}e()},[]),c)return(0,L.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,L.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-primary-400`})});let u=e?.total_alerts??0,d=e?.critical_alerts??0,f=e?.high_alerts??0,p=(e?.pending_alerts??0)+(e?.acknowledged_alerts??0),m=u>0?Math.max(54,Math.round((u-d)/u*100)):96,h=[{label:`Detect`,value:i+n,status:`online`,icon:Aa},{label:`Triage`,value:p,status:p>0?`queued`:`clear`,icon:ca},{label:`Hunt`,value:f+d,status:f+d>0?`active`:`standby`,icon:ga},{label:`Respond`,value:0,status:`approval gated`,icon:Fa}];return(0,L.jsxs)(`div`,{className:`space-y-7`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 xl:flex-row xl:items-end xl:justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-wider text-cyan-300`,children:`OneAlert Command`}),(0,L.jsx)(`h1`,{className:`mt-2 text-3xl font-bold text-white`,children:`Security Operations`}),(0,L.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm text-surface-400`,children:`OT asset risk, vulnerability intelligence, topology signals, and governed agent readiness.`})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4 xl:w-[560px]`,children:[{label:`Local model route`,value:`Planned`,tone:`text-cyan-300`},{label:`Run ledger`,value:`Design ready`,tone:`text-emerald-300`},{label:`Telemetry ingest`,value:`Sensor API live`,tone:`text-amber-300`},{label:`Offensive mode`,value:`Dry-run only`,tone:`text-rose-300`}].map(e=>(0,L.jsxs)(`div`,{className:`border border-surface-800 bg-surface-900/70 px-4 py-3`,children:[(0,L.jsx)(`p`,{className:`text-[11px] uppercase tracking-wide text-surface-500`,children:e.label}),(0,L.jsx)(`p`,{className:`mt-1 text-sm font-semibold ${e.tone}`,children:e.value})]},e.label))})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,L.jsx)(Za,{title:`Total Alerts`,value:e?.total_alerts??0,icon:Pa,color:`info`}),(0,L.jsx)(Za,{title:`Critical`,value:e?.critical_alerts??0,icon:Ba,color:`danger`}),(0,L.jsx)(Za,{title:`Assets Monitored`,value:n,icon:Ma,color:`success`}),(0,L.jsx)(Za,{title:`Devices Discovered`,value:i,icon:aa,color:`warning`})]}),(0,L.jsxs)(`section`,{className:`grid grid-cols-1 gap-6 xl:grid-cols-[1.35fr_0.65fr]`,children:[(0,L.jsxs)(`div`,{className:`border border-surface-800 bg-surface-900/70 p-6`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`AI Security Agent Readiness`}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-surface-400`,children:`Detect, triage, hunt, respond, and validate lanes.`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border border-cyan-500/30 bg-cyan-500/10 px-3 py-2 text-sm font-semibold text-cyan-200`,children:[(0,L.jsx)(ca,{className:`h-4 w-4`}),m,`% posture confidence`]})]}),(0,L.jsx)(`div`,{className:`mt-6 grid grid-cols-1 gap-3 md:grid-cols-4`,children:h.map(e=>(0,L.jsxs)(`div`,{className:`border border-surface-800 bg-surface-950/70 p-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(e.icon,{className:`h-5 w-5 text-cyan-300`}),(0,L.jsx)(`span`,{className:`text-xs font-medium uppercase text-surface-500`,children:e.status})]}),(0,L.jsx)(`p`,{className:`mt-4 text-2xl font-bold text-white`,children:e.value}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-surface-400`,children:e.label})]},e.label))}),(0,L.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-3 md:grid-cols-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border border-emerald-500/20 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-200`,children:[(0,L.jsx)(Fa,{className:`h-4 w-4`}),`Approval gates enabled`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border border-amber-500/20 bg-amber-500/10 px-4 py-3 text-sm text-amber-200`,children:[(0,L.jsx)(Ha,{className:`h-4 w-4`}),`Agent ledger planned`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:[(0,L.jsx)(ga,{className:`h-4 w-4`}),`Offensive actions scoped`]})]})]}),(0,L.jsxs)(`div`,{className:`border border-surface-800 bg-surface-900/70 p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Telemetry Health`}),(0,L.jsx)(aa,{className:`h-5 w-5 text-emerald-300`})]}),(0,L.jsx)(`div`,{className:`mt-5 space-y-4`,children:[{label:`Managed assets`,value:n,width:Math.min(100,n*8),tone:`bg-cyan-400`},{label:`Discovered devices`,value:i,width:Math.min(100,i*10),tone:`bg-emerald-400`},{label:`Open investigations`,value:p,width:Math.min(100,p*12),tone:`bg-amber-400`},{label:`Critical exposure`,value:d,width:Math.min(100,d*18),tone:`bg-rose-400`}].map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,L.jsx)(`span`,{className:`text-surface-400`,children:e.label}),(0,L.jsx)(`span`,{className:`font-semibold text-white`,children:e.value})]}),(0,L.jsx)(`div`,{className:`mt-2 h-2 bg-surface-800`,children:(0,L.jsx)(`div`,{className:`h-full ${e.tone}`,style:{width:`${Math.max(8,e.width)}%`}})})]},e.label))})]})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-900/70 border border-surface-800 p-6`,children:[(0,L.jsxs)(`div`,{className:`mb-4 flex items-center gap-2`,children:[(0,L.jsx)(Pa,{className:`h-5 w-5 text-cyan-300`}),(0,L.jsx)(`h3`,{className:`text-lg font-semibold text-white`,children:`Severity Breakdown`})]}),(0,L.jsx)(VV,{stats:e})]}),(0,L.jsxs)(`div`,{className:`bg-surface-900/70 border border-surface-800 p-6`,children:[(0,L.jsxs)(`div`,{className:`mb-4 flex items-center gap-2`,children:[(0,L.jsx)(ya,{className:`h-5 w-5 text-amber-300`}),(0,L.jsx)(`h3`,{className:`text-lg font-semibold text-white`,children:`Alert Trend (7 days)`})]}),(0,L.jsx)(HV,{alerts:o})]})]}),(0,L.jsxs)(`div`,{className:`bg-surface-900/70 border border-surface-800 p-6`,children:[(0,L.jsxs)(`div`,{className:`mb-4 flex items-center gap-2`,children:[(0,L.jsx)(Ea,{className:`h-5 w-5 text-emerald-300`}),(0,L.jsx)(`h3`,{className:`text-lg font-semibold text-white`,children:`Risk Heatmap`})]}),(0,L.jsx)(UV,{})]})]})}var GV={critical:`bg-red-500/20 text-red-400 border-red-500/30`,high:`bg-orange-500/20 text-orange-400 border-orange-500/30`,medium:`bg-yellow-500/20 text-yellow-400 border-yellow-500/30`,low:`bg-blue-500/20 text-blue-400 border-blue-500/30`,info:`bg-surface-500/20 text-surface-400 border-surface-500/30`},KV={open:`bg-red-500/20 text-red-400`,investigating:`bg-yellow-500/20 text-yellow-400`,resolved:`bg-green-500/20 text-green-400`,closed:`bg-surface-500/20 text-surface-400`,false_positive:`bg-surface-500/20 text-surface-500`};function qV(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(0),c=async()=>{try{let e=await I.get(`/cases/`,{params:{size:50}});t(e.data.cases),s(e.data.total)}catch(e){console.error(`Failed to load cases`,e)}finally{r(!1)}};return(0,v.useEffect)(()=>{c()},[]),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Investigations`}),(0,L.jsxs)(`p`,{className:`text-surface-400 text-sm mt-1`,children:[o,` cases — AI-correlated from alerts and events`]})]}),(0,L.jsxs)(`button`,{onClick:async()=>{a(!0);try{await I.post(`/cases/auto-triage`,null,{params:{hours_back:72}}),await c()}catch(e){console.error(`Triage failed`,e)}finally{a(!1)}},disabled:i,className:`flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg text-sm font-medium transition-colors`,children:[(0,L.jsx)(Oa,{className:`w-4 h-4`}),i?`Running Triage...`:`Run AI Triage`]})]}),n?(0,L.jsx)(`div`,{className:`grid gap-4`,children:[1,2,3].map(e=>(0,L.jsx)(`div`,{className:`bg-surface-800/50 rounded-xl p-6 animate-pulse h-32`},e))}):e.length===0?(0,L.jsxs)(`div`,{className:`text-center py-20`,children:[(0,L.jsx)(ua,{className:`w-16 h-16 text-surface-600 mx-auto mb-4`}),(0,L.jsx)(`h3`,{className:`text-lg font-medium text-surface-300`,children:`No cases yet`}),(0,L.jsx)(`p`,{className:`text-surface-500 mt-2 max-w-md mx-auto`,children:`Run AI Triage to automatically correlate your alerts and security events into investigation cases.`})]}):(0,L.jsx)(`div`,{className:`grid gap-4`,children:e.map(e=>(0,L.jsx)(It,{to:`/cases/${e.id}`,className:`block bg-surface-800/50 border border-surface-700 rounded-xl p-5 hover:border-primary-500/30 transition-colors group`,children:(0,L.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,L.jsx)(`span`,{className:z(`px-2 py-0.5 text-xs font-medium rounded-full border`,GV[e.severity]),children:e.severity}),(0,L.jsx)(`span`,{className:z(`px-2 py-0.5 text-xs font-medium rounded-full`,KV[e.status]),children:e.status}),e.confidence_score&&(0,L.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[Math.round(e.confidence_score*100),`% confidence`]})]}),(0,L.jsx)(`h3`,{className:`text-white font-medium truncate`,children:e.title}),e.summary&&(0,L.jsx)(`p`,{className:`text-surface-400 text-sm mt-1 line-clamp-2`,children:e.summary}),(0,L.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 text-xs text-surface-500`,children:[(0,L.jsxs)(`span`,{children:[e.alert_count,` alerts`]}),(0,L.jsxs)(`span`,{children:[e.event_count,` events`]}),e.mitre_tactics&&e.mitre_tactics.length>0&&(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(Ia,{className:`w-3 h-3`}),e.mitre_tactics.length,` MITRE tactics`]}),(0,L.jsx)(`span`,{children:new Date(e.created_at).toLocaleDateString()}),(0,L.jsx)(`span`,{className:`capitalize`,children:e.created_by})]})]}),(0,L.jsx)(da,{className:`w-5 h-5 text-surface-600 group-hover:text-primary-400 transition-colors mt-1`})]})},e.id))})]})}var JV={critical:`bg-red-500/20 text-red-400 border-red-500/30`,high:`bg-orange-500/20 text-orange-400 border-orange-500/30`,medium:`bg-yellow-500/20 text-yellow-400 border-yellow-500/30`,low:`bg-blue-500/20 text-blue-400 border-blue-500/30`,info:`bg-surface-500/20 text-surface-400 border-surface-500/30`},YV={ai_analysis:la,alert:Ba,event:aa,action:Ra,note:ha};function XV(){let{caseId:e}=Xe(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{(async()=>{try{let[t,r,a]=await Promise.all([I.get(`/cases/${e}`),I.get(`/cases/${e}/alerts`),I.get(`/cases/${e}/events`)]);n(t.data),i(r.data),o(a.data)}catch(e){console.error(`Failed to load case`,e)}finally{c(!1)}})()},[e]),s?(0,L.jsxs)(`div`,{className:`animate-pulse space-y-4`,children:[(0,L.jsx)(`div`,{className:`h-8 bg-surface-800 rounded w-1/3`}),(0,L.jsx)(`div`,{className:`h-40 bg-surface-800 rounded`})]}):t?(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(It,{to:`/cases`,className:`flex items-center gap-2 text-surface-400 hover:text-white text-sm mb-4 transition-colors`,children:[(0,L.jsx)(oa,{className:`w-4 h-4`}),` Back to Cases`]}),(0,L.jsx)(`div`,{className:`flex items-start justify-between`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,L.jsx)(`span`,{className:z(`px-2.5 py-1 text-xs font-medium rounded-full border`,JV[t.severity]),children:t.severity}),(0,L.jsx)(`span`,{className:`px-2.5 py-1 text-xs font-medium rounded-full bg-surface-700 text-surface-300`,children:t.status}),t.confidence_score&&(0,L.jsxs)(`span`,{className:`text-sm text-surface-400`,children:[Math.round(t.confidence_score*100),`% confidence`]})]}),(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:t.title}),t.summary&&(0,L.jsx)(`p`,{className:`text-surface-400 mt-2`,children:t.summary})]})})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`Alerts`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white mt-1`,children:t.alert_count})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`Events`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white mt-1`,children:t.event_count})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`MITRE Tactics`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white mt-1`,children:t.mitre_tactics?.length||0})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(`p`,{className:`text-xs text-surface-500 uppercase`,children:`Created By`}),(0,L.jsx)(`p`,{className:`text-lg font-medium text-primary-400 mt-1 capitalize`,children:t.created_by})]})]}),t.attack_narrative&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold text-white mb-3`,children:[(0,L.jsx)(la,{className:`w-5 h-5 text-primary-400`}),` AI Analysis`]}),(0,L.jsx)(`p`,{className:`text-surface-300 leading-relaxed whitespace-pre-wrap`,children:t.attack_narrative})]}),t.mitre_techniques&&t.mitre_techniques.length>0&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold text-white mb-3`,children:[(0,L.jsx)(Ra,{className:`w-5 h-5 text-primary-400`}),` MITRE ATT&CK Techniques`]}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.mitre_techniques.map((e,t)=>(0,L.jsxs)(`span`,{className:`px-3 py-1.5 bg-primary-600/20 text-primary-300 text-sm rounded-lg border border-primary-500/20`,children:[e.id,`: `,e.name,e.confidence&&(0,L.jsxs)(`span`,{className:`ml-2 text-primary-500 text-xs`,children:[`(`,Math.round(e.confidence*100),`%)`]})]},t))})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,L.jsx)(`div`,{className:`lg:col-span-2`,children:(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Investigation Timeline`}),t.timeline.length===0?(0,L.jsx)(`p`,{className:`text-surface-500`,children:`No timeline entries yet.`}):(0,L.jsx)(`div`,{className:`space-y-4`,children:t.timeline.map(e=>(0,L.jsxs)(`div`,{className:`flex gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,L.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-surface-700 flex items-center justify-center`,children:(0,L.jsx)(YV[e.entry_type]||ha,{className:`w-4 h-4 text-primary-400`})}),(0,L.jsx)(`div`,{className:`flex-1 w-px bg-surface-700 mt-2`})]}),(0,L.jsxs)(`div`,{className:`flex-1 pb-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-surface-500`,children:new Date(e.timestamp).toLocaleString()}),(0,L.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded bg-surface-700 text-surface-400`,children:e.entry_type}),(0,L.jsx)(`span`,{className:`text-xs text-surface-600`,children:e.source})]}),(0,L.jsx)(`p`,{className:`text-surface-300 text-sm`,children:e.content})]})]},e.id))})]})}),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-3`,children:`Related Alerts`}),r.length===0?(0,L.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No linked alerts.`}):(0,L.jsx)(`div`,{className:`space-y-2`,children:r.map(e=>(0,L.jsxs)(`div`,{className:`p-3 bg-surface-900/50 rounded-lg`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,L.jsx)(`span`,{className:z(`px-1.5 py-0.5 text-xs rounded`,JV[e.severity]),children:e.severity}),e.cve_id&&(0,L.jsx)(`span`,{className:`text-xs text-primary-400`,children:e.cve_id})]}),(0,L.jsx)(`p`,{className:`text-sm text-surface-300 truncate`,children:e.title})]},e.id))})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-3`,children:`Related Events`}),a.length===0?(0,L.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No linked events.`}):(0,L.jsx)(`div`,{className:`space-y-2 max-h-80 overflow-y-auto`,children:a.map(e=>(0,L.jsxs)(`div`,{className:`p-3 bg-surface-900/50 rounded-lg`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,L.jsx)(`span`,{className:z(`px-1.5 py-0.5 text-xs rounded`,JV[e.severity]),children:e.severity}),(0,L.jsx)(`span`,{className:`text-xs text-surface-500`,children:e.event_type})]}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-400`,children:[e.source_ip,` → `,e.dest_ip,` `,e.signature&&`| ${e.signature}`]})]},e.id))})]})]})]})]}):(0,L.jsx)(`div`,{className:`text-center py-20 text-surface-400`,children:`Case not found`})}var ZV={critical:`text-danger`,high:`text-warning`,medium:`text-info`,low:`text-success`};function QV({alert:e,onClose:t,onAcknowledge:n}){return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 flex justify-end`,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/50`,onClick:t}),(0,L.jsxs)(`div`,{className:`relative w-full max-w-lg bg-surface-900 border-l border-surface-700 h-full overflow-y-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:e.cve_id}),(0,L.jsx)(`button`,{onClick:t,className:`text-surface-400 hover:text-white`,children:(0,L.jsx)(Ua,{className:`w-5 h-5`})})]}),(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Title`}),(0,L.jsx)(`p`,{className:`text-surface-200 mt-1`,children:e.title})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Severity`}),(0,L.jsx)(`p`,{className:z(`mt-1 font-medium capitalize`,ZV[e.severity]),children:e.severity})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`CVSS`}),(0,L.jsx)(`p`,{className:`text-surface-200 mt-1`,children:e.cvss_score??`N/A`})]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Affected Asset`}),(0,L.jsxs)(`p`,{className:`text-surface-200 mt-1`,children:[e.asset_name,` (`,e.asset_vendor,` `,e.asset_product,`)`]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Description`}),(0,L.jsx)(`p`,{className:`text-surface-300 mt-1 text-sm leading-relaxed`,children:e.description})]}),e.remediation&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Remediation`}),(0,L.jsx)(`p`,{className:`text-surface-300 mt-1 text-sm`,children:e.remediation})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-xs text-surface-500 uppercase tracking-wide`,children:`Source`}),(0,L.jsx)(`p`,{className:`text-surface-300 mt-1 text-sm`,children:e.source})]}),(0,L.jsxs)(`div`,{className:`pt-4 border-t border-surface-700 space-y-3`,children:[e.status===`pending`&&(0,L.jsx)(`button`,{onClick:()=>n(e.id),className:`w-full py-2.5 bg-primary-600 hover:bg-primary-700 text-white rounded-lg font-medium transition-colors`,children:`Acknowledge Alert`}),(0,L.jsxs)(`a`,{href:`https://nvd.nist.gov/vuln/detail/${e.cve_id}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center justify-center gap-2 w-full py-2.5 bg-surface-800 hover:bg-surface-700 text-surface-300 rounded-lg font-medium transition-colors`,children:[(0,L.jsx)(_a,{className:`w-4 h-4`}),`View on NVD`]})]})]})]})]})}var $V={critical:`bg-danger/10 text-danger border-danger/20`,high:`bg-warning/10 text-warning border-warning/20`,medium:`bg-info/10 text-info border-info/20`,low:`bg-success/10 text-success border-success/20`};function eH(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)(1),[o,s]=(0,v.useState)(1),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(new Set),x=(0,v.useCallback)(async()=>{l(!0);try{let e={page:i,size:15};f&&(e.severity=f),m&&(e.status=m),g&&(e.cve_id=g);let n=await I.get(`/alerts/`,{params:e});t(n.data.alerts),r(n.data.total),s(n.data.pages)}catch(e){console.error(`Failed to fetch alerts:`,e)}finally{l(!1)}},[i,f,m,g]);(0,v.useEffect)(()=>{x()},[x]);let S=async e=>{await I.post(`/alerts/${e}/acknowledge`),x(),d(null)},C=async()=>{await Promise.all(Array.from(y).map(e=>I.post(`/alerts/${e}/acknowledge`))),b(new Set),x()},w=e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Alerts`}),(0,L.jsxs)(`p`,{className:`text-surface-400 mt-1`,children:[n,` total alerts`]})]}),y.size>0&&(0,L.jsxs)(`button`,{onClick:C,className:`flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors`,children:[(0,L.jsx)(fa,{className:`w-4 h-4`}),`Acknowledge (`,y.size,`)`]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(ja,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search CVE...`,value:g,onChange:e=>{_(e.target.value),a(1)},className:`pl-9 pr-4 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,L.jsxs)(`select`,{value:f,onChange:e=>{p(e.target.value),a(1)},className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,L.jsx)(`option`,{value:``,children:`All Severities`}),(0,L.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,L.jsx)(`option`,{value:`high`,children:`High`}),(0,L.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,L.jsx)(`option`,{value:`low`,children:`Low`})]}),(0,L.jsxs)(`select`,{value:m,onChange:e=>{h(e.target.value),a(1)},className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,L.jsx)(`option`,{value:``,children:`All Statuses`}),(0,L.jsx)(`option`,{value:`pending`,children:`Pending`}),(0,L.jsx)(`option`,{value:`acknowledged`,children:`Acknowledged`}),(0,L.jsx)(`option`,{value:`resolved`,children:`Resolved`})]})]}),(0,L.jsx)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl overflow-x-auto`,children:c?(0,L.jsx)(`div`,{className:`flex items-center justify-center h-32`,children:(0,L.jsx)(`div`,{className:`animate-spin rounded-full h-6 w-6 border-b-2 border-primary-400`})}):e.length===0?(0,L.jsxs)(`div`,{className:`p-8 text-center text-surface-500`,children:[(0,L.jsx)(xa,{className:`w-8 h-8 mx-auto mb-2 opacity-50`}),(0,L.jsx)(`p`,{children:`No alerts found`})]}):(0,L.jsxs)(`table`,{className:`w-full text-sm min-w-[500px]`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-400`,children:[(0,L.jsx)(`th`,{className:`px-4 py-3 text-left w-8 hidden sm:table-cell`,children:(0,L.jsx)(`input`,{type:`checkbox`,onChange:t=>{t.target.checked?b(new Set(e.map(e=>e.id))):b(new Set)},className:`rounded border-surface-600`,"aria-label":`Select all alerts`})}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`CVE`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Severity`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Asset`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Status`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left hidden md:table-cell`,children:`Date`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{onClick:()=>d(e),className:`border-b border-surface-700/50 hover:bg-surface-800 cursor-pointer transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-3 hidden sm:table-cell`,onClick:e=>e.stopPropagation(),children:(0,L.jsx)(`input`,{type:`checkbox`,checked:y.has(e.id),onChange:()=>w(e.id),className:`rounded border-surface-600`,"aria-label":`Select alert ${e.cve_id}`})}),(0,L.jsx)(`td`,{className:`px-4 py-3 font-mono text-primary-300`,children:e.cve_id}),(0,L.jsx)(`td`,{className:`px-4 py-3`,children:(0,L.jsx)(`span`,{className:z(`px-2 py-0.5 rounded-full text-xs font-medium border`,$V[e.severity]),children:e.severity})}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-300`,children:e.asset_name}),(0,L.jsx)(`td`,{className:`px-4 py-3`,children:(0,L.jsx)(`span`,{className:z(`text-xs`,e.status===`pending`?`text-warning`:`text-success`),children:e.status})}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-500 hidden md:table-cell`,children:new Date(e.created_at).toLocaleDateString()})]},e.id))})]})}),o>1&&(0,L.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>a(e=>Math.max(1,e-1)),disabled:i===1,className:`px-3 py-1.5 bg-surface-800 border border-surface-600 rounded text-sm text-surface-300 disabled:opacity-50`,children:`Previous`}),(0,L.jsxs)(`span`,{className:`text-sm text-surface-400`,children:[`Page `,i,` of `,o]}),(0,L.jsx)(`button`,{onClick:()=>a(e=>Math.min(o,e+1)),disabled:i===o,className:`px-3 py-1.5 bg-surface-800 border border-surface-600 rounded text-sm text-surface-300 disabled:opacity-50`,children:`Next`})]}),u&&(0,L.jsx)(QV,{alert:u,onClose:()=>d(null),onAcknowledge:S})]})}var tH={critical:`text-red-400`,high:`text-orange-400`,medium:`text-yellow-400`,low:`text-blue-400`,info:`text-surface-500`};function nH(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(1),[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(``),f=async()=>{try{let e={page:o,size:50};u&&(e.severity=u);let[n,i]=await Promise.all([I.get(`/events/`,{params:e}),I.get(`/events/stats`)]);t(n.data.events),l(n.data.total),r(i.data.data)}catch(e){console.error(`Failed to load events`,e)}finally{a(!1)}};return(0,v.useEffect)(()=>{f()},[o,u]),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Security Events`}),(0,L.jsxs)(`p`,{className:`text-surface-400 text-sm mt-1`,children:[c,` events from `,n?.source_count||0,` sources`]})]})}),n&&(0,L.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-3`,children:[`critical`,`high`,`medium`,`low`,`info`].map(e=>(0,L.jsxs)(`button`,{onClick:()=>d(u===e?``:e),className:z(`bg-surface-800/50 border rounded-xl p-4 text-left transition-colors`,u===e?`border-primary-500`:`border-surface-700 hover:border-surface-600`),children:[(0,L.jsx)(`p`,{className:z(`text-xs uppercase`,tH[e]),children:e}),(0,L.jsx)(`p`,{className:`text-xl font-bold text-white mt-1`,children:n.by_severity[e]||0})]},e))}),i?(0,L.jsx)(`div`,{className:`animate-pulse space-y-2`,children:[1,2,3,4,5].map(e=>(0,L.jsx)(`div`,{className:`h-12 bg-surface-800 rounded`},e))}):e.length===0?(0,L.jsxs)(`div`,{className:`text-center py-20`,children:[(0,L.jsx)(aa,{className:`w-16 h-16 text-surface-600 mx-auto mb-4`}),(0,L.jsx)(`h3`,{className:`text-lg font-medium text-surface-300`,children:`No events ingested yet`}),(0,L.jsx)(`p`,{className:`text-surface-500 mt-2 max-w-md mx-auto`,children:`Upload Suricata EVE JSON or Zeek logs, or configure a webhook receiver for real-time ingestion.`})]}):(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-surface-700`,children:[(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Time`}),(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Severity`}),(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Type`}),(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Source`}),(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Destination`}),(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Signature`}),(0,L.jsx)(`th`,{className:`text-left p-3 text-surface-400 font-medium`,children:`Source`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-b border-surface-800 hover:bg-surface-800/50`,children:[(0,L.jsx)(`td`,{className:`p-3 text-surface-400 whitespace-nowrap text-xs`,children:new Date(e.timestamp).toLocaleString()}),(0,L.jsx)(`td`,{className:`p-3`,children:(0,L.jsx)(`span`,{className:z(`text-xs font-medium`,tH[e.severity]),children:e.severity})}),(0,L.jsx)(`td`,{className:`p-3 text-surface-300`,children:e.event_type}),(0,L.jsxs)(`td`,{className:`p-3 text-surface-300 font-mono text-xs`,children:[e.source_ip,e.source_port?`:${e.source_port}`:``]}),(0,L.jsxs)(`td`,{className:`p-3 text-surface-300 font-mono text-xs`,children:[e.dest_ip,e.dest_port?`:${e.dest_port}`:``]}),(0,L.jsx)(`td`,{className:`p-3 text-surface-300 truncate max-w-xs`,children:e.signature||e.category||`—`}),(0,L.jsx)(`td`,{className:`p-3 text-surface-500 text-xs`,children:e.source_type})]},e.id))})]})}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between p-3 border-t border-surface-700`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[`Page `,o,` of `,Math.ceil(c/50)]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>s(Math.max(1,o-1)),disabled:o===1,className:`px-3 py-1 text-xs bg-surface-700 text-surface-300 rounded disabled:opacity-30`,children:`Prev`}),(0,L.jsx)(`button`,{onClick:()=>s(o+1),disabled:o>=Math.ceil(c/50),className:`px-3 py-1 text-xs bg-surface-700 text-surface-300 rounded disabled:opacity-30`,children:`Next`})]})]})]})]})}function rH(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)(1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(async()=>{l(!0);try{let e={page:i,size:15};o&&(e.search=o);let n=await I.get(`/assets/`,{params:e});t(n.data.assets),r(n.data.total)}catch(e){console.error(`Failed to fetch assets:`,e)}finally{l(!1)}},[i,o]);(0,v.useEffect)(()=>{m()},[m]);let h=async e=>{confirm(`Delete this asset?`)&&(await I.delete(`/assets/${e}`),m())};return(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Assets`}),(0,L.jsxs)(`p`,{className:`text-surface-400 mt-1`,children:[n,` monitored assets`]})]}),(0,L.jsxs)(`button`,{onClick:()=>{p(null),d(!0)},className:`flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors`,children:[(0,L.jsx)(ka,{className:`w-4 h-4`}),`Add Asset`]})]}),(0,L.jsxs)(`div`,{className:`relative max-w-sm`,children:[(0,L.jsx)(ja,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search assets...`,value:o,onChange:e=>{s(e.target.value),a(1)},className:`w-full pl-9 pr-4 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:c?(0,L.jsx)(`div`,{className:`col-span-full flex items-center justify-center h-32`,children:(0,L.jsx)(`div`,{className:`animate-spin rounded-full h-6 w-6 border-b-2 border-primary-400`})}):e.length===0?(0,L.jsxs)(`div`,{className:`col-span-full text-center py-12 text-surface-500`,children:[(0,L.jsx)(Ma,{className:`w-10 h-10 mx-auto mb-3 opacity-50`}),(0,L.jsx)(`p`,{children:`No assets found. Add your first asset to start monitoring.`})]}):e.map(e=>(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4 hover:border-surface-600 transition-colors`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold text-white truncate`,children:e.name}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-400 mt-1`,children:[e.vendor,` `,e.product]})]}),(0,L.jsxs)(`div`,{className:`flex gap-1 ml-2`,children:[(0,L.jsx)(`button`,{onClick:()=>{p(e),d(!0)},className:`p-1.5 text-surface-500 hover:text-primary-400 transition-colors`,children:(0,L.jsx)(Da,{className:`w-3.5 h-3.5`})}),(0,L.jsx)(`button`,{onClick:()=>h(e.id),className:`p-1.5 text-surface-500 hover:text-danger transition-colors`,children:(0,L.jsx)(za,{className:`w-3.5 h-3.5`})})]})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,L.jsx)(`span`,{className:`px-2 py-0.5 bg-surface-700 rounded text-xs text-surface-300`,children:e.asset_type}),e.is_ot_asset&&(0,L.jsx)(`span`,{className:`px-2 py-0.5 bg-warning/10 text-warning border border-warning/20 rounded text-xs`,children:`OT`}),e.criticality&&(0,L.jsx)(`span`,{className:z(`px-2 py-0.5 rounded text-xs border`,e.criticality===`high`?`bg-danger/10 text-danger border-danger/20`:e.criticality===`medium`?`bg-warning/10 text-warning border-warning/20`:`bg-success/10 text-success border-success/20`),children:e.criticality})]}),e.version&&(0,L.jsxs)(`p`,{className:`text-xs text-surface-500 mt-2`,children:[`v`,e.version]})]},e.id))}),u&&(0,L.jsx)(iH,{asset:f,onClose:()=>{d(!1),p(null)},onSave:async e=>{f?await I.put(`/assets/${f.id}`,e):await I.post(`/assets/`,e),d(!1),p(null),m()}})]})}function iH({asset:e,onClose:t,onSave:n}){let[r,i]=(0,v.useState)({name:e?.name||``,asset_type:e?.asset_type||`hardware`,vendor:e?.vendor||``,product:e?.product||``,version:e?.version||``,description:e?.description||``,is_ot_asset:e?.is_ot_asset||!1,network_zone:e?.network_zone||``,criticality:e?.criticality||`medium`});return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/50`,onClick:t}),(0,L.jsxs)(`div`,{className:`relative bg-surface-900 border border-surface-700 rounded-2xl p-6 w-full max-w-md max-h-[90vh] overflow-y-auto`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:e?`Edit Asset`:`Add Asset`}),(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),n(r)},className:`space-y-3`,children:[(0,L.jsx)(`input`,{type:`text`,placeholder:`Name`,value:r.name,onChange:e=>i({...r,name:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,required:!0}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,L.jsx)(`input`,{type:`text`,placeholder:`Vendor`,value:r.vendor,onChange:e=>i({...r,vendor:e.target.value}),className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,required:!0}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Product`,value:r.product,onChange:e=>i({...r,product:e.target.value}),className:`px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,required:!0})]}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Version`,value:r.version||``,onChange:e=>i({...r,version:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`}),(0,L.jsxs)(`select`,{value:r.asset_type,onChange:e=>i({...r,asset_type:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,L.jsx)(`option`,{value:`hardware`,children:`Hardware`}),(0,L.jsx)(`option`,{value:`software`,children:`Software`}),(0,L.jsx)(`option`,{value:`firmware`,children:`Firmware`}),(0,L.jsx)(`option`,{value:`plc`,children:`PLC`}),(0,L.jsx)(`option`,{value:`hmi`,children:`HMI`}),(0,L.jsx)(`option`,{value:`scada`,children:`SCADA`}),(0,L.jsx)(`option`,{value:`rtu`,children:`RTU`}),(0,L.jsx)(`option`,{value:`network_device`,children:`Network Device`}),(0,L.jsx)(`option`,{value:`other_ot`,children:`Other OT`})]}),(0,L.jsxs)(`select`,{value:r.criticality||`medium`,onChange:e=>i({...r,criticality:e.target.value}),className:`w-full px-3 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary-500`,children:[(0,L.jsx)(`option`,{value:`low`,children:`Low Criticality`}),(0,L.jsx)(`option`,{value:`medium`,children:`Medium Criticality`}),(0,L.jsx)(`option`,{value:`high`,children:`High Criticality`})]}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-surface-300`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:r.is_ot_asset||!1,onChange:e=>i({...r,is_ot_asset:e.target.checked}),className:`rounded border-surface-600`}),`OT/ICS Asset`]}),(0,L.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`flex-1 py-2 bg-surface-700 hover:bg-surface-600 text-surface-300 rounded-lg text-sm transition-colors`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,className:`flex-1 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors`,children:e?`Update`:`Create`})]})]})]})]})}function aH(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(!0);(0,v.useEffect)(()=>{async function e(){try{let[e,n,i]=await Promise.all([I.get(`/ot/summary`),I.get(`/ot/discovered-devices`,{params:{size:20}}),I.get(`/ot/devices-by-protocol`)]);t(e.data),r(n.data.devices||[]),a(i.data.protocols||[])}catch(e){console.error(`Failed to load OT data:`,e)}finally{s(!1)}}e()},[]);let c=async e=>{await I.post(`/ot/discovered-devices/${e}/promote-to-asset`),r((await I.get(`/ot/discovered-devices`,{params:{size:20}})).data.devices||[])};return o?(0,L.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,L.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-primary-400`})}):(0,L.jsxs)(`div`,{className:`space-y-8`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`OT Discovery`}),(0,L.jsx)(`p`,{className:`text-surface-400 mt-1`,children:`Network device discovery and correlation`})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(Ea,{className:`w-5 h-5 text-primary-400 mb-2`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:e?.managed_ot_assets??0}),(0,L.jsx)(`p`,{className:`text-xs text-surface-400`,children:`Managed OT Assets`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(Va,{className:`w-5 h-5 text-info mb-2`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:e?.discovered_ot_devices??0}),(0,L.jsx)(`p`,{className:`text-xs text-surface-400`,children:`Discovered Devices`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(Ba,{className:`w-5 h-5 text-danger mb-2`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:e?.high_risk_devices??0}),(0,L.jsx)(`p`,{className:`text-xs text-surface-400`,children:`High Risk`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-4`,children:[(0,L.jsx)(wa,{className:`w-5 h-5 text-warning mb-2`}),(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:e?.uncorrelated_devices??0}),(0,L.jsx)(`p`,{className:`text-xs text-surface-400`,children:`Uncorrelated`})]})]}),i.length>0&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h3`,{className:`text-lg font-semibold text-white mb-4`,children:`Protocols Detected`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:i.map(e=>(0,L.jsxs)(`div`,{className:`px-3 py-2 bg-surface-700/50 border border-surface-600 rounded-lg`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-white`,children:e.protocol}),(0,L.jsxs)(`span`,{className:`ml-2 text-xs text-surface-400`,children:[`(`,e.count,`)`]})]},e.protocol))})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`px-6 py-4 border-b border-surface-700`,children:(0,L.jsx)(`h3`,{className:`text-lg font-semibold text-white`,children:`Discovered Devices`})}),n.length===0?(0,L.jsx)(`div`,{className:`p-8 text-center text-surface-500`,children:`No devices discovered yet. Deploy a network sensor to start scanning.`}):(0,L.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-400`,children:[(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`IP Address`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Hostname`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Manufacturer`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Risk`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Status`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Actions`})]})}),(0,L.jsx)(`tbody`,{children:n.map(e=>(0,L.jsxs)(`tr`,{className:`border-b border-surface-700/50 hover:bg-surface-800 transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-3 font-mono text-surface-200`,children:e.ip_address}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-300`,children:e.hostname||`-`}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-300`,children:e.manufacturer||`Unknown`}),(0,L.jsx)(`td`,{className:`px-4 py-3`,children:(0,L.jsx)(`span`,{className:z(`text-xs font-medium`,e.risk_score>=70?`text-danger`:e.risk_score>=40?`text-warning`:`text-success`),children:e.risk_score.toFixed(0)})}),(0,L.jsx)(`td`,{className:`px-4 py-3`,children:e.is_correlated?(0,L.jsx)(`span`,{className:`text-xs text-success`,children:`Correlated`}):(0,L.jsx)(`span`,{className:`text-xs text-surface-500`,children:`Unmatched`})}),(0,L.jsx)(`td`,{className:`px-4 py-3`,children:!e.is_correlated&&(0,L.jsx)(`button`,{onClick:()=>c(e.id),className:`text-xs text-primary-400 hover:text-primary-300 font-medium`,children:`Promote to Asset`})})]},e.id))})]})]})]})}function oH(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!0);(0,v.useEffect)(()=>{(async()=>{try{let[e,n]=await Promise.all([I.get(`/mitre/coverage`),I.get(`/mitre/techniques`)]);t(e.data.data),r(n.data)}catch(e){console.error(`Failed to load MITRE data`,e)}finally{s(!1)}})()},[]);let c=i?n.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())||e.id.toLowerCase().includes(i.toLowerCase())):n;return o?(0,L.jsxs)(`div`,{className:`animate-pulse space-y-4`,children:[(0,L.jsx)(`div`,{className:`h-8 bg-surface-800 rounded w-1/3`}),(0,L.jsx)(`div`,{className:`grid grid-cols-4 gap-4`,children:[1,2,3,4].map(e=>(0,L.jsx)(`div`,{className:`h-24 bg-surface-800 rounded`},e))})]}):(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`MITRE ATT&CK Coverage`}),(0,L.jsx)(`p`,{className:`text-surface-400 text-sm mt-1`,children:`Detection coverage mapped to the MITRE ATT&CK framework`})]}),e&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Overall Coverage`}),(0,L.jsxs)(`span`,{className:`text-3xl font-bold text-primary-400`,children:[e.coverage_percentage,`%`]})]}),(0,L.jsx)(`div`,{className:`w-full h-3 bg-surface-700 rounded-full overflow-hidden`,children:(0,L.jsx)(`div`,{className:`h-full bg-primary-500 rounded-full transition-all`,style:{width:`${e.coverage_percentage}%`}})}),(0,L.jsxs)(`p`,{className:`text-sm text-surface-400 mt-2`,children:[e.covered_techniques,` of `,e.total_techniques,` techniques detected`]})]}),e&&(0,L.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3`,children:Object.entries(e.by_tactic).map(([e,t])=>(0,L.jsxs)(`div`,{className:z(`border rounded-xl p-4 transition-colors`,t.covered>0?`bg-primary-600/10 border-primary-500/30`:`bg-surface-800/50 border-surface-700`),children:[(0,L.jsx)(`p`,{className:`text-xs text-surface-500 font-mono`,children:e}),(0,L.jsx)(`p`,{className:`text-sm font-medium text-white mt-1`,children:t.name}),(0,L.jsxs)(`div`,{className:`mt-2`,children:[(0,L.jsx)(`div`,{className:`w-full h-1.5 bg-surface-700 rounded-full overflow-hidden`,children:(0,L.jsx)(`div`,{className:`h-full bg-primary-500 rounded-full`,style:{width:`${t.percentage}%`}})}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-400 mt-1`,children:[t.covered,`/`,t.total]})]})]},e))}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Techniques`}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(ja,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,L.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Search techniques...`,className:`pl-9 pr-4 py-2 bg-surface-900 border border-surface-600 rounded-lg text-white text-sm placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2 max-h-96 overflow-y-auto`,children:c.map(e=>(0,L.jsxs)(`div`,{className:`p-3 bg-surface-900/50 rounded-lg`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs font-mono text-primary-400`,children:e.id}),(0,L.jsx)(`span`,{className:`text-sm text-white`,children:e.name})]}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500 mt-1`,children:e.description})]},e.id))})]})]})}function sH(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),c=async()=>{try{r((await I.get(`/hunt/`)).data)}catch(e){console.error(e)}},l=async()=>{if(e.trim()){s(!0),a(null);try{a((await I.post(`/hunt/`,{hypothesis:e})).data.data),await c()}catch(e){console.error(e)}finally{s(!1)}}};return(0,v.useEffect)(()=>{c()},[]),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Threat Hunt Lab`}),(0,L.jsx)(`p`,{className:`text-surface-400 text-sm mt-1`,children:`Natural-language threat hunting with AI-generated queries`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-2`,children:`Hunting Hypothesis`}),(0,L.jsxs)(`div`,{className:`flex gap-3`,children:[(0,L.jsx)(`input`,{type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&l(),placeholder:`e.g. Look for lateral movement from engineering workstation to PLC subnet`,className:`flex-1 px-4 py-3 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`}),(0,L.jsxs)(`button`,{onClick:l,disabled:o||!e.trim(),className:`flex items-center gap-2 px-6 py-3 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg font-medium transition-colors`,children:[(0,L.jsx)(Oa,{className:`w-4 h-4`}),o?`Hunting...`:`Hunt`]})]}),(0,L.jsx)(`div`,{className:`flex gap-2 mt-3`,children:[`Port scan from 10.0.0.0/24`,`DNS tunneling to external domains`,`Modbus write commands to PLCs`,`Failed auth attempts across multiple hosts`].map(e=>(0,L.jsx)(`button`,{onClick:()=>t(e),className:`px-3 py-1 text-xs bg-surface-700 text-surface-400 rounded-full hover:bg-surface-600 hover:text-surface-300 transition-colors`,children:e},e))})]}),i&&(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-3`,children:`Hunt Results`}),i.explanation&&(0,L.jsx)(`p`,{className:`text-surface-300 text-sm mb-4`,children:i.explanation}),i.query_results?.map((e,t)=>(0,L.jsxs)(`div`,{className:`mb-4 last:mb-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,L.jsx)(ba,{className:`w-4 h-4 text-primary-400`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-white`,children:e.query?.description}),(0,L.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[e.row_count,` results`]})]}),(0,L.jsx)(`pre`,{className:`bg-surface-900 p-3 rounded-lg text-xs text-surface-400 overflow-x-auto mb-2`,children:e.query?.sql}),e.rows?.length>0&&(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsx)(`tr`,{className:`border-b border-surface-700`,children:Object.keys(e.rows[0]).map(e=>(0,L.jsx)(`th`,{className:`text-left p-2 text-surface-500`,children:e},e))})}),(0,L.jsx)(`tbody`,{children:e.rows.slice(0,20).map((e,t)=>(0,L.jsx)(`tr`,{className:`border-b border-surface-800`,children:Object.values(e).map((e,t)=>(0,L.jsx)(`td`,{className:`p-2 text-surface-300 truncate max-w-xs`,children:String(e??`—`)},t))},t))})]})}),e.error&&(0,L.jsx)(`p`,{className:`text-red-400 text-xs mt-1`,children:e.error})]},t))]}),i.sigma_rule&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`h3`,{className:`text-sm font-semibold text-white mb-2 flex items-center gap-2`,children:[(0,L.jsx)(ba,{className:`w-4 h-4 text-primary-400`}),`Generated Sigma Rule`]}),(0,L.jsx)(`pre`,{className:`bg-surface-900 p-4 rounded-lg text-xs text-green-400 overflow-x-auto whitespace-pre-wrap`,children:i.sigma_rule})]})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Hunt History`}),n.length===0?(0,L.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No hunt sessions yet. Enter a hypothesis above to start.`}):(0,L.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-surface-900/50 rounded-lg`,children:[(0,L.jsx)(ha,{className:`w-4 h-4 text-surface-500 shrink-0`}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm text-white truncate`,children:e.hypothesis}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-500`,children:[e.queries_run,` queries · `,e.findings_count,` findings · `,new Date(e.created_at).toLocaleDateString()]})]}),(0,L.jsx)(`span`,{className:z(`text-xs px-2 py-0.5 rounded`,e.status===`completed`?`bg-green-500/20 text-green-400`:`bg-yellow-500/20 text-yellow-400`),children:e.status})]},e.id))})]})]})}function cH(){let{user:e,fetchUser:t}=qi(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``);return(0,v.useEffect)(()=>{},[e]),(0,L.jsxs)(`div`,{className:`space-y-8 max-w-2xl`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Settings`}),(0,L.jsx)(`p`,{className:`text-surface-400 mt-1`,children:`Manage your account and integrations`})]}),u&&(0,L.jsx)(`div`,{className:`p-3 rounded-lg bg-primary-600/10 border border-primary-600/20 text-primary-300 text-sm`,children:u}),(0,L.jsxs)(`section`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,L.jsx)(Na,{className:`w-5 h-5 text-primary-400`}),(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Profile`})]}),(0,L.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-surface-400`,children:`Email`}),(0,L.jsx)(`span`,{className:`text-surface-200`,children:e?.email})]}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-surface-400`,children:`Name`}),(0,L.jsx)(`span`,{className:`text-surface-200`,children:e?.full_name||`Not set`})]}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-surface-400`,children:`Company`}),(0,L.jsx)(`span`,{className:`text-surface-200`,children:e?.company||`Not set`})]}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-surface-400`,children:`Role`}),(0,L.jsx)(`span`,{className:`text-surface-200 capitalize`,children:e?.role})]})]})]}),(0,L.jsxs)(`section`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,L.jsx)(Ia,{className:`w-5 h-5 text-success`}),(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Multi-Factor Authentication`})]}),e?.mfa_enabled?(0,L.jsx)(`p`,{className:`text-success text-sm`,children:`MFA is enabled`}):(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-surface-400 text-sm mb-3`,children:`Protect your account with TOTP-based MFA`}),(0,L.jsx)(`button`,{onClick:async()=>{try{s((await I.post(`/auth/me/mfa/setup`)).data.provisioning_uri)}catch{d(`Failed to setup MFA`)}},className:`px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors`,children:`Enable MFA`})]}),o&&(0,L.jsxs)(`div`,{className:`mt-4 p-4 bg-surface-900 rounded-lg`,children:[(0,L.jsx)(`p`,{className:`text-xs text-surface-400 mb-2`,children:`Scan this URI with your authenticator app:`}),(0,L.jsx)(`code`,{className:`text-xs text-primary-300 break-all`,children:o})]})]}),(0,L.jsxs)(`section`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,L.jsx)(sa,{className:`w-5 h-5 text-warning`}),(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:`Notification Integrations`})]}),(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-sm text-surface-400 block mb-1`,children:`Slack Webhook URL`}),(0,L.jsx)(`input`,{type:`url`,value:n,onChange:e=>r(e.target.value),placeholder:`https://hooks.slack.com/services/...`,className:`w-full px-3 py-2 bg-surface-900 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`text-sm text-surface-400 block mb-1`,children:`Custom Webhook URL`}),(0,L.jsx)(`input`,{type:`url`,value:i,onChange:e=>a(e.target.value),placeholder:`https://your-server.com/webhook`,className:`w-full px-3 py-2 bg-surface-900 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,L.jsx)(`button`,{onClick:async()=>{l(!0);try{let e=new URLSearchParams;n&&e.append(`slack_webhook_url`,n),i&&e.append(`webhook_url`,i),await I.patch(`/auth/me/integrations?${e.toString()}`),d(`Integrations saved`),t()}catch{d(`Failed to save`)}finally{l(!1),setTimeout(()=>d(``),3e3)}},disabled:c,className:`px-4 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg text-sm font-medium transition-colors`,children:c?`Saving...`:`Save Integrations`})]})]})]})}function lH(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{async function e(){try{t((await I.get(`/auth/audit-logs`)).data)}catch(e){e.response?.status===403?s(`Admin access required to view audit logs.`):s(`Failed to load audit logs.`)}finally{r(!1)}}e()},[]);let c=e.filter(e=>!i||e.action.toLowerCase().includes(i.toLowerCase())||e.detail?.toLowerCase().includes(i.toLowerCase()));return n?(0,L.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,L.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-primary-400`})}):(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Audit Log`}),(0,L.jsx)(`p`,{className:`text-surface-400 mt-1`,children:`Track all user actions`})]}),o?(0,L.jsxs)(`div`,{className:`p-6 bg-surface-800/50 border border-surface-700 rounded-xl text-center`,children:[(0,L.jsx)(ma,{className:`w-8 h-8 mx-auto mb-3 text-surface-500`}),(0,L.jsx)(`p`,{className:`text-surface-400`,children:o})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`relative max-w-sm`,children:[(0,L.jsx)(ja,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-surface-500`}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search actions...`,value:i,onChange:e=>a(e.target.value),className:`w-full pl-9 pr-4 py-2 bg-surface-800 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,L.jsx)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl overflow-hidden`,children:(0,L.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-400`,children:[(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Timestamp`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Action`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Target`}),(0,L.jsx)(`th`,{className:`px-4 py-3 text-left`,children:`Detail`})]})}),(0,L.jsx)(`tbody`,{children:c.length===0?(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{colSpan:4,className:`px-4 py-8 text-center text-surface-500`,children:`No audit log entries found`})}):c.map(e=>(0,L.jsxs)(`tr`,{className:`border-b border-surface-700/50 hover:bg-surface-800 transition-colors`,children:[(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-400 text-xs`,children:e.timestamp?new Date(e.timestamp).toLocaleString():`-`}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-200 font-medium`,children:e.action}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-400`,children:e.target_type?`${e.target_type} #${e.target_id}`:`-`}),(0,L.jsx)(`td`,{className:`px-4 py-3 text-surface-500 text-xs max-w-xs truncate`,children:e.detail||`-`})]},e.id))})]})})]})]})}var uH={success:fa,error:pa,warning:Ba,info:Sa},dH={success:`bg-emerald-500/10 border-emerald-500/30 text-emerald-400`,error:`bg-red-500/10 border-red-500/30 text-red-400`,warning:`bg-amber-500/10 border-amber-500/30 text-amber-400`,info:`bg-blue-500/10 border-blue-500/30 text-blue-400`},fH=0,pH=null;function mH(e,t=`info`){pH?.(e,t)}function hH(){let[e,t]=(0,v.useState)([]),n=(0,v.useCallback)((e,n)=>{let r=++fH;t(t=>[...t,{id:r,message:e,type:n}]),setTimeout(()=>{t(e=>e.filter(e=>e.id!==r))},4e3)},[]),r=(0,v.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return(0,v.useEffect)(()=>(pH=n,()=>{pH=null}),[n]),e.length===0?null:(0,L.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm`,role:`status`,"aria-live":`polite`,children:e.map(e=>{let t=uH[e.type];return(0,L.jsxs)(`div`,{className:z(`flex items-center gap-3 px-4 py-3 rounded-lg border text-sm animate-in slide-in-from-right`,dH[e.type]),children:[(0,L.jsx)(t,{className:`w-4 h-4 shrink-0`}),(0,L.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,L.jsx)(`button`,{onClick:()=>r(e.id),"aria-label":`Dismiss notification`,className:`text-current opacity-60 hover:opacity-100 transition-opacity`,children:(0,L.jsx)(Ua,{className:`w-3.5 h-3.5`})})]},e.id)})})}var gH={draft:`bg-surface-600/20 text-surface-400`,pending_approval:`bg-amber-500/20 text-amber-400`,approved:`bg-green-500/20 text-green-400`,executing:`bg-blue-500/20 text-blue-400`,completed:`bg-emerald-500/20 text-emerald-400`,rejected:`bg-red-500/20 text-red-400`,partial:`bg-orange-500/20 text-orange-400`};function _H(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),o=async()=>{try{t((await I.get(`/response-plans/`)).data.data||[])}catch(e){console.error(e)}},s=async()=>{try{r((await I.get(`/response-plans/pending-approvals`)).data.data||[])}catch(e){console.error(e)}},c=async e=>{try{await I.post(`/response-plans/${e}/approve`),mH(`Plan approved`,`success`),await Promise.all([o(),s()])}catch(e){console.error(e),mH(`Failed to approve plan`,`error`)}},l=async e=>{try{await I.post(`/response-plans/${e}/reject`,{reason:`Manual rejection`}),mH(`Plan rejected`,`warning`),await Promise.all([o(),s()])}catch(e){console.error(e),mH(`Failed to reject plan`,`error`)}},u=async e=>{try{await I.post(`/response-plans/${e}/execute`),mH(`Plan executed successfully`,`success`),await o()}catch(e){console.error(e),mH(`Execution failed`,`error`)}};return(0,v.useEffect)(()=>{o(),s()},[]),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Response Plans`}),(0,L.jsx)(`p`,{className:`text-surface-400 text-sm mt-1`,children:`AI-generated response plans with human approval workflow`})]}),n.length>0&&(0,L.jsxs)(`div`,{className:`bg-amber-500/5 border border-amber-500/30 rounded-xl p-6`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold text-amber-400 mb-4 flex items-center gap-2`,children:[(0,L.jsx)(ha,{className:`w-5 h-5`}),`Pending Approvals (`,n.length,`)`]}),(0,L.jsx)(`div`,{className:`space-y-3`,children:n.map(e=>(0,L.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-4 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex-1`,children:[(0,L.jsxs)(`p`,{className:`text-sm text-white font-medium`,children:[`Plan #`,e.plan_id,` — Case #`,e.case_id]}),(0,L.jsx)(`p`,{className:`text-xs text-surface-400 mt-1`,children:e.reason}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-500 mt-1`,children:[e.actions?.length||0,` actions · Level `,e.autonomy_level]})]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsxs)(`button`,{onClick:()=>c(e.plan_id),className:`flex items-center gap-1 px-3 py-1.5 bg-green-600 hover:bg-green-700 text-white rounded text-xs font-medium transition-colors`,children:[(0,L.jsx)(fa,{className:`w-3.5 h-3.5`}),` Approve`]}),(0,L.jsxs)(`button`,{onClick:()=>l(e.plan_id),className:`flex items-center gap-1 px-3 py-1.5 bg-red-600 hover:bg-red-700 text-white rounded text-xs font-medium transition-colors`,children:[(0,L.jsx)(pa,{className:`w-3.5 h-3.5`}),` Reject`]})]})]},e.id))})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`All Response Plans`}),e.length===0?(0,L.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No response plans yet. Run the agent pipeline to generate plans.`}):(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`border-b border-surface-700 text-surface-500 text-xs`,children:[(0,L.jsx)(`th`,{className:`text-left p-3`,children:`ID`}),(0,L.jsx)(`th`,{className:`text-left p-3`,children:`Case`}),(0,L.jsx)(`th`,{className:`text-left p-3`,children:`Actions`}),(0,L.jsx)(`th`,{className:`text-left p-3`,children:`Level`}),(0,L.jsx)(`th`,{className:`text-left p-3`,children:`Status`}),(0,L.jsx)(`th`,{className:`text-left p-3`,children:`Created`}),(0,L.jsx)(`th`,{className:`text-left p-3`,children:`Actions`})]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-b border-surface-800 hover:bg-surface-800/50 cursor-pointer`,onClick:()=>a(i?.id===e.id?null:e),children:[(0,L.jsxs)(`td`,{className:`p-3 text-surface-300`,children:[`#`,e.id]}),(0,L.jsxs)(`td`,{className:`p-3 text-surface-300`,children:[`Case #`,e.case_id]}),(0,L.jsx)(`td`,{className:`p-3 text-surface-300`,children:e.actions?.length||0}),(0,L.jsx)(`td`,{className:`p-3`,children:(0,L.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded bg-primary-500/20 text-primary-400`,children:e.autonomy_level})}),(0,L.jsx)(`td`,{className:`p-3`,children:(0,L.jsx)(`span`,{className:z(`text-xs px-2 py-0.5 rounded`,gH[e.status]||gH.draft),children:e.status})}),(0,L.jsx)(`td`,{className:`p-3 text-surface-500 text-xs`,children:new Date(e.created_at).toLocaleString()}),(0,L.jsx)(`td`,{className:`p-3`,children:e.status===`approved`&&(0,L.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),u(e.id)},className:`flex items-center gap-1 px-2 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded text-xs transition-colors`,children:[(0,L.jsx)(Oa,{className:`w-3 h-3`}),` Execute`]})})]},e.id))})]})})]}),i&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold text-white mb-4 flex items-center gap-2`,children:[(0,L.jsx)(Ia,{className:`w-5 h-5 text-primary-400`}),`Plan #`,i.id,` Actions`]}),(0,L.jsx)(`div`,{className:`space-y-2`,children:i.actions?.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-surface-900/50 rounded-lg`,children:[(0,L.jsxs)(`span`,{className:`text-xs font-mono text-surface-500 w-6`,children:[`#`,e.priority||t+1]}),(0,L.jsx)(`span`,{className:z(`text-xs px-2 py-0.5 rounded font-medium`,e.policy_check?.approved?`bg-green-500/20 text-green-400`:`bg-amber-500/20 text-amber-400`),children:e.action_type}),(0,L.jsx)(`span`,{className:`text-sm text-surface-300 flex-1`,children:e.target}),(0,L.jsx)(`span`,{className:`text-xs text-surface-500`,children:e.reason}),e.execution_result&&(0,L.jsx)(`span`,{className:z(`text-xs px-2 py-0.5 rounded`,e.execution_result.status===`completed`?`bg-emerald-500/20 text-emerald-400`:`bg-red-500/20 text-red-400`),children:e.execution_result.status})]},t))})]})]})}var vH=[{id:`T1059`,name:`Command and Scripting Interpreter`},{id:`T1071`,name:`Application Layer Protocol`},{id:`T1110`,name:`Brute Force`},{id:`T1190`,name:`Exploit Public-Facing Application`},{id:`T1078`,name:`Valid Accounts`},{id:`T1021`,name:`Remote Services`},{id:`T1046`,name:`Network Service Discovery`},{id:`T1486`,name:`Data Encrypted for Impact`}],yH={pending:`bg-surface-600/20 text-surface-400`,running:`bg-blue-500/20 text-blue-400`,completed:`bg-green-500/20 text-green-400`,failed:`bg-red-500/20 text-red-400`};function bH(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)({name:``,description:``,techniques:[]}),[c,l]=(0,v.useState)(!1),u=async()=>{try{t((await I.get(`/validation/runs`)).data.data||[])}catch(e){console.error(e)}},d=async()=>{if(!(!o.name.trim()||o.techniques.length===0)){l(!0);try{await I.post(`/validation/runs`,{name:o.name,description:o.description,mode:`dry_run`,mitre_techniques:o.techniques}),r(!1),s({name:``,description:``,techniques:[]}),mH(`Validation run created`,`success`),await u()}catch(e){console.error(e),mH(`Failed to create run`,`error`)}finally{l(!1)}}},f=async e=>{try{await I.post(`/validation/runs/${e}/execute`),mH(`Validation complete`,`success`),await u(),await p(e)}catch(e){console.error(e),mH(`Execution failed`,`error`)}},p=async e=>{try{a((await I.get(`/validation/runs/${e}`)).data.data)}catch(e){console.error(e)}},m=e=>{s(t=>({...t,techniques:t.techniques.includes(e)?t.techniques.filter(t=>t!==e):[...t.techniques,e]}))};return(0,v.useEffect)(()=>{u()},[]),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:`Purple-Team Validation`}),(0,L.jsx)(`p`,{className:`text-surface-400 text-sm mt-1`,children:`Test detection controls against simulated ATT&CK techniques`})]}),(0,L.jsxs)(`button`,{onClick:()=>r(!n),className:`flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors`,children:[(0,L.jsx)(ka,{className:`w-4 h-4`}),` New Validation`]})]}),n&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Create Validation Run`}),(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-1`,children:`Name`}),(0,L.jsx)(`input`,{type:`text`,value:o.name,onChange:e=>s({...o,name:e.target.value}),placeholder:`e.g. Weekly Detection Coverage Test`,className:`w-full px-4 py-2 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`block text-sm font-medium text-surface-300 mb-2`,children:`ATT&CK Techniques`}),(0,L.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-2`,children:vH.map(e=>(0,L.jsxs)(`button`,{onClick:()=>m(e.id),className:z(`p-2 rounded-lg text-left text-xs border transition-colors`,o.techniques.includes(e.id)?`border-primary-500 bg-primary-500/10 text-primary-300`:`border-surface-700 bg-surface-900/50 text-surface-400 hover:border-surface-600`),children:[(0,L.jsx)(`span`,{className:`font-mono font-medium`,children:e.id}),(0,L.jsx)(`p`,{className:`text-xs mt-0.5 truncate`,children:e.name})]},e.id))})]}),(0,L.jsx)(`button`,{onClick:d,disabled:c||!o.name.trim()||o.techniques.length===0,className:`px-6 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg text-sm font-medium transition-colors`,children:c?`Creating...`:`Create Run`})]})]}),(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-white mb-4`,children:`Validation Runs`}),e.length===0?(0,L.jsx)(`p`,{className:`text-surface-500 text-sm`,children:`No validation runs yet. Create one to test your detection coverage.`}):(0,L.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-4 p-4 bg-surface-900/50 rounded-lg cursor-pointer hover:bg-surface-900/80 transition-colors`,onClick:()=>p(e.id),children:[(0,L.jsx)(Fa,{className:`w-5 h-5 text-primary-400 shrink-0`}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm text-white font-medium`,children:e.name}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-500`,children:[e.mitre_techniques?.length||0,` techniques · `,e.mode,` · `,new Date(e.created_at).toLocaleDateString()]})]}),e.results_summary&&(0,L.jsxs)(`div`,{className:`text-right`,children:[(0,L.jsxs)(`p`,{className:z(`text-lg font-bold`,e.results_summary.detection_rate>=70?`text-green-400`:e.results_summary.detection_rate>=40?`text-amber-400`:`text-red-400`),children:[e.results_summary.detection_rate,`%`]}),(0,L.jsxs)(`p`,{className:`text-xs text-surface-500`,children:[e.results_summary.detected,`/`,e.results_summary.tested,` detected`]})]}),(0,L.jsx)(`span`,{className:z(`text-xs px-2 py-0.5 rounded`,yH[e.status]||yH.pending),children:e.status}),e.status===`pending`&&(0,L.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),f(e.id)},className:`flex items-center gap-1 px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded text-xs font-medium transition-colors`,children:[(0,L.jsx)(Oa,{className:`w-3 h-3`}),` Run`]})]},e.id))})]}),i&&(0,L.jsxs)(`div`,{className:`bg-surface-800/50 border border-surface-700 rounded-xl p-6`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold text-white mb-4 flex items-center gap-2`,children:[(0,L.jsx)(Ra,{className:`w-5 h-5 text-primary-400`}),i.name,` — Results`]}),i.results_summary&&(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,L.jsx)(`p`,{className:`text-2xl font-bold text-white`,children:i.results_summary.tested}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Tests Run`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,L.jsx)(`p`,{className:`text-2xl font-bold text-green-400`,children:i.results_summary.detected}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Detected`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,L.jsx)(`p`,{className:`text-2xl font-bold text-red-400`,children:i.results_summary.missed}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Missed`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-900/50 rounded-lg p-3 text-center`,children:[(0,L.jsxs)(`p`,{className:z(`text-2xl font-bold`,i.results_summary.detection_rate>=70?`text-green-400`:`text-amber-400`),children:[i.results_summary.detection_rate,`%`]}),(0,L.jsx)(`p`,{className:`text-xs text-surface-500`,children:`Detection Rate`})]})]}),i.steps?.length>0&&(0,L.jsx)(`div`,{className:`space-y-2`,children:i.steps.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-surface-900/30 rounded-lg`,children:[e.actual_result===`detected`?(0,L.jsx)(fa,{className:`w-4 h-4 text-green-400 shrink-0`}):(0,L.jsx)(pa,{className:`w-4 h-4 text-red-400 shrink-0`}),(0,L.jsx)(`span`,{className:`font-mono text-xs text-primary-400 w-12`,children:e.technique_id}),(0,L.jsx)(`span`,{className:`text-sm text-surface-300 flex-1`,children:e.test_name}),(0,L.jsx)(`span`,{className:z(`text-xs px-2 py-0.5 rounded`,e.actual_result===`detected`?`bg-green-500/20 text-green-400`:`bg-red-500/20 text-red-400`),children:e.actual_result}),(0,L.jsxs)(`span`,{className:`text-xs text-surface-500`,children:[e.duration_ms,`ms`]})]},e.id))})]})]})}function xH(){let{isAuthenticated:e,fetchUser:t}=qi();return(0,v.useEffect)(()=>{e&&t()},[e,t]),(0,L.jsxs)(Nt,{basename:`/app`,children:[(0,L.jsx)(hH,{}),(0,L.jsxs)(xt,{children:[(0,L.jsx)(yt,{path:`/login`,element:e?(0,L.jsx)(_t,{to:`/`}):(0,L.jsx)(Ja,{})}),(0,L.jsx)(yt,{path:`/register`,element:e?(0,L.jsx)(_t,{to:`/`}):(0,L.jsx)(Ya,{})}),(0,L.jsxs)(yt,{element:(0,L.jsx)(Yi,{children:(0,L.jsx)(qa,{})}),children:[(0,L.jsx)(yt,{path:`/`,element:(0,L.jsx)(WV,{})}),(0,L.jsx)(yt,{path:`/cases`,element:(0,L.jsx)(qV,{})}),(0,L.jsx)(yt,{path:`/cases/:caseId`,element:(0,L.jsx)(XV,{})}),(0,L.jsx)(yt,{path:`/alerts`,element:(0,L.jsx)(eH,{})}),(0,L.jsx)(yt,{path:`/events`,element:(0,L.jsx)(nH,{})}),(0,L.jsx)(yt,{path:`/assets`,element:(0,L.jsx)(rH,{})}),(0,L.jsx)(yt,{path:`/ot`,element:(0,L.jsx)(aH,{})}),(0,L.jsx)(yt,{path:`/mitre`,element:(0,L.jsx)(oH,{})}),(0,L.jsx)(yt,{path:`/hunt`,element:(0,L.jsx)(sH,{})}),(0,L.jsx)(yt,{path:`/response-plans`,element:(0,L.jsx)(_H,{})}),(0,L.jsx)(yt,{path:`/validation`,element:(0,L.jsx)(bH,{})}),(0,L.jsx)(yt,{path:`/settings`,element:(0,L.jsx)(cH,{})}),(0,L.jsx)(yt,{path:`/audit-log`,element:(0,L.jsx)(lH,{})})]}),(0,L.jsx)(yt,{path:`*`,element:(0,L.jsx)(_t,{to:`/`})})]})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(v.StrictMode,{children:(0,L.jsx)(xH,{})})); \ No newline at end of file diff --git a/frontend-v2/dist/assets/play-C2dygcG1.js b/frontend-v2/dist/assets/play-C2dygcG1.js new file mode 100644 index 0000000..57cf9b6 --- /dev/null +++ b/frontend-v2/dist/assets/play-C2dygcG1.js @@ -0,0 +1 @@ +import{g as e}from"./index-CjOT90JS.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t}; \ No newline at end of file diff --git a/frontend-v2/dist/assets/plus-B6elnz9I.js b/frontend-v2/dist/assets/plus-B6elnz9I.js new file mode 100644 index 0000000..f5b807a --- /dev/null +++ b/frontend-v2/dist/assets/plus-B6elnz9I.js @@ -0,0 +1 @@ +import{g as e}from"./index-CjOT90JS.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t}; \ No newline at end of file diff --git a/frontend-v2/dist/index.html b/frontend-v2/dist/index.html index 22bdf8b..e7090ba 100644 --- a/frontend-v2/dist/index.html +++ b/frontend-v2/dist/index.html @@ -5,8 +5,8 @@ OneAlert — OT Security Platform - - + +
diff --git a/frontend-v2/eslint.config.js b/frontend-v2/eslint.config.js index 5e6b472..279a505 100644 --- a/frontend-v2/eslint.config.js +++ b/frontend-v2/eslint.config.js @@ -19,5 +19,10 @@ export default defineConfig([ ecmaVersion: 2020, globals: globals.browser, }, + rules: { + // Network bootstrapping in route effects is intentional; this experimental + // rule currently flags standard async data loaders as synchronous updates. + 'react-hooks/set-state-in-effect': 'off', + }, }, ]) diff --git a/frontend-v2/package-lock.json b/frontend-v2/package-lock.json index f52b716..61f1ca5 100644 --- a/frontend-v2/package-lock.json +++ b/frontend-v2/package-lock.json @@ -37,13 +37,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", - "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.28.5", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -52,9 +52,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", - "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { @@ -62,21 +62,21 @@ } }, "node_modules/@babel/core": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", - "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-compilation-targets": "^7.28.6", - "@babel/helper-module-transforms": "^7.28.6", - "@babel/helpers": "^7.28.6", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/traverse": "^7.29.0", - "@babel/types": "^7.29.0", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -93,14 +93,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.29.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", - "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.0", - "@babel/types": "^7.29.0", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -110,14 +110,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", - "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.28.6", - "@babel/helper-validator-option": "^7.27.1", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -127,9 +127,9 @@ } }, "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, "license": "MIT", "engines": { @@ -137,29 +137,29 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", - "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.28.6", - "@babel/types": "^7.28.6" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", - "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.28.6", - "@babel/helper-validator-identifier": "^7.28.5", - "@babel/traverse": "^7.28.6" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -169,9 +169,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, "license": "MIT", "engines": { @@ -179,9 +179,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, "license": "MIT", "engines": { @@ -189,9 +189,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { @@ -199,27 +199,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", - "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", - "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.29.0" + "@babel/types": "^7.29.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -229,33 +229,33 @@ } }, "node_modules/@babel/template": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", - "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.28.6", - "@babel/parser": "^7.28.6", - "@babel/types": "^7.28.6" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", - "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", "debug": "^4.3.1" }, "engines": { @@ -263,34 +263,34 @@ } }, "node_modules/@babel/types": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", - "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@emnapi/core": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz", - "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", "license": "MIT", "optional": true, "dependencies": { - "@emnapi/wasi-threads": "1.2.1", + "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz", - "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", "license": "MIT", "optional": true, "dependencies": { @@ -298,9 +298,9 @@ } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", "license": "MIT", "optional": true, "dependencies": { @@ -676,13 +676,13 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", - "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", "license": "MIT", "optional": true, "dependencies": { - "@tybys/wasm-util": "^0.10.1" + "@tybys/wasm-util": "^0.10.3" }, "funding": { "type": "github", @@ -694,9 +694,9 @@ } }, "node_modules/@oxc-project/types": { - "version": "0.126.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.126.0.tgz", - "integrity": "sha512-oGfVtjAgwQVVpfBrbtk4e1XDyWHRFta6BS3GWVzrF8xYBT2VGQAk39yJS/wFSMrZqoiCU4oghT3Ch0HaHGIHcQ==", + "version": "0.139.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/Boshen" @@ -786,9 +786,9 @@ } }, "node_modules/@rolldown/binding-android-arm64": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.16.tgz", - "integrity": "sha512-rhY3k7Bsae9qQfOtph2Pm2jZEA+s8Gmjoz4hhmx70K9iMQ/ddeae+xhRQcM5IuVx5ry1+bGfkvMn7D6MJggVSA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", "cpu": [ "arm64" ], @@ -802,9 +802,9 @@ } }, "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.16.tgz", - "integrity": "sha512-rNz0yK078yrNn3DrdgN+PKiMOW8HfQ92jQiXxwX8yW899ayV00MLVdaCNeVBhG/TbH3ouYVObo8/yrkiectkcQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", "cpu": [ "arm64" ], @@ -818,9 +818,9 @@ } }, "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.16.tgz", - "integrity": "sha512-r/OmdR00HmD4i79Z//xO06uEPOq5hRXdhw7nzkxQxwSavs3PSHa1ijntdpOiZ2mzOQ3fVVu8C1M19FoNM+dMUQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", "cpu": [ "x64" ], @@ -834,9 +834,9 @@ } }, "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.16.tgz", - "integrity": "sha512-KcRE5w8h0OnjUatG8pldyD14/CQ5Phs1oxfR+3pKDjboHRo9+MkqQaiIZlZRpsxC15paeXme/I127tUa9TXJ6g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", "cpu": [ "x64" ], @@ -850,9 +850,9 @@ } }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.16.tgz", - "integrity": "sha512-bT0guA1bpxEJ/ZhTRniQf7rNF8ybvXOuWbNIeLABaV5NGjx4EtOWBTSRGWFU9ZWVkPOZ+HNFP8RMcBokBiZ0Kg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", "cpu": [ "arm" ], @@ -866,9 +866,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.16.tgz", - "integrity": "sha512-+tHktCHWV8BDQSjemUqm/Jl/TPk3QObCTIjmdDy/nlupcujZghmKK2962LYrqFpWu+ai01AN/REOH3NEpqvYQg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", "cpu": [ "arm64" ], @@ -882,9 +882,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.16.tgz", - "integrity": "sha512-3fPzdREH806oRLxpTWW1Gt4tQHs0TitZFOECB2xzCFLPKnSOy90gwA7P29cksYilFO6XVRY1kzga0cL2nRjKPg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", "cpu": [ "arm64" ], @@ -898,9 +898,9 @@ } }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.16.tgz", - "integrity": "sha512-EKwI1tSrLs7YVw+JPJT/G2dJQ1jl9qlTTTEG0V2Ok/RdOenRfBw2PQdLPyjhIu58ocdBfP7vIRN/pvMsPxs/AQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", "cpu": [ "ppc64" ], @@ -914,9 +914,9 @@ } }, "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.16.tgz", - "integrity": "sha512-Uknladnb3Sxqu6SEcqBldQyJUpk8NleooZEc0MbRBJ4inEhRYWZX0NJu12vNf2mqAq7gsofAxHrGghiUYjhaLQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", "cpu": [ "s390x" ], @@ -930,9 +930,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.16.tgz", - "integrity": "sha512-FIb8+uG49sZBtLTn+zt1AJ20TqVcqWeSIyoVt0or7uAWesgKaHbiBh6OpA/k9v0LTt+PTrb1Lao133kP4uVxkg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", "cpu": [ "x64" ], @@ -946,9 +946,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.16.tgz", - "integrity": "sha512-RuERhF9/EgWxZEXYWCOaViUWHIboceK4/ivdtQ3R0T44NjLkIIlGIAVAuCddFxsZ7vnRHtNQUrt2vR2n2slB2w==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", "cpu": [ "x64" ], @@ -962,9 +962,9 @@ } }, "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.16.tgz", - "integrity": "sha512-mXcXnvd9GpazCxeUCCnZ2+YF7nut+ZOEbE4GtaiPtyY6AkhZWbK70y1KK3j+RDhjVq5+U8FySkKRb/+w0EeUwA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", "cpu": [ "arm64" ], @@ -978,27 +978,27 @@ } }, "node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.16.tgz", - "integrity": "sha512-3Q2KQxnC8IJOLqXmUMoYwyIPZU9hzRbnHaoV3Euz+VVnjZKcY8ktnNP8T9R4/GGQtb27C/UYKABxesKWb8lsvQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", "cpu": [ "wasm32" ], "license": "MIT", "optional": true, "dependencies": { - "@emnapi/core": "1.9.2", - "@emnapi/runtime": "1.9.2", - "@napi-rs/wasm-runtime": "^1.1.4" + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" }, "engines": { "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.16.tgz", - "integrity": "sha512-tj7XRemQcOcFwv7qhpUxMTBbI5mWMlE4c1Omhg5+h8GuLXzyj8HviYgR+bB2DMDgRqUE+jiDleqSCRjx4aYk/Q==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", "cpu": [ "arm64" ], @@ -1012,9 +1012,9 @@ } }, "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.16.tgz", - "integrity": "sha512-PH5DRZT+F4f2PTXRXR8uJxnBq2po/xFtddyabTJVJs/ZYVHqXPEgNIr35IHTEa6bpa0Q8Awg+ymkTaGnKITw4g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", "cpu": [ "x64" ], @@ -1366,9 +1366,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", - "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", "license": "MIT", "optional": true, "dependencies": { @@ -1909,9 +1909,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.20", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.20.tgz", - "integrity": "sha512-1AaXxEPfXT+GvTBJFuy4yXVHWJBXa4OdbIebGN/wX5DlsIkU0+wzGnd2lOzokSk51d5LUmqjgBLRLlypLUqInQ==", + "version": "2.10.43", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", + "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -1933,9 +1933,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", - "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "version": "4.28.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", + "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", "dev": true, "funding": [ { @@ -1953,10 +1953,10 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.12", - "caniuse-lite": "^1.0.30001782", - "electron-to-chromium": "^1.5.328", - "node-releases": "^2.0.36", + "baseline-browser-mapping": "^2.10.42", + "caniuse-lite": "^1.0.30001803", + "electron-to-chromium": "^1.5.389", + "node-releases": "^2.0.51", "update-browserslist-db": "^1.2.3" }, "bin": { @@ -1990,9 +1990,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001788", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001788.tgz", - "integrity": "sha512-6q8HFp+lOQtcf7wBK+uEenxymVWkGKkjFpCvw5W25cmMwEDU45p1xQFBQv8JDlMMry7eNxyBaR+qxgmTUZkIRQ==", + "version": "1.0.30001805", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", + "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", "dev": true, "funding": [ { @@ -2289,9 +2289,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.340", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.340.tgz", - "integrity": "sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==", + "version": "1.5.389", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", + "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", "dev": true, "license": "ISC" }, @@ -2686,16 +2686,16 @@ } }, "node_modules/form-data": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", - "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" + "hasown": "^2.0.4", + "mime-types": "^2.1.35" }, "engines": { "node": ">= 6" @@ -2853,9 +2853,9 @@ } }, "node_modules/hasown": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", - "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -2984,10 +2984,20 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -3418,9 +3428,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", "funding": [ { "type": "github", @@ -3443,11 +3453,14 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.37", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", - "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/optionator": { "version": "0.9.4", @@ -3539,9 +3552,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "license": "MIT", "engines": { "node": ">=12" @@ -3551,9 +3564,9 @@ } }, "node_modules/postcss": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz", - "integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==", + "version": "8.5.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.18.tgz", + "integrity": "sha512-xdB1oSLHbz1vRWgCDalrCqEFTWzFlhqFC5tIHLMOSUIjhm3XXQ1qrFy8S/ESr1JYRRXqM3c1QFiMZUJdUTqyMQ==", "funding": [ { "type": "opencollective", @@ -3570,7 +3583,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.11", + "nanoid": "^3.3.12", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -3790,13 +3803,13 @@ } }, "node_modules/rolldown": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.16.tgz", - "integrity": "sha512-rzi5WqKzEZw3SooTt7cgm4eqIoujPIyGcJNGFL7iPEuajQw7vxMHUkXylu4/vhCkJGXsgRmxqMKXUpT6FEgl0g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.126.0", - "@rolldown/pluginutils": "1.0.0-rc.16" + "@oxc-project/types": "=0.139.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { "rolldown": "bin/cli.mjs" @@ -3805,27 +3818,27 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.0.0-rc.16", - "@rolldown/binding-darwin-arm64": "1.0.0-rc.16", - "@rolldown/binding-darwin-x64": "1.0.0-rc.16", - "@rolldown/binding-freebsd-x64": "1.0.0-rc.16", - "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.16", - "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.16", - "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.16", - "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.16", - "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.16", - "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.16", - "@rolldown/binding-linux-x64-musl": "1.0.0-rc.16", - "@rolldown/binding-openharmony-arm64": "1.0.0-rc.16", - "@rolldown/binding-wasm32-wasi": "1.0.0-rc.16", - "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.16", - "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.16" + "@rolldown/binding-android-arm64": "1.1.5", + "@rolldown/binding-darwin-arm64": "1.1.5", + "@rolldown/binding-darwin-x64": "1.1.5", + "@rolldown/binding-freebsd-x64": "1.1.5", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", + "@rolldown/binding-linux-arm64-gnu": "1.1.5", + "@rolldown/binding-linux-arm64-musl": "1.1.5", + "@rolldown/binding-linux-ppc64-gnu": "1.1.5", + "@rolldown/binding-linux-s390x-gnu": "1.1.5", + "@rolldown/binding-linux-x64-gnu": "1.1.5", + "@rolldown/binding-linux-x64-musl": "1.1.5", + "@rolldown/binding-openharmony-arm64": "1.1.5", + "@rolldown/binding-wasm32-wasi": "1.1.5", + "@rolldown/binding-win32-arm64-msvc": "1.1.5", + "@rolldown/binding-win32-x64-msvc": "1.1.5" } }, "node_modules/rolldown/node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.16", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.16.tgz", - "integrity": "sha512-45+YtqxLYKDWQouLKCrpIZhke+nXxhsw+qAHVzHDVwttyBlHNBVs2K25rDXrZzhpTp9w1FlAlvweV1H++fdZoA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", "license": "MIT" }, "node_modules/scheduler": { @@ -3934,9 +3947,9 @@ "license": "MIT" }, "node_modules/tinyglobby": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", - "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "license": "MIT", "dependencies": { "fdir": "^6.5.0", @@ -4099,16 +4112,16 @@ } }, "node_modules/vite": { - "version": "8.0.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.9.tgz", - "integrity": "sha512-t7g7GVRpMXjNpa67HaVWI/8BWtdVIQPCL2WoozXXA7LBGEFK4AkkKkHx2hAQf5x1GZSlcmEDPkVLSGahxnEEZw==", + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", + "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", "license": "MIT", "dependencies": { "lightningcss": "^1.32.0", - "picomatch": "^4.0.4", - "postcss": "^8.5.10", - "rolldown": "1.0.0-rc.16", - "tinyglobby": "^0.2.16" + "picomatch": "^4.0.5", + "postcss": "^8.5.16", + "rolldown": "~1.1.4", + "tinyglobby": "^0.2.17" }, "bin": { "vite": "bin/vite.js" @@ -4124,7 +4137,7 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.1.0", + "@vitejs/devtools": "^0.3.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", diff --git a/frontend-v2/src/App.tsx b/frontend-v2/src/App.tsx index fd295a8..8390e36 100644 --- a/frontend-v2/src/App.tsx +++ b/frontend-v2/src/App.tsx @@ -1,37 +1,39 @@ import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; -import { useEffect } from 'react'; +import { lazy, Suspense, useEffect } from 'react'; import { useAuthStore } from './stores/authStore'; import { ProtectedRoute } from './components/ProtectedRoute'; import { AppLayout } from './components/layout/AppLayout'; -import { Login } from './pages/Login'; -import { Register } from './pages/Register'; -import { Dashboard } from './pages/Dashboard'; -import { Cases } from './pages/Cases'; -import { CaseDetail } from './pages/CaseDetail'; -import { Alerts } from './pages/Alerts'; -import { Events } from './pages/Events'; -import { Assets } from './pages/Assets'; -import { OTDiscovery } from './pages/OTDiscovery'; -import { MitreMap } from './pages/MitreMap'; -import { HuntLab } from './pages/HuntLab'; -import { Settings } from './pages/Settings'; -import { AuditLog } from './pages/AuditLog'; -import { ResponsePlans } from './pages/ResponsePlans'; -import { Validation } from './pages/Validation'; import { ToastContainer } from './components/Toast'; +const Login = lazy(() => import('./pages/Login').then(module => ({ default: module.Login }))); +const Register = lazy(() => import('./pages/Register').then(module => ({ default: module.Register }))); +const Dashboard = lazy(() => import('./pages/Dashboard').then(module => ({ default: module.Dashboard }))); +const Cases = lazy(() => import('./pages/Cases').then(module => ({ default: module.Cases }))); +const CaseDetail = lazy(() => import('./pages/CaseDetail').then(module => ({ default: module.CaseDetail }))); +const Alerts = lazy(() => import('./pages/Alerts').then(module => ({ default: module.Alerts }))); +const Events = lazy(() => import('./pages/Events').then(module => ({ default: module.Events }))); +const Assets = lazy(() => import('./pages/Assets').then(module => ({ default: module.Assets }))); +const OTDiscovery = lazy(() => import('./pages/OTDiscovery').then(module => ({ default: module.OTDiscovery }))); +const MitreMap = lazy(() => import('./pages/MitreMap').then(module => ({ default: module.MitreMap }))); +const HuntLab = lazy(() => import('./pages/HuntLab').then(module => ({ default: module.HuntLab }))); +const Settings = lazy(() => import('./pages/Settings').then(module => ({ default: module.Settings }))); +const AuditLog = lazy(() => import('./pages/AuditLog').then(module => ({ default: module.AuditLog }))); +const ResponsePlans = lazy(() => import('./pages/ResponsePlans').then(module => ({ default: module.ResponsePlans }))); +const Validation = lazy(() => import('./pages/Validation').then(module => ({ default: module.Validation }))); + function App() { - const { isAuthenticated, fetchUser } = useAuthStore(); + const { isAuthenticated, hasCheckedSession, fetchUser } = useAuthStore(); useEffect(() => { - if (isAuthenticated) { + if (!hasCheckedSession) { fetchUser(); } - }, [isAuthenticated, fetchUser]); + }, [hasCheckedSession, fetchUser]); return ( + Loading OneAlert…}> : } /> : } /> @@ -58,6 +60,7 @@ function App() { } /> + ); } diff --git a/frontend-v2/src/api/client.ts b/frontend-v2/src/api/client.ts index e6c7eb9..4a3cd52 100644 --- a/frontend-v2/src/api/client.ts +++ b/frontend-v2/src/api/client.ts @@ -1,6 +1,7 @@ import axios from 'axios'; const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || '/api/v1'; +export const SESSION_EXPIRED_EVENT = 'onealert:session-expired'; const apiClient = axios.create({ baseURL: API_BASE_URL, @@ -10,24 +11,13 @@ const apiClient = axios.create({ withCredentials: true, }); -apiClient.interceptors.request.use((config) => { - const token = localStorage.getItem('access_token'); - if (token) { - config.headers.Authorization = `Bearer ${token}`; - } - return config; -}); - apiClient.interceptors.response.use( (response) => response, (error) => { - if (error.response?.status === 401) { - // Only redirect if we had a token (session expired), not on login attempts - const hadToken = localStorage.getItem('access_token'); - if (hadToken) { - localStorage.removeItem('access_token'); - window.location.href = '/app/login'; - } + const requestUrl = String(error.config?.url ?? ''); + const isAuthAttempt = requestUrl.includes('/auth/login') || requestUrl.includes('/auth/register'); + if (error.response?.status === 401 && !isAuthAttempt) { + window.dispatchEvent(new CustomEvent(SESSION_EXPIRED_EVENT)); } return Promise.reject(error); } diff --git a/frontend-v2/src/api/errors.ts b/frontend-v2/src/api/errors.ts new file mode 100644 index 0000000..3c5a52d --- /dev/null +++ b/frontend-v2/src/api/errors.ts @@ -0,0 +1,31 @@ +import axios from 'axios'; + +interface ErrorEnvelope { + detail?: string | { message?: string }; + error?: { message?: string }; + message?: string; +} + +export function getApiErrorMessage(error: unknown, fallback: string): string { + if (!axios.isAxiosError(error)) { + return error instanceof Error && error.message ? error.message : fallback; + } + + const data = error.response?.data; + if (typeof data?.error?.message === 'string' && data.error.message.trim()) { + return data.error.message; + } + if (typeof data?.detail === 'string' && data.detail.trim()) { + return data.detail; + } + if (typeof data?.detail === 'object' && typeof data.detail?.message === 'string') { + return data.detail.message; + } + if (typeof data?.message === 'string' && data.message.trim()) { + return data.message; + } + if (!error.response) { + return 'OneAlert could not reach the service. Check your connection and try again.'; + } + return fallback; +} diff --git a/frontend-v2/src/components/AlertDetail.tsx b/frontend-v2/src/components/AlertDetail.tsx index 901e5b5..b91c496 100644 --- a/frontend-v2/src/components/AlertDetail.tsx +++ b/frontend-v2/src/components/AlertDetail.tsx @@ -1,6 +1,7 @@ import type { Alert } from '../api/types'; import { X, ExternalLink } from 'lucide-react'; import clsx from 'clsx'; +import { useEffect, useRef } from 'react'; interface Props { alert: Alert; @@ -16,14 +17,23 @@ const severityColors: Record = { }; export function AlertDetail({ alert, onClose, onAcknowledge }: Props) { + const closeButtonRef = useRef(null); + useEffect(() => { + const previous = document.activeElement instanceof HTMLElement ? document.activeElement : null; + closeButtonRef.current?.focus(); + const onKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape') onClose(); }; + document.addEventListener('keydown', onKeyDown); + return () => { document.removeEventListener('keydown', onKeyDown); previous?.focus(); }; + }, [onClose]); + return (
-
+
-

{alert.cve_id}

-
diff --git a/frontend-v2/src/components/KPICard.tsx b/frontend-v2/src/components/KPICard.tsx index c5150ee..468cae4 100644 --- a/frontend-v2/src/components/KPICard.tsx +++ b/frontend-v2/src/components/KPICard.tsx @@ -3,9 +3,10 @@ import clsx from 'clsx'; interface KPICardProps { title: string; - value: number; + value: number | string; icon: LucideIcon; color: 'info' | 'danger' | 'success' | 'warning'; + detail?: string; } const colorMap = { @@ -15,16 +16,17 @@ const colorMap = { warning: 'text-warning bg-warning/10 border-warning/20', }; -export function KPICard({ title, value, icon: Icon, color }: KPICardProps) { +export function KPICard({ title, value, icon: Icon, color, detail }: KPICardProps) { return ( -
+

{title}

-

{value}

+

{value}

+ {detail &&

{detail}

}
-
- +
+
diff --git a/frontend-v2/src/components/ProtectedRoute.tsx b/frontend-v2/src/components/ProtectedRoute.tsx index 43a33a1..0a95e9f 100644 --- a/frontend-v2/src/components/ProtectedRoute.tsx +++ b/frontend-v2/src/components/ProtectedRoute.tsx @@ -2,9 +2,20 @@ import { Navigate, useLocation } from 'react-router-dom'; import { useAuthStore } from '../stores/authStore'; export function ProtectedRoute({ children }: { children: React.ReactNode }) { - const isAuthenticated = useAuthStore((s) => s.isAuthenticated); + const { isAuthenticated, hasCheckedSession } = useAuthStore(); const location = useLocation(); + if (!hasCheckedSession) { + return ( +
+
+
+

Checking secure session…

+
+
+ ); + } + if (!isAuthenticated) { return ; } diff --git a/frontend-v2/src/components/Toast.tsx b/frontend-v2/src/components/Toast.tsx index 83f25c5..a52ae52 100644 --- a/frontend-v2/src/components/Toast.tsx +++ b/frontend-v2/src/components/Toast.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-refresh/only-export-components -- imperative toast API is shared by route actions */ import { useState, useEffect, useCallback } from 'react'; import { CheckCircle, XCircle, AlertTriangle, Info, X } from 'lucide-react'; import clsx from 'clsx'; diff --git a/frontend-v2/src/components/layout/AppLayout.tsx b/frontend-v2/src/components/layout/AppLayout.tsx index 4ce2c66..b9594ca 100644 --- a/frontend-v2/src/components/layout/AppLayout.tsx +++ b/frontend-v2/src/components/layout/AppLayout.tsx @@ -1,12 +1,34 @@ +import { useCallback, useEffect, useRef, useState } from 'react'; import { Outlet } from 'react-router-dom'; +import { CommandBar } from './CommandBar'; import { Sidebar } from './Sidebar'; export function AppLayout() { + const [navigationOpen, setNavigationOpen] = useState(false); + const menuButtonRef = useRef(null); + const closeNavigation = useCallback(() => setNavigationOpen(false), []); + + useEffect(() => { + if (!navigationOpen) return; + const onKeyDown = (event: KeyboardEvent) => { + if (event.key === 'Escape') { + setNavigationOpen(false); + requestAnimationFrame(() => menuButtonRef.current?.focus()); + } + }; + document.addEventListener('keydown', onKeyDown); + return () => document.removeEventListener('keydown', onKeyDown); + }, [navigationOpen]); + return (
- -
- + Skip to content + + setNavigationOpen(true)} menuButtonRef={menuButtonRef} /> +
+
+ +
); diff --git a/frontend-v2/src/components/layout/CommandBar.tsx b/frontend-v2/src/components/layout/CommandBar.tsx new file mode 100644 index 0000000..91f4944 --- /dev/null +++ b/frontend-v2/src/components/layout/CommandBar.tsx @@ -0,0 +1,49 @@ +import { Menu, Radio, ShieldCheck } from 'lucide-react'; +import { useLocation } from 'react-router-dom'; +import type { RefObject } from 'react'; + +const routeMeta: Array<{ match: (path: string) => boolean; section: string; title: string }> = [ + { match: path => /^\/cases\/\d+/.test(path), section: 'Command / Investigations', title: 'Case workspace' }, + { match: path => path === '/cases', section: 'Command', title: 'Investigations' }, + { match: path => path === '/alerts', section: 'Observe', title: 'Alerts' }, + { match: path => path === '/events', section: 'Observe', title: 'Security events' }, + { match: path => path === '/assets', section: 'Observe', title: 'Asset inventory' }, + { match: path => path === '/ot', section: 'Observe', title: 'OT discovery' }, + { match: path => path === '/mitre', section: 'Analyze', title: 'MITRE ATT&CK' }, + { match: path => path === '/hunt', section: 'Analyze', title: 'Hunt lab' }, + { match: path => path === '/response-plans', section: 'Act', title: 'Response plans' }, + { match: path => path === '/validation', section: 'Act', title: 'Purple-team validation' }, + { match: path => path === '/audit-log', section: 'Govern', title: 'Audit log' }, + { match: path => path === '/settings', section: 'Govern', title: 'Settings' }, + { match: path => path === '/', section: 'Command', title: 'Security operations' }, +]; + +export function CommandBar({ onOpenNavigation, menuButtonRef }: { onOpenNavigation: () => void; menuButtonRef: RefObject }) { + const { pathname } = useLocation(); + const meta = routeMeta.find(item => item.match(pathname)) ?? routeMeta[routeMeta.length - 1]; + + return ( +
+
+ +
+

{meta.section}

+

{meta.title}

+
+
+
+
+
+
+
+
+
+ ); +} diff --git a/frontend-v2/src/components/layout/Sidebar.tsx b/frontend-v2/src/components/layout/Sidebar.tsx index eee5382..df69ca2 100644 --- a/frontend-v2/src/components/layout/Sidebar.tsx +++ b/frontend-v2/src/components/layout/Sidebar.tsx @@ -1,92 +1,118 @@ -import { NavLink } from 'react-router-dom'; +import { NavLink, useLocation } from 'react-router-dom'; +import { useEffect } from 'react'; import { useAuthStore } from '../../stores/authStore'; import { - LayoutDashboard, - Bell, - Server, - Network, - Settings, - LogOut, - Shield, - ClipboardList, - BriefcaseMedical, - Activity, - Target, - Search, - FileCheck, - Swords, + Activity, Bell, BriefcaseMedical, ClipboardList, FileCheck, + LayoutDashboard, LogOut, Network, Search, Server, Settings, Shield, + Swords, Target, X, } from 'lucide-react'; import clsx from 'clsx'; -const navItems = [ - { to: '/', icon: LayoutDashboard, label: 'Dashboard' }, - { to: '/cases', icon: BriefcaseMedical, label: 'Cases' }, - { to: '/alerts', icon: Bell, label: 'Alerts' }, - { to: '/events', icon: Activity, label: 'Events' }, - { to: '/assets', icon: Server, label: 'Assets' }, - { to: '/ot', icon: Network, label: 'OT Discovery' }, - { to: '/mitre', icon: Target, label: 'MITRE ATT&CK' }, - { to: '/hunt', icon: Search, label: 'Hunt Lab' }, - { to: '/response-plans', icon: FileCheck, label: 'Response Plans' }, - { to: '/validation', icon: Swords, label: 'Validation' }, - { to: '/audit-log', icon: ClipboardList, label: 'Audit Log' }, - { to: '/settings', icon: Settings, label: 'Settings' }, +const navigation = [ + { label: 'Command', items: [ + { to: '/', icon: LayoutDashboard, label: 'Overview' }, + { to: '/cases', icon: BriefcaseMedical, label: 'Investigations' }, + ] }, + { label: 'Observe', items: [ + { to: '/alerts', icon: Bell, label: 'Alerts' }, + { to: '/events', icon: Activity, label: 'Events' }, + { to: '/assets', icon: Server, label: 'Assets' }, + { to: '/ot', icon: Network, label: 'OT Discovery' }, + ] }, + { label: 'Analyze', items: [ + { to: '/mitre', icon: Target, label: 'MITRE ATT&CK' }, + { to: '/hunt', icon: Search, label: 'Hunt Lab' }, + ] }, + { label: 'Act', items: [ + { to: '/response-plans', icon: FileCheck, label: 'Response Plans' }, + { to: '/validation', icon: Swords, label: 'Validation' }, + ] }, + { label: 'Govern', items: [ + { to: '/audit-log', icon: ClipboardList, label: 'Audit Log' }, + { to: '/settings', icon: Settings, label: 'Settings' }, + ] }, ]; -export function Sidebar() { +interface SidebarProps { + open: boolean; + onClose: () => void; +} + +export function Sidebar({ open, onClose }: SidebarProps) { const { user, logout } = useAuthStore(); + const location = useLocation(); + + useEffect(() => { onClose(); }, [location.pathname, onClose]); return ( - + + ); } diff --git a/frontend-v2/src/components/ui/AsyncState.tsx b/frontend-v2/src/components/ui/AsyncState.tsx new file mode 100644 index 0000000..06838d5 --- /dev/null +++ b/frontend-v2/src/components/ui/AsyncState.tsx @@ -0,0 +1,67 @@ +import type { ReactNode } from 'react'; +import { AlertTriangle, Inbox, RefreshCw } from 'lucide-react'; + +interface StateProps { + title: string; + description: string; + action?: ReactNode; +} + +export function ErrorState({ title, description, action }: StateProps) { + return ( +
+ + +

{title}

+

{description}

+ {action &&
{action}
} +
+ ); +} + +export function EmptyState({ title, description, action }: StateProps) { + return ( +
+
+ ); +} + +export function RetryButton({ onClick, label = 'Retry' }: { onClick: () => void; label?: string }) { + return ( + + ); +} + +export function LoadingSurface({ rows = 4, label = 'Loading data' }: { rows?: number; label?: string }) { + return ( +
+ {label} + {Array.from({ length: rows }, (_, index) => ( +
+ ))} +
+ ); +} + +export function DegradedBanner({ messages, onRetry }: { messages: string[]; onRetry: () => void }) { + return ( +
+
+
+ +
+ ); +} diff --git a/frontend-v2/src/components/ui/PageHeader.tsx b/frontend-v2/src/components/ui/PageHeader.tsx new file mode 100644 index 0000000..6e35370 --- /dev/null +++ b/frontend-v2/src/components/ui/PageHeader.tsx @@ -0,0 +1,23 @@ +import type { ReactNode } from 'react'; + +interface PageHeaderProps { + eyebrow?: string; + title: string; + description: string; + actions?: ReactNode; + meta?: ReactNode; +} + +export function PageHeader({ eyebrow, title, description, actions, meta }: PageHeaderProps) { + return ( +
+
+ {eyebrow &&

{eyebrow}

} +

{title}

+

{description}

+ {meta &&
{meta}
} +
+ {actions &&
{actions}
} +
+ ); +} diff --git a/frontend-v2/src/components/ui/Panel.tsx b/frontend-v2/src/components/ui/Panel.tsx new file mode 100644 index 0000000..33145b8 --- /dev/null +++ b/frontend-v2/src/components/ui/Panel.tsx @@ -0,0 +1,26 @@ +import type { HTMLAttributes, ReactNode } from 'react'; +import clsx from 'clsx'; + +interface PanelProps extends HTMLAttributes { + title?: string; + description?: string; + action?: ReactNode; + children: ReactNode; +} + +export function Panel({ title, description, action, children, className, ...props }: PanelProps) { + return ( +
+ {(title || description || action) && ( +
+
+ {title &&

{title}

} + {description &&

{description}

} +
+ {action} +
+ )} + {children} +
+ ); +} diff --git a/frontend-v2/src/components/ui/StatusBadge.tsx b/frontend-v2/src/components/ui/StatusBadge.tsx new file mode 100644 index 0000000..aa3c1d1 --- /dev/null +++ b/frontend-v2/src/components/ui/StatusBadge.tsx @@ -0,0 +1,14 @@ +import type { ReactNode } from 'react'; +import clsx from 'clsx'; + +const tones = { + neutral: 'border-surface-600 bg-surface-700/35 text-surface-300', + info: 'border-info/30 bg-info/10 text-info', + success: 'border-success/30 bg-success/10 text-success', + warning: 'border-warning/30 bg-warning/10 text-warning', + danger: 'border-danger/30 bg-danger/10 text-danger', +}; + +export function StatusBadge({ children, tone = 'neutral' }: { children: ReactNode; tone?: keyof typeof tones }) { + return {children}; +} diff --git a/frontend-v2/src/index.css b/frontend-v2/src/index.css index 876ec76..90abf4f 100644 --- a/frontend-v2/src/index.css +++ b/frontend-v2/src/index.css @@ -1,39 +1,95 @@ @import "tailwindcss"; @theme { - --color-primary-50: #ecfeff; - --color-primary-100: #cffafe; - --color-primary-200: #a5f3fc; - --color-primary-300: #67e8f9; - --color-primary-400: #22d3ee; - --color-primary-500: #06b6d4; - --color-primary-600: #0891b2; - --color-primary-700: #0e7490; - --color-primary-800: #155e75; - --color-primary-900: #164e63; - --color-surface-50: #fafafa; - --color-surface-100: #f4f4f5; - --color-surface-200: #e4e4e7; - --color-surface-300: #d4d4d8; - --color-surface-400: #a1a1aa; - --color-surface-500: #71717a; - --color-surface-600: #52525b; - --color-surface-700: #3f3f46; - --color-surface-800: #27272a; - --color-surface-900: #18181b; - --color-surface-950: #09090b; - --color-danger: #f43f5e; - --color-warning: #f59e0b; - --color-success: #10b981; - --color-info: #38bdf8; + --color-primary-50: oklch(97.8% 0.018 205); + --color-primary-100: oklch(94.5% 0.045 205); + --color-primary-200: oklch(89.5% 0.08 205); + --color-primary-300: oklch(83.2% 0.112 205); + --color-primary-400: oklch(76.5% 0.13 205); + --color-primary-500: oklch(68.5% 0.126 210); + --color-primary-600: oklch(58.5% 0.109 214); + --color-primary-700: oklch(49% 0.088 216); + --color-primary-800: oklch(39% 0.067 218); + --color-primary-900: oklch(30% 0.05 220); + --color-surface-50: oklch(97% 0.006 235); + --color-surface-100: oklch(93.5% 0.007 235); + --color-surface-200: oklch(86.5% 0.009 235); + --color-surface-300: oklch(77% 0.011 235); + --color-surface-400: oklch(67% 0.014 235); + --color-surface-500: oklch(57% 0.016 235); + --color-surface-600: oklch(45% 0.018 235); + --color-surface-700: oklch(34% 0.021 235); + --color-surface-800: oklch(24% 0.022 235); + --color-surface-850: oklch(20% 0.021 235); + --color-surface-900: oklch(17% 0.02 235); + --color-surface-950: oklch(12.5% 0.018 235); + --color-danger: oklch(65% 0.205 22); + --color-warning: oklch(78% 0.165 77); + --color-success: oklch(72% 0.145 160); + --color-info: oklch(74% 0.13 225); + --color-white: oklch(97% 0.006 235); + --color-black: oklch(12.5% 0.018 235); } +:root { + color-scheme: dark; + --oa-command-height: 3.5rem; + --oa-sidebar-width: 15.5rem; + --oa-radius-sm: 0.25rem; + --oa-radius-md: 0.5rem; + --oa-radius-lg: 0.75rem; + --oa-shadow-float: 0 18px 50px oklch(5% 0.02 235 / 0.5); +} + +* { box-sizing: border-box; } + +html { background: var(--color-surface-950); } + body { @apply bg-surface-950 text-surface-100 antialiased; margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; + min-width: 320px; + background-image: + linear-gradient(oklch(70% 0.06 215 / 0.025) 1px, transparent 1px), + linear-gradient(90deg, oklch(70% 0.06 215 / 0.025) 1px, transparent 1px); + background-size: 32px 32px; } +::selection { background: oklch(68.5% 0.126 210 / 0.3); } + +button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; } +button:not(:disabled), [role="button"]:not([aria-disabled="true"]) { cursor: pointer; } +button:disabled { cursor: not-allowed; } + +table { border-collapse: collapse; } +thead { background: oklch(17% 0.02 235 / 0.88); } +th { font-size: 0.6875rem; letter-spacing: 0.055em; text-transform: uppercase; } +tbody tr { transition: background-color 150ms ease, border-color 150ms ease; } + +code, pre, kbd, .font-mono { font-variant-ligatures: none; } + +.oa-panel { + border: 1px solid var(--color-surface-700); + border-radius: var(--oa-radius-md); + background: oklch(17% 0.02 235 / 0.86); + box-shadow: inset 0 1px oklch(90% 0.02 220 / 0.025); +} + +.oa-panel-muted { + border: 1px solid oklch(34% 0.021 235 / 0.75); + border-radius: var(--oa-radius-md); + background: oklch(12.5% 0.018 235 / 0.52); +} + +.oa-skeleton { + background: linear-gradient(90deg, var(--color-surface-800), var(--color-surface-700), var(--color-surface-800)); + background-size: 200% 100%; + animation: oa-shimmer 1.4s ease-in-out infinite; +} + +@keyframes oa-shimmer { to { background-position-x: -200%; } } + @keyframes slide-in-from-right { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } @@ -52,3 +108,12 @@ body { outline: 2px solid var(--color-primary-500); outline-offset: 2px; } + +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { + scroll-behavior: auto !important; + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + } +} diff --git a/frontend-v2/src/pages/Alerts.tsx b/frontend-v2/src/pages/Alerts.tsx index 01447ed..3ca1ae7 100644 --- a/frontend-v2/src/pages/Alerts.tsx +++ b/frontend-v2/src/pages/Alerts.tsx @@ -4,6 +4,10 @@ import type { Alert, AlertListResponse } from '../api/types'; import { AlertDetail } from '../components/AlertDetail'; import clsx from 'clsx'; import { Search, Filter, CheckCircle } from 'lucide-react'; +import { getApiErrorMessage } from '../api/errors'; +import { PageHeader } from '../components/ui/PageHeader'; +import { ErrorState, RetryButton } from '../components/ui/AsyncState'; +import { toast } from '../components/Toast'; const severityColors: Record = { critical: 'bg-danger/10 text-danger border-danger/20', @@ -23,11 +27,14 @@ export function Alerts() { const [statusFilter, setStatusFilter] = useState(''); const [cveSearch, setCveSearch] = useState(''); const [selectedIds, setSelectedIds] = useState>(new Set()); + const [error, setError] = useState(null); + const [pendingIds, setPendingIds] = useState>(new Set()); const fetchAlerts = useCallback(async () => { setLoading(true); + setError(null); try { - const params: Record = { page, size: 15 }; + const params: Record = { page, size: 15 }; if (severityFilter) params.severity = severityFilter; if (statusFilter) params.status = statusFilter; if (cveSearch) params.cve_id = cveSearch; @@ -36,8 +43,8 @@ export function Alerts() { setAlerts(res.data.alerts); setTotal(res.data.total); setPages(res.data.pages); - } catch (err) { - console.error('Failed to fetch alerts:', err); + } catch (err: unknown) { + setError(getApiErrorMessage(err, 'Alerts could not be loaded.')); } finally { setLoading(false); } @@ -48,17 +55,30 @@ export function Alerts() { }, [fetchAlerts]); const handleAcknowledge = async (alertId: number) => { - await apiClient.post(`/alerts/${alertId}/acknowledge`); - fetchAlerts(); - setSelectedAlert(null); + if (pendingIds.has(alertId)) return; + setPendingIds(current => new Set(current).add(alertId)); + try { + await apiClient.post(`/alerts/${alertId}/acknowledge`); + await fetchAlerts(); + setSelectedAlert(null); + } catch (err: unknown) { + toast(getApiErrorMessage(err, 'Alert could not be acknowledged.'), 'error'); + } finally { + setPendingIds(current => { const next = new Set(current); next.delete(alertId); return next; }); + } }; const handleBulkAcknowledge = async () => { - await Promise.all( - Array.from(selectedIds).map((id) => apiClient.post(`/alerts/${id}/acknowledge`)) - ); - setSelectedIds(new Set()); - fetchAlerts(); + const ids = Array.from(selectedIds).filter(id => !pendingIds.has(id)); + if (ids.length === 0) return; + setPendingIds(current => new Set([...current, ...ids])); + const results = await Promise.allSettled(ids.map(id => apiClient.post(`/alerts/${id}/acknowledge`))); + const failedIds = ids.filter((_, index) => results[index].status === 'rejected'); + setSelectedIds(new Set(failedIds)); + setPendingIds(current => { const next = new Set(current); ids.forEach(id => next.delete(id)); return next; }); + await fetchAlerts(); + if (failedIds.length > 0) toast(`${failedIds.length} alerts could not be acknowledged and remain selected.`, 'error'); + else toast(`${ids.length} alerts acknowledged.`, 'success'); }; const toggleSelect = (id: number) => { @@ -72,21 +92,18 @@ export function Alerts() { return (
-
-
-

Alerts

-

{total} total alerts

-
- {selectedIds.size > 0 && ( + 0 ? ( - )} -
+ ) : undefined + } /> {/* Filters */}
@@ -124,7 +141,7 @@ export function Alerts() {
{/* Table */} -
+ {error ? void fetchAlerts()} />} /> :
{loading ? (
@@ -195,7 +212,7 @@ export function Alerts() { )} -
+
} {/* Pagination */} {pages > 1 && ( diff --git a/frontend-v2/src/pages/Assets.tsx b/frontend-v2/src/pages/Assets.tsx index 0881bd8..0c9ba85 100644 --- a/frontend-v2/src/pages/Assets.tsx +++ b/frontend-v2/src/pages/Assets.tsx @@ -3,6 +3,10 @@ import apiClient from '../api/client'; import type { Asset, AssetCreate, AssetListResponse } from '../api/types'; import { Plus, Search, Server, Trash2, Edit2 } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { ErrorState, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; +import { toast } from '../components/Toast'; export function Assets() { const [assets, setAssets] = useState([]); @@ -12,17 +16,21 @@ export function Assets() { const [loading, setLoading] = useState(true); const [showModal, setShowModal] = useState(false); const [editAsset, setEditAsset] = useState(null); + const [error, setError] = useState(null); + const [saving, setSaving] = useState(false); + const [deletingIds, setDeletingIds] = useState>(new Set()); const fetchAssets = useCallback(async () => { setLoading(true); + setError(null); try { - const params: Record = { page, size: 15 }; + const params: Record = { page, size: 15 }; if (search) params.search = search; const res = await apiClient.get('/assets/', { params }); setAssets(res.data.assets); setTotal(res.data.total); - } catch (err) { - console.error('Failed to fetch assets:', err); + } catch (err: unknown) { + setError(getApiErrorMessage(err, 'Asset inventory could not be loaded.')); } finally { setLoading(false); } @@ -33,37 +41,47 @@ export function Assets() { }, [fetchAssets]); const handleDelete = async (id: number) => { - if (!confirm('Delete this asset?')) return; - await apiClient.delete(`/assets/${id}`); - fetchAssets(); + if (deletingIds.has(id) || !confirm('Delete this asset from the managed inventory?')) return; + setDeletingIds(current => new Set(current).add(id)); + try { + await apiClient.delete(`/assets/${id}`); + await fetchAssets(); + toast('Asset deleted.', 'success'); + } catch (err: unknown) { + toast(getApiErrorMessage(err, 'Asset could not be deleted.'), 'error'); + } finally { + setDeletingIds(current => { const next = new Set(current); next.delete(id); return next; }); + } }; const handleSave = async (data: AssetCreate) => { - if (editAsset) { - await apiClient.put(`/assets/${editAsset.id}`, data); - } else { - await apiClient.post('/assets/', data); + if (saving) return; + setSaving(true); + try { + if (editAsset) await apiClient.put(`/assets/${editAsset.id}`, data); + else await apiClient.post('/assets/', data); + setShowModal(false); + setEditAsset(null); + await fetchAssets(); + toast(editAsset ? 'Asset updated.' : 'Asset created.', 'success'); + } catch (err: unknown) { + toast(getApiErrorMessage(err, 'Asset could not be saved.'), 'error'); + } finally { + setSaving(false); } - setShowModal(false); - setEditAsset(null); - fetchAssets(); }; return (
-
-
-

Assets

-

{total} monitored assets

-
+ { setEditAsset(null); setShowModal(true); }} - className="flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors" + className="flex min-h-9 items-center gap-2 rounded-md bg-primary-500 px-3.5 text-sm font-semibold text-surface-950 hover:bg-primary-400" > Add Asset -
+ } />
@@ -76,7 +94,7 @@ export function Assets() { />
-
+ {error ? void fetchAssets()} />} /> :
{loading ? (
@@ -101,12 +119,15 @@ export function Assets() { @@ -138,20 +159,21 @@ export function Assets() {
)) )} -
+
} {showModal && ( { setShowModal(false); setEditAsset(null); }} onSave={handleSave} + saving={saving} /> )}
); } -function AssetModal({ asset, onClose, onSave }: { asset: Asset | null; onClose: () => void; onSave: (data: AssetCreate) => void }) { +function AssetModal({ asset, onClose, onSave, saving }: { asset: Asset | null; onClose: () => void; onSave: (data: AssetCreate) => void; saving: boolean }) { const [form, setForm] = useState({ name: asset?.name || '', asset_type: asset?.asset_type || 'hardware', @@ -169,11 +191,17 @@ function AssetModal({ asset, onClose, onSave }: { asset: Asset | null; onClose: onSave(form); }; + useEffect(() => { + const onKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape' && !saving) onClose(); }; + document.addEventListener('keydown', onKeyDown); + return () => document.removeEventListener('keydown', onKeyDown); + }, [onClose, saving]); + return (
-
-

{asset ? 'Edit Asset' : 'Add Asset'}

+
+

{asset ? 'Edit Asset' : 'Add Asset'}

Cancel -
diff --git a/frontend-v2/src/pages/AuditLog.tsx b/frontend-v2/src/pages/AuditLog.tsx index 89d9213..27da5d1 100644 --- a/frontend-v2/src/pages/AuditLog.tsx +++ b/frontend-v2/src/pages/AuditLog.tsx @@ -1,6 +1,9 @@ import { useEffect, useState } from 'react'; import apiClient from '../api/client'; -import { ClipboardList, Search } from 'lucide-react'; +import { Search } from 'lucide-react'; +import { getApiErrorMessage } from '../api/errors'; +import { ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; interface AuditEntry { id: number; @@ -18,22 +21,21 @@ export function AuditLog() { const [search, setSearch] = useState(''); const [error, setError] = useState(''); - useEffect(() => { - async function fetchLogs() { - try { - const res = await apiClient.get('/auth/audit-logs'); - setLogs(res.data); - } catch (err: any) { - if (err.response?.status === 403) { - setError('Admin access required to view audit logs.'); - } else { - setError('Failed to load audit logs.'); - } - } finally { - setLoading(false); - } + const fetchLogs = async () => { + setLoading(true); + setError(''); + try { + const res = await apiClient.get('/auth/audit-logs'); + setLogs(res.data); + } catch (err: unknown) { + setError(getApiErrorMessage(err, 'Audit activity could not be loaded.')); + } finally { + setLoading(false); } - fetchLogs(); + }; + + useEffect(() => { + void fetchLogs(); }, []); const filteredLogs = logs.filter((log) => @@ -42,25 +44,15 @@ export function AuditLog() { ); if (loading) { - return ( -
-
-
- ); + return ; } return (
-
-

Audit Log

-

Track all user actions

-
+ {error ? ( -
- -

{error}

-
+ void fetchLogs()} />} /> ) : ( <>
diff --git a/frontend-v2/src/pages/CaseDetail.tsx b/frontend-v2/src/pages/CaseDetail.tsx index d092f7c..0ac1713 100644 --- a/frontend-v2/src/pages/CaseDetail.tsx +++ b/frontend-v2/src/pages/CaseDetail.tsx @@ -1,8 +1,10 @@ -import { useState, useEffect } from 'react'; +import { useCallback, useState, useEffect } from 'react'; import { useParams, Link } from 'react-router-dom'; import apiClient from '../api/client'; import { ArrowLeft, Brain, AlertTriangle, Activity, Clock, Target } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { DegradedBanner, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; const severityColors: Record = { critical: 'bg-red-500/20 text-red-400 border-red-500/30', @@ -45,47 +47,52 @@ interface CaseData { event_count: number; timeline: TimelineEntry[]; } +interface RelatedAlert { id: number; severity: string; cve_id?: string | null; title: string; } +interface RelatedEvent { id: number; severity: string; event_type: string; source_ip?: string | null; dest_ip?: string | null; signature?: string | null; } export function CaseDetail() { const { caseId } = useParams<{ caseId: string }>(); const [caseData, setCaseData] = useState(null); - const [alerts, setAlerts] = useState([]); - const [events, setEvents] = useState([]); + const [alerts, setAlerts] = useState([]); + const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); + const [degraded, setDegraded] = useState([]); - useEffect(() => { - const fetchAll = async () => { - try { - const [caseRes, alertsRes, eventsRes] = await Promise.all([ - apiClient.get(`/cases/${caseId}`), - apiClient.get(`/cases/${caseId}/alerts`), - apiClient.get(`/cases/${caseId}/events`), - ]); - setCaseData(caseRes.data); - setAlerts(alertsRes.data); - setEvents(eventsRes.data); - } catch (err) { - console.error('Failed to load case', err); - } finally { - setLoading(false); - } - }; - fetchAll(); + const fetchAll = useCallback(async () => { + setLoading(true); + const [caseResult, alertsResult, eventsResult] = await Promise.allSettled([ + apiClient.get(`/cases/${caseId}`), apiClient.get(`/cases/${caseId}/alerts`), apiClient.get(`/cases/${caseId}/events`), + ]); + if (caseResult.status === 'rejected') { + setError(getApiErrorMessage(caseResult.reason, 'This case could not be loaded.')); + setCaseData(null); + } else { + setCaseData(caseResult.value.data); + setError(''); + } + const partial: string[] = []; + if (alertsResult.status === 'fulfilled') setAlerts(alertsResult.value.data); + else { setAlerts([]); partial.push('Linked alerts unavailable'); } + if (eventsResult.status === 'fulfilled') setEvents(eventsResult.value.data); + else { setEvents([]); partial.push('Linked events unavailable'); } + setDegraded(partial); + setLoading(false); }, [caseId]); + useEffect(() => { void fetchAll(); }, [fetchAll]); + if (loading) { - return
-
-
-
; + return ; } if (!caseData) { - return
Case not found
; + return } />; } return (
+ {degraded.length > 0 && } {/* Header */}
@@ -203,7 +210,7 @@ export function CaseDetail() {

No linked alerts.

) : (
- {alerts.map((a: any) => ( + {alerts.map(a => (
{a.severity} @@ -222,7 +229,7 @@ export function CaseDetail() {

No linked events.

) : (
- {events.map((e: any) => ( + {events.map(e => (
{e.severity} diff --git a/frontend-v2/src/pages/Cases.tsx b/frontend-v2/src/pages/Cases.tsx index 3d59cb4..7310ce3 100644 --- a/frontend-v2/src/pages/Cases.tsx +++ b/frontend-v2/src/pages/Cases.tsx @@ -1,14 +1,18 @@ import { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import apiClient from '../api/client'; -import { BriefcaseMedical, Play, Shield, ChevronRight } from 'lucide-react'; +import { Play, Shield, ChevronRight } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { EmptyState, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; +import { toast } from '../components/Toast'; const severityColors: Record = { - critical: 'bg-red-500/20 text-red-400 border-red-500/30', - high: 'bg-orange-500/20 text-orange-400 border-orange-500/30', - medium: 'bg-yellow-500/20 text-yellow-400 border-yellow-500/30', - low: 'bg-blue-500/20 text-blue-400 border-blue-500/30', + critical: 'bg-danger/10 text-danger border-danger/30', + high: 'bg-warning/10 text-warning border-warning/30', + medium: 'bg-info/10 text-info border-info/30', + low: 'bg-success/10 text-success border-success/30', info: 'bg-surface-500/20 text-surface-400 border-surface-500/30', }; @@ -39,14 +43,16 @@ export function Cases() { const [loading, setLoading] = useState(true); const [triaging, setTriaging] = useState(false); const [total, setTotal] = useState(0); + const [error, setError] = useState(null); const fetchCases = async () => { + setError(null); try { const res = await apiClient.get('/cases/', { params: { size: 50 } }); setCases(res.data.cases); setTotal(res.data.total); - } catch (err) { - console.error('Failed to load cases', err); + } catch (err: unknown) { + setError(getApiErrorMessage(err, 'Investigations could not be loaded.')); } finally { setLoading(false); } @@ -57,8 +63,8 @@ export function Cases() { try { await apiClient.post('/cases/auto-triage', null, { params: { hours_back: 72 } }); await fetchCases(); - } catch (err) { - console.error('Triage failed', err); + } catch (err: unknown) { + toast(getApiErrorMessage(err, 'AI triage could not be started.'), 'error'); } finally { setTriaging(false); } @@ -68,42 +74,30 @@ export function Cases() { return (
-
-
-

Investigations

-

{total} cases — AI-correlated from alerts and events

-
+ - {triaging ? 'Running Triage...' : 'Run AI Triage'} + {triaging ? 'Running triage…' : 'Run AI triage'} -
+ } /> {loading ? ( -
- {[1, 2, 3].map(i => ( -
- ))} -
+ + ) : error ? ( + void fetchCases()} />} /> ) : cases.length === 0 ? ( -
- -

No cases yet

-

- Run AI Triage to automatically correlate your alerts and security events into investigation cases. -

-
+ void runTriage()} className="text-sm font-semibold text-primary-300">Run AI triage} /> ) : (
{cases.map(c => (
diff --git a/frontend-v2/src/pages/Dashboard.tsx b/frontend-v2/src/pages/Dashboard.tsx index 7d4b3f3..45cf549 100644 --- a/frontend-v2/src/pages/Dashboard.tsx +++ b/frontend-v2/src/pages/Dashboard.tsx @@ -1,222 +1,163 @@ -import { useEffect, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; +import { Link } from 'react-router-dom'; +import { + Activity, AlertTriangle, ArrowUpRight, Bot, Crosshair, + Radar, Server, ShieldAlert, ShieldCheck, Workflow, +} from 'lucide-react'; import apiClient from '../api/client'; -import type { AlertStats, Alert } from '../api/types'; +import { getApiErrorMessage } from '../api/errors'; +import type { AlertStats, Alert, AlertListResponse } from '../api/types'; import { KPICard } from '../components/KPICard'; import { SeverityBreakdown } from '../components/charts/SeverityBreakdown'; import { AlertTrend } from '../components/charts/AlertTrend'; import { RiskHeatmap } from '../components/charts/RiskHeatmap'; -import { - Activity, - AlertTriangle, - Bot, - Crosshair, - FileClock, - Network, - Radar, - Server, - ShieldAlert, - ShieldCheck, - Workflow, -} from 'lucide-react'; +import { DegradedBanner, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; +import { Panel } from '../components/ui/Panel'; +import { StatusBadge } from '../components/ui/StatusBadge'; + +type DashboardErrors = Partial>; export function Dashboard() { const [stats, setStats] = useState(null); - const [totalAssets, setTotalAssets] = useState(0); - const [totalDiscovered, setTotalDiscovered] = useState(0); - const [alerts, setAlerts] = useState([]); + const [totalAssets, setTotalAssets] = useState(null); + const [totalDiscovered, setTotalDiscovered] = useState(null); + const [alerts, setAlerts] = useState(null); + const [errors, setErrors] = useState({}); const [loading, setLoading] = useState(true); + const [refreshKey, setRefreshKey] = useState(0); + const [lastUpdated, setLastUpdated] = useState(null); - useEffect(() => { - async function fetchData() { - try { - const [statsRes, assetsRes, devicesRes, alertsRes] = await Promise.all([ - apiClient.get('/alerts/stats/overview'), - apiClient.get('/assets/', { params: { size: 1 } }), - apiClient.get('/ot/discovered-devices', { params: { size: 1 } }), - apiClient.get('/alerts/', { params: { size: 50 } }), - ]); - setStats(statsRes.data); - setTotalAssets(assetsRes.data.total ?? 0); - setTotalDiscovered(devicesRes.data.total ?? 0); - setAlerts(alertsRes.data.alerts ?? []); - } catch (err) { - console.error('Failed to load dashboard data:', err); - } finally { - setLoading(false); - } - } - fetchData(); + const loadDashboard = useCallback(() => { + setRefreshKey(key => key + 1); }, []); - if (loading) { - return ( -
-
-
- ); + useEffect(() => { + let active = true; + const fetchData = async () => { + setLoading(true); + setErrors({}); + const requests = [ + apiClient.get('/alerts/stats/overview'), + apiClient.get<{ total?: number }>('/assets/', { params: { size: 1 } }), + apiClient.get<{ total?: number }>('/ot/discovered-devices', { params: { size: 1 } }), + apiClient.get('/alerts/', { params: { size: 50 } }), + ] as const; + const results = await Promise.allSettled(requests); + if (!active) return; + + const nextErrors: DashboardErrors = {}; + if (results[0].status === 'fulfilled') setStats(results[0].value.data); + else nextErrors.stats = getApiErrorMessage(results[0].reason, 'Alert statistics are unavailable'); + if (results[1].status === 'fulfilled') setTotalAssets(results[1].value.data.total ?? 0); + else nextErrors.assets = getApiErrorMessage(results[1].reason, 'Asset inventory is unavailable'); + if (results[2].status === 'fulfilled') setTotalDiscovered(results[2].value.data.total ?? 0); + else nextErrors.devices = getApiErrorMessage(results[2].reason, 'Discovery telemetry is unavailable'); + if (results[3].status === 'fulfilled') setAlerts(results[3].value.data.alerts ?? []); + else nextErrors.alerts = getApiErrorMessage(results[3].reason, 'Recent alert activity is unavailable'); + + setErrors(nextErrors); + setLastUpdated(new Date()); + setLoading(false); + }; + void fetchData(); + return () => { active = false; }; + }, [refreshKey]); + + const hasAnyData = stats !== null || totalAssets !== null || totalDiscovered !== null || alerts !== null; + const errorMessages = Object.values(errors); + if (loading && !hasAnyData) return ; + if (!hasAnyData && errorMessages.length > 0) { + return } />; } - const totalAlerts = stats?.total_alerts ?? 0; - const criticalAlerts = stats?.critical_alerts ?? 0; - const highAlerts = stats?.high_alerts ?? 0; - const unresolvedAlerts = (stats?.pending_alerts ?? 0) + (stats?.acknowledged_alerts ?? 0); - const agentConfidence = totalAlerts > 0 - ? Math.max(54, Math.round(((totalAlerts - criticalAlerts) / totalAlerts) * 100)) - : 96; + const totalAlerts = stats?.total_alerts; + const criticalAlerts = stats?.critical_alerts; + const highAlerts = stats?.high_alerts; + const unresolvedAlerts = stats ? stats.pending_alerts + stats.acknowledged_alerts : null; + const agentConfidence = stats && stats.total_alerts > 0 + ? Math.max(54, Math.round(((stats.total_alerts - stats.critical_alerts) / stats.total_alerts) * 100)) + : stats ? 96 : null; + + const priorityAlerts = (alerts ?? []) + .filter(alert => alert.severity === 'critical' || alert.severity === 'high') + .slice(0, 4); const agentLanes = [ - { label: 'Detect', value: totalDiscovered + totalAssets, status: 'online', icon: Radar }, - { label: 'Triage', value: unresolvedAlerts, status: unresolvedAlerts > 0 ? 'queued' : 'clear', icon: Bot }, - { label: 'Hunt', value: highAlerts + criticalAlerts, status: highAlerts + criticalAlerts > 0 ? 'active' : 'standby', icon: Crosshair }, + { label: 'Detect', value: totalDiscovered !== null && totalAssets !== null ? totalDiscovered + totalAssets : null, status: 'online', icon: Radar }, + { label: 'Triage', value: unresolvedAlerts, status: unresolvedAlerts === null ? 'unknown' : unresolvedAlerts > 0 ? 'queued' : 'clear', icon: Bot }, + { label: 'Hunt', value: highAlerts !== undefined && criticalAlerts !== undefined ? highAlerts + criticalAlerts : null, status: 'ready', icon: Crosshair }, { label: 'Respond', value: 0, status: 'approval gated', icon: ShieldCheck }, ]; - const readinessItems = [ - { label: 'Local model route', value: 'Planned', tone: 'text-cyan-300' }, - { label: 'Run ledger', value: 'Design ready', tone: 'text-emerald-300' }, - { label: 'Telemetry ingest', value: 'Sensor API live', tone: 'text-amber-300' }, - { label: 'Offensive mode', value: 'Dry-run only', tone: 'text-rose-300' }, - ]; - return ( -
-
-
-

OneAlert Command

-

Security Operations

-

- OT asset risk, vulnerability intelligence, topology signals, and governed agent readiness. -

-
-
- {readinessItems.map((item) => ( -
-

{item.label}

-

{item.value}

-
- ))} -
-
- -
- - - - -
- -
-
-
-
-

AI Security Agent Readiness

-

Detect, triage, hunt, respond, and validate lanes.

-
-
- - {agentConfidence}% posture confidence -
+
+ Monitoring activeUpdated {lastUpdated?.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) ?? '—'}
} + actions={Open investigations } + /> + + {errorMessages.length > 0 && } + +
+ + + + +
+ +
+ View all alerts}> +
+ {priorityAlerts.length > 0 ? priorityAlerts.map(alert => ( + + {alert.severity} +

{alert.title}

{alert.cve_id || alert.source} · {alert.asset_name}

+ {alert.status} + + )) : ( +
{alerts === null ? 'Recent alert activity is unavailable.' : 'No critical or high alerts require prioritization.'}
+ )}
+
-
- {agentLanes.map((lane) => ( -
-
- - {lane.status} -
-

{lane.value}

-

{lane.label}

+ +
+ {agentLanes.map(lane => ( +
+
{lane.status}
+

{lane.value ?? '—'}

+

{lane.label}

))}
+
Human approval enforced{agentConfidence ?? '—'}{agentConfidence !== null ? '%' : ''}
+
+
-
-
- - Approval gates enabled -
-
- - Agent ledger planned -
-
- - Offensive actions scoped -
-
-
+
+
+
+
-
-
-

Telemetry Health

- -
-
+
+
+ +
{[ - { label: 'Managed assets', value: totalAssets, width: Math.min(100, totalAssets * 8), tone: 'bg-cyan-400' }, - { label: 'Discovered devices', value: totalDiscovered, width: Math.min(100, totalDiscovered * 10), tone: 'bg-emerald-400' }, - { label: 'Open investigations', value: unresolvedAlerts, width: Math.min(100, unresolvedAlerts * 12), tone: 'bg-amber-400' }, - { label: 'Critical exposure', value: criticalAlerts, width: Math.min(100, criticalAlerts * 18), tone: 'bg-rose-400' }, - ].map((item) => ( -
-
- {item.label} - {item.value} -
-
-
-
-
+ { label: 'Managed assets', value: totalAssets, tone: 'bg-primary-400' }, + { label: 'Discovered devices', value: totalDiscovered, tone: 'bg-success' }, + { label: 'Open investigations', value: unresolvedAlerts, tone: 'bg-warning' }, + { label: 'Critical exposure', value: criticalAlerts ?? null, tone: 'bg-danger' }, + ].map(item => ( +
{item.label}{item.value ?? '—'}
0 ? 8 : 0, item.value * 9))}%` }} />
))}
-
+
- -
-
-
- -

Severity Breakdown

-
- -
-
-
- -

Alert Trend (7 days)

-
- -
-
- -
-
- -

Risk Heatmap

-
- -
); } diff --git a/frontend-v2/src/pages/Events.tsx b/frontend-v2/src/pages/Events.tsx index 44c65c9..b396a77 100644 --- a/frontend-v2/src/pages/Events.tsx +++ b/frontend-v2/src/pages/Events.tsx @@ -1,7 +1,10 @@ -import { useState, useEffect } from 'react'; +import { useCallback, useState, useEffect } from 'react'; import apiClient from '../api/client'; import { Activity } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { DegradedBanner, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; const severityColors: Record = { critical: 'text-red-400', @@ -40,37 +43,38 @@ export function Events() { const [page, setPage] = useState(1); const [total, setTotal] = useState(0); const [severityFilter, setSeverityFilter] = useState(''); + const [errors, setErrors] = useState([]); - const fetchEvents = async () => { + const fetchEvents = useCallback(async () => { + setLoading(true); + setErrors([]); try { - const params: Record = { page, size: 50 }; + const params: Record = { page, size: 50 }; if (severityFilter) params.severity = severityFilter; - const [evtRes, statsRes] = await Promise.all([ + const [evtResult, statsResult] = await Promise.allSettled([ apiClient.get('/events/', { params }), apiClient.get('/events/stats'), ]); - setEvents(evtRes.data.events); - setTotal(evtRes.data.total); - setStats(statsRes.data.data); - } catch (err) { - console.error('Failed to load events', err); + const nextErrors: string[] = []; + if (evtResult.status === 'fulfilled') { setEvents(evtResult.value.data.events); setTotal(evtResult.value.data.total); } + else nextErrors.push(getApiErrorMessage(evtResult.reason, 'Event stream is unavailable')); + if (statsResult.status === 'fulfilled') setStats(statsResult.value.data.data); + else nextErrors.push(getApiErrorMessage(statsResult.reason, 'Event statistics are unavailable')); + setErrors(nextErrors); + } catch (err: unknown) { + setErrors([getApiErrorMessage(err, 'Security events could not be loaded.')]); } finally { setLoading(false); } - }; + }, [page, severityFilter]); - useEffect(() => { fetchEvents(); }, [page, severityFilter]); + useEffect(() => { void fetchEvents(); }, [fetchEvents]); return (
-
-
-

Security Events

-

- {total} events from {stats?.source_count || 0} sources -

-
-
+ + + {errors.length > 0 && (events.length > 0 || stats) && void fetchEvents()} />} {/* Stats */} {stats && ( @@ -93,9 +97,9 @@ export function Events() { {/* Event Table */} {loading ? ( -
- {[1, 2, 3, 4, 5].map(i =>
)} -
+ + ) : errors.length > 0 && events.length === 0 ? ( + void fetchEvents()} />} /> ) : events.length === 0 ? (
@@ -105,7 +109,7 @@ export function Events() {

) : ( -
+
diff --git a/frontend-v2/src/pages/HuntLab.tsx b/frontend-v2/src/pages/HuntLab.tsx index 8d97f50..673abe0 100644 --- a/frontend-v2/src/pages/HuntLab.tsx +++ b/frontend-v2/src/pages/HuntLab.tsx @@ -2,6 +2,10 @@ import { useState, useEffect } from 'react'; import apiClient from '../api/client'; import { Play, FileCode, Clock } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { EmptyState, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; +import { toast } from '../components/Toast'; interface HuntSession { id: number; @@ -13,18 +17,34 @@ interface HuntSession { created_at: string; } +type HuntRow = Record; +interface HuntQueryResult { + query?: { description?: string; sql?: string }; + row_count?: number; + rows?: HuntRow[]; + error?: string; +} +interface HuntResult { + explanation?: string; + query_results?: HuntQueryResult[]; + sigma_rule?: string; +} + export function HuntLab() { const [hypothesis, setHypothesis] = useState(''); const [sessions, setSessions] = useState([]); - const [activeResult, setActiveResult] = useState(null); + const [activeResult, setActiveResult] = useState(null); const [hunting, setHunting] = useState(false); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); const fetchSessions = async () => { try { const res = await apiClient.get('/hunt/'); setSessions(res.data); + setError(''); } catch (err) { - console.error(err); - } + setError(getApiErrorMessage(err, 'Hunt history could not be loaded.')); + } finally { setLoading(false); } }; const startHunt = async () => { @@ -36,7 +56,7 @@ export function HuntLab() { setActiveResult(res.data.data); await fetchSessions(); } catch (err) { - console.error(err); + toast(getApiErrorMessage(err, 'The hunt could not be completed.'), 'error'); } finally { setHunting(false); } @@ -46,17 +66,15 @@ export function HuntLab() { return (
-
-

Threat Hunt Lab

-

Natural-language threat hunting with AI-generated queries

-
+ {/* Hunt Input */}
- +
setHypothesis(e.target.value)} onKeyDown={e => e.key === 'Enter' && startHunt()} @@ -72,7 +90,7 @@ export function HuntLab() { {hunting ? 'Hunting...' : 'Hunt'}
-
+
{['Port scan from 10.0.0.0/24', 'DNS tunneling to external domains', 'Modbus write commands to PLCs', 'Failed auth attempts across multiple hosts'].map(example => (
- {Object.keys(qr.rows[0]).map(key => ( + {Object.keys(qr.rows?.[0] ?? {}).map(key => ( ))} - {qr.rows.slice(0, 20).map((row: any, j: number) => ( + {(qr.rows ?? []).slice(0, 20).map((row, j) => ( - {Object.values(row).map((val: any, k: number) => ( + {Object.values(row).map((val, k) => ( ))} @@ -147,10 +165,12 @@ export function HuntLab() { )} {/* Past Sessions */} -
+ {loading ? : error ? ( + } /> + ) :

Hunt History

{sessions.length === 0 ? ( -

No hunt sessions yet. Enter a hypothesis above to start.

+ ) : (
{sessions.map(s => ( @@ -170,7 +190,7 @@ export function HuntLab() { ))}
)} -
+
} ); } diff --git a/frontend-v2/src/pages/Login.tsx b/frontend-v2/src/pages/Login.tsx index 9614a14..08139cc 100644 --- a/frontend-v2/src/pages/Login.tsx +++ b/frontend-v2/src/pages/Login.tsx @@ -1,108 +1,92 @@ import { useState, type FormEvent } from 'react'; -import { Link, useNavigate } from 'react-router-dom'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; +import { Activity, LockKeyhole, Shield, ShieldCheck } from 'lucide-react'; import { useAuthStore } from '../stores/authStore'; -import { Shield } from 'lucide-react'; export function Login() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const { login, isLoading, error, clearError } = useAuthStore(); const navigate = useNavigate(); + const location = useLocation(); - const handleSubmit = async (e: FormEvent) => { - e.preventDefault(); + const handleSubmit = async (event: FormEvent) => { + event.preventDefault(); try { await login(email, password); - navigate('/'); + const requested = (location.state as { from?: { pathname?: string; search?: string } } | null)?.from; + const destination = requested?.pathname?.startsWith('/') + ? `${requested.pathname}${requested.search ?? ''}` + : '/'; + navigate(destination, { replace: true }); } catch { - // error is set in store + // Store owns the user-facing error. } }; - const handleGitHubLogin = () => { - window.location.href = '/api/v1/auth/github/login'; - }; - return ( -
-
-
- -

Welcome back

-

Sign in to OneAlert

+
+
+
+
+ + +

OneAlert

AI Security OS

+
+

Industrial defense, governed

+

See the signal.
Protect the process.

+

A dense operations workspace for OT visibility, investigation, and human-approved response.

+
+ {[['Passive', 'Asset discovery'], ['Gated', 'Response actions'], ['Audited', 'Agent decisions']].map(([value, label]) => ( +

{value}

{label}

+ ))} +
+
+
+
-
- {error && ( -
- {error} - -
- )} - -
-
- - setEmail(e.target.value)} - className="w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" - placeholder="you@company.com" - required - /> -
- -
- - setPassword(e.target.value)} - className="w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" - placeholder="Enter your password" - required - /> -
+
+
+
+
+
); } diff --git a/frontend-v2/src/pages/MitreMap.tsx b/frontend-v2/src/pages/MitreMap.tsx index aa7fbbb..7e5248a 100644 --- a/frontend-v2/src/pages/MitreMap.tsx +++ b/frontend-v2/src/pages/MitreMap.tsx @@ -2,6 +2,9 @@ import { useState, useEffect } from 'react'; import apiClient from '../api/client'; import { Search } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { DegradedBanner, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; interface TacticCoverage { name: string; @@ -27,23 +30,26 @@ export function MitreMap() { const [techniques, setTechniques] = useState([]); const [search, setSearch] = useState(''); const [loading, setLoading] = useState(true); + const [errors, setErrors] = useState([]); + + const fetchData = async () => { + setLoading(true); + setErrors([]); + const [coverageResult, techniquesResult] = await Promise.allSettled([ + apiClient.get('/mitre/coverage'), + apiClient.get('/mitre/techniques'), + ]); + const nextErrors: string[] = []; + if (coverageResult.status === 'fulfilled') setCoverage(coverageResult.value.data.data); + else nextErrors.push(getApiErrorMessage(coverageResult.reason, 'Coverage data is unavailable')); + if (techniquesResult.status === 'fulfilled') setTechniques(techniquesResult.value.data); + else nextErrors.push(getApiErrorMessage(techniquesResult.reason, 'Technique catalog is unavailable')); + setErrors(nextErrors); + setLoading(false); + }; useEffect(() => { - const fetchData = async () => { - try { - const [covRes, techRes] = await Promise.all([ - apiClient.get('/mitre/coverage'), - apiClient.get('/mitre/techniques'), - ]); - setCoverage(covRes.data.data); - setTechniques(techRes.data); - } catch (err) { - console.error('Failed to load MITRE data', err); - } finally { - setLoading(false); - } - }; - fetchData(); + void fetchData(); }, []); const filteredTechniques = search @@ -51,18 +57,15 @@ export function MitreMap() { : techniques; if (loading) { - return
-
-
{[1,2,3,4].map(i =>
)}
-
; + return ; } + if (!coverage && techniques.length === 0 && errors.length > 0) return void fetchData()} />} />; + return (
-
-

MITRE ATT&CK Coverage

-

Detection coverage mapped to the MITRE ATT&CK framework

-
+ + {errors.length > 0 && void fetchData()} />} {/* Overall Coverage */} {coverage && ( diff --git a/frontend-v2/src/pages/OTDiscovery.tsx b/frontend-v2/src/pages/OTDiscovery.tsx index 283d90d..8f1e635 100644 --- a/frontend-v2/src/pages/OTDiscovery.tsx +++ b/frontend-v2/src/pages/OTDiscovery.tsx @@ -3,54 +3,67 @@ import apiClient from '../api/client'; import type { DiscoveredDevice, OTSummary, ProtocolData } from '../api/types'; import { Network, Wifi, AlertTriangle, Link2 } from 'lucide-react'; import clsx from 'clsx'; +import { getApiErrorMessage } from '../api/errors'; +import { DegradedBanner, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; +import { toast } from '../components/Toast'; export function OTDiscovery() { const [summary, setSummary] = useState(null); const [devices, setDevices] = useState([]); const [protocols, setProtocols] = useState([]); const [loading, setLoading] = useState(true); + const [errors, setErrors] = useState([]); + const [pendingDevices, setPendingDevices] = useState>(new Set()); + + const fetchData = async () => { + setLoading(true); + setErrors([]); + const [summaryResult, devicesResult, protocolsResult] = await Promise.allSettled([ + apiClient.get('/ot/summary'), + apiClient.get('/ot/discovered-devices', { params: { size: 20 } }), + apiClient.get('/ot/devices-by-protocol'), + ]); + const nextErrors: string[] = []; + if (summaryResult.status === 'fulfilled') setSummary(summaryResult.value.data); + else nextErrors.push(getApiErrorMessage(summaryResult.reason, 'OT summary is unavailable')); + if (devicesResult.status === 'fulfilled') setDevices(devicesResult.value.data.devices || []); + else nextErrors.push(getApiErrorMessage(devicesResult.reason, 'Discovered devices are unavailable')); + if (protocolsResult.status === 'fulfilled') setProtocols(protocolsResult.value.data.protocols || []); + else nextErrors.push(getApiErrorMessage(protocolsResult.reason, 'Protocol telemetry is unavailable')); + setErrors(nextErrors); + setLoading(false); + }; useEffect(() => { - async function fetchData() { - try { - const [summaryRes, devicesRes, protocolsRes] = await Promise.all([ - apiClient.get('/ot/summary'), - apiClient.get('/ot/discovered-devices', { params: { size: 20 } }), - apiClient.get('/ot/devices-by-protocol'), - ]); - setSummary(summaryRes.data); - setDevices(devicesRes.data.devices || []); - setProtocols(protocolsRes.data.protocols || []); - } catch (err) { - console.error('Failed to load OT data:', err); - } finally { - setLoading(false); - } - } - fetchData(); + void fetchData(); }, []); const handlePromote = async (deviceId: number) => { - await apiClient.post(`/ot/discovered-devices/${deviceId}/promote-to-asset`); - // Refresh - const res = await apiClient.get('/ot/discovered-devices', { params: { size: 20 } }); - setDevices(res.data.devices || []); + if (pendingDevices.has(deviceId)) return; + setPendingDevices(current => new Set(current).add(deviceId)); + try { + await apiClient.post(`/ot/discovered-devices/${deviceId}/promote-to-asset`); + const res = await apiClient.get('/ot/discovered-devices', { params: { size: 20 } }); + setDevices(res.data.devices || []); + toast('Device promoted to the managed asset inventory.', 'success'); + } catch (error: unknown) { + toast(getApiErrorMessage(error, 'Device could not be promoted.'), 'error'); + } finally { + setPendingDevices(current => { const next = new Set(current); next.delete(deviceId); return next; }); + } }; if (loading) { - return ( -
-
-
- ); + return ; } + if (!summary && devices.length === 0 && protocols.length === 0 && errors.length > 0) return void fetchData()} />} />; + return (
-
-

OT Discovery

-

Network device discovery and correlation

-
+ + {errors.length > 0 && void fetchData()} />} {/* Summary Cards */}
@@ -92,7 +105,7 @@ export function OTDiscovery() { )} {/* Discovered Devices Table */} -
+

Discovered Devices

@@ -101,7 +114,7 @@ export function OTDiscovery() { No devices discovered yet. Deploy a network sensor to start scanning.
) : ( -
{key}
{String(val ?? '—')}
+
@@ -136,18 +149,18 @@ export function OTDiscovery() { ))} -
IP Address {!device.is_correlated && ( - )}
+
)}
diff --git a/frontend-v2/src/pages/Register.tsx b/frontend-v2/src/pages/Register.tsx index c5b2278..c8e09fa 100644 --- a/frontend-v2/src/pages/Register.tsx +++ b/frontend-v2/src/pages/Register.tsx @@ -32,7 +32,7 @@ export function Register() {
{error && ( -
+ @@ -40,9 +40,11 @@ export function Register() {
- + setFullName(e.target.value)} className="w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" @@ -52,9 +54,11 @@ export function Register() {
- + setEmail(e.target.value)} className="w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" @@ -64,9 +68,11 @@ export function Register() {
- + setCompany(e.target.value)} className="w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" @@ -75,9 +81,11 @@ export function Register() {
- + setPassword(e.target.value)} className="w-full px-4 py-2.5 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent" diff --git a/frontend-v2/src/pages/ResponsePlans.tsx b/frontend-v2/src/pages/ResponsePlans.tsx index f3be23a..da24d79 100644 --- a/frontend-v2/src/pages/ResponsePlans.tsx +++ b/frontend-v2/src/pages/ResponsePlans.tsx @@ -3,11 +3,23 @@ import apiClient from '../api/client'; import { CheckCircle, XCircle, Play, Clock, Shield } from 'lucide-react'; import clsx from 'clsx'; import { toast } from '../components/Toast'; +import { getApiErrorMessage } from '../api/errors'; +import { EmptyState, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; + +interface ResponseAction { + priority?: number; + action_type: string; + target: string; + reason: string; + policy_check?: { approved?: boolean }; + execution_result?: { status?: string }; +} interface ResponsePlan { id: number; case_id: number; - actions: any[]; + actions: ResponseAction[]; status: string; autonomy_level: string; created_by: string; @@ -22,7 +34,7 @@ interface PendingApproval { case_id: number; status: string; reason: string; - actions: any[]; + actions: ResponseAction[]; autonomy_level: string; created_at: string; } @@ -41,53 +53,67 @@ export function ResponsePlans() { const [plans, setPlans] = useState([]); const [pending, setPending] = useState([]); const [selectedPlan, setSelectedPlan] = useState(null); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); + const [workingPlan, setWorkingPlan] = useState(null); const fetchPlans = async () => { try { const res = await apiClient.get('/response-plans/'); setPlans(res.data.data || []); - } catch (err) { console.error(err); } + setError(''); + } catch (err) { setError(getApiErrorMessage(err, 'Response plans could not be loaded.')); } + finally { setLoading(false); } }; const fetchPending = async () => { try { const res = await apiClient.get('/response-plans/pending-approvals'); setPending(res.data.data || []); - } catch (err) { console.error(err); } + } catch (err) { setError(getApiErrorMessage(err, 'Pending approvals could not be loaded.')); } }; const approvePlan = async (planId: number) => { + if (workingPlan !== null) return; + setWorkingPlan(planId); try { await apiClient.post(`/response-plans/${planId}/approve`); toast('Plan approved', 'success'); await Promise.all([fetchPlans(), fetchPending()]); - } catch (err) { console.error(err); toast('Failed to approve plan', 'error'); } + } catch (err) { toast(getApiErrorMessage(err, 'Failed to approve plan.'), 'error'); } + finally { setWorkingPlan(null); } }; const rejectPlan = async (planId: number) => { + if (workingPlan !== null || !window.confirm('Reject this response plan?')) return; + setWorkingPlan(planId); try { await apiClient.post(`/response-plans/${planId}/reject`, { reason: 'Manual rejection' }); toast('Plan rejected', 'warning'); await Promise.all([fetchPlans(), fetchPending()]); - } catch (err) { console.error(err); toast('Failed to reject plan', 'error'); } + } catch (err) { toast(getApiErrorMessage(err, 'Failed to reject plan.'), 'error'); } + finally { setWorkingPlan(null); } }; const executePlan = async (planId: number) => { + if (workingPlan !== null || !window.confirm('Execute this approved response plan now?')) return; + setWorkingPlan(planId); try { await apiClient.post(`/response-plans/${planId}/execute`); toast('Plan executed successfully', 'success'); await fetchPlans(); - } catch (err) { console.error(err); toast('Execution failed', 'error'); } + } catch (err) { toast(getApiErrorMessage(err, 'Execution failed.'), 'error'); } + finally { setWorkingPlan(null); } }; useEffect(() => { fetchPlans(); fetchPending(); }, []); return (
-
-

Response Plans

-

AI-generated response plans with human approval workflow

-
+ + + {error && plans.length === 0 ? { fetchPlans(); fetchPending(); }} />} /> : null} + {loading && } {/* Pending Approvals */} {pending.length > 0 && ( @@ -107,11 +133,11 @@ export function ResponsePlans() {

- - @@ -126,7 +152,7 @@ export function ResponsePlans() {

All Response Plans

{plans.length === 0 ? ( -

No response plans yet. Run the agent pipeline to generate plans.

+ ) : (
@@ -143,7 +169,8 @@ export function ResponsePlans() { {plans.map(p => ( - { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); setSelectedPlan(selectedPlan?.id === p.id ? null : p); } }} onClick={() => setSelectedPlan(selectedPlan?.id === p.id ? null : p)}> @@ -157,7 +184,7 @@ export function ResponsePlans() {
#{p.id} Case #{p.case_id}{new Date(p.created_at).toLocaleString()} {p.status === 'approved' && ( - @@ -179,7 +206,7 @@ export function ResponsePlans() { Plan #{selectedPlan.id} Actions
- {selectedPlan.actions?.map((action: any, i: number) => ( + {selectedPlan.actions?.map((action, i) => (
#{action.priority || i + 1} (null); const [saving, setSaving] = useState(false); - const [message, setMessage] = useState(''); - - useEffect(() => { - // Load current integration settings from user or a dedicated endpoint if needed - }, [user]); + const [message, setMessage] = useState<{ text: string; error: boolean } | null>(null); const handleSaveIntegrations = async () => { + if (!slackUrl && !webhookUrl) { + setMessage({ text: 'Enter at least one HTTPS webhook URL to update.', error: true }); + return; + } setSaving(true); + setMessage(null); try { - const params = new URLSearchParams(); - if (slackUrl) params.append('slack_webhook_url', slackUrl); - if (webhookUrl) params.append('webhook_url', webhookUrl); - await apiClient.patch(`/auth/me/integrations?${params.toString()}`); - setMessage('Integrations saved'); - fetchUser(); - } catch { - setMessage('Failed to save'); + await apiClient.patch('/auth/me/integrations', { + slack_webhook_url: slackUrl || null, + webhook_url: webhookUrl || null, + }); + setSlackUrl(''); + setWebhookUrl(''); + setMessage({ text: 'Integration credentials updated and hidden.', error: false }); + } catch (error: unknown) { + setMessage({ text: getApiErrorMessage(error, 'Integration settings could not be saved.'), error: true }); } finally { setSaving(false); - setTimeout(() => setMessage(''), 3000); } }; const handleSetupMFA = async () => { + setMessage(null); try { - const res = await apiClient.post('/auth/me/mfa/setup'); - setMfaUri(res.data.provisioning_uri); - } catch { - setMessage('Failed to setup MFA'); + const response = await apiClient.post<{ provisioning_uri: string }>('/auth/me/mfa/setup'); + setMfaUri(response.data.provisioning_uri); + } catch (error: unknown) { + setMessage({ text: getApiErrorMessage(error, 'MFA setup could not be started.'), error: true }); } }; return ( -
-
-

Settings

-

Manage your account and integrations

-
+
+ - {message && ( -
- {message} -
- )} + {message &&
{message.text}
} - {/* Profile */} -
-
- -

Profile

-
-
-
- Email - {user?.email} -
-
- Name - {user?.full_name || 'Not set'} -
-
- Company - {user?.company || 'Not set'} -
-
- Role - {user?.role} -
-
-
+
+
+ }> +
+ {[ + ['Email', user?.email || 'Unavailable'], + ['Name', user?.full_name || 'Not set'], + ['Company', user?.company || 'Not set'], + ].map(([label, value]) =>
{label}
{value}
)} +
Role
{user?.role || 'analyst'}
+
+
- {/* MFA */} -
-
- -

Multi-Factor Authentication

+ }> +
+ {user?.mfa_enabled ? MFA enabled : } + {mfaUri &&

Add this provisioning URI to your authenticator, then finish verification.

{mfaUri}
} +
+
- {user?.mfa_enabled ? ( -

MFA is enabled

- ) : ( -
-

Protect your account with TOTP-based MFA

- -
- )} - {mfaUri && ( -
-

Scan this URI with your authenticator app:

- {mfaUri} -
- )} -
- {/* Integrations */} -
-
- -

Notification Integrations

-
-
-
- - setSlackUrl(e.target.value)} - placeholder="https://hooks.slack.com/services/..." - className="w-full px-3 py-2 bg-surface-900 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500" - /> -
-
- - setWebhookUrl(e.target.value)} - placeholder="https://your-server.com/webhook" - className="w-full px-3 py-2 bg-surface-900 border border-surface-600 rounded-lg text-sm text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500" - /> -
- -
-
+ }> + { event.preventDefault(); void handleSaveIntegrations(); }}> +
+ + setSlackUrl(event.target.value)} placeholder="https://hooks.slack.com/services/…" className="w-full rounded-md border border-surface-600 bg-surface-950 px-3 py-2.5 text-sm text-surface-100 placeholder-surface-500" /> +

Must use HTTPS. The credential is cleared from this form after saving.

+
+
+ + setWebhookUrl(event.target.value)} placeholder="https://security.example.com/onealert" className="w-full rounded-md border border-surface-600 bg-surface-950 px-3 py-2.5 text-sm text-surface-100 placeholder-surface-500" /> +
+
+ Sent in an encrypted request body + +
+ +
+
); } diff --git a/frontend-v2/src/pages/Validation.tsx b/frontend-v2/src/pages/Validation.tsx index 3df7576..bf7b773 100644 --- a/frontend-v2/src/pages/Validation.tsx +++ b/frontend-v2/src/pages/Validation.tsx @@ -3,6 +3,18 @@ import apiClient from '../api/client'; import { Play, Plus, ShieldCheck, Target, CheckCircle, XCircle } from 'lucide-react'; import clsx from 'clsx'; import { toast } from '../components/Toast'; +import { getApiErrorMessage } from '../api/errors'; +import { EmptyState, ErrorState, LoadingSurface, RetryButton } from '../components/ui/AsyncState'; +import { PageHeader } from '../components/ui/PageHeader'; + +interface ValidationStep { + id: number; + technique_id: string; + test_name: string; + actual_result: string; + duration_ms: number; +} +interface ValidationRunDetail extends ValidationRun { steps: ValidationStep[]; } interface ValidationRun { id: number; @@ -36,15 +48,20 @@ const STATUS_STYLES: Record = { export function Validation() { const [runs, setRuns] = useState([]); const [showCreate, setShowCreate] = useState(false); - const [selectedRun, setSelectedRun] = useState(null); + const [selectedRun, setSelectedRun] = useState(null); const [newRun, setNewRun] = useState({ name: '', description: '', techniques: [] as string[] }); const [creating, setCreating] = useState(false); + const [executing, setExecuting] = useState(null); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); const fetchRuns = async () => { try { const res = await apiClient.get('/validation/runs'); setRuns(res.data.data || []); - } catch (err) { console.error(err); } + setError(''); + } catch (err) { setError(getApiErrorMessage(err, 'Validation runs could not be loaded.')); } + finally { setLoading(false); } }; const createRun = async () => { @@ -61,24 +78,27 @@ export function Validation() { setNewRun({ name: '', description: '', techniques: [] }); toast('Validation run created', 'success'); await fetchRuns(); - } catch (err) { console.error(err); toast('Failed to create run', 'error'); } + } catch (err) { toast(getApiErrorMessage(err, 'Failed to create run.'), 'error'); } finally { setCreating(false); } }; const executeRun = async (runId: number) => { + if (executing !== null || !window.confirm('Run this detection validation now?')) return; + setExecuting(runId); try { await apiClient.post(`/validation/runs/${runId}/execute`); toast('Validation complete', 'success'); await fetchRuns(); await viewRun(runId); - } catch (err) { console.error(err); toast('Execution failed', 'error'); } + } catch (err) { toast(getApiErrorMessage(err, 'Execution failed.'), 'error'); } + finally { setExecuting(null); } }; const viewRun = async (runId: number) => { try { const res = await apiClient.get(`/validation/runs/${runId}`); setSelectedRun(res.data.data); - } catch (err) { console.error(err); } + } catch (err) { toast(getApiErrorMessage(err, 'Run details could not be loaded.'), 'error'); } }; const toggleTechnique = (techId: string) => { @@ -94,16 +114,12 @@ export function Validation() { return (
-
-
-

Purple-Team Validation

-

Test detection controls against simulated ATT&CK techniques

-
+ setShowCreate(!showCreate)} className="flex items-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg text-sm font-medium transition-colors"> New Validation -
+ } /> {/* Create Form */} {showCreate && ( @@ -111,8 +127,8 @@ export function Validation() {

Create Validation Run

- - setNewRun({ ...newRun, name: e.target.value })} + + setNewRun({ ...newRun, name: e.target.value })} placeholder="e.g. Weekly Detection Coverage Test" className="w-full px-4 py-2 bg-surface-900 border border-surface-600 rounded-lg text-white placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500" />
@@ -140,14 +156,15 @@ export function Validation() { )} {/* Runs List */} -
+ {loading ? : error ? } /> :

Validation Runs

{runs.length === 0 ? ( -

No validation runs yet. Create one to test your detection coverage.

+ ) : (
{runs.map(r => ( -
{ if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); viewRun(r.id); } }} onClick={() => viewRun(r.id)}>
@@ -168,7 +185,7 @@ export function Validation() { {r.status} {r.status === 'pending' && ( - @@ -177,7 +194,7 @@ export function Validation() { ))}
)} -
+
} {/* Run Detail */} {selectedRun && ( @@ -212,7 +229,7 @@ export function Validation() { {selectedRun.steps?.length > 0 && (
- {selectedRun.steps.map((step: any) => ( + {selectedRun.steps.map(step => (
{step.actual_result === 'detected' ? ( diff --git a/frontend-v2/src/stores/authStore.ts b/frontend-v2/src/stores/authStore.ts index e1a033b..65418fb 100644 --- a/frontend-v2/src/stores/authStore.ts +++ b/frontend-v2/src/stores/authStore.ts @@ -1,82 +1,80 @@ import { create } from 'zustand'; -import apiClient from '../api/client'; +import apiClient, { SESSION_EXPIRED_EVENT } from '../api/client'; +import { getApiErrorMessage } from '../api/errors'; import type { User } from '../api/types'; interface AuthState { user: User | null; - token: string | null; isAuthenticated: boolean; + hasCheckedSession: boolean; isLoading: boolean; error: string | null; login: (email: string, password: string) => Promise; register: (email: string, password: string, fullName: string, company?: string) => Promise; - logout: () => void; + logout: () => Promise; fetchUser: () => Promise; clearError: () => void; } -export const useAuthStore = create((set) => ({ +const anonymousState = { user: null, - token: localStorage.getItem('access_token'), - isAuthenticated: !!localStorage.getItem('access_token'), + isAuthenticated: false, + hasCheckedSession: true, isLoading: false, +}; + +export const useAuthStore = create((set) => ({ + ...anonymousState, + hasCheckedSession: false, error: null, - login: async (email: string, password: string) => { + login: async (email, password) => { set({ isLoading: true, error: null }); try { - const formData = new URLSearchParams(); - formData.append('username', email); - formData.append('password', password); - - const response = await apiClient.post('/auth/login', formData, { + const formData = new URLSearchParams({ username: email, password }); + await apiClient.post('/auth/login', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, }); - - const { access_token } = response.data; - localStorage.setItem('access_token', access_token); - set({ token: access_token, isAuthenticated: true, isLoading: false }); - - const userResponse = await apiClient.get('/auth/me'); - set({ user: userResponse.data }); - } catch (error: any) { - const message = error.response?.data?.detail || 'Login failed'; - set({ error: message, isLoading: false }); + const userResponse = await apiClient.get('/auth/me'); + set({ user: userResponse.data, isAuthenticated: true, hasCheckedSession: true, isLoading: false }); + } catch (error: unknown) { + set({ ...anonymousState, error: getApiErrorMessage(error, 'Sign-in failed. Check your credentials and try again.') }); throw error; } }, - register: async (email: string, password: string, fullName: string, company?: string) => { + register: async (email, password, fullName, company) => { set({ isLoading: true, error: null }); try { - await apiClient.post('/auth/register', { - email, - password, - full_name: fullName, - company: company || null, - }); + await apiClient.post('/auth/register', { email, password, full_name: fullName, company: company || null }); set({ isLoading: false }); - } catch (error: any) { - const message = error.response?.data?.detail || 'Registration failed'; - set({ error: message, isLoading: false }); + } catch (error: unknown) { + set({ error: getApiErrorMessage(error, 'Registration failed. Review your details and try again.'), isLoading: false }); throw error; } }, - logout: () => { - localStorage.removeItem('access_token'); - set({ user: null, token: null, isAuthenticated: false }); + logout: async () => { + set({ ...anonymousState, error: null }); + try { + await apiClient.post('/auth/logout'); + } catch { + // Keep local session cleared if the service is unavailable. + } }, fetchUser: async () => { try { - const response = await apiClient.get('/auth/me'); - set({ user: response.data, isAuthenticated: true }); + const response = await apiClient.get('/auth/me'); + set({ user: response.data, isAuthenticated: true, hasCheckedSession: true, error: null }); } catch { - localStorage.removeItem('access_token'); - set({ user: null, token: null, isAuthenticated: false }); + set({ ...anonymousState }); } }, clearError: () => set({ error: null }), })); + +if (typeof window !== 'undefined') { + window.addEventListener(SESSION_EXPIRED_EVENT, () => useAuthStore.setState({ ...anonymousState })); +} diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts new file mode 100644 index 0000000..6a4a3ec --- /dev/null +++ b/tests/e2e/global-setup.ts @@ -0,0 +1,16 @@ +import { request, type FullConfig } from '@playwright/test'; +import path from 'node:path'; + +export const AUTH_STATE_PATH = path.join(__dirname, '.auth', 'admin.json'); + +export default async function globalSetup(config: FullConfig) { + const baseURL = String(config.projects[0].use.baseURL); + const context = await request.newContext({ baseURL }); + const response = await context.post('/api/v1/auth/login', { + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + data: 'username=admin@example.com&password=password123', + }); + if (!response.ok()) throw new Error(`E2E authentication failed: ${response.status()} ${await response.text()}`); + await context.storageState({ path: AUTH_STATE_PATH }); + await context.dispose(); +} diff --git a/tests/e2e/local-ui-flow.spec.ts b/tests/e2e/local-ui-flow.spec.ts index 4e473b3..71eb626 100644 --- a/tests/e2e/local-ui-flow.spec.ts +++ b/tests/e2e/local-ui-flow.spec.ts @@ -3,19 +3,12 @@ import { test, expect, type Page } from '@playwright/test'; const BASE_URL = 'http://127.0.0.1:8765'; async function loginAsAdmin(page: Page) { - await page.goto(`${BASE_URL}/app/login`); - await page.waitForLoadState('networkidle', { timeout: 15000 }); - await page.getByPlaceholder('you@company.com').fill('admin@example.com'); - await page.getByPlaceholder('Enter your password').fill('password123'); - await page.getByRole('button', { name: 'Sign In' }).click(); - // Wait for redirect — login field disappears OR URL changes - await page.waitForFunction(() => !document.querySelector('input[placeholder="you@company.com"]'), { timeout: 15000 }) - .catch(() => page.waitForTimeout(3000)); - // Extra settle time for SPA routing - await page.waitForTimeout(1000); + await page.goto(`${BASE_URL}/app/`); + await expect(page).toHaveURL(/\/app\/?$/, { timeout: 15000 }); } test.describe('Auth Flow', () => { + test.beforeEach(async ({ context }) => { await context.clearCookies(); }); test('login page has all elements', async ({ page }) => { await page.goto(`${BASE_URL}/app/login`); await page.waitForLoadState('networkidle', { timeout: 15000 }); @@ -38,7 +31,11 @@ test.describe('Auth Flow', () => { }); test('login succeeds and redirects', async ({ page }) => { - await loginAsAdmin(page); + await page.goto(`${BASE_URL}/app/login`); + await page.getByLabel('Email').fill('admin@example.com'); + await page.getByLabel('Password').fill('password123'); + await page.getByRole('button', { name: 'Sign In' }).click(); + await expect(page).toHaveURL(/\/app\/?$/, { timeout: 15000 }); await expect(page.getByPlaceholder('you@company.com')).not.toBeVisible(); }); }); @@ -47,8 +44,8 @@ test.describe('Sidebar', () => { test.beforeEach(async ({ page }) => { await loginAsAdmin(page); }); test('all nav items visible', async ({ page }) => { - for (const item of ['Dashboard', 'Cases', 'Alerts', 'Events', 'Assets', 'OT Discovery', 'MITRE', 'Hunt Lab', 'Response Plans', 'Validation', 'Settings']) { - await expect(page.getByRole('link', { name: new RegExp(item, 'i') })).toBeVisible({ timeout: 5000 }); + for (const item of ['Overview', 'Investigations', 'Alerts', 'Events', 'Assets', 'OT Discovery', 'MITRE ATT&CK', 'Hunt Lab', 'Response Plans', 'Validation', 'Settings']) { + await expect(page.getByRole('navigation', { name: 'Primary navigation' }).getByRole('link', { name: item, exact: true })).toBeVisible({ timeout: 5000 }); } }); }); @@ -67,19 +64,19 @@ test.describe('Cases', () => { test.beforeEach(async ({ page }) => { await loginAsAdmin(page); }); test('page loads with header', async ({ page }) => { - await page.getByRole('link', { name: 'Cases' }).click(); - await expect(page.getByText('Investigations')).toBeVisible({ timeout: 10000 }); + await page.getByRole('navigation', { name: 'Primary navigation' }).getByRole('link', { name: 'Investigations', exact: true }).click(); + await expect(page.getByRole('heading', { name: 'Investigations' })).toBeVisible({ timeout: 10000 }); }); test('Run AI Triage or Pipeline button exists', async ({ page }) => { - await page.getByRole('link', { name: 'Cases' }).click(); + await page.getByRole('navigation', { name: 'Primary navigation' }).getByRole('link', { name: 'Investigations', exact: true }).click(); await page.waitForTimeout(3000); const text = await page.textContent('body'); expect(text).toMatch(/Triage|Pipeline|Run/i); }); test('seeded case visible', async ({ page }) => { - await page.getByRole('link', { name: 'Cases' }).click(); + await page.getByRole('navigation', { name: 'Primary navigation' }).getByRole('link', { name: 'Investigations', exact: true }).click(); await page.waitForTimeout(3000); const text = await page.textContent('body'); // Should have the seeded attack case OR empty state @@ -103,7 +100,7 @@ test.describe('Events', () => { test('page loads with header', async ({ page }) => { await page.getByRole('link', { name: 'Events' }).click(); - await expect(page.getByText('Security Events')).toBeVisible({ timeout: 10000 }); + await expect(page.getByRole('heading', { name: 'Security Events' })).toBeVisible({ timeout: 10000 }); }); test('severity filter cards visible', async ({ page }) => { @@ -197,7 +194,7 @@ test.describe('Full Journey', () => { await loginAsAdmin(page); const pages = [ - { link: 'Cases', expect: 'Investigations', exact: true }, + { link: 'Investigations', expect: 'Investigations', exact: true }, { link: 'Alerts', expect: '', exact: true }, { link: 'Events', expect: 'Security Events', exact: true }, { link: 'MITRE ATT&CK', expect: 'MITRE ATT&CK Coverage', exact: true }, @@ -207,14 +204,14 @@ test.describe('Full Journey', () => { { link: 'Assets', expect: '', exact: true }, { link: 'OT Discovery', expect: '', exact: true }, { link: 'Settings', expect: '', exact: true }, - { link: 'Dashboard', expect: '', exact: true }, + { link: 'Overview', expect: '', exact: true }, ]; for (const p of pages) { - await page.getByRole('link', { name: p.link, exact: p.exact }).click(); + await page.getByRole('navigation', { name: 'Primary navigation' }).getByRole('link', { name: p.link, exact: p.exact }).click(); await page.waitForTimeout(1500); if (p.expect) { - await expect(page.getByText(p.expect)).toBeVisible({ timeout: 10000 }); + await expect(page.getByRole('heading', { name: p.expect, exact: true })).toBeVisible({ timeout: 10000 }); } // No console errors (basic check) const text = await page.textContent('body'); diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 5bd6c93..7c5f85a 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "playwright test ui-resilience.spec.ts local-ui-flow.spec.ts", + "test:resilience": "playwright test ui-resilience.spec.ts" }, "keywords": [], "author": "", diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts index f051820..bd5023a 100644 --- a/tests/e2e/playwright.config.ts +++ b/tests/e2e/playwright.config.ts @@ -1,11 +1,36 @@ -import { defineConfig } from '@playwright/test'; +import { defineConfig, devices } from '@playwright/test'; +import path from 'node:path'; + +const rootDir = path.resolve(__dirname, '../..'); +const baseURL = process.env.ONEALERT_BASE_URL ?? 'http://127.0.0.1:8765'; +const authStatePath = path.join(__dirname, '.auth', 'admin.json'); export default defineConfig({ testDir: '.', + globalSetup: './global-setup.ts', timeout: 30000, retries: 1, reporter: [['list'], ['html', { open: 'never' }]], + expect: { timeout: 10000 }, use: { - ignoreHTTPSErrors: true, + baseURL, + storageState: authStatePath, + trace: 'retain-on-failure', + screenshot: 'only-on-failure', + }, + projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], + webServer: process.env.ONEALERT_BASE_URL ? undefined : { + command: 'python -m uvicorn backend.main:app --host 127.0.0.1 --port 8765', + cwd: rootDir, + url: `${baseURL}/health`, + reuseExistingServer: true, + timeout: 120000, + env: { + ...process.env, + DEBUG: 'false', + DISABLE_SCHEDULER: '1', + DATABASE_URL: 'sqlite:///./e2e.db', + SECRET_KEY: 'e2e-only-secret-key-with-at-least-32-bytes', + }, }, }); diff --git a/tests/e2e/ui-resilience.spec.ts b/tests/e2e/ui-resilience.spec.ts new file mode 100644 index 0000000..384e8cc --- /dev/null +++ b/tests/e2e/ui-resilience.spec.ts @@ -0,0 +1,84 @@ +import { expect, test, type Page } from '@playwright/test'; + +const BASE_URL = process.env.ONEALERT_BASE_URL ?? 'http://127.0.0.1:8765'; + +async function loginAsAdmin(page: Page) { + await page.goto(`${BASE_URL}/app/`); + await expect(page).toHaveURL(/\/app\/?$/, { timeout: 15_000 }); +} + +test.describe('Mission Control shell', () => { + test('groups dense navigation by operational intent', async ({ page }) => { + await loginAsAdmin(page); + + await expect(page.getByRole('banner')).toBeVisible(); + const navigation = page.getByRole('navigation', { name: 'Primary navigation' }); + await expect(navigation.getByText('Command', { exact: true })).toBeVisible(); + await expect(navigation.getByText('Observe', { exact: true })).toBeVisible(); + await expect(navigation.getByText('Analyze', { exact: true })).toBeVisible(); + await expect(navigation.getByText('Act', { exact: true })).toBeVisible(); + await expect(navigation.getByText('Govern', { exact: true })).toBeVisible(); + }); + + test('opens and dismisses mobile navigation with the keyboard', async ({ page }) => { + await page.setViewportSize({ width: 390, height: 844 }); + await loginAsAdmin(page); + + const menuButton = page.getByRole('button', { name: 'Open navigation' }); + await expect(menuButton).toBeVisible(); + await menuButton.click(); + await expect(page.getByRole('navigation', { name: 'Primary navigation' })).toBeVisible(); + + await page.keyboard.press('Escape'); + await expect(page.getByRole('navigation', { name: 'Primary navigation' })).not.toBeVisible(); + await expect(menuButton).toBeFocused(); + }); +}); + +test.describe('Non-happy paths', () => { + test('shows the backend error envelope on failed login', async ({ page }) => { + await page.context().clearCookies(); + await page.route('**/api/v1/auth/login', async route => { + await route.fulfill({ + status: 401, + contentType: 'application/json', + body: JSON.stringify({ + success: false, + data: null, + error: { code: 'HTTP_401', message: 'Account credentials were rejected' }, + metadata: { request_id: 'test-request' }, + }), + }); + }); + + await page.goto(`${BASE_URL}/app/login`); + await page.getByLabel('Email').fill('analyst@example.com'); + await page.getByLabel('Password').fill('incorrect-password'); + await page.getByRole('button', { name: 'Sign In' }).click(); + + await expect(page.getByRole('alert')).toContainText('Account credentials were rejected'); + await expect(page).toHaveURL(/\/app\/login$/); + }); + + test('reports a partial dashboard failure instead of healthy zeroes', async ({ page }) => { + await loginAsAdmin(page); + await page.route('**/api/v1/alerts/stats/overview', async route => { + await route.fulfill({ + status: 503, + contentType: 'application/json', + body: JSON.stringify({ + success: false, + data: null, + error: { code: 'UPSTREAM_UNAVAILABLE', message: 'Alert statistics are temporarily unavailable' }, + metadata: { request_id: 'stats-down' }, + }), + }); + }); + + await page.reload(); + + await expect(page.getByRole('status')).toContainText('Some live data is unavailable'); + await expect(page.getByRole('button', { name: /retry/i })).toBeVisible(); + await expect(page.getByText('Alert statistics are temporarily unavailable')).toBeVisible(); + }); +}); diff --git a/tests/test_alert_logic.py b/tests/test_alert_logic.py index 8f84852..de6b851 100644 --- a/tests/test_alert_logic.py +++ b/tests/test_alert_logic.py @@ -7,8 +7,8 @@ from unittest.mock import Mock, AsyncMock, patch, MagicMock from backend.services.alert_checker import AlertChecker from backend.models.user import User +from backend.models.organization import Organization # noqa: F401 - registers SQLAlchemy relationship target from backend.models.asset import Asset, AssetType -from backend.models.alert import Alert, Severity, AlertStatus class TestAlertChecker: @@ -182,6 +182,7 @@ async def test_create_alert_from_cve(self, mock_enrich, mock_email_service, mock alert_checker, mock_user, mock_asset): """Test creating an alert from CVE data.""" mock_db = AsyncMock() + mock_db.add = MagicMock() mock_session_local.return_value.__aenter__.return_value = mock_db mock_enrich.return_value = {} @@ -217,6 +218,7 @@ async def test_create_alert_from_advisory(self, mock_email_service, mock_session alert_checker, mock_user, mock_asset): """Test creating an alert from vendor advisory.""" mock_db = AsyncMock() + mock_db.add = MagicMock() mock_session_local.return_value.__aenter__.return_value = mock_db # Mock the result of db.execute() @@ -314,4 +316,4 @@ async def test_alert_checker_integration(): if __name__ == "__main__": - pytest.main([__file__]) \ No newline at end of file + pytest.main([__file__]) diff --git a/tests/test_api.py b/tests/test_api.py index fa999e1..6410a27 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -109,6 +109,86 @@ def test_register_user(self, client, test_user_data): assert data["full_name"] == test_user_data["full_name"] assert "id" in data assert "hashed_password" not in data # Should not expose password + + def test_register_rejects_short_password(self, client, test_user_data): + """Registration enforces the compatible eight-character minimum.""" + test_user_data["password"] = "short" + + response = client.post("/api/v1/auth/register", json=test_user_data) + + assert response.status_code == 422 + + @pytest.mark.parametrize("password", [ + "A" * 73, + "🙂" * 19, + ]) + def test_register_rejects_password_over_72_utf8_bytes( + self, client, test_user_data, password + ): + """bcrypt's byte limit is rejected instead of silently truncating.""" + test_user_data["password"] = password + + response = client.post("/api/v1/auth/register", json=test_user_data) + + assert response.status_code == 422 + + def test_user_response_does_not_expose_webhook_secrets(self, client, test_user_data): + """Profile DTOs do not serialize notification credentials.""" + test_user_data.update({ + "slack_webhook_url": "https://hooks.slack.com/services/secret", + "webhook_url": "https://example.com/hook?token=secret", + }) + + response = client.post("/api/v1/auth/register", json=test_user_data) + + assert response.status_code == 201 + assert "slack_webhook_url" not in response.json() + assert "webhook_url" not in response.json() + + def test_integration_update_requires_json_and_hides_secrets(self, client, test_user_data): + """Webhook credentials are accepted only in a validated JSON body.""" + client.post("/api/v1/auth/register", json=test_user_data) + login_response = client.post("/api/v1/auth/login", data={ + "username": test_user_data["email"], + "password": test_user_data["password"], + }) + headers = { + "Authorization": f"Bearer {login_response.json()['access_token']}" + } + + query_response = client.patch( + "/api/v1/auth/me/integrations", + params={"webhook_url": "https://example.com/hook?token=secret"}, + headers=headers, + ) + json_response = client.patch( + "/api/v1/auth/me/integrations", + json={"webhook_url": "https://example.com/hook?token=secret"}, + headers=headers, + ) + + assert query_response.status_code == 422 + assert json_response.status_code == 200 + assert "webhook_url" not in json_response.json() + + def test_integration_update_rejects_non_https_url(self, client, test_user_data): + """Notification credentials cannot be sent over plaintext HTTP.""" + client.post("/api/v1/auth/register", json=test_user_data) + login_response = client.post("/api/v1/auth/login", data={ + "username": test_user_data["email"], + "password": test_user_data["password"], + }) + headers = { + "Authorization": f"Bearer {login_response.json()['access_token']}" + } + + response = client.patch( + "/api/v1/auth/me/integrations", + json={"webhook_url": "http://example.com/hook"}, + headers=headers, + ) + + assert response.status_code == 422 def test_register_duplicate_email(self, client, test_user_data): """Test registration with duplicate email.""" @@ -139,6 +219,41 @@ def test_login_success(self, client, test_user_data): data = response.json() assert "access_token" in data assert data["token_type"] == "bearer" + + cookie = response.headers["set-cookie"] + assert "access_token=" in cookie + assert "HttpOnly" in cookie + assert "SameSite=lax" in cookie + + def test_login_cookie_authenticates_without_bearer_header(self, client, test_user_data): + """Browser sessions can bootstrap authentication from the HttpOnly cookie.""" + client.post("/api/v1/auth/register", json=test_user_data) + login_response = client.post("/api/v1/auth/login", data={ + "username": test_user_data["email"], + "password": test_user_data["password"], + }) + assert login_response.status_code == 200 + + response = client.get("/api/v1/auth/me") + + assert response.status_code == 200 + assert response.json()["email"] == test_user_data["email"] + + def test_logout_clears_cookie_session(self, client, test_user_data): + """Logout expires the session cookie and makes cookie-only auth fail.""" + client.post("/api/v1/auth/register", json=test_user_data) + client.post("/api/v1/auth/login", data={ + "username": test_user_data["email"], + "password": test_user_data["password"], + }) + + logout_response = client.post("/api/v1/auth/logout") + me_response = client.get("/api/v1/auth/me") + + assert logout_response.status_code == 200 + assert "access_token=" in logout_response.headers["set-cookie"] + assert "Max-Age=0" in logout_response.headers["set-cookie"] + assert me_response.status_code == 401 def test_login_invalid_credentials(self, client, test_user_data): """Test login with invalid credentials.""" @@ -172,6 +287,25 @@ def test_get_current_user(self, client, test_user_data): data = response.json() assert data["email"] == test_user_data["email"] assert data["full_name"] == test_user_data["full_name"] + + def test_inactive_user_token_is_rejected(self, client, test_user_data): + """Deactivation invalidates existing access tokens at the auth boundary.""" + client.post("/api/v1/auth/register", json=test_user_data) + login_response = client.post("/api/v1/auth/login", data={ + "username": test_user_data["email"], + "password": test_user_data["password"], + }) + headers = { + "Authorization": f"Bearer {login_response.json()['access_token']}" + } + with TestingSessionLocal() as db: + user = db.query(User).filter(User.email == test_user_data["email"]).one() + user.is_active = False + db.commit() + + response = client.get("/api/v1/auth/me", headers=headers) + + assert response.status_code == 403 def test_unauthorized_access(self, client): """Test accessing protected endpoint without token.""" @@ -418,4 +552,4 @@ async def test_api_integration(client, test_user_data, test_asset_data): if __name__ == "__main__": - pytest.main([__file__]) \ No newline at end of file + pytest.main([__file__]) diff --git a/tests/test_billing.py b/tests/test_billing.py index cb41c14..3e4d78e 100644 --- a/tests/test_billing.py +++ b/tests/test_billing.py @@ -96,7 +96,6 @@ def create_org(client: TestClient, headers: dict, slug: str = "test-org"): resp = client.post("/api/v1/orgs/", json={ "name": "Test Org", "slug": slug, - "plan": "starter", }, headers=headers) assert resp.status_code == 201, f"Org creation failed: {resp.text}" return resp.json() @@ -209,6 +208,25 @@ def test_checkout_no_org_returns_404(self, client): }, headers=headers) assert resp.status_code == 404 + def test_checkout_requires_org_admin(self, client): + """A viewer cannot initiate checkout for the organization.""" + admin_h = register_and_login(client, "admin@example.com") + create_org(client, admin_h) + member_h = register_and_login(client, "member@example.com") + client.post( + "/api/v1/orgs/me/invite", + params={"email": "member@example.com"}, + headers=admin_h, + ) + + resp = client.post( + "/api/v1/billing/checkout", + json={"plan": "pro"}, + headers=member_h, + ) + + assert resp.status_code == 403 + # --------------------------------------------------------------------------- # Usage @@ -225,13 +243,13 @@ def test_usage_returns_counts_vs_limits(self, client): resp = client.get("/api/v1/billing/usage", headers=headers) assert resp.status_code == 200 data = resp.json()["data"] - assert data["plan"] == "starter" + assert data["plan"] == "free" assert "assets" in data assert "users" in data assert data["assets"]["current"] >= 0 - assert data["assets"]["limit"] == 100 # starter plan + assert data["assets"]["limit"] == 10 # free plan assert data["users"]["current"] >= 1 # at least the admin - assert data["users"]["limit"] == 5 # starter plan + assert data["users"]["limit"] == 1 # free plan assert "features" in data def test_usage_no_org_returns_404(self, client): @@ -337,3 +355,27 @@ def test_cancel_subscription_updates_flag(self, client): assert resp.status_code == 200 data = resp.json()["data"] assert data["cancel_at_period_end"] is True + + def test_cancel_subscription_requires_org_admin(self, client): + """A viewer cannot cancel the organization's subscription.""" + admin_h = register_and_login(client, "admin@example.com") + org_data = create_org(client, admin_h) + member_h = register_and_login(client, "member@example.com") + client.post( + "/api/v1/orgs/me/invite", + params={"email": "member@example.com"}, + headers=admin_h, + ) + with _TestingSessionLocal() as db: + db.add(Subscription( + org_id=org_data["id"], + plan="pro", + status="active", + stripe_subscription_id="sub_test_viewer", + cancel_at_period_end=False, + )) + db.commit() + + resp = client.post("/api/v1/billing/cancel", headers=member_h) + + assert resp.status_code == 403 diff --git a/tests/test_integrations.py b/tests/test_integrations.py index 28f7d2e..dcafaad 100644 --- a/tests/test_integrations.py +++ b/tests/test_integrations.py @@ -13,6 +13,17 @@ from backend.database.db import get_db, get_async_db, Base +@pytest.fixture(autouse=True) +def mock_public_integration_dns(): + """Keep integration tests offline while exercising public-address validation.""" + resolved = [(2, 1, 6, "", ("93.184.216.34", 443))] + with patch( + "backend.services.integrations.base.socket.getaddrinfo", + return_value=resolved, + ): + yield + + # Test database setup SQLALCHEMY_DATABASE_URL = "sqlite:///./test_integrations.db" engine = create_engine( @@ -132,6 +143,31 @@ def test_create_invalid_type(self, client, auth_headers): ) assert response.status_code == 400 + def test_create_rejects_private_integration_endpoint(self, client, auth_headers): + """User-controlled endpoints must not resolve to internal networks.""" + private_result = [(2, 1, 6, "", ("169.254.169.254", 443))] + payload = { + "integration_type": "splunk", + "name": "Metadata probe", + "config": { + "hec_url": "https://metadata.example.test", + "hec_token": "test-token", + }, + } + + with patch( + "backend.services.integrations.base.socket.getaddrinfo", + return_value=private_result, + ): + response = client.post( + "/api/v1/integrations/", json=payload, headers=auth_headers + ) + + assert response.status_code == 400 + assert response.json()["error"]["message"] == ( + "Integration endpoint must be a public HTTPS URL" + ) + def test_list_user_integrations(self, client, auth_headers): """Test listing user's integration configurations.""" # Create two integrations diff --git a/tests/test_organizations.py b/tests/test_organizations.py index 9cf0232..4a17824 100644 --- a/tests/test_organizations.py +++ b/tests/test_organizations.py @@ -51,14 +51,13 @@ def client(): app.dependency_overrides[get_db] = _override_get_db app.dependency_overrides[get_async_db] = _override_get_async_db + # Recreate the schema atomically for each test. Iterating global metadata in + # teardown is brittle because later-imported model modules can add tables + # that were not present when this fixture created the database. + Base.metadata.drop_all(bind=_engine) Base.metadata.create_all(bind=_engine) with TestClient(app) as test_client: yield test_client - with _engine.connect() as connection: - transaction = connection.begin() - for table in reversed(Base.metadata.sorted_tables): - connection.execute(table.delete()) - transaction.commit() Base.metadata.drop_all(bind=_engine) @@ -97,19 +96,30 @@ def test_create_org(self, client): resp = client.post("/api/v1/orgs/", json={ "name": "Acme Corp", "slug": "acme-corp", - "plan": "starter", }, headers=headers) assert resp.status_code == 201 data = resp.json() assert data["name"] == "Acme Corp" assert data["slug"] == "acme-corp" - assert data["plan"] == "starter" + assert data["plan"] == "free" assert data["max_assets"] == 50 assert data["max_users"] == 3 assert "id" in data assert "created_at" in data + def test_create_org_cannot_self_select_paid_plan(self, client): + """Paid entitlements can only be assigned by the billing system.""" + headers = register_and_login(client, "admin@example.com") + + resp = client.post("/api/v1/orgs/", json={ + "name": "Enterprise For Free", + "slug": "enterprise-for-free", + "plan": "enterprise", + }, headers=headers) + + assert resp.status_code == 422 + def test_create_org_default_plan(self, client): """Default plan should be 'free'.""" headers = register_and_login(client, "admin@example.com") @@ -187,16 +197,48 @@ def test_update_org_admin(self, client): "name": "New Name", "max_assets": 200, }, headers=headers) + assert resp.status_code == 422 + + read_resp = client.get("/api/v1/orgs/me", headers=headers) + data = read_resp.json() + assert data["name"] == "Old Name" + assert data["max_assets"] == 50 + + def test_update_org_name_only(self, client): + """Admins may still update non-billing organization metadata.""" + headers = register_and_login(client, "admin@example.com") + client.post("/api/v1/orgs/", json={ + "name": "Old Name", "slug": "rename-org", + }, headers=headers) + + resp = client.patch("/api/v1/orgs/me", json={ + "name": "New Name", + }, headers=headers) + assert resp.status_code == 200 - data = resp.json() - assert data["name"] == "New Name" - assert data["max_assets"] == 200 + assert resp.json()["name"] == "New Name" + + @pytest.mark.parametrize("field,value", [ + ("plan", "enterprise"), + ("max_assets", 999999), + ("max_users", 999999), + ]) + def test_update_org_rejects_billing_entitlements(self, client, field, value): + """Organization updates cannot mutate billing-owned entitlements.""" + headers = register_and_login(client, f"{field}@example.com") + client.post("/api/v1/orgs/", json={ + "name": "Secure Org", "slug": f"secure-{field}", + }, headers=headers) + + resp = client.patch("/api/v1/orgs/me", json={field: value}, headers=headers) + + assert resp.status_code == 422 def test_update_org_non_admin_forbidden(self, client): """Non-admin member cannot update org.""" admin_h = register_and_login(client, "admin@example.com") client.post("/api/v1/orgs/", json={ - "name": "Org", "slug": "my-org", "plan": "pro", + "name": "Org", "slug": "my-org", }, headers=admin_h) # Register a second user and invite them @@ -294,6 +336,27 @@ def test_list_members(self, client): assert "alice@example.com" in emails assert len(members) == 2 + def test_list_members_does_not_expose_webhook_secrets(self, client): + """Member directory responses never contain notification credentials.""" + admin_h = register_and_login(client, "admin@example.com") + client.patch( + "/api/v1/auth/me/integrations", + json={ + "slack_webhook_url": "https://hooks.slack.com/services/secret", + "webhook_url": "https://example.com/hook?token=secret", + }, + headers=admin_h, + ) + client.post("/api/v1/orgs/", json={ + "name": "Members Org", "slug": "secret-members-org", + }, headers=admin_h) + + resp = client.get("/api/v1/orgs/me/members", headers=admin_h) + + assert resp.status_code == 200 + assert "slack_webhook_url" not in resp.json()[0] + assert "webhook_url" not in resp.json()[0] + # --------------------------------------------------------------------------- # Cross-org data isolation diff --git a/tests/test_security_hardening.py b/tests/test_security_hardening.py new file mode 100644 index 0000000..7acd590 --- /dev/null +++ b/tests/test_security_hardening.py @@ -0,0 +1,172 @@ +"""Focused regression tests for outbound requests and ingestion boundaries.""" + +from io import BytesIO +from unittest.mock import AsyncMock, MagicMock, patch + +import httpx +import pytest +from fastapi import HTTPException, UploadFile + + +@pytest.mark.asyncio +async def test_outbound_url_requires_https(): + from backend.services.integrations.base import validate_outbound_url + + with pytest.raises(ValueError, match="HTTPS"): + await validate_outbound_url("http://example.com") + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "address", + [ + "127.0.0.1", + "10.1.2.3", + "169.254.169.254", + "224.0.0.1", + "192.0.2.1", + "::1", + "fe80::1", + ], +) +async def test_outbound_url_rejects_non_public_dns_results(address): + from backend.services.integrations.base import validate_outbound_url + + family = 10 if ":" in address else 2 + resolved = [(family, 1, 6, "", (address, 443))] + with patch("backend.services.integrations.base.socket.getaddrinfo", return_value=resolved): + with pytest.raises(ValueError, match="public"): + await validate_outbound_url("https://integration.example.com") + + +@pytest.mark.asyncio +async def test_outbound_url_accepts_only_public_dns_results(): + from backend.services.integrations.base import validate_outbound_url + + resolved = [(2, 1, 6, "", ("93.184.216.34", 443))] + with patch("backend.services.integrations.base.socket.getaddrinfo", return_value=resolved): + assert await validate_outbound_url("https://integration.example.com") == ( + "https://integration.example.com" + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("integration_type", "config"), + [ + ("splunk", {"hec_url": "http://splunk.example.com"}), + ("servicenow", {"instance_url": "http://tenant.service-now.com"}), + ], +) +async def test_integration_config_rejects_non_https_endpoint(integration_type, config): + from backend.routers.integrations import validate_integration_config + + with pytest.raises(ValueError, match="HTTPS"): + await validate_integration_config(integration_type, config) + + +@pytest.mark.asyncio +async def test_splunk_enables_tls_verification(): + from backend.services.integrations.splunk import SplunkIntegration + + response = httpx.Response(200, json={"text": "Success", "code": 0}) + client = MagicMock() + client.post = AsyncMock(return_value=response) + context = MagicMock() + context.__aenter__ = AsyncMock(return_value=client) + context.__aexit__ = AsyncMock(return_value=None) + + with ( + patch( + "backend.services.integrations.splunk.validate_outbound_url", + new=AsyncMock(return_value="https://splunk.example.com:8088"), + ), + patch("backend.services.integrations.splunk.httpx.AsyncClient", return_value=context) as factory, + ): + result = await SplunkIntegration( + {"hec_url": "https://splunk.example.com:8088", "hec_token": "token"} + ).send_alert({"title": "test"}) + + assert result["success"] is True + assert factory.call_args.kwargs["verify"] is True + + +@pytest.mark.asyncio +async def test_integration_exception_is_not_returned_to_client(): + from backend.services.integrations.splunk import SplunkIntegration + + secret_error = "connection failed for /internal/path?token=super-secret" + with ( + patch( + "backend.services.integrations.splunk.validate_outbound_url", + new=AsyncMock(return_value="https://splunk.example.com:8088"), + ), + patch("httpx.AsyncClient.post", new=AsyncMock(side_effect=RuntimeError(secret_error))), + ): + result = await SplunkIntegration( + {"hec_url": "https://splunk.example.com:8088", "hec_token": "token"} + ).send_alert({"title": "test"}) + + assert result == {"success": False, "error": "Integration request failed"} + assert "super-secret" not in result["error"] + + +@pytest.mark.asyncio +async def test_upload_reader_enforces_cap_before_buffering_excess_bytes(): + from backend.routers.events import _read_upload_with_limit + + upload = UploadFile(filename="events.json", file=BytesIO(b"a" * 11)) + with pytest.raises(HTTPException) as exc_info: + await _read_upload_with_limit(upload, max_bytes=10, chunk_size=4) + + assert exc_info.value.status_code == 413 + assert exc_info.value.detail == "Uploaded file is too large" + + +@pytest.mark.asyncio +async def test_upload_reader_accepts_exact_byte_cap(): + from backend.routers.events import _read_upload_with_limit + + content = b"a" * 10 + upload = UploadFile(filename="events.json", file=BytesIO(content)) + + assert await _read_upload_with_limit(upload, max_bytes=10, chunk_size=4) == content + + +@pytest.mark.asyncio +async def test_sensor_ingestion_exception_is_not_returned_to_client(): + from backend.routers.sensor_ingest import ingest_single_device + + current_user = MagicMock(id=42) + with patch( + "backend.routers.sensor_ingest._process_ingested_device", + new=AsyncMock(side_effect=RuntimeError("database password super-secret")), + ): + with pytest.raises(HTTPException) as exc_info: + await ingest_single_device( + {"ip_address": "192.0.2.1"}, current_user=current_user, db=AsyncMock() + ) + + assert exc_info.value.status_code == 500 + assert exc_info.value.detail == "Unable to ingest device" + assert "super-secret" not in exc_info.value.detail + + +@pytest.mark.asyncio +async def test_sensor_batch_exception_is_not_returned_to_client(): + from backend.routers.sensor_ingest import ingest_sensor_batch + + current_user = MagicMock(id=42) + database = AsyncMock() + database.execute.side_effect = RuntimeError("database password super-secret") + + with pytest.raises(HTTPException) as exc_info: + await ingest_sensor_batch( + {"sensor_id": 7, "devices": [{"ip_address": "192.0.2.1"}]}, + current_user=current_user, + db=database, + ) + + assert exc_info.value.status_code == 500 + assert exc_info.value.detail == "Unable to ingest sensor batch" + assert "super-secret" not in exc_info.value.detail