From 42e45b4b503d3d8f9ff34a5123c44f12835f0779 Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Mon, 6 Jul 2026 14:48:12 +0200 Subject: [PATCH] Hermes-GUI: eingebaute hermes serve-Weboberflaeche same-origin in MC2 einbetten (ersetzt CLI-Terminal-Tab) Statt des ttyd-CLI-Terminals zeigt der Tab jetzt die reiche eingebaute Hermes-Web-GUI (hermes serve/dashboard: Threads, sichtbare Tool-Calls, Sessions, Config) - same-origin, ohne offenen Port, ohne Login (Loopback :9119 = LAN-Trust wie Terminal/Konsole). - backend/routers/hermes_ui.py: generischer Reverse-Proxy /hermes-ui/* (alle Methoden + beliebige WebSockets) -> 127.0.0.1:9119; injiziert window.__HERMES_BASE_PATH__=/hermes-ui in die index.html, damit die SPA ihre API/WS-Calls unter dem Praefix absetzt (sonst Kollision mit MC2s /api). - deploy/hermes-builtin-ui.service: hermes serve --skip-build auf Loopback :9119. - deploy/deploy.sh: baut das GUI-Bundle mit Vite-base=/hermes-ui/ (Temp->Swap, ueberlebt Hermes- Updates) + installiert/startet den Dienst. - backend/app.py + config.py + services/agent.py: Router registriert, Upstream/Pfad + Status-Feld. - frontend: Terminal-Tab -> "Hermes GUI" (TerminalView iframe /hermes-ui/, nav-Label, vite-Dev-Proxy). E2E im Browser verifiziert: GUI rendert eingebettet, /hermes-ui/api/* liefern echte Daten (289 Sessions, verbundene Plattformen), Assets + Plugins laden, Basis-Pfad korrekt. Co-Authored-By: Claude Opus 4.8 --- backend/app.py | 3 +- backend/config.py | 8 + backend/routers/hermes_ui.py | 135 +++++++++++ backend/services/agent.py | 7 +- deploy/deploy.sh | 19 ++ deploy/hermes-builtin-ui.service | 21 ++ ...View--jt2Kx1K.js => GraphView-yMisqyGY.js} | 2 +- .../{index-BZIxDFd6.js => index-_1h7akwb.js} | 217 +++++++++--------- frontend/dist/index.html | 2 +- frontend/src/lib/api.ts | 2 + frontend/src/nav.ts | 4 +- frontend/src/views/TerminalView.tsx | 20 +- frontend/vite.config.ts | 2 + 13 files changed, 320 insertions(+), 122 deletions(-) create mode 100644 backend/routers/hermes_ui.py create mode 100644 deploy/hermes-builtin-ui.service rename frontend/dist/assets/{GraphView--jt2Kx1K.js => GraphView-yMisqyGY.js} (99%) rename frontend/dist/assets/{index-BZIxDFd6.js => index-_1h7akwb.js} (76%) diff --git a/backend/app.py b/backend/app.py index 4cf1713..179ea82 100644 --- a/backend/app.py +++ b/backend/app.py @@ -19,7 +19,7 @@ from fastapi.staticfiles import StaticFiles from starlette.requests import Request from config import FRONTEND_DIST, VERSION -from routers import agent, connect, console, gateway_proxy, health, maintenance, memory, models, reminders as reminders_router, routing, system, voice +from routers import agent, connect, console, gateway_proxy, health, hermes_ui, maintenance, memory, models, reminders as reminders_router, routing, system, voice from services import memory as memory_svc, reminders, sentry, warmer # Zentrales Logging — Level via MC_LOG_LEVEL (INFO default). Eine Konfiguration @@ -90,6 +90,7 @@ app.include_router(reminders_router.router) # Erinnerungen/Routinen (A3) — fe app.include_router(gateway_proxy.router) # OpenAI-kompatibler /v1-Gateway (model:auto) app.include_router(maintenance.router) app.include_router(console.router) # Box-Konsole (ttyd) same-origin durchreichen — VOR dem SPA-Catch-all +app.include_router(hermes_ui.router) # Eingebaute Hermes-Web-GUI (hermes serve) same-origin unter /hermes-ui/ — VOR dem SPA-Catch-all # Prod: gebautes Frontend ausliefern (falls vorhanden). SPA-Fallback auf index.html. diff --git a/backend/config.py b/backend/config.py index ecf5ae8..4a66392 100644 --- a/backend/config.py +++ b/backend/config.py @@ -107,6 +107,14 @@ HERMES_TERMINAL_PATH = "/hermes-terminal/" BOX_CONSOLE_UPSTREAM = os.environ.get("MC_BOX_CONSOLE_UPSTREAM", "http://127.0.0.1:7682").rstrip("/") # Öffentlicher, gleicher-Ursprung-Pfad, unter dem MC2 die Konsole ausliefert (iframe-Ziel). BOX_CONSOLE_PATH = "/console/" +# Eingebaute Hermes-Web-GUI (`hermes serve`/`dashboard` — die richtige Agent-Oberfläche mit +# Threads/Tool-Calls, die auch die Electron-Desktop-App umhüllt). Bindet NUR an Loopback +# (127.0.0.1:9119, kein Login — LAN-Trust wie Terminal/Konsole) und wird von MC2 same-origin unter +# /hermes-ui/ durchgereicht (routers/hermes_ui.py). Anders als das ttyd-Terminal ist es eine volle +# SPA → das Bundle wird mit Vite-base=/hermes-ui/ gebaut, damit Assets/API/WS unter dem Präfix +# liegen; der Proxy streift /hermes-ui ab. Kein eigener Firewall-Port nötig. +HERMES_BUILTIN_UI_UPSTREAM = os.environ.get("MC_HERMES_BUILTIN_UI_UPSTREAM", "http://127.0.0.1:9119").rstrip("/") +HERMES_BUILTIN_UI_PATH = "/hermes-ui/" # GitHub-Repo für Update-Checks. HERMES_AGENT_REPO = os.environ.get("MC_HERMES_AGENT_REPO", "NousResearch/hermes-agent") HERMES_HOME = Path(os.path.expanduser(os.environ.get("HERMES_HOME", "~/.hermes"))) diff --git a/backend/routers/hermes_ui.py b/backend/routers/hermes_ui.py new file mode 100644 index 0000000..49f8cc5 --- /dev/null +++ b/backend/routers/hermes_ui.py @@ -0,0 +1,135 @@ +""" +Same-origin Reverse-Proxy für die EINGEBAUTE Hermes-Web-GUI (`hermes serve`/`dashboard`). + +Anders als das ttyd-Terminal (reiner Byte-Durchreicher, siehe routers/console.py) ist die +Hermes-GUI eine volle Single-Page-App: HTML + gehashte Assets + JSON-API + MEHRERE WebSockets +(/api/ws, /api/console, /api/pty, /api/events). Deshalb hier ein GENERISCHER Reverse-Proxy für +alles unter `/hermes-ui/*` (alle HTTP-Methoden + beliebige WebSockets). + +Der Backend-Server läuft NUR auf Loopback (127.0.0.1:9119, `hermes serve --skip-build`, kein +Login — gleiches LAN-Trust-Modell wie Konsole/Terminal) und wird über den ohnehin offenen +MC2-Port (9001) same-origin durchgereicht → keine eigene Firewall-Freigabe, kein CORS. + +Damit die absoluten Pfade der SPA (`/assets`, `/api`, `/api/ws`) nicht mit MC2s eigenen (`/assets`, +`/api`) kollidieren, wird das Hermes-Bundle mit Vite-`base=/hermes-ui/` gebaut (deploy.sh) — dann +liegen ALLE seine Pfade unter `/hermes-ui/`. Dieser Proxy streift das Präfix ab und leitet an +`:9119/...` weiter. +""" + +import asyncio +import logging +import re + +import httpx +import websockets +from fastapi import APIRouter, Request, WebSocket +from starlette.responses import RedirectResponse, Response + +from config import HERMES_BUILTIN_UI_UPSTREAM + +log = logging.getLogger(__name__) +router = APIRouter() + +_BASE = "hermes-ui" + +# Hop-by-hop- + Kodierungs-Header, die ein Proxy nicht 1:1 weiterreichen darf (Länge/Encoding +# rechnet Starlette neu; httpx liefert bereits dekodierten Body). +_DROP = { + "connection", "keep-alive", "proxy-authenticate", "proxy-authorization", "te", "trailers", + "transfer-encoding", "upgrade", "content-encoding", "content-length", "host", +} + + +@router.websocket(f"/{_BASE}/{{path:path}}") +async def _proxy_ws(ws: WebSocket, path: str) -> None: + """Beliebige WebSocket unter /hermes-ui/* (z. B. /hermes-ui/api/ws) an :9119 durchreichen.""" + ws_upstream = HERMES_BUILTIN_UI_UPSTREAM.replace("http://", "ws://").replace("https://", "wss://") + query = ws.url.query + target = f"{ws_upstream}/{path}" + (f"?{query}" if query else "") + await ws.accept() + try: + async with websockets.connect( + target, open_timeout=10, max_size=None, ping_interval=None, + ) as up: + async def c2u() -> None: + while True: + msg = await ws.receive() + if msg.get("type") == "websocket.disconnect": + return + if (t := msg.get("text")) is not None: + await up.send(t) + elif (b := msg.get("bytes")) is not None: + await up.send(b) + + async def u2c() -> None: + async for m in up: + if isinstance(m, (bytes, bytearray)): + await ws.send_bytes(bytes(m)) + else: + await ws.send_text(m) + + _done, pending = await asyncio.wait( + [asyncio.create_task(c2u()), asyncio.create_task(u2c())], + return_when=asyncio.FIRST_COMPLETED, + ) + for task in pending: + task.cancel() + except Exception: + log.debug("hermes-ui ws-proxy (%s) beendet/fehlgeschlagen", path, exc_info=True) + finally: + try: + await ws.close() + except Exception: + pass + + +# Die SPA liest ihren API/WS-Basis-Pfad zur Laufzeit aus `window.__HERMES_BASE_PATH__` (nf() im +# Bundle). `hermes serve` injiziert diese Zuweisung selbst ans Ende von (Wert leer, weil es +# auf Root läuft) — dessen Wert überschreiben wir auf /hermes-ui, sonst setzt die GUI ihre /api-Calls +# auf MC2s eigenen /api-Namensraum (SPA-Fallback = HTML) ab. Die Assets liegen bereits per +# Vite-base=/hermes-ui/ richtig. MC2 macht die Ersetzung → überlebt Hermes-Updates, ohne die gebaute +# index.html patchen zu müssen. Fällt die Server-Injektion je weg, setzen wir sie ersatzweise selbst. +_BASE_PATH_RE = re.compile(rb'window\.__HERMES_BASE_PATH__\s*=\s*"[^"]*"') +_BASE_PATH_SET = b'window.__HERMES_BASE_PATH__="/' + _BASE.encode() + b'"' +_HEAD_INJECT = b"" + + +async def _proxy_http(request: Request, path: str = "") -> Response: + upstream = f"{HERMES_BUILTIN_UI_UPSTREAM}/{path}" + fwd_headers = {k: v for k, v in request.headers.items() if k.lower() not in _DROP} + # Upstream unkomprimiert anfordern: sonst greift die HTML-Injektion nicht und die + # content-encoding-Header würden nicht zum (bereits dekodierten) Body passen. + fwd_headers["accept-encoding"] = "identity" + try: + async with httpx.AsyncClient(timeout=30.0, follow_redirects=False) as c: + r = await c.request( + request.method, upstream, + headers=fwd_headers, params=request.query_params, content=await request.body(), + ) + except httpx.HTTPError as exc: + log.debug("hermes-ui http-proxy (%s) nicht erreichbar: %s", path, exc) + return Response( + content=b"Hermes-WebUI (hermes serve) nicht erreichbar.", + status_code=502, media_type="text/plain", + ) + body = r.content + if "text/html" in r.headers.get("content-type", "").lower(): + if _BASE_PATH_RE.search(body): + body = _BASE_PATH_RE.sub(_BASE_PATH_SET, body) + elif b"" in body: + body = body.replace(b"", _HEAD_INJECT, 1) + resp_headers = {k: v for k, v in r.headers.items() if k.lower() not in _DROP} + return Response(content=body, status_code=r.status_code, headers=resp_headers) + + +@router.get(f"/{_BASE}") +async def _root_redirect() -> RedirectResponse: + # Ohne Schrägstrich → auf /hermes-ui/ umleiten (die SPA erwartet den Präfix mit Slash). + return RedirectResponse(url=f"/{_BASE}/") + + +router.add_api_route( + f"/{_BASE}/{{path:path}}", _proxy_http, + methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], + name="hermes_ui_proxy", +) diff --git a/backend/services/agent.py b/backend/services/agent.py index b882e9b..cce55b8 100644 --- a/backend/services/agent.py +++ b/backend/services/agent.py @@ -12,7 +12,8 @@ import httpx import psutil from config import (HERMES_TERMINAL_UPSTREAM, HERMES_TERMINAL_PATH, BOX_CONSOLE_UPSTREAM, - BOX_CONSOLE_PATH, HERMES_API_URL, HERMES_HOME, PC_EXECUTOR_URL) + BOX_CONSOLE_PATH, HERMES_BUILTIN_UI_UPSTREAM, HERMES_BUILTIN_UI_PATH, + HERMES_API_URL, HERMES_HOME, PC_EXECUTOR_URL) log = logging.getLogger(__name__) @@ -144,10 +145,14 @@ def agent_status() -> dict: "terminal_url": HERMES_TERMINAL_PATH, # Box-Konsole (ttyd → Login-Shell): same-origin über MC2 geproxyt (/console/). "box_console_url": BOX_CONSOLE_PATH, + # Eingebaute Hermes-Web-GUI (hermes serve): same-origin über MC2 geproxyt (/hermes-ui/). + "hermes_ui_url": HERMES_BUILTIN_UI_PATH, "gateway_reachable": _reach(HERMES_API_URL, "/health"), # Erreichbarkeit der lokalen ttyd-Upstreams (Loopback, je base-path). "terminal_reachable": _reach(HERMES_TERMINAL_UPSTREAM, "/hermes-terminal/"), "box_console_reachable": _reach(BOX_CONSOLE_UPSTREAM, "/console/"), + # Erreichbarkeit der eingebauten Hermes-GUI (Loopback :9119). + "hermes_ui_reachable": _reach(HERMES_BUILTIN_UI_UPSTREAM, "/"), "home_exists": home.exists(), "brain_model": brain_model, # Best-effort: welche Verdrahtung lokal sichtbar ist (auf der Box aussagekräftig). diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 315be69..6098bbf 100644 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -86,12 +86,29 @@ cp "$SRC/deploy/skills/wartung/SKILL.md" "$HOME/.hermes/skills/wartung/SKILL.md" # Orchestrator-Skill (Autonomie): Werkstatt verallgemeinert — zerlegen → an Worker delegieren → gaten. mkdir -p "$HOME/.hermes/skills/orchestrator" cp "$SRC/deploy/skills/orchestrator/SKILL.md" "$HOME/.hermes/skills/orchestrator/SKILL.md" +# Eingebaute Hermes-Web-GUI (`hermes serve`) für die Einbettung in MC2 (routers/hermes_ui.py → +# same-origin /hermes-ui/) vorbereiten: das SPA-Bundle mit Vite-base=/hermes-ui/ (neu) bauen, sonst +# kollidieren seine absoluten Pfade (/assets, /api) mit MC2s eigenen. Läuft auch nach jedem +# Hermes-Update mit → hält die Einbettung frisch. Best-effort + Build-zu-Temp-dann-Swap, damit ein +# Fehlschlag die laufende web_dist NICHT leert (emptyOutDir). +cp "$SRC/deploy/hermes-builtin-ui.service" "$HOME/.config/systemd/user/hermes-builtin-ui.service" +_HUI_WEB="$HOME/.hermes/hermes-agent/web" +_HUI_DIST="$HOME/.hermes/hermes-agent/hermes_cli/web_dist" +if [ -d "$_HUI_WEB" ] && [ -x "$HOME/.hermes/node/bin/npx" ]; then + if ( cd "$_HUI_WEB" && PATH="$HOME/.hermes/node/bin:$PATH" npx --no-install vite build \ + --base=/hermes-ui/ --outDir /tmp/hermes-ui-build --emptyOutDir ) >/tmp/hermes-ui-build.log 2>&1; then + rm -rf "$_HUI_DIST" && cp -r /tmp/hermes-ui-build "$_HUI_DIST" && echo "Hermes-GUI (base=/hermes-ui/) gebaut." + else + echo "WARN: Hermes-GUI-Build fehlgeschlagen (siehe /tmp/hermes-ui-build.log) — bestehende web_dist bleibt." + fi +fi systemctl --user daemon-reload systemctl --user enable mission-control-2 >/dev/null 2>&1 || true systemctl --user enable hermes-terminal >/dev/null 2>&1 || true systemctl --user enable box-console >/dev/null 2>&1 || true systemctl --user enable mem0-service >/dev/null 2>&1 || true systemctl --user enable voice-service >/dev/null 2>&1 || true +systemctl --user enable hermes-builtin-ui >/dev/null 2>&1 || true systemctl --user enable --now mc2-backup.timer >/dev/null 2>&1 || true systemctl --user enable --now mc2-autoupdate.timer >/dev/null 2>&1 || true systemctl --user enable --now mc2-selfsmoke.timer >/dev/null 2>&1 || true @@ -100,6 +117,8 @@ loginctl enable-linger "$USER" >/dev/null 2>&1 || true [ -x "$HOME/.mem0/venv/bin/python" ] && systemctl --user restart mem0-service 2>/dev/null || true # Voice-Sidecar (re)starten (best-effort; Erststart lädt das STT-Modell vor). [ -x "$HOME/.voice/venv/bin/python" ] && systemctl --user restart voice-service 2>/dev/null || true +# Eingebaute Hermes-Web-GUI (Loopback :9119) (re)starten — MC2 bettet sie unter /hermes-ui/ ein. +systemctl --user restart hermes-builtin-ui 2>/dev/null || true systemctl --user restart mission-control-2 command -v ttyd >/dev/null 2>&1 && systemctl --user restart hermes-terminal 2>/dev/null || true command -v ttyd >/dev/null 2>&1 && systemctl --user restart box-console 2>/dev/null || true diff --git a/deploy/hermes-builtin-ui.service b/deploy/hermes-builtin-ui.service new file mode 100644 index 0000000..0e7dfc5 --- /dev/null +++ b/deploy/hermes-builtin-ui.service @@ -0,0 +1,21 @@ +[Unit] +Description=Hermes Built-in Web UI (`hermes serve` — Agent-Dashboard/Chat, Loopback only) +After=network-online.target +Wants=network-online.target + +[Service] +# Serviert die EINGEBAUTE Hermes-Web-GUI (die reiche Agent-Oberflaeche mit Threads/Tool-Calls, die +# auch die Electron-Desktop-App umhuellt) headless. +# SICHERHEIT: Bindet NUR an Loopback (127.0.0.1:9119) und laeuft hinter dem MC2-Reverse-Proxy +# (routers/hermes_ui.py → same-origin /hermes-ui/ auf dem offenen Port 9001) — KEINE eigene +# Firewall-Freigabe, KEIN Login (LAN-Trust wie Konsole/Terminal). --skip-build nutzt das von +# deploy.sh mit Vite-base=/hermes-ui/ vorgebaute web_dist, damit alle SPA-Pfade unter /hermes-ui/ +# liegen und der Proxy sie sauber durchreichen kann. +Type=simple +Environment=HERMES_HOME=%h/.hermes +ExecStart=%h/.hermes/hermes-agent/venv/bin/hermes serve --skip-build --host 127.0.0.1 --port 9119 +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=default.target diff --git a/frontend/dist/assets/GraphView--jt2Kx1K.js b/frontend/dist/assets/GraphView-yMisqyGY.js similarity index 99% rename from frontend/dist/assets/GraphView--jt2Kx1K.js rename to frontend/dist/assets/GraphView-yMisqyGY.js index e49d97e..94ffdcb 100644 --- a/frontend/dist/assets/GraphView--jt2Kx1K.js +++ b/frontend/dist/assets/GraphView-yMisqyGY.js @@ -1,4 +1,4 @@ -import{g as bi,r as ce,j as H,R as rr,S as nr,a as Ut,T as ar}from"./index-BZIxDFd6.js";var et={exports:{}},zt;function or(){if(zt)return et.exports;zt=1;var n=typeof Reflect=="object"?Reflect:null,i=n&&typeof n.apply=="function"?n.apply:function(b,R,A){return Function.prototype.apply.call(b,R,A)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(b){return Object.getOwnPropertyNames(b).concat(Object.getOwnPropertySymbols(b))}:t=function(b){return Object.getOwnPropertyNames(b)};function e(p){console&&console.warn&&console.warn(p)}var r=Number.isNaN||function(b){return b!==b};function a(){a.init.call(this)}et.exports=a,et.exports.once=D,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof p)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(p){if(typeof p!="number"||p<0||r(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");o=p}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(b){if(typeof b!="number"||b<0||r(b))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+b+".");return this._maxListeners=b,this};function u(p){return p._maxListeners===void 0?a.defaultMaxListeners:p._maxListeners}a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(b){for(var R=[],A=1;A0&&(P=R[0]),P instanceof Error)throw P;var V=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw V.context=P,V}var z=F[b];if(z===void 0)return!1;if(typeof z=="function")i(z,this,R);else for(var g=z.length,K=y(z,g),A=0;A0&&P.length>G&&!P.warned){P.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=p,V.type=b,V.count=P.length,e(V)}return p}a.prototype.addListener=function(b,R){return h(this,b,R,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(b,R){return h(this,b,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(p,b,R){var A={fired:!1,wrapFn:void 0,target:p,type:b,listener:R},G=d.bind(A);return G.listener=R,A.wrapFn=G,G}a.prototype.once=function(b,R){return s(R),this.on(b,l(this,b,R)),this},a.prototype.prependOnceListener=function(b,R){return s(R),this.prependListener(b,l(this,b,R)),this},a.prototype.removeListener=function(b,R){var A,G,F,P,V;if(s(R),G=this._events,G===void 0)return this;if(A=G[b],A===void 0)return this;if(A===R||A.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete G[b],G.removeListener&&this.emit("removeListener",b,A.listener||R));else if(typeof A!="function"){for(F=-1,P=A.length-1;P>=0;P--)if(A[P]===R||A[P].listener===R){V=A[P].listener,F=P;break}if(F<0)return this;F===0?A.shift():w(A,F),A.length===1&&(G[b]=A[0]),G.removeListener!==void 0&&this.emit("removeListener",b,V||R)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(b){var R,A,G;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[b]),this;if(arguments.length===0){var F=Object.keys(A),P;for(G=0;G=0;G--)this.removeListener(b,R[G]);return this};function f(p,b,R){var A=p._events;if(A===void 0)return[];var G=A[b];return G===void 0?[]:typeof G=="function"?R?[G.listener||G]:[G]:R?T(G):y(G,G.length)}a.prototype.listeners=function(b){return f(this,b,!0)},a.prototype.rawListeners=function(b){return f(this,b,!1)},a.listenerCount=function(p,b){return typeof p.listenerCount=="function"?p.listenerCount(b):c.call(p,b)},a.prototype.listenerCount=c;function c(p){var b=this._events;if(b!==void 0){var R=b[p];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(p,b){for(var R=new Array(b),A=0;An++}function me(){const n=arguments;let i=null,t=-1;return{[Symbol.iterator](){return this},next(){let e=null;do{if(i===null){if(t++,t>=n.length)return{done:!0};i=n[t][Symbol.iterator]()}if(e=i.next(),e.done){i=null;continue}break}while(!0);return e}}}function Le(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Lt extends Error{constructor(i){super(),this.name="GraphError",this.message=i}}class k extends Lt{constructor(i){super(i),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,k.prototype.constructor)}}class C extends Lt{constructor(i){super(i),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,C.prototype.constructor)}}class I extends Lt{constructor(i){super(i),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,I.prototype.constructor)}}function _i(n,i){this.key=n,this.attributes=i,this.clear()}_i.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ti(n,i){this.key=n,this.attributes=i,this.clear()}Ti.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Si(n,i){this.key=n,this.attributes=i,this.clear()}Si.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ge(n,i,t,e,r){this.key=i,this.attributes=r,this.undirected=n,this.source=t,this.target=e}Ge.prototype.attach=function(){let n="out",i="in";this.undirected&&(n=i="undirected");const t=this.source.key,e=this.target.key;this.source[n][e]=this,!(this.undirected&&t===e)&&(this.target[i][t]=this)};Ge.prototype.attachMulti=function(){let n="out",i="in";const t=this.source.key,e=this.target.key;this.undirected&&(n=i="undirected");const r=this.source[n],a=r[e];if(typeof a>"u"){r[e]=this,this.undirected&&t===e||(this.target[i][t]=this);return}a.previous=this,this.next=a,r[e]=this,this.target[i][t]=this};Ge.prototype.detach=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),delete this.source[t][i],delete this.target[e][n]};Ge.prototype.detachMulti=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][i],delete this.target[e][n]):(this.next.previous=void 0,this.source[t][i]=this.next,this.target[e][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Ri=0,Ai=1,hr=2,xi=3;function ye(n,i,t,e,r,a,o){let s,u,h,d;if(e=""+e,t===Ri){if(s=n._nodes.get(e),!s)throw new C(`Graph.${i}: could not find the "${e}" node in the graph.`);h=r,d=a}else if(t===xi){if(r=""+r,u=n._edges.get(r),!u)throw new C(`Graph.${i}: could not find the "${r}" edge in the graph.`);const l=u.source.key,f=u.target.key;if(e===l)s=u.target;else if(e===f)s=u.source;else throw new C(`Graph.${i}: the "${e}" node is not attached to the "${r}" edge (${l}, ${f}).`);h=a,d=o}else{if(u=n._edges.get(e),!u)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`);t===Ai?s=u.source:s=u.target,h=r,d=a}return[s,h,d]}function dr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes[s]}}function lr(n,i,t){n.prototype[i]=function(e,r){const[a]=ye(this,i,t,e,r);return a.attributes}}function cr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes.hasOwnProperty(s)}}function fr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);return s.attributes[u]=h,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function gr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);if(typeof h!="function")throw new k(`Graph.${i}: updater should be a function.`);const d=s.attributes,l=h(d[u]);return d[u]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function pr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return delete o.attributes[s],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:s}),this}}function vr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return o.attributes=s,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function mr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(o.attributes,s),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:s}),this}}function yr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(typeof s!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return o.attributes=s(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const br=[{name:n=>`get${n}Attribute`,attacher:dr},{name:n=>`get${n}Attributes`,attacher:lr},{name:n=>`has${n}Attribute`,attacher:cr},{name:n=>`set${n}Attribute`,attacher:fr},{name:n=>`update${n}Attribute`,attacher:gr},{name:n=>`remove${n}Attribute`,attacher:pr},{name:n=>`replace${n}Attributes`,attacher:vr},{name:n=>`merge${n}Attributes`,attacher:mr},{name:n=>`update${n}Attributes`,attacher:yr}];function wr(n){br.forEach(function({name:i,attacher:t}){t(n,i("Node"),Ri),t(n,i("Source"),Ai),t(n,i("Target"),hr),t(n,i("Opposite"),xi)})}function Er(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]}}function _r(n,i,t){n.prototype[i]=function(e){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+e,o=""+arguments[1];if(r=oe(this,a,o,t),!r)throw new C(`Graph.${i}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,r=this._edges.get(e),!r)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Tr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes.hasOwnProperty(r)}}function Sr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return o.attributes[r]=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Rr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof a!="function")throw new k(`Graph.${i}: updater should be a function.`);return o.attributes[r]=a(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Ar(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return delete a.attributes[r],this.emit("edgeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:r}),this}}function xr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return a.attributes=r,this.emit("edgeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function Cr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(a.attributes,r),this.emit("edgeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:r}),this}}function kr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof r!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return a.attributes=r(a.attributes),this.emit("edgeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const Dr=[{name:n=>`get${n}Attribute`,attacher:Er},{name:n=>`get${n}Attributes`,attacher:_r},{name:n=>`has${n}Attribute`,attacher:Tr},{name:n=>`set${n}Attribute`,attacher:Sr},{name:n=>`update${n}Attribute`,attacher:Rr},{name:n=>`remove${n}Attribute`,attacher:Ar},{name:n=>`replace${n}Attributes`,attacher:xr},{name:n=>`merge${n}Attributes`,attacher:Cr},{name:n=>`update${n}Attributes`,attacher:kr}];function Lr(n){Dr.forEach(function({name:i,attacher:t}){t(n,i("Edge"),"mixed"),t(n,i("DirectedEdge"),"directed"),t(n,i("UndirectedEdge"),"undirected")})}const Gr=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Fr(n,i,t,e){let r=!1;for(const a in i){if(a===e)continue;const o=i[a];if(r=t(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),n&&r)return o.key}}function Nr(n,i,t,e){let r,a,o,s=!1;for(const u in i)if(u!==e){r=i[u];do{if(a=r.source,o=r.target,s=t(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected),n&&s)return r.key;r=r.next}while(r!==void 0)}}function lt(n,i){const t=Object.keys(n),e=t.length;let r,a=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(a>=e)return{done:!0};const o=t[a++];if(o===i){r=void 0;continue}r=n[o]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function Pr(n,i,t,e){const r=i[t];if(!r)return;const a=r.source,o=r.target;if(e(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected)&&n)return r.key}function Ir(n,i,t,e){let r=i[t];if(!r)return;let a=!1;do{if(a=e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),n&&a)return r.key;r=r.next}while(r!==void 0)}function ct(n,i){let t=n[i];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let e=!1;return{[Symbol.iterator](){return this},next(){return e===!0?{done:!0}:(e=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Or(n,i){if(n.size===0)return[];if(i==="mixed"||i===n.type)return Array.from(n._edges.keys());const t=i==="undirected"?n.undirectedSize:n.directedSize,e=new Array(t),r=i==="undirected",a=n._edges.values();let o=0,s,u;for(;s=a.next(),s.done!==!0;)u=s.value,u.undirected===r&&(e[o++]=u.key);return e}function Ci(n,i,t,e){if(i.size===0)return;const r=t!=="mixed"&&t!==i.type,a=t==="undirected";let o,s,u=!1;const h=i._edges.values();for(;o=h.next(),o.done!==!0;){if(s=o.value,r&&s.undirected!==a)continue;const{key:d,attributes:l,source:f,target:c}=s;if(u=e(d,l,f.key,c.key,f.attributes,c.attributes,s.undirected),n&&u)return d}}function Ur(n,i){if(n.size===0)return Le();const t=i!=="mixed"&&i!==n.type,e=i==="undirected",r=n._edges.values();return{[Symbol.iterator](){return this},next(){let a,o;for(;;){if(a=r.next(),a.done)return a;if(o=a.value,!(t&&o.undirected!==e))break}return{value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected},done:!1}}}}function Gt(n,i,t,e,r,a){const o=i?Nr:Fr;let s;if(t!=="undirected"&&(e!=="out"&&(s=o(n,r.in,a),n&&s)||e!=="in"&&(s=o(n,r.out,a,e?void 0:r.key),n&&s))||t!=="directed"&&(s=o(n,r.undirected,a),n&&s))return s}function zr(n,i,t,e){const r=[];return Gt(!1,n,i,t,e,function(a){r.push(a)}),r}function $r(n,i,t){let e=Le();return n!=="undirected"&&(i!=="out"&&typeof t.in<"u"&&(e=me(e,lt(t.in))),i!=="in"&&typeof t.out<"u"&&(e=me(e,lt(t.out,i?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(e=me(e,lt(t.undirected))),e}function Ft(n,i,t,e,r,a,o){const s=t?Ir:Pr;let u;if(i!=="undirected"&&(typeof r.in<"u"&&e!=="out"&&(u=s(n,r.in,a,o),n&&u)||typeof r.out<"u"&&e!=="in"&&(e||r.key!==a)&&(u=s(n,r.out,a,o),n&&u))||i!=="directed"&&typeof r.undirected<"u"&&(u=s(n,r.undirected,a,o),n&&u))return u}function Br(n,i,t,e,r){const a=[];return Ft(!1,n,i,t,e,r,function(o){a.push(o)}),a}function Mr(n,i,t,e){let r=Le();return n!=="undirected"&&(typeof t.in<"u"&&i!=="out"&&e in t.in&&(r=me(r,ct(t.in,e))),typeof t.out<"u"&&i!=="in"&&e in t.out&&(i||t.key!==e)&&(r=me(r,ct(t.out,e)))),n!=="directed"&&typeof t.undirected<"u"&&e in t.undirected&&(r=me(r,ct(t.undirected,e))),r}function Hr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a,o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];if(!arguments.length)return Or(this,e);if(arguments.length===1){a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return zr(this.multi,e==="mixed"?this.type:e,r,s)}if(arguments.length===2){a=""+a,o=""+o;const s=this._nodes.get(a);if(!s)throw new C(`Graph.${t}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new C(`Graph.${t}: could not find the "${o}" target node in the graph.`);return Br(e,this.multi,r,s,o)}throw new k(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Wr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d,l){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){if(arguments.length===1)return l=h,Ci(!1,this,e,l);if(arguments.length===2){h=""+h,l=d;const f=this._nodes.get(h);if(typeof f>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);return Gt(!1,this.multi,e==="mixed"?this.type:e,r,f,l)}if(arguments.length===3){h=""+h,d=""+d;const f=this._nodes.get(h);if(!f)throw new C(`Graph.${a}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(d))throw new C(`Graph.${a}: could not find the "${d}" target node in the graph.`);return Ft(!1,e,this.multi,r,f,d,l)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop();let l;if(h.length===0){let f=0;e!=="directed"&&(f+=this.undirectedSize),e!=="undirected"&&(f+=this.directedSize),l=new Array(f);let c=0;h.push((y,w,T,D,m,S,p)=>{l[c++]=d(y,w,T,D,m,S,p)})}else l=[],h.push((f,c,y,w,T,D,m)=>{l.push(d(f,c,y,w,T,D,m))});return this[a].apply(this,h),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop(),l=[];return h.push((f,c,y,w,T,D,m)=>{d(f,c,y,w,T,D,m)&&l.push(f)}),this[a].apply(this,h),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new k(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d,l;h.length===2?(d=h[0],l=h[1],h=[]):h.length===3?(d=h[1],l=h[2],h=[h[0]]):h.length===4&&(d=h[2],l=h[3],h=[h[0],h[1]]);let f=l;return h.push((c,y,w,T,D,m,S)=>{f=d(f,c,y,w,T,D,m,S)}),this[a].apply(this,h),f}}function jr(n,i){const{name:t,type:e,direction:r}=i,a="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(u,h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return!1;if(arguments.length===1)return d=u,Ci(!0,this,e,d);if(arguments.length===2){u=""+u,d=h;const l=this._nodes.get(u);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${u}" node in the graph.`);return Gt(!0,this.multi,e==="mixed"?this.type:e,r,l,d)}if(arguments.length===3){u=""+u,h=""+h;const l=this._nodes.get(u);if(!l)throw new C(`Graph.${a}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(h))throw new C(`Graph.${a}: could not find the "${h}" target node in the graph.`);return Ft(!0,e,this.multi,r,l,h,d)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>h(l,f,c,y,w,T,D)),!!this[a].apply(this,u)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>!h(l,f,c,y,w,T,D)),!this[a].apply(this,u)}}function Vr(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o,s){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();if(!arguments.length)return Ur(this,e);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return $r(e,r,u)}if(arguments.length===2){o=""+o,s=""+s;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new C(`Graph.${a}: could not find the "${s}" target node in the graph.`);return Mr(e,r,u,s)}throw new k(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function qr(n){Gr.forEach(i=>{Hr(n,i),Wr(n,i),jr(n,i),Vr(n,i)})}const Kr=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ut(){this.A=null,this.B=null}ut.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};ut.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function Oe(n,i,t,e,r){for(const a in e){const o=e[a],s=o.source,u=o.target,h=s===t?u:s;if(i&&i.has(h.key))continue;const d=r(h.key,h.attributes);if(n&&d)return h.key}}function Nt(n,i,t,e,r){if(i!=="mixed"){if(i==="undirected")return Oe(n,null,e,e.undirected,r);if(typeof t=="string")return Oe(n,null,e,e[t],r)}const a=new ut;let o;if(i!=="undirected"){if(t!=="out"){if(o=Oe(n,null,e,e.in,r),n&&o)return o;a.wrap(e.in)}if(t!=="in"){if(o=Oe(n,a,e,e.out,r),n&&o)return o;a.wrap(e.out)}}if(i!=="directed"&&(o=Oe(n,a,e,e.undirected,r),n&&o))return o}function Yr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof i=="string")return Object.keys(t[i])}const e=[];return Nt(!1,n,i,t,function(r){e.push(r)}),e}function Ue(n,i,t){const e=Object.keys(t),r=e.length;let a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=r)return n&&n.wrap(t),{done:!0};const s=t[e[a++]],u=s.source,h=s.target;if(o=u===i?h:u,n&&n.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Zr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Ue(null,t,t.undirected);if(typeof i=="string")return Ue(null,t,t[i])}let e=Le();const r=new ut;return n!=="undirected"&&(i!=="out"&&(e=me(e,Ue(r,t,t.in))),i!=="in"&&(e=me(e,Ue(r,t,t.out)))),n!=="directed"&&(e=me(e,Ue(r,t,t.undirected))),e}function Xr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return Yr(e==="mixed"?this.type:e,r,o)}}function Jr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);Nt(!1,e==="mixed"?this.type:e,r,l,d)};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(h,d){const l=[];return this[a](h,(f,c)=>{l.push(d(f,c))}),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(h,d){const l=[];return this[a](h,(f,c)=>{d(f,c)&&l.push(f)}),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(h,d,l){if(arguments.length<3)throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f=l;return this[a](h,(c,y)=>{f=d(f,c,y)}),f}}function Qr(n,i){const{name:t,type:e,direction:r}=i,a=t[0].toUpperCase()+t.slice(1,-1),o="find"+a;n.prototype[o]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${o}: could not find the "${h}" node in the graph.`);return Nt(!0,e==="mixed"?this.type:e,r,l,d)};const s="some"+a;n.prototype[s]=function(h,d){return!!this[o](h,d)};const u="every"+a;n.prototype[u]=function(h,d){return!this[o](h,(f,c)=>!d(f,c))}}function en(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return Zr(e==="mixed"?this.type:e,r,s)}}function tn(n){Kr.forEach(i=>{Xr(n,i),Jr(n,i),Qr(n,i),en(n,i)})}function tt(n,i,t,e,r){const a=e._nodes.values(),o=e.type;let s,u,h,d,l,f;for(;s=a.next(),s.done!==!0;){let c=!1;if(u=s.value,o!=="undirected"){d=u.out;for(h in d){l=d[h];do f=l.target,c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}if(o!=="directed"){d=u.undirected;for(h in d)if(!(i&&u.key>h)){l=d[h];do f=l.target,f.key!==h&&(f=l.source),c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}t&&!c&&r(u.key,null,u.attributes,null,null,null,null)}}function rn(n,i){const t={key:n};return Ei(i.attributes)||(t.attributes=Z({},i.attributes)),t}function nn(n,i,t){const e={key:i,source:t.source.key,target:t.target.key};return Ei(t.attributes)||(e.attributes=Z({},t.attributes)),n==="mixed"&&t.undirected&&(e.undirected=!0),e}function an(n){if(!J(n))throw new k('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new k("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function on(n){if(!J(n))throw new k('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new k("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new k("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new k("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const sn=ur(),un=new Set(["directed","undirected","mixed"]),Bt=new Set(["domain","_events","_eventsCount","_maxListeners"]),hn=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],dn={allowSelfLoops:!0,multi:!1,type:"mixed"};function ln(n,i,t){if(t&&!J(t))throw new k(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(i=""+i,t=t||{},n._nodes.has(i))throw new I(`Graph.addNode: the "${i}" node already exist in the graph.`);const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function Mt(n,i,t){const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function ki(n,i,t,e,r,a,o,s){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`);if(a=""+a,o=""+o,s=s||{},!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=n._nodes.get(a),h=n._nodes.get(o);if(!u)throw new C(`Graph.${i}: source node "${a}" not found.`);if(!h)throw new C(`Graph.${i}: target node "${o}" not found.`);const d={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);if(!n.multi&&(e?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new I(`Graph.${i}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const l=new Ge(e,r,u,h,s);n._edges.set(r,l);const f=a===o;return e?(u.undirectedDegree++,h.undirectedDegree++,f&&(u.undirectedLoops++,n._undirectedSelfLoopCount++)):(u.outDegree++,h.inDegree++,f&&(u.directedLoops++,n._directedSelfLoopCount++)),n.multi?l.attachMulti():l.attach(),e?n._undirectedSize++:n._directedSize++,d.key=r,n.emit("edgeAdded",d),r}function cn(n,i,t,e,r,a,o,s,u){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(u){if(typeof s!="function")throw new k(`Graph.${i}: invalid updater function. Expecting a function but got "${s}"`)}else if(!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`)}a=""+a,o=""+o;let h;if(u&&(h=s,s=void 0),!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=n._nodes.get(a),l=n._nodes.get(o),f,c;if(!t&&(f=n._edges.get(r),f)){if((f.source.key!==a||f.target.key!==o)&&(!e||f.source.key!==o||f.target.key!==a))throw new I(`Graph.${i}: inconsistency detected when attempting to merge the "${r}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);c=f}if(!c&&!n.multi&&d&&(c=e?d.undirected[o]:d.out[o]),c){const m=[c.key,!1,!1,!1];if(u?!h:!s)return m;if(u){const S=c.attributes;c.attributes=h(S),n.emit("edgeAttributesUpdated",{type:"replace",key:c.key,attributes:c.attributes})}else Z(c.attributes,s),n.emit("edgeAttributesUpdated",{type:"merge",key:c.key,attributes:c.attributes,data:s});return m}s=s||{},u&&h&&(s=h(s));const y={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);let w=!1,T=!1;d||(d=Mt(n,a,{}),w=!0,a===o&&(l=d,T=!0)),l||(l=Mt(n,o,{}),T=!0),f=new Ge(e,r,d,l,s),n._edges.set(r,f);const D=a===o;return e?(d.undirectedDegree++,l.undirectedDegree++,D&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,l.inDegree++,D&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?f.attachMulti():f.attach(),e?n._undirectedSize++:n._directedSize++,y.key=r,n.emit("edgeAdded",y),[r,!0,w,T]}function xe(n,i){n._edges.delete(i.key);const{source:t,target:e,attributes:r}=i,a=i.undirected,o=t===e;a?(t.undirectedDegree--,e.undirectedDegree--,o&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,e.inDegree--,o&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?i.detachMulti():i.detach(),a?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:i.key,attributes:r,source:t.key,target:e.key,undirected:a})}class j extends wi.EventEmitter{constructor(i){if(super(),i=Z({},dn,i),typeof i.multi!="boolean")throw new k(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${i.multi}".`);if(!un.has(i.type))throw new k(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${i.type}".`);if(typeof i.allowSelfLoops!="boolean")throw new k(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${i.allowSelfLoops}".`);const t=i.type==="mixed"?_i:i.type==="directed"?Ti:Si;ae(this,"NodeDataClass",t);const e="geid_"+sn()+"_";let r=0;const a=()=>{let o;do o=e+r++;while(this._edges.has(o));return o};ae(this,"_attributes",{}),ae(this,"_nodes",new Map),ae(this,"_edges",new Map),ae(this,"_directedSize",0),ae(this,"_undirectedSize",0),ae(this,"_directedSelfLoopCount",0),ae(this,"_undirectedSelfLoopCount",0),ae(this,"_edgeKeyGenerator",a),ae(this,"_options",i),Bt.forEach(o=>ae(this,o,this[o])),he(this,"order",()=>this._nodes.size),he(this,"size",()=>this._edges.size),he(this,"directedSize",()=>this._directedSize),he(this,"undirectedSize",()=>this._undirectedSize),he(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),he(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),he(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),he(this,"multi",this._options.multi),he(this,"type",this._options.type),he(this,"allowSelfLoops",this._options.allowSelfLoops),he(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(i){return this._nodes.has(""+i)}hasDirectedEdge(i,t){if(this.type==="undirected")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&!r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.out.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(i,t){if(this.type==="directed")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(i,t){if(arguments.length===1){const e=""+i;return this._edges.has(e)}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?typeof e.out<"u"&&e.out.hasOwnProperty(t)||typeof e.undirected<"u"&&e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(i,t){if(this.type==="undirected")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.directedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||void 0;if(r)return r.key}undirectedEdge(i,t){if(this.type==="directed")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.undirectedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=e.undirected&&e.undirected[t]||void 0;if(r)return r.key}edge(i,t){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.edge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||e.undirected&&e.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areDirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in||t in e.out}areOutNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.out}areInNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in}areUndirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areUndirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="directed"?!1:t in e.undirected}areNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&(t in e.in||t in e.out)||this.type!=="directed"&&t in e.undirected}areInboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.in||this.type!=="directed"&&t in e.undirected}areOutboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.out||this.type!=="directed"&&t in e.undirected}inDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegree: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree),e}outboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.outDegree),e}degree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree),e}inDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree,r+=t.directedLoops),e-r}outboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.outDegree,r+=t.directedLoops),e-r}degreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree,r+=t.directedLoops*2),e-r}source(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.source: could not find the "${i}" edge in the graph.`);return t.source.key}target(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.target: could not find the "${i}" edge in the graph.`);return t.target.key}extremities(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.extremities: could not find the "${i}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(i,t){i=""+i,t=""+t;const e=this._edges.get(t);if(!e)throw new C(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=e.source.key,a=e.target.key;if(i===r)return a;if(i===a)return r;throw new C(`Graph.opposite: the "${i}" node is not attached to the "${t}" edge (${r}, ${a}).`)}hasExtremity(i,t){i=""+i,t=""+t;const e=this._edges.get(i);if(!e)throw new C(`Graph.hasExtremity: could not find the "${i}" edge in the graph.`);return e.source.key===t||e.target.key===t}isUndirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isUndirected: could not find the "${i}" edge in the graph.`);return t.undirected}isDirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isDirected: could not find the "${i}" edge in the graph.`);return!t.undirected}isSelfLoop(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isSelfLoop: could not find the "${i}" edge in the graph.`);return t.source===t.target}addNode(i,t){return ln(this,i,t).key}mergeNode(i,t){if(t&&!J(t))throw new k(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);i=""+i,t=t||{};let e=this._nodes.get(i);return e?(t&&(Z(e.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:i,attributes:e.attributes,data:t})),[i,!1]):(e=new this.NodeDataClass(i,t),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:t}),[i,!0])}updateNode(i,t){if(t&&typeof t!="function")throw new k(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);i=""+i;let e=this._nodes.get(i);if(e){if(t){const a=e.attributes;e.attributes=t(a),this.emit("nodeAttributesUpdated",{type:"replace",key:i,attributes:e.attributes})}return[i,!1]}const r=t?t({}):{};return e=new this.NodeDataClass(i,r),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:r}),[i,!0]}dropNode(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.dropNode: could not find the "${i}" node in the graph.`);let e;if(this.type!=="undirected"){for(const r in t.out){e=t.out[r];do xe(this,e),e=e.next;while(e)}for(const r in t.in){e=t.in[r];do xe(this,e),e=e.next;while(e)}}if(this.type!=="directed")for(const r in t.undirected){e=t.undirected[r];do xe(this,e),e=e.next;while(e)}this._nodes.delete(i),this.emit("nodeDropped",{key:i,attributes:t.attributes})}dropEdge(i){let t;if(arguments.length>1){const e=""+arguments[0],r=""+arguments[1];if(t=oe(this,e,r,this.type),!t)throw new C(`Graph.dropEdge: could not find the "${e}" -> "${r}" edge in the graph.`)}else if(i=""+i,t=this._edges.get(i),!t)throw new C(`Graph.dropEdge: could not find the "${i}" edge in the graph.`);return xe(this,t),this}dropDirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");i=""+i,t=""+t;const e=oe(this,i,t,"directed");if(!e)throw new C(`Graph.dropDirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}dropUndirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const e=oe(this,i,t,"undirected");if(!e)throw new C(`Graph.dropUndirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const i=this._nodes.values();let t;for(;t=i.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(i){return this._attributes[i]}getAttributes(){return this._attributes}hasAttribute(i){return this._attributes.hasOwnProperty(i)}setAttribute(i,t){return this._attributes[i]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}updateAttribute(i,t){if(typeof t!="function")throw new k("Graph.updateAttribute: updater should be a function.");const e=this._attributes[i];return this._attributes[i]=t(e),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}removeAttribute(i){return delete this._attributes[i],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:i}),this}replaceAttributes(i){if(!J(i))throw new k("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=i,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(i){if(!J(i))throw new k("Graph.mergeAttributes: provided attributes are not a plain object.");return Z(this._attributes,i),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:i}),this}updateAttributes(i){if(typeof i!="function")throw new k("Graph.updateAttributes: provided updater is not a function.");return this._attributes=i(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._nodes.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,a.attributes=i(a.key,a.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._edges.values();let r,a,o,s;for(;r=e.next(),r.done!==!0;)a=r.value,o=a.source,s=a.target,a.attributes=i(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntry: expecting a callback.");tt(!1,!1,!1,this,i)}forEachAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!1,!0,this,i)}forEachAssymetricAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");tt(!1,!0,!1,this,i)}forEachAssymetricAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!0,!0,this,i)}nodes(){return Array.from(this._nodes.keys())}forEachNode(i){if(typeof i!="function")throw new k("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)}findNode(i){if(typeof i!="function")throw new k("Graph.findNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return r.key}mapNodes(i){if(typeof i!="function")throw new k("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let e,r;const a=new Array(this.order);let o=0;for(;e=t.next(),e.done!==!0;)r=e.value,a[o++]=i(r.key,r.attributes);return a}someNode(i){if(typeof i!="function")throw new k("Graph.someNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return!0;return!1}everyNode(i){if(typeof i!="function")throw new k("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,!i(r.key,r.attributes))return!1;return!0}filterNodes(i){if(typeof i!="function")throw new k("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let e,r;const a=[];for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)&&a.push(r.key);return a}reduceNodes(i,t){if(typeof i!="function")throw new k("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new k("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let e=t;const r=this._nodes.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,e=i(e,o.key,o.attributes);return e}nodeEntries(){const i=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=i.next();if(t.done)return t;const e=t.value;return{value:{node:e.key,attributes:e.attributes},done:!1}}}}export(){const i=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,a)=>{i[t++]=rn(a,r)});const e=new Array(this._edges.size);return t=0,this._edges.forEach((r,a)=>{e[t++]=nn(this.type,a,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:i,edges:e}}import(i,t=!1){if(i instanceof j)return i.forEachNode((u,h)=>{t?this.mergeNode(u,h):this.addNode(u,h)}),i.forEachEdge((u,h,d,l,f,c,y)=>{t?y?this.mergeUndirectedEdgeWithKey(u,d,l,h):this.mergeDirectedEdgeWithKey(u,d,l,h):y?this.addUndirectedEdgeWithKey(u,d,l,h):this.addDirectedEdgeWithKey(u,d,l,h)}),this;if(!J(i))throw new k("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(i.attributes){if(!J(i.attributes))throw new k("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(i.attributes):this.replaceAttributes(i.attributes)}let e,r,a,o,s;if(i.nodes){if(a=i.nodes,!Array.isArray(a))throw new k("Graph.import: invalid nodes. Expecting an array.");for(e=0,r=a.length;e{const a=Z({},e.attributes);e=new t.NodeDataClass(r,a),t._nodes.set(r,e)}),t}copy(i){if(i=i||{},typeof i.type=="string"&&i.type!==this.type&&i.type!=="mixed")throw new I(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${i.type}" because this would mean losing information about the current graph.`);if(typeof i.multi=="boolean"&&i.multi!==this.multi&&i.multi!==!0)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof i.allowSelfLoops=="boolean"&&i.allowSelfLoops!==this.allowSelfLoops&&i.allowSelfLoops!==!0)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(i),e=this._edges.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,ki(t,"copy",!1,a.undirected,a.key,a.source.key,a.target.key,Z({},a.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const i={};this._nodes.forEach((a,o)=>{i[o]=a.attributes});const t={},e={};this._edges.forEach((a,o)=>{const s=a.undirected?"--":"->";let u="",h=a.source.key,d=a.target.key,l;a.undirected&&h>d&&(l=h,h=d,d=l);const f=`(${h})${s}(${d})`;o.startsWith("geid_")?this.multi&&(typeof e[f]>"u"?e[f]=0:e[f]++,u+=`${e[f]}. `):u+=`[${o}]: `,u+=f,t[u]=a.attributes});const r={};for(const a in this)this.hasOwnProperty(a)&&!Bt.has(a)&&typeof this[a]!="function"&&typeof a!="symbol"&&(r[a]=this[a]);return r.attributes=this._attributes,r.nodes=i,r.edges=t,ae(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(j.prototype[Symbol.for("nodejs.util.inspect.custom")]=j.prototype.inspect);hn.forEach(n=>{["add","merge","update"].forEach(i=>{const t=n.name(i),e=i==="add"?ki:cn;n.generateKey?j.prototype[t]=function(r,a,o){return e(this,t,!0,(n.type||this.type)==="undirected",null,r,a,o,i==="update")}:j.prototype[t]=function(r,a,o,s){return e(this,t,!1,(n.type||this.type)==="undirected",r,a,o,s,i==="update")}})});wr(j);Lr(j);qr(j);tn(j);class Di extends j{constructor(i){const t=Z({type:"directed"},i);if("multi"in t&&t.multi!==!1)throw new k("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new k('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Li extends j{constructor(i){const t=Z({type:"undirected"},i);if("multi"in t&&t.multi!==!1)throw new k("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new k('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Gi extends j{constructor(i){const t=Z({multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class Fi extends j{constructor(i){const t=Z({type:"directed",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new k('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Ni extends j{constructor(i){const t=Z({type:"undirected",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new k('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Fe(n){n.from=function(i,t){const e=Z({},i.options,t),r=new n(e);return r.import(i),r}}Fe(j);Fe(Di);Fe(Li);Fe(Gi);Fe(Fi);Fe(Ni);j.Graph=j;j.DirectedGraph=Di;j.UndirectedGraph=Li;j.MultiGraph=Gi;j.MultiDirectedGraph=Fi;j.MultiUndirectedGraph=Ni;j.InvalidArgumentsGraphError=k;j.NotFoundGraphError=C;j.UsageGraphError=I;var ft,Ht;function Pi(){return Ht||(Ht=1,ft=function(i){return i!==null&&typeof i=="object"&&typeof i.addUndirectedEdgeWithKey=="function"&&typeof i.dropNode=="function"&&typeof i.multi=="boolean"}),ft}var ze={},Wt;function fn(){if(Wt)return ze;Wt=1;function n(e){return typeof e!="number"||isNaN(e)?1:e}function i(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getNodeAttributes(d))},a.fromEntry=function(h,d){return s(d)}):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){return o(e(d,h.getNodeAttributes(d)))},a.fromEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u),a}function t(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getEdgeAttributes(d))},a.fromEntry=function(h,d){return s(d)},a.fromPartialEntry=a.fromEntry,a.fromMinimalEntry=a.fromEntry):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){var l=h.extremities(d);return o(e(d,h.getEdgeAttributes(d),l[0],l[1],h.getNodeAttributes(l[0]),h.getNodeAttributes(l[1]),h.isUndirected(d)))},a.fromEntry=function(h,d,l,f,c,y,w){return o(e(h,d,l,f,c,y,w))},a.fromPartialEntry=function(h,d,l,f){return o(e(h,d,l,f))},a.fromMinimalEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u,a.fromMinimalEntry=u),a}return ze.createNodeValueGetter=i,ze.createEdgeValueGetter=t,ze.createEdgeWeightGetter=function(e){return t(e,n)},ze}var gt,jt;function gn(){if(jt)return gt;jt=1;var n=0,i=1,t=2,e=3,r=4,a=5,o=6,s=7,u=8,h=9,d=0,l=1,f=2,c=0,y=1,w=2,T=3,D=4,m=5,S=6,p=7,b=8,R=3,A=10,G=3,F=9,P=10;return gt=function(z,g,K){var te,x,v,$,W,X,ie,Y,N,Ne,re=g.length,tr=K.length,Pe=z.adjustSizes,ir=z.barnesHutTheta*z.barnesHutTheta,qe,q,B,M,fe,U,O,E=[];for(v=0;vYe?(Ee-=(Ke-Ye)/2,Re=Ee+Ke):(we-=(Ye-Ke)/2,Se=we+Ye),E[0+c]=-1,E[0+y]=(we+Se)/2,E[0+w]=(Ee+Re)/2,E[0+T]=Math.max(Se-we,Re-Ee),E[0+D]=-1,E[0+m]=-1,E[0+S]=0,E[0+p]=0,E[0+b]=0,te=1,v=0;v=0){g[v+n]=0)if(U=Math.pow(g[v+n]-E[x+p],2)+Math.pow(g[v+i]-E[x+b],2),Ne=E[x+T],4*Ne*Ne/U0?(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*E[x+S]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O),x=E[x+D],x<0)break;continue}else{x=E[x+m];continue}else{if(X=E[x+c],X>=0&&X!==v&&(B=g[v+n]-g[X+n],M=g[v+i]-g[X+i],U=B*B+M*M,Pe===!0?U>0?(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*g[X+o]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O)),x=E[x+D],x<0)break;continue}else for(q=z.scalingRatio,$=0;$0?(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O):U<0&&(O=100*q*g[$+o]*g[W+o],g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O)):(U=Math.sqrt(B*B+M*M),U>0&&(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O));for(N=z.gravity/z.scalingRatio,q=z.scalingRatio,v=0;v0&&(O=q*g[v+o]*N):U>0&&(O=q*g[v+o]*N/U),g[v+t]-=B*O,g[v+e]-=M*O;for(q=1*(z.outboundAttractionDistribution?qe:1),ie=0;ie0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?U>0&&(O=-q*fe/g[$+o]):U>0&&(O=-q*fe)):(U=Math.sqrt(Math.pow(B,2)+Math.pow(M,2)),z.linLogMode?z.outboundAttractionDistribution?U>0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?(U=1,O=-q*fe/g[$+o]):(U=1,O=-q*fe)),U>0&&(g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O);var Ze,Ie,Xe,_e,Je,Qe;if(Pe===!0)for(v=0;vP&&(g[v+t]=g[v+t]*P/Ze,g[v+e]=g[v+e]*P/Ze),Ie=g[v+o]*Math.sqrt((g[v+r]-g[v+t])*(g[v+r]-g[v+t])+(g[v+a]-g[v+e])*(g[v+a]-g[v+e])),Xe=Math.sqrt((g[v+r]+g[v+t])*(g[v+r]+g[v+t])+(g[v+a]+g[v+e])*(g[v+a]+g[v+e]))/2,_e=.1*Math.log(1+Xe)/(1+Math.sqrt(Ie)),Je=g[v+n]+g[v+t]*(_e/z.slowDown),g[v+n]=Je,Qe=g[v+i]+g[v+e]*(_e/z.slowDown),g[v+i]=Qe);else for(v=0;v=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ge.graphToByteArrays=function(t,e){var r=t.order,a=t.size,o={},s,u=new Float32Array(r*n),h=new Float32Array(a*i);return s=0,t.forEachNode(function(d,l){o[d]=s,u[s]=l.x,u[s+1]=l.y,u[s+2]=0,u[s+3]=0,u[s+4]=0,u[s+5]=0,u[s+6]=1,u[s+7]=1,u[s+8]=l.size||1,u[s+9]=l.fixed?1:0,s+=n}),s=0,t.forEachEdge(function(d,l,f,c,y,w,T){var D=o[f],m=o[c],S=e(d,l,f,c,y,w,T);u[D+6]+=S,u[m+6]+=S,h[s]=D,h[s+1]=m,h[s+2]=S,s+=i}),{nodes:u,edges:h}},ge.assignLayoutChanges=function(t,e,r){var a=0;t.updateEachNodeAttributes(function(o,s){return s.x=e[a],s.y=e[a+1],a+=n,r?r(o,s):s})},ge.readGraphPositions=function(t,e){var r=0;t.forEachNode(function(a,o){e[r]=o.x,e[r+1]=o.y,r+=n})},ge.collectLayoutChanges=function(t,e,r){for(var a=t.nodes(),o={},s=0,u=0,h=e.length;s2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var s=a.bind(null,!1);return s.assign=a.bind(null,!0),s.inferSettings=o,vt=s,vt}var yn=mn();const it=bi(yn);function bn(n,i){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,i);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function je(n){var i=bn(n,"string");return typeof i=="symbol"?i:i+""}function Q(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}function Yt(n,i){for(var t=0;tn.length)&&(i=n.length);for(var t=0,e=Array(i);t0&&(P=R[0]),P instanceof Error)throw P;var V=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw V.context=P,V}var z=F[b];if(z===void 0)return!1;if(typeof z=="function")i(z,this,R);else for(var g=z.length,K=y(z,g),A=0;A0&&P.length>G&&!P.warned){P.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=p,V.type=b,V.count=P.length,e(V)}return p}a.prototype.addListener=function(b,R){return h(this,b,R,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(b,R){return h(this,b,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(p,b,R){var A={fired:!1,wrapFn:void 0,target:p,type:b,listener:R},G=d.bind(A);return G.listener=R,A.wrapFn=G,G}a.prototype.once=function(b,R){return s(R),this.on(b,l(this,b,R)),this},a.prototype.prependOnceListener=function(b,R){return s(R),this.prependListener(b,l(this,b,R)),this},a.prototype.removeListener=function(b,R){var A,G,F,P,V;if(s(R),G=this._events,G===void 0)return this;if(A=G[b],A===void 0)return this;if(A===R||A.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete G[b],G.removeListener&&this.emit("removeListener",b,A.listener||R));else if(typeof A!="function"){for(F=-1,P=A.length-1;P>=0;P--)if(A[P]===R||A[P].listener===R){V=A[P].listener,F=P;break}if(F<0)return this;F===0?A.shift():w(A,F),A.length===1&&(G[b]=A[0]),G.removeListener!==void 0&&this.emit("removeListener",b,V||R)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(b){var R,A,G;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[b]),this;if(arguments.length===0){var F=Object.keys(A),P;for(G=0;G=0;G--)this.removeListener(b,R[G]);return this};function f(p,b,R){var A=p._events;if(A===void 0)return[];var G=A[b];return G===void 0?[]:typeof G=="function"?R?[G.listener||G]:[G]:R?T(G):y(G,G.length)}a.prototype.listeners=function(b){return f(this,b,!0)},a.prototype.rawListeners=function(b){return f(this,b,!1)},a.listenerCount=function(p,b){return typeof p.listenerCount=="function"?p.listenerCount(b):c.call(p,b)},a.prototype.listenerCount=c;function c(p){var b=this._events;if(b!==void 0){var R=b[p];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(p,b){for(var R=new Array(b),A=0;An++}function me(){const n=arguments;let i=null,t=-1;return{[Symbol.iterator](){return this},next(){let e=null;do{if(i===null){if(t++,t>=n.length)return{done:!0};i=n[t][Symbol.iterator]()}if(e=i.next(),e.done){i=null;continue}break}while(!0);return e}}}function Le(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Lt extends Error{constructor(i){super(),this.name="GraphError",this.message=i}}class k extends Lt{constructor(i){super(i),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,k.prototype.constructor)}}class C extends Lt{constructor(i){super(i),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,C.prototype.constructor)}}class I extends Lt{constructor(i){super(i),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,I.prototype.constructor)}}function _i(n,i){this.key=n,this.attributes=i,this.clear()}_i.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ti(n,i){this.key=n,this.attributes=i,this.clear()}Ti.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Si(n,i){this.key=n,this.attributes=i,this.clear()}Si.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ge(n,i,t,e,r){this.key=i,this.attributes=r,this.undirected=n,this.source=t,this.target=e}Ge.prototype.attach=function(){let n="out",i="in";this.undirected&&(n=i="undirected");const t=this.source.key,e=this.target.key;this.source[n][e]=this,!(this.undirected&&t===e)&&(this.target[i][t]=this)};Ge.prototype.attachMulti=function(){let n="out",i="in";const t=this.source.key,e=this.target.key;this.undirected&&(n=i="undirected");const r=this.source[n],a=r[e];if(typeof a>"u"){r[e]=this,this.undirected&&t===e||(this.target[i][t]=this);return}a.previous=this,this.next=a,r[e]=this,this.target[i][t]=this};Ge.prototype.detach=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),delete this.source[t][i],delete this.target[e][n]};Ge.prototype.detachMulti=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][i],delete this.target[e][n]):(this.next.previous=void 0,this.source[t][i]=this.next,this.target[e][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Ri=0,Ai=1,hr=2,xi=3;function ye(n,i,t,e,r,a,o){let s,u,h,d;if(e=""+e,t===Ri){if(s=n._nodes.get(e),!s)throw new C(`Graph.${i}: could not find the "${e}" node in the graph.`);h=r,d=a}else if(t===xi){if(r=""+r,u=n._edges.get(r),!u)throw new C(`Graph.${i}: could not find the "${r}" edge in the graph.`);const l=u.source.key,f=u.target.key;if(e===l)s=u.target;else if(e===f)s=u.source;else throw new C(`Graph.${i}: the "${e}" node is not attached to the "${r}" edge (${l}, ${f}).`);h=a,d=o}else{if(u=n._edges.get(e),!u)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`);t===Ai?s=u.source:s=u.target,h=r,d=a}return[s,h,d]}function dr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes[s]}}function lr(n,i,t){n.prototype[i]=function(e,r){const[a]=ye(this,i,t,e,r);return a.attributes}}function cr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes.hasOwnProperty(s)}}function fr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);return s.attributes[u]=h,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function gr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);if(typeof h!="function")throw new k(`Graph.${i}: updater should be a function.`);const d=s.attributes,l=h(d[u]);return d[u]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function pr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return delete o.attributes[s],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:s}),this}}function vr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return o.attributes=s,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function mr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(o.attributes,s),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:s}),this}}function yr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(typeof s!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return o.attributes=s(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const br=[{name:n=>`get${n}Attribute`,attacher:dr},{name:n=>`get${n}Attributes`,attacher:lr},{name:n=>`has${n}Attribute`,attacher:cr},{name:n=>`set${n}Attribute`,attacher:fr},{name:n=>`update${n}Attribute`,attacher:gr},{name:n=>`remove${n}Attribute`,attacher:pr},{name:n=>`replace${n}Attributes`,attacher:vr},{name:n=>`merge${n}Attributes`,attacher:mr},{name:n=>`update${n}Attributes`,attacher:yr}];function wr(n){br.forEach(function({name:i,attacher:t}){t(n,i("Node"),Ri),t(n,i("Source"),Ai),t(n,i("Target"),hr),t(n,i("Opposite"),xi)})}function Er(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]}}function _r(n,i,t){n.prototype[i]=function(e){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+e,o=""+arguments[1];if(r=oe(this,a,o,t),!r)throw new C(`Graph.${i}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,r=this._edges.get(e),!r)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Tr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes.hasOwnProperty(r)}}function Sr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return o.attributes[r]=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Rr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof a!="function")throw new k(`Graph.${i}: updater should be a function.`);return o.attributes[r]=a(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Ar(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return delete a.attributes[r],this.emit("edgeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:r}),this}}function xr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return a.attributes=r,this.emit("edgeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function Cr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(a.attributes,r),this.emit("edgeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:r}),this}}function kr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof r!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return a.attributes=r(a.attributes),this.emit("edgeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const Dr=[{name:n=>`get${n}Attribute`,attacher:Er},{name:n=>`get${n}Attributes`,attacher:_r},{name:n=>`has${n}Attribute`,attacher:Tr},{name:n=>`set${n}Attribute`,attacher:Sr},{name:n=>`update${n}Attribute`,attacher:Rr},{name:n=>`remove${n}Attribute`,attacher:Ar},{name:n=>`replace${n}Attributes`,attacher:xr},{name:n=>`merge${n}Attributes`,attacher:Cr},{name:n=>`update${n}Attributes`,attacher:kr}];function Lr(n){Dr.forEach(function({name:i,attacher:t}){t(n,i("Edge"),"mixed"),t(n,i("DirectedEdge"),"directed"),t(n,i("UndirectedEdge"),"undirected")})}const Gr=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Fr(n,i,t,e){let r=!1;for(const a in i){if(a===e)continue;const o=i[a];if(r=t(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),n&&r)return o.key}}function Nr(n,i,t,e){let r,a,o,s=!1;for(const u in i)if(u!==e){r=i[u];do{if(a=r.source,o=r.target,s=t(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected),n&&s)return r.key;r=r.next}while(r!==void 0)}}function lt(n,i){const t=Object.keys(n),e=t.length;let r,a=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(a>=e)return{done:!0};const o=t[a++];if(o===i){r=void 0;continue}r=n[o]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function Pr(n,i,t,e){const r=i[t];if(!r)return;const a=r.source,o=r.target;if(e(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected)&&n)return r.key}function Ir(n,i,t,e){let r=i[t];if(!r)return;let a=!1;do{if(a=e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),n&&a)return r.key;r=r.next}while(r!==void 0)}function ct(n,i){let t=n[i];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let e=!1;return{[Symbol.iterator](){return this},next(){return e===!0?{done:!0}:(e=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Or(n,i){if(n.size===0)return[];if(i==="mixed"||i===n.type)return Array.from(n._edges.keys());const t=i==="undirected"?n.undirectedSize:n.directedSize,e=new Array(t),r=i==="undirected",a=n._edges.values();let o=0,s,u;for(;s=a.next(),s.done!==!0;)u=s.value,u.undirected===r&&(e[o++]=u.key);return e}function Ci(n,i,t,e){if(i.size===0)return;const r=t!=="mixed"&&t!==i.type,a=t==="undirected";let o,s,u=!1;const h=i._edges.values();for(;o=h.next(),o.done!==!0;){if(s=o.value,r&&s.undirected!==a)continue;const{key:d,attributes:l,source:f,target:c}=s;if(u=e(d,l,f.key,c.key,f.attributes,c.attributes,s.undirected),n&&u)return d}}function Ur(n,i){if(n.size===0)return Le();const t=i!=="mixed"&&i!==n.type,e=i==="undirected",r=n._edges.values();return{[Symbol.iterator](){return this},next(){let a,o;for(;;){if(a=r.next(),a.done)return a;if(o=a.value,!(t&&o.undirected!==e))break}return{value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected},done:!1}}}}function Gt(n,i,t,e,r,a){const o=i?Nr:Fr;let s;if(t!=="undirected"&&(e!=="out"&&(s=o(n,r.in,a),n&&s)||e!=="in"&&(s=o(n,r.out,a,e?void 0:r.key),n&&s))||t!=="directed"&&(s=o(n,r.undirected,a),n&&s))return s}function zr(n,i,t,e){const r=[];return Gt(!1,n,i,t,e,function(a){r.push(a)}),r}function $r(n,i,t){let e=Le();return n!=="undirected"&&(i!=="out"&&typeof t.in<"u"&&(e=me(e,lt(t.in))),i!=="in"&&typeof t.out<"u"&&(e=me(e,lt(t.out,i?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(e=me(e,lt(t.undirected))),e}function Ft(n,i,t,e,r,a,o){const s=t?Ir:Pr;let u;if(i!=="undirected"&&(typeof r.in<"u"&&e!=="out"&&(u=s(n,r.in,a,o),n&&u)||typeof r.out<"u"&&e!=="in"&&(e||r.key!==a)&&(u=s(n,r.out,a,o),n&&u))||i!=="directed"&&typeof r.undirected<"u"&&(u=s(n,r.undirected,a,o),n&&u))return u}function Br(n,i,t,e,r){const a=[];return Ft(!1,n,i,t,e,r,function(o){a.push(o)}),a}function Mr(n,i,t,e){let r=Le();return n!=="undirected"&&(typeof t.in<"u"&&i!=="out"&&e in t.in&&(r=me(r,ct(t.in,e))),typeof t.out<"u"&&i!=="in"&&e in t.out&&(i||t.key!==e)&&(r=me(r,ct(t.out,e)))),n!=="directed"&&typeof t.undirected<"u"&&e in t.undirected&&(r=me(r,ct(t.undirected,e))),r}function Hr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a,o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];if(!arguments.length)return Or(this,e);if(arguments.length===1){a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return zr(this.multi,e==="mixed"?this.type:e,r,s)}if(arguments.length===2){a=""+a,o=""+o;const s=this._nodes.get(a);if(!s)throw new C(`Graph.${t}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new C(`Graph.${t}: could not find the "${o}" target node in the graph.`);return Br(e,this.multi,r,s,o)}throw new k(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Wr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d,l){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){if(arguments.length===1)return l=h,Ci(!1,this,e,l);if(arguments.length===2){h=""+h,l=d;const f=this._nodes.get(h);if(typeof f>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);return Gt(!1,this.multi,e==="mixed"?this.type:e,r,f,l)}if(arguments.length===3){h=""+h,d=""+d;const f=this._nodes.get(h);if(!f)throw new C(`Graph.${a}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(d))throw new C(`Graph.${a}: could not find the "${d}" target node in the graph.`);return Ft(!1,e,this.multi,r,f,d,l)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop();let l;if(h.length===0){let f=0;e!=="directed"&&(f+=this.undirectedSize),e!=="undirected"&&(f+=this.directedSize),l=new Array(f);let c=0;h.push((y,w,T,D,m,S,p)=>{l[c++]=d(y,w,T,D,m,S,p)})}else l=[],h.push((f,c,y,w,T,D,m)=>{l.push(d(f,c,y,w,T,D,m))});return this[a].apply(this,h),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop(),l=[];return h.push((f,c,y,w,T,D,m)=>{d(f,c,y,w,T,D,m)&&l.push(f)}),this[a].apply(this,h),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new k(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d,l;h.length===2?(d=h[0],l=h[1],h=[]):h.length===3?(d=h[1],l=h[2],h=[h[0]]):h.length===4&&(d=h[2],l=h[3],h=[h[0],h[1]]);let f=l;return h.push((c,y,w,T,D,m,S)=>{f=d(f,c,y,w,T,D,m,S)}),this[a].apply(this,h),f}}function jr(n,i){const{name:t,type:e,direction:r}=i,a="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(u,h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return!1;if(arguments.length===1)return d=u,Ci(!0,this,e,d);if(arguments.length===2){u=""+u,d=h;const l=this._nodes.get(u);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${u}" node in the graph.`);return Gt(!0,this.multi,e==="mixed"?this.type:e,r,l,d)}if(arguments.length===3){u=""+u,h=""+h;const l=this._nodes.get(u);if(!l)throw new C(`Graph.${a}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(h))throw new C(`Graph.${a}: could not find the "${h}" target node in the graph.`);return Ft(!0,e,this.multi,r,l,h,d)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>h(l,f,c,y,w,T,D)),!!this[a].apply(this,u)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>!h(l,f,c,y,w,T,D)),!this[a].apply(this,u)}}function Vr(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o,s){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();if(!arguments.length)return Ur(this,e);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return $r(e,r,u)}if(arguments.length===2){o=""+o,s=""+s;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new C(`Graph.${a}: could not find the "${s}" target node in the graph.`);return Mr(e,r,u,s)}throw new k(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function qr(n){Gr.forEach(i=>{Hr(n,i),Wr(n,i),jr(n,i),Vr(n,i)})}const Kr=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ut(){this.A=null,this.B=null}ut.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};ut.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function Oe(n,i,t,e,r){for(const a in e){const o=e[a],s=o.source,u=o.target,h=s===t?u:s;if(i&&i.has(h.key))continue;const d=r(h.key,h.attributes);if(n&&d)return h.key}}function Nt(n,i,t,e,r){if(i!=="mixed"){if(i==="undirected")return Oe(n,null,e,e.undirected,r);if(typeof t=="string")return Oe(n,null,e,e[t],r)}const a=new ut;let o;if(i!=="undirected"){if(t!=="out"){if(o=Oe(n,null,e,e.in,r),n&&o)return o;a.wrap(e.in)}if(t!=="in"){if(o=Oe(n,a,e,e.out,r),n&&o)return o;a.wrap(e.out)}}if(i!=="directed"&&(o=Oe(n,a,e,e.undirected,r),n&&o))return o}function Yr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof i=="string")return Object.keys(t[i])}const e=[];return Nt(!1,n,i,t,function(r){e.push(r)}),e}function Ue(n,i,t){const e=Object.keys(t),r=e.length;let a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=r)return n&&n.wrap(t),{done:!0};const s=t[e[a++]],u=s.source,h=s.target;if(o=u===i?h:u,n&&n.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Zr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Ue(null,t,t.undirected);if(typeof i=="string")return Ue(null,t,t[i])}let e=Le();const r=new ut;return n!=="undirected"&&(i!=="out"&&(e=me(e,Ue(r,t,t.in))),i!=="in"&&(e=me(e,Ue(r,t,t.out)))),n!=="directed"&&(e=me(e,Ue(r,t,t.undirected))),e}function Xr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return Yr(e==="mixed"?this.type:e,r,o)}}function Jr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);Nt(!1,e==="mixed"?this.type:e,r,l,d)};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(h,d){const l=[];return this[a](h,(f,c)=>{l.push(d(f,c))}),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(h,d){const l=[];return this[a](h,(f,c)=>{d(f,c)&&l.push(f)}),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(h,d,l){if(arguments.length<3)throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f=l;return this[a](h,(c,y)=>{f=d(f,c,y)}),f}}function Qr(n,i){const{name:t,type:e,direction:r}=i,a=t[0].toUpperCase()+t.slice(1,-1),o="find"+a;n.prototype[o]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${o}: could not find the "${h}" node in the graph.`);return Nt(!0,e==="mixed"?this.type:e,r,l,d)};const s="some"+a;n.prototype[s]=function(h,d){return!!this[o](h,d)};const u="every"+a;n.prototype[u]=function(h,d){return!this[o](h,(f,c)=>!d(f,c))}}function en(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return Zr(e==="mixed"?this.type:e,r,s)}}function tn(n){Kr.forEach(i=>{Xr(n,i),Jr(n,i),Qr(n,i),en(n,i)})}function tt(n,i,t,e,r){const a=e._nodes.values(),o=e.type;let s,u,h,d,l,f;for(;s=a.next(),s.done!==!0;){let c=!1;if(u=s.value,o!=="undirected"){d=u.out;for(h in d){l=d[h];do f=l.target,c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}if(o!=="directed"){d=u.undirected;for(h in d)if(!(i&&u.key>h)){l=d[h];do f=l.target,f.key!==h&&(f=l.source),c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}t&&!c&&r(u.key,null,u.attributes,null,null,null,null)}}function rn(n,i){const t={key:n};return Ei(i.attributes)||(t.attributes=Z({},i.attributes)),t}function nn(n,i,t){const e={key:i,source:t.source.key,target:t.target.key};return Ei(t.attributes)||(e.attributes=Z({},t.attributes)),n==="mixed"&&t.undirected&&(e.undirected=!0),e}function an(n){if(!J(n))throw new k('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new k("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function on(n){if(!J(n))throw new k('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new k("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new k("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new k("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const sn=ur(),un=new Set(["directed","undirected","mixed"]),Bt=new Set(["domain","_events","_eventsCount","_maxListeners"]),hn=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],dn={allowSelfLoops:!0,multi:!1,type:"mixed"};function ln(n,i,t){if(t&&!J(t))throw new k(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(i=""+i,t=t||{},n._nodes.has(i))throw new I(`Graph.addNode: the "${i}" node already exist in the graph.`);const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function Mt(n,i,t){const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function ki(n,i,t,e,r,a,o,s){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`);if(a=""+a,o=""+o,s=s||{},!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=n._nodes.get(a),h=n._nodes.get(o);if(!u)throw new C(`Graph.${i}: source node "${a}" not found.`);if(!h)throw new C(`Graph.${i}: target node "${o}" not found.`);const d={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);if(!n.multi&&(e?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new I(`Graph.${i}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const l=new Ge(e,r,u,h,s);n._edges.set(r,l);const f=a===o;return e?(u.undirectedDegree++,h.undirectedDegree++,f&&(u.undirectedLoops++,n._undirectedSelfLoopCount++)):(u.outDegree++,h.inDegree++,f&&(u.directedLoops++,n._directedSelfLoopCount++)),n.multi?l.attachMulti():l.attach(),e?n._undirectedSize++:n._directedSize++,d.key=r,n.emit("edgeAdded",d),r}function cn(n,i,t,e,r,a,o,s,u){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(u){if(typeof s!="function")throw new k(`Graph.${i}: invalid updater function. Expecting a function but got "${s}"`)}else if(!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`)}a=""+a,o=""+o;let h;if(u&&(h=s,s=void 0),!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=n._nodes.get(a),l=n._nodes.get(o),f,c;if(!t&&(f=n._edges.get(r),f)){if((f.source.key!==a||f.target.key!==o)&&(!e||f.source.key!==o||f.target.key!==a))throw new I(`Graph.${i}: inconsistency detected when attempting to merge the "${r}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);c=f}if(!c&&!n.multi&&d&&(c=e?d.undirected[o]:d.out[o]),c){const m=[c.key,!1,!1,!1];if(u?!h:!s)return m;if(u){const S=c.attributes;c.attributes=h(S),n.emit("edgeAttributesUpdated",{type:"replace",key:c.key,attributes:c.attributes})}else Z(c.attributes,s),n.emit("edgeAttributesUpdated",{type:"merge",key:c.key,attributes:c.attributes,data:s});return m}s=s||{},u&&h&&(s=h(s));const y={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);let w=!1,T=!1;d||(d=Mt(n,a,{}),w=!0,a===o&&(l=d,T=!0)),l||(l=Mt(n,o,{}),T=!0),f=new Ge(e,r,d,l,s),n._edges.set(r,f);const D=a===o;return e?(d.undirectedDegree++,l.undirectedDegree++,D&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,l.inDegree++,D&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?f.attachMulti():f.attach(),e?n._undirectedSize++:n._directedSize++,y.key=r,n.emit("edgeAdded",y),[r,!0,w,T]}function xe(n,i){n._edges.delete(i.key);const{source:t,target:e,attributes:r}=i,a=i.undirected,o=t===e;a?(t.undirectedDegree--,e.undirectedDegree--,o&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,e.inDegree--,o&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?i.detachMulti():i.detach(),a?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:i.key,attributes:r,source:t.key,target:e.key,undirected:a})}class j extends wi.EventEmitter{constructor(i){if(super(),i=Z({},dn,i),typeof i.multi!="boolean")throw new k(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${i.multi}".`);if(!un.has(i.type))throw new k(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${i.type}".`);if(typeof i.allowSelfLoops!="boolean")throw new k(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${i.allowSelfLoops}".`);const t=i.type==="mixed"?_i:i.type==="directed"?Ti:Si;ae(this,"NodeDataClass",t);const e="geid_"+sn()+"_";let r=0;const a=()=>{let o;do o=e+r++;while(this._edges.has(o));return o};ae(this,"_attributes",{}),ae(this,"_nodes",new Map),ae(this,"_edges",new Map),ae(this,"_directedSize",0),ae(this,"_undirectedSize",0),ae(this,"_directedSelfLoopCount",0),ae(this,"_undirectedSelfLoopCount",0),ae(this,"_edgeKeyGenerator",a),ae(this,"_options",i),Bt.forEach(o=>ae(this,o,this[o])),he(this,"order",()=>this._nodes.size),he(this,"size",()=>this._edges.size),he(this,"directedSize",()=>this._directedSize),he(this,"undirectedSize",()=>this._undirectedSize),he(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),he(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),he(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),he(this,"multi",this._options.multi),he(this,"type",this._options.type),he(this,"allowSelfLoops",this._options.allowSelfLoops),he(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(i){return this._nodes.has(""+i)}hasDirectedEdge(i,t){if(this.type==="undirected")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&!r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.out.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(i,t){if(this.type==="directed")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(i,t){if(arguments.length===1){const e=""+i;return this._edges.has(e)}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?typeof e.out<"u"&&e.out.hasOwnProperty(t)||typeof e.undirected<"u"&&e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(i,t){if(this.type==="undirected")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.directedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||void 0;if(r)return r.key}undirectedEdge(i,t){if(this.type==="directed")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.undirectedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=e.undirected&&e.undirected[t]||void 0;if(r)return r.key}edge(i,t){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.edge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||e.undirected&&e.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areDirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in||t in e.out}areOutNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.out}areInNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in}areUndirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areUndirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="directed"?!1:t in e.undirected}areNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&(t in e.in||t in e.out)||this.type!=="directed"&&t in e.undirected}areInboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.in||this.type!=="directed"&&t in e.undirected}areOutboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.out||this.type!=="directed"&&t in e.undirected}inDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegree: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree),e}outboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.outDegree),e}degree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree),e}inDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree,r+=t.directedLoops),e-r}outboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.outDegree,r+=t.directedLoops),e-r}degreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree,r+=t.directedLoops*2),e-r}source(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.source: could not find the "${i}" edge in the graph.`);return t.source.key}target(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.target: could not find the "${i}" edge in the graph.`);return t.target.key}extremities(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.extremities: could not find the "${i}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(i,t){i=""+i,t=""+t;const e=this._edges.get(t);if(!e)throw new C(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=e.source.key,a=e.target.key;if(i===r)return a;if(i===a)return r;throw new C(`Graph.opposite: the "${i}" node is not attached to the "${t}" edge (${r}, ${a}).`)}hasExtremity(i,t){i=""+i,t=""+t;const e=this._edges.get(i);if(!e)throw new C(`Graph.hasExtremity: could not find the "${i}" edge in the graph.`);return e.source.key===t||e.target.key===t}isUndirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isUndirected: could not find the "${i}" edge in the graph.`);return t.undirected}isDirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isDirected: could not find the "${i}" edge in the graph.`);return!t.undirected}isSelfLoop(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isSelfLoop: could not find the "${i}" edge in the graph.`);return t.source===t.target}addNode(i,t){return ln(this,i,t).key}mergeNode(i,t){if(t&&!J(t))throw new k(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);i=""+i,t=t||{};let e=this._nodes.get(i);return e?(t&&(Z(e.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:i,attributes:e.attributes,data:t})),[i,!1]):(e=new this.NodeDataClass(i,t),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:t}),[i,!0])}updateNode(i,t){if(t&&typeof t!="function")throw new k(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);i=""+i;let e=this._nodes.get(i);if(e){if(t){const a=e.attributes;e.attributes=t(a),this.emit("nodeAttributesUpdated",{type:"replace",key:i,attributes:e.attributes})}return[i,!1]}const r=t?t({}):{};return e=new this.NodeDataClass(i,r),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:r}),[i,!0]}dropNode(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.dropNode: could not find the "${i}" node in the graph.`);let e;if(this.type!=="undirected"){for(const r in t.out){e=t.out[r];do xe(this,e),e=e.next;while(e)}for(const r in t.in){e=t.in[r];do xe(this,e),e=e.next;while(e)}}if(this.type!=="directed")for(const r in t.undirected){e=t.undirected[r];do xe(this,e),e=e.next;while(e)}this._nodes.delete(i),this.emit("nodeDropped",{key:i,attributes:t.attributes})}dropEdge(i){let t;if(arguments.length>1){const e=""+arguments[0],r=""+arguments[1];if(t=oe(this,e,r,this.type),!t)throw new C(`Graph.dropEdge: could not find the "${e}" -> "${r}" edge in the graph.`)}else if(i=""+i,t=this._edges.get(i),!t)throw new C(`Graph.dropEdge: could not find the "${i}" edge in the graph.`);return xe(this,t),this}dropDirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");i=""+i,t=""+t;const e=oe(this,i,t,"directed");if(!e)throw new C(`Graph.dropDirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}dropUndirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const e=oe(this,i,t,"undirected");if(!e)throw new C(`Graph.dropUndirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const i=this._nodes.values();let t;for(;t=i.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(i){return this._attributes[i]}getAttributes(){return this._attributes}hasAttribute(i){return this._attributes.hasOwnProperty(i)}setAttribute(i,t){return this._attributes[i]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}updateAttribute(i,t){if(typeof t!="function")throw new k("Graph.updateAttribute: updater should be a function.");const e=this._attributes[i];return this._attributes[i]=t(e),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}removeAttribute(i){return delete this._attributes[i],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:i}),this}replaceAttributes(i){if(!J(i))throw new k("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=i,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(i){if(!J(i))throw new k("Graph.mergeAttributes: provided attributes are not a plain object.");return Z(this._attributes,i),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:i}),this}updateAttributes(i){if(typeof i!="function")throw new k("Graph.updateAttributes: provided updater is not a function.");return this._attributes=i(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._nodes.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,a.attributes=i(a.key,a.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._edges.values();let r,a,o,s;for(;r=e.next(),r.done!==!0;)a=r.value,o=a.source,s=a.target,a.attributes=i(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntry: expecting a callback.");tt(!1,!1,!1,this,i)}forEachAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!1,!0,this,i)}forEachAssymetricAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");tt(!1,!0,!1,this,i)}forEachAssymetricAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!0,!0,this,i)}nodes(){return Array.from(this._nodes.keys())}forEachNode(i){if(typeof i!="function")throw new k("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)}findNode(i){if(typeof i!="function")throw new k("Graph.findNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return r.key}mapNodes(i){if(typeof i!="function")throw new k("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let e,r;const a=new Array(this.order);let o=0;for(;e=t.next(),e.done!==!0;)r=e.value,a[o++]=i(r.key,r.attributes);return a}someNode(i){if(typeof i!="function")throw new k("Graph.someNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return!0;return!1}everyNode(i){if(typeof i!="function")throw new k("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,!i(r.key,r.attributes))return!1;return!0}filterNodes(i){if(typeof i!="function")throw new k("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let e,r;const a=[];for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)&&a.push(r.key);return a}reduceNodes(i,t){if(typeof i!="function")throw new k("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new k("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let e=t;const r=this._nodes.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,e=i(e,o.key,o.attributes);return e}nodeEntries(){const i=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=i.next();if(t.done)return t;const e=t.value;return{value:{node:e.key,attributes:e.attributes},done:!1}}}}export(){const i=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,a)=>{i[t++]=rn(a,r)});const e=new Array(this._edges.size);return t=0,this._edges.forEach((r,a)=>{e[t++]=nn(this.type,a,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:i,edges:e}}import(i,t=!1){if(i instanceof j)return i.forEachNode((u,h)=>{t?this.mergeNode(u,h):this.addNode(u,h)}),i.forEachEdge((u,h,d,l,f,c,y)=>{t?y?this.mergeUndirectedEdgeWithKey(u,d,l,h):this.mergeDirectedEdgeWithKey(u,d,l,h):y?this.addUndirectedEdgeWithKey(u,d,l,h):this.addDirectedEdgeWithKey(u,d,l,h)}),this;if(!J(i))throw new k("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(i.attributes){if(!J(i.attributes))throw new k("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(i.attributes):this.replaceAttributes(i.attributes)}let e,r,a,o,s;if(i.nodes){if(a=i.nodes,!Array.isArray(a))throw new k("Graph.import: invalid nodes. Expecting an array.");for(e=0,r=a.length;e{const a=Z({},e.attributes);e=new t.NodeDataClass(r,a),t._nodes.set(r,e)}),t}copy(i){if(i=i||{},typeof i.type=="string"&&i.type!==this.type&&i.type!=="mixed")throw new I(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${i.type}" because this would mean losing information about the current graph.`);if(typeof i.multi=="boolean"&&i.multi!==this.multi&&i.multi!==!0)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof i.allowSelfLoops=="boolean"&&i.allowSelfLoops!==this.allowSelfLoops&&i.allowSelfLoops!==!0)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(i),e=this._edges.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,ki(t,"copy",!1,a.undirected,a.key,a.source.key,a.target.key,Z({},a.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const i={};this._nodes.forEach((a,o)=>{i[o]=a.attributes});const t={},e={};this._edges.forEach((a,o)=>{const s=a.undirected?"--":"->";let u="",h=a.source.key,d=a.target.key,l;a.undirected&&h>d&&(l=h,h=d,d=l);const f=`(${h})${s}(${d})`;o.startsWith("geid_")?this.multi&&(typeof e[f]>"u"?e[f]=0:e[f]++,u+=`${e[f]}. `):u+=`[${o}]: `,u+=f,t[u]=a.attributes});const r={};for(const a in this)this.hasOwnProperty(a)&&!Bt.has(a)&&typeof this[a]!="function"&&typeof a!="symbol"&&(r[a]=this[a]);return r.attributes=this._attributes,r.nodes=i,r.edges=t,ae(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(j.prototype[Symbol.for("nodejs.util.inspect.custom")]=j.prototype.inspect);hn.forEach(n=>{["add","merge","update"].forEach(i=>{const t=n.name(i),e=i==="add"?ki:cn;n.generateKey?j.prototype[t]=function(r,a,o){return e(this,t,!0,(n.type||this.type)==="undirected",null,r,a,o,i==="update")}:j.prototype[t]=function(r,a,o,s){return e(this,t,!1,(n.type||this.type)==="undirected",r,a,o,s,i==="update")}})});wr(j);Lr(j);qr(j);tn(j);class Di extends j{constructor(i){const t=Z({type:"directed"},i);if("multi"in t&&t.multi!==!1)throw new k("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new k('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Li extends j{constructor(i){const t=Z({type:"undirected"},i);if("multi"in t&&t.multi!==!1)throw new k("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new k('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Gi extends j{constructor(i){const t=Z({multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class Fi extends j{constructor(i){const t=Z({type:"directed",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new k('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Ni extends j{constructor(i){const t=Z({type:"undirected",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new k('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Fe(n){n.from=function(i,t){const e=Z({},i.options,t),r=new n(e);return r.import(i),r}}Fe(j);Fe(Di);Fe(Li);Fe(Gi);Fe(Fi);Fe(Ni);j.Graph=j;j.DirectedGraph=Di;j.UndirectedGraph=Li;j.MultiGraph=Gi;j.MultiDirectedGraph=Fi;j.MultiUndirectedGraph=Ni;j.InvalidArgumentsGraphError=k;j.NotFoundGraphError=C;j.UsageGraphError=I;var ft,Ht;function Pi(){return Ht||(Ht=1,ft=function(i){return i!==null&&typeof i=="object"&&typeof i.addUndirectedEdgeWithKey=="function"&&typeof i.dropNode=="function"&&typeof i.multi=="boolean"}),ft}var ze={},Wt;function fn(){if(Wt)return ze;Wt=1;function n(e){return typeof e!="number"||isNaN(e)?1:e}function i(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getNodeAttributes(d))},a.fromEntry=function(h,d){return s(d)}):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){return o(e(d,h.getNodeAttributes(d)))},a.fromEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u),a}function t(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getEdgeAttributes(d))},a.fromEntry=function(h,d){return s(d)},a.fromPartialEntry=a.fromEntry,a.fromMinimalEntry=a.fromEntry):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){var l=h.extremities(d);return o(e(d,h.getEdgeAttributes(d),l[0],l[1],h.getNodeAttributes(l[0]),h.getNodeAttributes(l[1]),h.isUndirected(d)))},a.fromEntry=function(h,d,l,f,c,y,w){return o(e(h,d,l,f,c,y,w))},a.fromPartialEntry=function(h,d,l,f){return o(e(h,d,l,f))},a.fromMinimalEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u,a.fromMinimalEntry=u),a}return ze.createNodeValueGetter=i,ze.createEdgeValueGetter=t,ze.createEdgeWeightGetter=function(e){return t(e,n)},ze}var gt,jt;function gn(){if(jt)return gt;jt=1;var n=0,i=1,t=2,e=3,r=4,a=5,o=6,s=7,u=8,h=9,d=0,l=1,f=2,c=0,y=1,w=2,T=3,D=4,m=5,S=6,p=7,b=8,R=3,A=10,G=3,F=9,P=10;return gt=function(z,g,K){var te,x,v,$,W,X,ie,Y,N,Ne,re=g.length,tr=K.length,Pe=z.adjustSizes,ir=z.barnesHutTheta*z.barnesHutTheta,qe,q,B,M,fe,U,O,E=[];for(v=0;vYe?(Ee-=(Ke-Ye)/2,Re=Ee+Ke):(we-=(Ye-Ke)/2,Se=we+Ye),E[0+c]=-1,E[0+y]=(we+Se)/2,E[0+w]=(Ee+Re)/2,E[0+T]=Math.max(Se-we,Re-Ee),E[0+D]=-1,E[0+m]=-1,E[0+S]=0,E[0+p]=0,E[0+b]=0,te=1,v=0;v=0){g[v+n]=0)if(U=Math.pow(g[v+n]-E[x+p],2)+Math.pow(g[v+i]-E[x+b],2),Ne=E[x+T],4*Ne*Ne/U0?(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*E[x+S]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O),x=E[x+D],x<0)break;continue}else{x=E[x+m];continue}else{if(X=E[x+c],X>=0&&X!==v&&(B=g[v+n]-g[X+n],M=g[v+i]-g[X+i],U=B*B+M*M,Pe===!0?U>0?(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*g[X+o]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O)),x=E[x+D],x<0)break;continue}else for(q=z.scalingRatio,$=0;$0?(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O):U<0&&(O=100*q*g[$+o]*g[W+o],g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O)):(U=Math.sqrt(B*B+M*M),U>0&&(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O));for(N=z.gravity/z.scalingRatio,q=z.scalingRatio,v=0;v0&&(O=q*g[v+o]*N):U>0&&(O=q*g[v+o]*N/U),g[v+t]-=B*O,g[v+e]-=M*O;for(q=1*(z.outboundAttractionDistribution?qe:1),ie=0;ie0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?U>0&&(O=-q*fe/g[$+o]):U>0&&(O=-q*fe)):(U=Math.sqrt(Math.pow(B,2)+Math.pow(M,2)),z.linLogMode?z.outboundAttractionDistribution?U>0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?(U=1,O=-q*fe/g[$+o]):(U=1,O=-q*fe)),U>0&&(g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O);var Ze,Ie,Xe,_e,Je,Qe;if(Pe===!0)for(v=0;vP&&(g[v+t]=g[v+t]*P/Ze,g[v+e]=g[v+e]*P/Ze),Ie=g[v+o]*Math.sqrt((g[v+r]-g[v+t])*(g[v+r]-g[v+t])+(g[v+a]-g[v+e])*(g[v+a]-g[v+e])),Xe=Math.sqrt((g[v+r]+g[v+t])*(g[v+r]+g[v+t])+(g[v+a]+g[v+e])*(g[v+a]+g[v+e]))/2,_e=.1*Math.log(1+Xe)/(1+Math.sqrt(Ie)),Je=g[v+n]+g[v+t]*(_e/z.slowDown),g[v+n]=Je,Qe=g[v+i]+g[v+e]*(_e/z.slowDown),g[v+i]=Qe);else for(v=0;v=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ge.graphToByteArrays=function(t,e){var r=t.order,a=t.size,o={},s,u=new Float32Array(r*n),h=new Float32Array(a*i);return s=0,t.forEachNode(function(d,l){o[d]=s,u[s]=l.x,u[s+1]=l.y,u[s+2]=0,u[s+3]=0,u[s+4]=0,u[s+5]=0,u[s+6]=1,u[s+7]=1,u[s+8]=l.size||1,u[s+9]=l.fixed?1:0,s+=n}),s=0,t.forEachEdge(function(d,l,f,c,y,w,T){var D=o[f],m=o[c],S=e(d,l,f,c,y,w,T);u[D+6]+=S,u[m+6]+=S,h[s]=D,h[s+1]=m,h[s+2]=S,s+=i}),{nodes:u,edges:h}},ge.assignLayoutChanges=function(t,e,r){var a=0;t.updateEachNodeAttributes(function(o,s){return s.x=e[a],s.y=e[a+1],a+=n,r?r(o,s):s})},ge.readGraphPositions=function(t,e){var r=0;t.forEachNode(function(a,o){e[r]=o.x,e[r+1]=o.y,r+=n})},ge.collectLayoutChanges=function(t,e,r){for(var a=t.nodes(),o={},s=0,u=0,h=e.length;s2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var s=a.bind(null,!1);return s.assign=a.bind(null,!0),s.inferSettings=o,vt=s,vt}var yn=mn();const it=bi(yn);function bn(n,i){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,i);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function je(n){var i=bn(n,"string");return typeof i=="symbol"?i:i+""}function Q(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}function Yt(n,i){for(var t=0;tn.length)&&(i=n.length);for(var t=0,e=Array(i);t>>16,t=(n&65280)>>>8,e=n&255,r=255,a=zi(i,t,e,r);return bt[n]=a,a}function Zt(n,i,t,e){return t+(i<<8)+(n<<16)}function Xt(n,i,t,e,r,a){var o=Math.floor(t/a*r),s=Math.floor(n.drawingBufferHeight/a-e/a*r),u=new Uint8Array(4);n.bindFramebuffer(n.FRAMEBUFFER,i),n.readPixels(o,s,1,1,n.RGBA,n.UNSIGNED_BYTE,u);var h=De(u,4),d=h[0],l=h[1],f=h[2],c=h[3];return[d,l,f,c]}function _(n,i,t){return(i=je(i))in n?Object.defineProperty(n,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[i]=t,n}function Jt(n,i){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,e)}return t}function L(n){for(var i=1;i{throw TypeError(e)};var s3=(e,t,r)=>t in e?o3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Xo=(e,t,r)=>s3(e,typeof t!="symbol"?t+"":t,r),Qp=(e,t,r)=>t.has(e)||tw("Cannot "+r);var L=(e,t,r)=>(Qp(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?tw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),be=(e,t,r,n)=>(Qp(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),He=(e,t,r)=>(Qp(e,t,"access private method"),r);var yd=(e,t,r,n)=>({set _(i){be(e,t,i,r)},get _(){return L(e,t,n)}});function l3(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function b0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yp={exports:{}},Vl={},Xp={exports:{}},Fe={};/** +var o3=Object.defineProperty;var tw=e=>{throw TypeError(e)};var s3=(e,t,r)=>t in e?o3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Xo=(e,t,r)=>s3(e,typeof t!="symbol"?t+"":t,r),Qp=(e,t,r)=>t.has(e)||tw("Cannot "+r);var L=(e,t,r)=>(Qp(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?tw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),be=(e,t,r,n)=>(Qp(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),He=(e,t,r)=>(Qp(e,t,"access private method"),r);var vd=(e,t,r,n)=>({set _(i){be(e,t,i,r)},get _(){return L(e,t,n)}});function l3(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function b0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yp={exports:{}},Gl={},Xp={exports:{}},Fe={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var o3=Object.defineProperty;var tw=e=>{throw TypeError(e)};var s3=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var rw;function u3(){if(rw)return Fe;rw=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function S(I,M,H){this.props=I,this.context=M,this.refs=k,this.updater=H||b}S.prototype.isReactComponent={},S.prototype.setState=function(I,M){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,M,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function N(){}N.prototype=S.prototype;function E(I,M,H){this.props=I,this.context=M,this.refs=k,this.updater=H||b}var A=E.prototype=new N;A.constructor=E,j(A,S.prototype),A.isPureReactComponent=!0;var P=Array.isArray,_=Object.prototype.hasOwnProperty,O={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function B(I,M,H){var ie,J={},Z=null,ae=null;if(M!=null)for(ie in M.ref!==void 0&&(ae=M.ref),M.key!==void 0&&(Z=""+M.key),M)_.call(M,ie)&&!T.hasOwnProperty(ie)&&(J[ie]=M[ie]);var me=arguments.length-2;if(me===1)J.children=H;else if(1{throw TypeError(e)};var s3=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iw;function c3(){if(iw)return Vl;iw=1;var e=Vs(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(c,f,h){var m,g={},v=null,b=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(b=f.ref);for(m in f)n.call(f,m)&&!o.hasOwnProperty(m)&&(g[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)g[m]===void 0&&(g[m]=f[m]);return{$$typeof:t,type:c,key:v,ref:b,props:g,_owner:i.current}}return Vl.Fragment=r,Vl.jsx=u,Vl.jsxs=u,Vl}var aw;function d3(){return aw||(aw=1,Yp.exports=c3()),Yp.exports}var l=d3(),y=Vs();const w0=b0(y),ah=l3({__proto__:null,default:w0},[y]);var xd={},Zp={exports:{}},wr={},Jp={exports:{}},eg={};/** + */var iw;function c3(){if(iw)return Gl;iw=1;var e=Gs(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(c,f,h){var m,g={},v=null,b=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(b=f.ref);for(m in f)n.call(f,m)&&!o.hasOwnProperty(m)&&(g[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)g[m]===void 0&&(g[m]=f[m]);return{$$typeof:t,type:c,key:v,ref:b,props:g,_owner:i.current}}return Gl.Fragment=r,Gl.jsx=u,Gl.jsxs=u,Gl}var aw;function d3(){return aw||(aw=1,Yp.exports=c3()),Yp.exports}var l=d3(),y=Gs();const w0=b0(y),ah=l3({__proto__:null,default:w0},[y]);var yd={},Zp={exports:{}},wr={},Jp={exports:{}},eg={};/** * @license React * scheduler.production.min.js * @@ -30,14 +30,14 @@ var o3=Object.defineProperty;var tw=e=>{throw TypeError(e)};var s3=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lw;function m3(){if(lw)return wr;lw=1;var e=Vs(),t=h3();function r(a){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=1;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},g={};function v(a){return f.call(g,a)?!0:f.call(m,a)?!1:h.test(a)?g[a]=!0:(m[a]=!0,!1)}function b(a,s,d,p){if(d!==null&&d.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return p?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function j(a,s,d,p){if(s===null||typeof s>"u"||b(a,s,d,p))return!0;if(p)return!1;if(d!==null)switch(d.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(a,s,d,p,x,w,C){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=p,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=a,this.type=s,this.sanitizeURL=w,this.removeEmptyString=C}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){S[a]=new k(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var s=a[0];S[s]=new k(s,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){S[a]=new k(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){S[a]=new k(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){S[a]=new k(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){S[a]=new k(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){S[a]=new k(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){S[a]=new k(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){S[a]=new k(a,5,!1,a.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var s=a.replace(N,E);S[s]=new k(s,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var s=a.replace(N,E);S[s]=new k(s,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var s=a.replace(N,E);S[s]=new k(s,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){S[a]=new k(a,1,!1,a.toLowerCase(),null,!1,!1)}),S.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){S[a]=new k(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,s,d,p){var x=S.hasOwnProperty(s)?S[s]:null;(x!==null?x.type!==0:p||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},g={};function v(a){return f.call(g,a)?!0:f.call(m,a)?!1:h.test(a)?g[a]=!0:(m[a]=!0,!1)}function b(a,s,d,p){if(d!==null&&d.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return p?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function j(a,s,d,p){if(s===null||typeof s>"u"||b(a,s,d,p))return!0;if(p)return!1;if(d!==null)switch(d.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(a,s,d,p,x,w,C){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=p,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=a,this.type=s,this.sanitizeURL=w,this.removeEmptyString=C}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){S[a]=new k(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var s=a[0];S[s]=new k(s,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){S[a]=new k(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){S[a]=new k(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){S[a]=new k(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){S[a]=new k(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){S[a]=new k(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){S[a]=new k(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){S[a]=new k(a,5,!1,a.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var s=a.replace(N,E);S[s]=new k(s,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var s=a.replace(N,E);S[s]=new k(s,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var s=a.replace(N,E);S[s]=new k(s,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){S[a]=new k(a,1,!1,a.toLowerCase(),null,!1,!1)}),S.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){S[a]=new k(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,s,d,p){var x=S.hasOwnProperty(s)?S[s]:null;(x!==null?x.type!==0:p||!(2D||x[C]!==w[D]){var R=` -`+x[C].replace(" at new "," at ");return a.displayName&&R.includes("")&&(R=R.replace("",a.displayName)),R}while(1<=C&&0<=D);break}}}finally{H=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?M(a):""}function J(a){switch(a.tag){case 5:return M(a.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return a=ie(a.type,!1),a;case 11:return a=ie(a.type.render,!1),a;case 1:return a=ie(a.type,!0),a;default:return""}}function Z(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case O:return"Portal";case $:return"Profiler";case B:return"StrictMode";case ve:return"Suspense";case ue:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case Q:return(a.displayName||"Context")+".Consumer";case z:return(a._context.displayName||"Context")+".Provider";case U:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case pe:return s=a.displayName||null,s!==null?s:Z(a.type)||"Memo";case oe:s=a._payload,a=a._init;try{return Z(a(s))}catch{}}return null}function ae(a){var s=a.type;switch(a.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=s.render,a=a.displayName||a.name||"",s.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(s);case 8:return s===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function me(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ye(a){var s=re(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),p=""+a[s];if(!a.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,w=d.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return x.call(this)},set:function(C){p=""+C,w.call(this,C)}}),Object.defineProperty(a,s,{enumerable:d.enumerable}),{getValue:function(){return p},setValue:function(C){p=""+C},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Oe(a){a._valueTracker||(a._valueTracker=ye(a))}function de(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var d=s.getValue(),p="";return a&&(p=re(a)?a.checked?"true":"false":a.value),a=p,a!==d?(s.setValue(a),!0):!1}function Ze(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ue(a,s){var d=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??a._wrapperState.initialChecked})}function _e(a,s){var d=s.defaultValue==null?"":s.defaultValue,p=s.checked!=null?s.checked:s.defaultChecked;d=me(s.value!=null?s.value:d),a._wrapperState={initialChecked:p,initialValue:d,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function xt(a,s){s=s.checked,s!=null&&A(a,"checked",s,!1)}function Jt(a,s){xt(a,s);var d=me(s.value),p=s.type;if(d!=null)p==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+d):a.value!==""+d&&(a.value=""+d);else if(p==="submit"||p==="reset"){a.removeAttribute("value");return}s.hasOwnProperty("value")?Ne(a,s.type,d):s.hasOwnProperty("defaultValue")&&Ne(a,s.type,me(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(a.defaultChecked=!!s.defaultChecked)}function G(a,s,d){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var p=s.type;if(!(p!=="submit"&&p!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+a._wrapperState.initialValue,d||s===a.value||(a.value=s),a.defaultValue=s}d=a.name,d!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,d!==""&&(a.name=d)}function Ne(a,s,d){(s!=="number"||Ze(a.ownerDocument)!==a)&&(d==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+d&&(a.defaultValue=""+d))}var Pe=Array.isArray;function Ve(a,s,d,p){if(a=a.options,s){s={};for(var x=0;x"+s.valueOf().toString()+"",s=cc.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;s.firstChild;)a.appendChild(s.firstChild)}});function ul(a,s){if(s){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=s;return}}a.textContent=s}var cl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},c_=["Webkit","ms","Moz","O"];Object.keys(cl).forEach(function(a){c_.forEach(function(s){s=s+a.charAt(0).toUpperCase()+a.substring(1),cl[s]=cl[a]})});function gx(a,s,d){return s==null||typeof s=="boolean"||s===""?"":d||typeof s!="number"||s===0||cl.hasOwnProperty(a)&&cl[a]?(""+s).trim():s+"px"}function vx(a,s){a=a.style;for(var d in s)if(s.hasOwnProperty(d)){var p=d.indexOf("--")===0,x=gx(d,s[d],p);d==="float"&&(d="cssFloat"),p?a.setProperty(d,x):a[d]=x}}var d_=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sm(a,s){if(s){if(d_[a]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function lm(a,s){if(a.indexOf("-")===-1)return typeof s.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var um=null;function cm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var dm=null,Ao=null,Co=null;function yx(a){if(a=Ml(a)){if(typeof dm!="function")throw Error(r(280));var s=a.stateNode;s&&(s=Ic(s),dm(a.stateNode,a.type,s))}}function xx(a){Ao?Co?Co.push(a):Co=[a]:Ao=a}function bx(){if(Ao){var a=Ao,s=Co;if(Co=Ao=null,yx(a),s)for(a=0;a>>=0,a===0?32:31-(k_(a)/j_|0)|0}var pc=64,gc=4194304;function ml(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function vc(a,s){var d=a.pendingLanes;if(d===0)return 0;var p=0,x=a.suspendedLanes,w=a.pingedLanes,C=d&268435455;if(C!==0){var D=C&~x;D!==0?p=ml(D):(w&=C,w!==0&&(p=ml(w)))}else C=d&~x,C!==0?p=ml(C):w!==0&&(p=ml(w));if(p===0)return 0;if(s!==0&&s!==p&&(s&x)===0&&(x=p&-p,w=s&-s,x>=w||x===16&&(w&4194240)!==0))return s;if((p&4)!==0&&(p|=d&16),s=a.entangledLanes,s!==0)for(a=a.entanglements,s&=p;0d;d++)s.push(a);return s}function pl(a,s,d){a.pendingLanes|=s,s!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,s=31-on(s),a[s]=d}function A_(a,s){var d=a.pendingLanes&~s;a.pendingLanes=s,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=s,a.mutableReadLanes&=s,a.entangledLanes&=s,s=a.entanglements;var p=a.eventTimes;for(a=a.expirationTimes;0=jl),qx=" ",Qx=!1;function Yx(a,s){switch(a){case"keyup":return t4.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xx(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var _o=!1;function n4(a,s){switch(a){case"compositionend":return Xx(s);case"keypress":return s.which!==32?null:(Qx=!0,qx);case"textInput":return a=s.data,a===qx&&Qx?null:a;default:return null}}function i4(a,s){if(_o)return a==="compositionend"||!Pm&&Yx(a,s)?(a=Ux(),kc=jm=Ii=null,_o=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-a};a=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=ib(d)}}function ob(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?ob(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function sb(){for(var a=window,s=Ze();s instanceof a.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)a=s.contentWindow;else break;s=Ze(a.document)}return s}function Mm(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}function h4(a){var s=sb(),d=a.focusedElem,p=a.selectionRange;if(s!==d&&d&&d.ownerDocument&&ob(d.ownerDocument.documentElement,d)){if(p!==null&&Mm(d)){if(s=p.start,a=p.end,a===void 0&&(a=s),"selectionStart"in d)d.selectionStart=s,d.selectionEnd=Math.min(a,d.value.length);else if(a=(s=d.ownerDocument||document)&&s.defaultView||window,a.getSelection){a=a.getSelection();var x=d.textContent.length,w=Math.min(p.start,x);p=p.end===void 0?w:Math.min(p.end,x),!a.extend&&w>p&&(x=p,p=w,w=x),x=ab(d,w);var C=ab(d,p);x&&C&&(a.rangeCount!==1||a.anchorNode!==x.node||a.anchorOffset!==x.offset||a.focusNode!==C.node||a.focusOffset!==C.offset)&&(s=s.createRange(),s.setStart(x.node,x.offset),a.removeAllRanges(),w>p?(a.addRange(s),a.extend(C.node,C.offset)):(s.setEnd(C.node,C.offset),a.addRange(s)))}}for(s=[],a=d;a=a.parentNode;)a.nodeType===1&&s.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Mo=null,Im=null,Al=null,Tm=!1;function lb(a,s,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Tm||Mo==null||Mo!==Ze(p)||(p=Mo,"selectionStart"in p&&Mm(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Al&&El(Al,p)||(Al=p,p=Oc(Im,"onSelect"),0Lo||(a.current=Gm[Lo],Gm[Lo]=null,Lo--)}function tt(a,s){Lo++,Gm[Lo]=a.current,a.current=s}var Li={},er=Ri(Li),gr=Ri(!1),Na=Li;function $o(a,s){var d=a.type.contextTypes;if(!d)return Li;var p=a.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var x={},w;for(w in d)x[w]=s[w];return p&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=s,a.__reactInternalMemoizedMaskedChildContext=x),x}function vr(a){return a=a.childContextTypes,a!=null}function Tc(){at(gr),at(er)}function jb(a,s,d){if(er.current!==Li)throw Error(r(168));tt(er,s),tt(gr,d)}function Sb(a,s,d){var p=a.stateNode;if(s=s.childContextTypes,typeof p.getChildContext!="function")return d;p=p.getChildContext();for(var x in p)if(!(x in s))throw Error(r(108,ae(a)||"Unknown",x));return te({},d,p)}function Dc(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Li,Na=er.current,tt(er,a),tt(gr,gr.current),!0}function Nb(a,s,d){var p=a.stateNode;if(!p)throw Error(r(169));d?(a=Sb(a,s,Na),p.__reactInternalMemoizedMergedChildContext=a,at(gr),at(er),tt(er,a)):at(gr),tt(gr,d)}var Qn=null,Rc=!1,Vm=!1;function Eb(a){Qn===null?Qn=[a]:Qn.push(a)}function N4(a){Rc=!0,Eb(a)}function $i(){if(!Vm&&Qn!==null){Vm=!0;var a=0,s=Je;try{var d=Qn;for(Je=1;a>=C,x-=C,Yn=1<<32-on(s)+x|d<Re?(Tt=Te,Te=null):Tt=Te.sibling;var Qe=le(W,Te,V[Re],ge);if(Qe===null){Te===null&&(Te=Tt);break}a&&Te&&Qe.alternate===null&&s(W,Te),F=w(Qe,F,Re),Ie===null?Ce=Qe:Ie.sibling=Qe,Ie=Qe,Te=Tt}if(Re===V.length)return d(W,Te),ut&&Aa(W,Re),Ce;if(Te===null){for(;ReRe?(Tt=Te,Te=null):Tt=Te.sibling;var Vi=le(W,Te,Qe.value,ge);if(Vi===null){Te===null&&(Te=Tt);break}a&&Te&&Vi.alternate===null&&s(W,Te),F=w(Vi,F,Re),Ie===null?Ce=Vi:Ie.sibling=Vi,Ie=Vi,Te=Tt}if(Qe.done)return d(W,Te),ut&&Aa(W,Re),Ce;if(Te===null){for(;!Qe.done;Re++,Qe=V.next())Qe=fe(W,Qe.value,ge),Qe!==null&&(F=w(Qe,F,Re),Ie===null?Ce=Qe:Ie.sibling=Qe,Ie=Qe);return ut&&Aa(W,Re),Ce}for(Te=p(W,Te);!Qe.done;Re++,Qe=V.next())Qe=xe(Te,W,Re,Qe.value,ge),Qe!==null&&(a&&Qe.alternate!==null&&Te.delete(Qe.key===null?Re:Qe.key),F=w(Qe,F,Re),Ie===null?Ce=Qe:Ie.sibling=Qe,Ie=Qe);return a&&Te.forEach(function(a3){return s(W,a3)}),ut&&Aa(W,Re),Ce}function wt(W,F,V,ge){if(typeof V=="object"&&V!==null&&V.type===T&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case _:e:{for(var Ce=V.key,Ie=F;Ie!==null;){if(Ie.key===Ce){if(Ce=V.type,Ce===T){if(Ie.tag===7){d(W,Ie.sibling),F=x(Ie,V.props.children),F.return=W,W=F;break e}}else if(Ie.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===oe&&Mb(Ce)===Ie.type){d(W,Ie.sibling),F=x(Ie,V.props),F.ref=Il(W,Ie,V),F.return=W,W=F;break e}d(W,Ie);break}else s(W,Ie);Ie=Ie.sibling}V.type===T?(F=Da(V.props.children,W.mode,ge,V.key),F.return=W,W=F):(ge=cd(V.type,V.key,V.props,null,W.mode,ge),ge.ref=Il(W,F,V),ge.return=W,W=ge)}return C(W);case O:e:{for(Ie=V.key;F!==null;){if(F.key===Ie)if(F.tag===4&&F.stateNode.containerInfo===V.containerInfo&&F.stateNode.implementation===V.implementation){d(W,F.sibling),F=x(F,V.children||[]),F.return=W,W=F;break e}else{d(W,F);break}else s(W,F);F=F.sibling}F=Wp(V,W.mode,ge),F.return=W,W=F}return C(W);case oe:return Ie=V._init,wt(W,F,Ie(V._payload),ge)}if(Pe(V))return Se(W,F,V,ge);if(ne(V))return Ee(W,F,V,ge);Fc(W,V)}return typeof V=="string"&&V!==""||typeof V=="number"?(V=""+V,F!==null&&F.tag===6?(d(W,F.sibling),F=x(F,V),F.return=W,W=F):(d(W,F),F=Hp(V,W.mode,ge),F.return=W,W=F),C(W)):d(W,F)}return wt}var Uo=Ib(!0),Tb=Ib(!1),Bc=Ri(null),Uc=null,Ho=null,Jm=null;function ep(){Jm=Ho=Uc=null}function tp(a){var s=Bc.current;at(Bc),a._currentValue=s}function rp(a,s,d){for(;a!==null;){var p=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),a===d)break;a=a.return}}function Wo(a,s){Uc=a,Jm=Ho=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&s)!==0&&(yr=!0),a.firstContext=null)}function Hr(a){var s=a._currentValue;if(Jm!==a)if(a={context:a,memoizedValue:s,next:null},Ho===null){if(Uc===null)throw Error(r(308));Ho=a,Uc.dependencies={lanes:0,firstContext:a}}else Ho=Ho.next=a;return s}var Ca=null;function np(a){Ca===null?Ca=[a]:Ca.push(a)}function Db(a,s,d,p){var x=s.interleaved;return x===null?(d.next=d,np(s)):(d.next=x.next,x.next=d),s.interleaved=d,Zn(a,p)}function Zn(a,s){a.lanes|=s;var d=a.alternate;for(d!==null&&(d.lanes|=s),d=a,a=a.return;a!==null;)a.childLanes|=s,d=a.alternate,d!==null&&(d.childLanes|=s),d=a,a=a.return;return d.tag===3?d.stateNode:null}var zi=!1;function ip(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rb(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Jn(a,s){return{eventTime:a,lane:s,tag:0,payload:null,callback:null,next:null}}function Fi(a,s,d){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(qe&2)!==0){var x=p.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),p.pending=s,Zn(a,d)}return x=p.interleaved,x===null?(s.next=s,np(p)):(s.next=x.next,x.next=s),p.interleaved=s,Zn(a,d)}function Hc(a,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194240)!==0)){var p=s.lanes;p&=a.pendingLanes,d|=p,s.lanes=d,ym(a,d)}}function Lb(a,s){var d=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var C={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};w===null?x=w=C:w=w.next=C,d=d.next}while(d!==null);w===null?x=w=s:w=w.next=s}else x=w=s;d={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,effects:p.effects},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=s:a.next=s,d.lastBaseUpdate=s}function Wc(a,s,d,p){var x=a.updateQueue;zi=!1;var w=x.firstBaseUpdate,C=x.lastBaseUpdate,D=x.shared.pending;if(D!==null){x.shared.pending=null;var R=D,Y=R.next;R.next=null,C===null?w=Y:C.next=Y,C=R;var ce=a.alternate;ce!==null&&(ce=ce.updateQueue,D=ce.lastBaseUpdate,D!==C&&(D===null?ce.firstBaseUpdate=Y:D.next=Y,ce.lastBaseUpdate=R))}if(w!==null){var fe=x.baseState;C=0,ce=Y=R=null,D=w;do{var le=D.lane,xe=D.eventTime;if((p&le)===le){ce!==null&&(ce=ce.next={eventTime:xe,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Se=a,Ee=D;switch(le=s,xe=d,Ee.tag){case 1:if(Se=Ee.payload,typeof Se=="function"){fe=Se.call(xe,fe,le);break e}fe=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ee.payload,le=typeof Se=="function"?Se.call(xe,fe,le):Se,le==null)break e;fe=te({},fe,le);break e;case 2:zi=!0}}D.callback!==null&&D.lane!==0&&(a.flags|=64,le=x.effects,le===null?x.effects=[D]:le.push(D))}else xe={eventTime:xe,lane:le,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ce===null?(Y=ce=xe,R=fe):ce=ce.next=xe,C|=le;if(D=D.next,D===null){if(D=x.shared.pending,D===null)break;le=D,D=le.next,le.next=null,x.lastBaseUpdate=le,x.shared.pending=null}}while(!0);if(ce===null&&(R=fe),x.baseState=R,x.firstBaseUpdate=Y,x.lastBaseUpdate=ce,s=x.shared.interleaved,s!==null){x=s;do C|=x.lane,x=x.next;while(x!==s)}else w===null&&(x.shared.lanes=0);_a|=C,a.lanes=C,a.memoizedState=fe}}function $b(a,s,d){if(a=s.effects,s.effects=null,a!==null)for(s=0;sd?d:4,a(!0);var p=up.transition;up.transition={};try{a(!1),s()}finally{Je=d,up.transition=p}}function n1(){return Wr().memoizedState}function P4(a,s,d){var p=Wi(a);if(d={lane:p,action:d,hasEagerState:!1,eagerState:null,next:null},i1(a))a1(s,d);else if(d=Db(a,s,d,p),d!==null){var x=cr();fn(d,a,p,x),o1(d,s,p)}}function O4(a,s,d){var p=Wi(a),x={lane:p,action:d,hasEagerState:!1,eagerState:null,next:null};if(i1(a))a1(s,x);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var C=s.lastRenderedState,D=w(C,d);if(x.hasEagerState=!0,x.eagerState=D,sn(D,C)){var R=s.interleaved;R===null?(x.next=x,np(s)):(x.next=R.next,R.next=x),s.interleaved=x;return}}catch{}finally{}d=Db(a,s,x,p),d!==null&&(x=cr(),fn(d,a,p,x),o1(d,s,p))}}function i1(a){var s=a.alternate;return a===mt||s!==null&&s===mt}function a1(a,s){Ll=Vc=!0;var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}function o1(a,s,d){if((d&4194240)!==0){var p=s.lanes;p&=a.pendingLanes,d|=p,s.lanes=d,ym(a,d)}}var Yc={readContext:Hr,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},_4={readContext:Hr,useCallback:function(a,s){return En().memoizedState=[a,s===void 0?null:s],a},useContext:Hr,useEffect:Qb,useImperativeHandle:function(a,s,d){return d=d!=null?d.concat([a]):null,qc(4194308,4,Zb.bind(null,s,a),d)},useLayoutEffect:function(a,s){return qc(4194308,4,a,s)},useInsertionEffect:function(a,s){return qc(4,2,a,s)},useMemo:function(a,s){var d=En();return s=s===void 0?null:s,a=a(),d.memoizedState=[a,s],a},useReducer:function(a,s,d){var p=En();return s=d!==void 0?d(s):s,p.memoizedState=p.baseState=s,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:s},p.queue=a,a=a.dispatch=P4.bind(null,mt,a),[p.memoizedState,a]},useRef:function(a){var s=En();return a={current:a},s.memoizedState=a},useState:Vb,useDebugValue:gp,useDeferredValue:function(a){return En().memoizedState=a},useTransition:function(){var a=Vb(!1),s=a[0];return a=C4.bind(null,a[1]),En().memoizedState=a,[s,a]},useMutableSource:function(){},useSyncExternalStore:function(a,s,d){var p=mt,x=En();if(ut){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),It===null)throw Error(r(349));(Oa&30)!==0||Ub(p,s,d)}x.memoizedState=d;var w={value:d,getSnapshot:s};return x.queue=w,Qb(Wb.bind(null,p,w,a),[a]),p.flags|=2048,Fl(9,Hb.bind(null,p,w,d,s),void 0,null),d},useId:function(){var a=En(),s=It.identifierPrefix;if(ut){var d=Xn,p=Yn;d=(p&~(1<<32-on(p)-1)).toString(32)+d,s=":"+s+"R"+d,d=$l++,0")&&(R=R.replace("",a.displayName)),R}while(1<=C&&0<=D);break}}}finally{H=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?M(a):""}function J(a){switch(a.tag){case 5:return M(a.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return a=ie(a.type,!1),a;case 11:return a=ie(a.type.render,!1),a;case 1:return a=ie(a.type,!0),a;default:return""}}function Z(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case O:return"Portal";case $:return"Profiler";case B:return"StrictMode";case ve:return"Suspense";case ue:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case Q:return(a.displayName||"Context")+".Consumer";case z:return(a._context.displayName||"Context")+".Provider";case U:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case pe:return s=a.displayName||null,s!==null?s:Z(a.type)||"Memo";case oe:s=a._payload,a=a._init;try{return Z(a(s))}catch{}}return null}function ae(a){var s=a.type;switch(a.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=s.render,a=a.displayName||a.name||"",s.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(s);case 8:return s===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function me(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ye(a){var s=re(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),p=""+a[s];if(!a.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,w=d.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return x.call(this)},set:function(C){p=""+C,w.call(this,C)}}),Object.defineProperty(a,s,{enumerable:d.enumerable}),{getValue:function(){return p},setValue:function(C){p=""+C},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Oe(a){a._valueTracker||(a._valueTracker=ye(a))}function de(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var d=s.getValue(),p="";return a&&(p=re(a)?a.checked?"true":"false":a.value),a=p,a!==d?(s.setValue(a),!0):!1}function Ze(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ue(a,s){var d=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??a._wrapperState.initialChecked})}function _e(a,s){var d=s.defaultValue==null?"":s.defaultValue,p=s.checked!=null?s.checked:s.defaultChecked;d=me(s.value!=null?s.value:d),a._wrapperState={initialChecked:p,initialValue:d,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function xt(a,s){s=s.checked,s!=null&&A(a,"checked",s,!1)}function Jt(a,s){xt(a,s);var d=me(s.value),p=s.type;if(d!=null)p==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+d):a.value!==""+d&&(a.value=""+d);else if(p==="submit"||p==="reset"){a.removeAttribute("value");return}s.hasOwnProperty("value")?Ne(a,s.type,d):s.hasOwnProperty("defaultValue")&&Ne(a,s.type,me(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(a.defaultChecked=!!s.defaultChecked)}function G(a,s,d){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var p=s.type;if(!(p!=="submit"&&p!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+a._wrapperState.initialValue,d||s===a.value||(a.value=s),a.defaultValue=s}d=a.name,d!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,d!==""&&(a.name=d)}function Ne(a,s,d){(s!=="number"||Ze(a.ownerDocument)!==a)&&(d==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+d&&(a.defaultValue=""+d))}var Pe=Array.isArray;function Ve(a,s,d,p){if(a=a.options,s){s={};for(var x=0;x"+s.valueOf().toString()+"",s=uc.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;s.firstChild;)a.appendChild(s.firstChild)}});function ll(a,s){if(s){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=s;return}}a.textContent=s}var ul={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},c_=["Webkit","ms","Moz","O"];Object.keys(ul).forEach(function(a){c_.forEach(function(s){s=s+a.charAt(0).toUpperCase()+a.substring(1),ul[s]=ul[a]})});function gx(a,s,d){return s==null||typeof s=="boolean"||s===""?"":d||typeof s!="number"||s===0||ul.hasOwnProperty(a)&&ul[a]?(""+s).trim():s+"px"}function vx(a,s){a=a.style;for(var d in s)if(s.hasOwnProperty(d)){var p=d.indexOf("--")===0,x=gx(d,s[d],p);d==="float"&&(d="cssFloat"),p?a.setProperty(d,x):a[d]=x}}var d_=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sm(a,s){if(s){if(d_[a]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function lm(a,s){if(a.indexOf("-")===-1)return typeof s.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var um=null;function cm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var dm=null,Ao=null,Co=null;function yx(a){if(a=_l(a)){if(typeof dm!="function")throw Error(r(280));var s=a.stateNode;s&&(s=Mc(s),dm(a.stateNode,a.type,s))}}function xx(a){Ao?Co?Co.push(a):Co=[a]:Ao=a}function bx(){if(Ao){var a=Ao,s=Co;if(Co=Ao=null,yx(a),s)for(a=0;a>>=0,a===0?32:31-(k_(a)/j_|0)|0}var mc=64,pc=4194304;function hl(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function gc(a,s){var d=a.pendingLanes;if(d===0)return 0;var p=0,x=a.suspendedLanes,w=a.pingedLanes,C=d&268435455;if(C!==0){var D=C&~x;D!==0?p=hl(D):(w&=C,w!==0&&(p=hl(w)))}else C=d&~x,C!==0?p=hl(C):w!==0&&(p=hl(w));if(p===0)return 0;if(s!==0&&s!==p&&(s&x)===0&&(x=p&-p,w=s&-s,x>=w||x===16&&(w&4194240)!==0))return s;if((p&4)!==0&&(p|=d&16),s=a.entangledLanes,s!==0)for(a=a.entanglements,s&=p;0d;d++)s.push(a);return s}function ml(a,s,d){a.pendingLanes|=s,s!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,s=31-sn(s),a[s]=d}function A_(a,s){var d=a.pendingLanes&~s;a.pendingLanes=s,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=s,a.mutableReadLanes&=s,a.entangledLanes&=s,s=a.entanglements;var p=a.eventTimes;for(a=a.expirationTimes;0=kl),qx=" ",Qx=!1;function Yx(a,s){switch(a){case"keyup":return t4.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xx(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var _o=!1;function n4(a,s){switch(a){case"compositionend":return Xx(s);case"keypress":return s.which!==32?null:(Qx=!0,qx);case"textInput":return a=s.data,a===qx&&Qx?null:a;default:return null}}function i4(a,s){if(_o)return a==="compositionend"||!Pm&&Yx(a,s)?(a=Ux(),wc=jm=Ii=null,_o=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-a};a=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=ib(d)}}function ob(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?ob(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function sb(){for(var a=window,s=Ze();s instanceof a.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)a=s.contentWindow;else break;s=Ze(a.document)}return s}function Mm(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}function h4(a){var s=sb(),d=a.focusedElem,p=a.selectionRange;if(s!==d&&d&&d.ownerDocument&&ob(d.ownerDocument.documentElement,d)){if(p!==null&&Mm(d)){if(s=p.start,a=p.end,a===void 0&&(a=s),"selectionStart"in d)d.selectionStart=s,d.selectionEnd=Math.min(a,d.value.length);else if(a=(s=d.ownerDocument||document)&&s.defaultView||window,a.getSelection){a=a.getSelection();var x=d.textContent.length,w=Math.min(p.start,x);p=p.end===void 0?w:Math.min(p.end,x),!a.extend&&w>p&&(x=p,p=w,w=x),x=ab(d,w);var C=ab(d,p);x&&C&&(a.rangeCount!==1||a.anchorNode!==x.node||a.anchorOffset!==x.offset||a.focusNode!==C.node||a.focusOffset!==C.offset)&&(s=s.createRange(),s.setStart(x.node,x.offset),a.removeAllRanges(),w>p?(a.addRange(s),a.extend(C.node,C.offset)):(s.setEnd(C.node,C.offset),a.addRange(s)))}}for(s=[],a=d;a=a.parentNode;)a.nodeType===1&&s.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Mo=null,Im=null,El=null,Tm=!1;function lb(a,s,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Tm||Mo==null||Mo!==Ze(p)||(p=Mo,"selectionStart"in p&&Mm(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),El&&Nl(El,p)||(El=p,p=Pc(Im,"onSelect"),0Lo||(a.current=Gm[Lo],Gm[Lo]=null,Lo--)}function tt(a,s){Lo++,Gm[Lo]=a.current,a.current=s}var Li={},er=Ri(Li),gr=Ri(!1),Na=Li;function $o(a,s){var d=a.type.contextTypes;if(!d)return Li;var p=a.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===s)return p.__reactInternalMemoizedMaskedChildContext;var x={},w;for(w in d)x[w]=s[w];return p&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=s,a.__reactInternalMemoizedMaskedChildContext=x),x}function vr(a){return a=a.childContextTypes,a!=null}function Ic(){at(gr),at(er)}function jb(a,s,d){if(er.current!==Li)throw Error(r(168));tt(er,s),tt(gr,d)}function Sb(a,s,d){var p=a.stateNode;if(s=s.childContextTypes,typeof p.getChildContext!="function")return d;p=p.getChildContext();for(var x in p)if(!(x in s))throw Error(r(108,ae(a)||"Unknown",x));return te({},d,p)}function Tc(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Li,Na=er.current,tt(er,a),tt(gr,gr.current),!0}function Nb(a,s,d){var p=a.stateNode;if(!p)throw Error(r(169));d?(a=Sb(a,s,Na),p.__reactInternalMemoizedMergedChildContext=a,at(gr),at(er),tt(er,a)):at(gr),tt(gr,d)}var Qn=null,Dc=!1,Vm=!1;function Eb(a){Qn===null?Qn=[a]:Qn.push(a)}function N4(a){Dc=!0,Eb(a)}function $i(){if(!Vm&&Qn!==null){Vm=!0;var a=0,s=Je;try{var d=Qn;for(Je=1;a>=C,x-=C,Yn=1<<32-sn(s)+x|d<Re?(Tt=Te,Te=null):Tt=Te.sibling;var Qe=le(W,Te,V[Re],ge);if(Qe===null){Te===null&&(Te=Tt);break}a&&Te&&Qe.alternate===null&&s(W,Te),F=w(Qe,F,Re),Ie===null?Ce=Qe:Ie.sibling=Qe,Ie=Qe,Te=Tt}if(Re===V.length)return d(W,Te),ut&&Aa(W,Re),Ce;if(Te===null){for(;ReRe?(Tt=Te,Te=null):Tt=Te.sibling;var Vi=le(W,Te,Qe.value,ge);if(Vi===null){Te===null&&(Te=Tt);break}a&&Te&&Vi.alternate===null&&s(W,Te),F=w(Vi,F,Re),Ie===null?Ce=Vi:Ie.sibling=Vi,Ie=Vi,Te=Tt}if(Qe.done)return d(W,Te),ut&&Aa(W,Re),Ce;if(Te===null){for(;!Qe.done;Re++,Qe=V.next())Qe=fe(W,Qe.value,ge),Qe!==null&&(F=w(Qe,F,Re),Ie===null?Ce=Qe:Ie.sibling=Qe,Ie=Qe);return ut&&Aa(W,Re),Ce}for(Te=p(W,Te);!Qe.done;Re++,Qe=V.next())Qe=xe(Te,W,Re,Qe.value,ge),Qe!==null&&(a&&Qe.alternate!==null&&Te.delete(Qe.key===null?Re:Qe.key),F=w(Qe,F,Re),Ie===null?Ce=Qe:Ie.sibling=Qe,Ie=Qe);return a&&Te.forEach(function(a3){return s(W,a3)}),ut&&Aa(W,Re),Ce}function wt(W,F,V,ge){if(typeof V=="object"&&V!==null&&V.type===T&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case _:e:{for(var Ce=V.key,Ie=F;Ie!==null;){if(Ie.key===Ce){if(Ce=V.type,Ce===T){if(Ie.tag===7){d(W,Ie.sibling),F=x(Ie,V.props.children),F.return=W,W=F;break e}}else if(Ie.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===oe&&Mb(Ce)===Ie.type){d(W,Ie.sibling),F=x(Ie,V.props),F.ref=Ml(W,Ie,V),F.return=W,W=F;break e}d(W,Ie);break}else s(W,Ie);Ie=Ie.sibling}V.type===T?(F=Da(V.props.children,W.mode,ge,V.key),F.return=W,W=F):(ge=ud(V.type,V.key,V.props,null,W.mode,ge),ge.ref=Ml(W,F,V),ge.return=W,W=ge)}return C(W);case O:e:{for(Ie=V.key;F!==null;){if(F.key===Ie)if(F.tag===4&&F.stateNode.containerInfo===V.containerInfo&&F.stateNode.implementation===V.implementation){d(W,F.sibling),F=x(F,V.children||[]),F.return=W,W=F;break e}else{d(W,F);break}else s(W,F);F=F.sibling}F=Wp(V,W.mode,ge),F.return=W,W=F}return C(W);case oe:return Ie=V._init,wt(W,F,Ie(V._payload),ge)}if(Pe(V))return Se(W,F,V,ge);if(ne(V))return Ee(W,F,V,ge);zc(W,V)}return typeof V=="string"&&V!==""||typeof V=="number"?(V=""+V,F!==null&&F.tag===6?(d(W,F.sibling),F=x(F,V),F.return=W,W=F):(d(W,F),F=Hp(V,W.mode,ge),F.return=W,W=F),C(W)):d(W,F)}return wt}var Uo=Ib(!0),Tb=Ib(!1),Fc=Ri(null),Bc=null,Ho=null,Jm=null;function ep(){Jm=Ho=Bc=null}function tp(a){var s=Fc.current;at(Fc),a._currentValue=s}function rp(a,s,d){for(;a!==null;){var p=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),a===d)break;a=a.return}}function Wo(a,s){Bc=a,Jm=Ho=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&s)!==0&&(yr=!0),a.firstContext=null)}function Hr(a){var s=a._currentValue;if(Jm!==a)if(a={context:a,memoizedValue:s,next:null},Ho===null){if(Bc===null)throw Error(r(308));Ho=a,Bc.dependencies={lanes:0,firstContext:a}}else Ho=Ho.next=a;return s}var Ca=null;function np(a){Ca===null?Ca=[a]:Ca.push(a)}function Db(a,s,d,p){var x=s.interleaved;return x===null?(d.next=d,np(s)):(d.next=x.next,x.next=d),s.interleaved=d,Zn(a,p)}function Zn(a,s){a.lanes|=s;var d=a.alternate;for(d!==null&&(d.lanes|=s),d=a,a=a.return;a!==null;)a.childLanes|=s,d=a.alternate,d!==null&&(d.childLanes|=s),d=a,a=a.return;return d.tag===3?d.stateNode:null}var zi=!1;function ip(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rb(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Jn(a,s){return{eventTime:a,lane:s,tag:0,payload:null,callback:null,next:null}}function Fi(a,s,d){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(qe&2)!==0){var x=p.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),p.pending=s,Zn(a,d)}return x=p.interleaved,x===null?(s.next=s,np(p)):(s.next=x.next,x.next=s),p.interleaved=s,Zn(a,d)}function Uc(a,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194240)!==0)){var p=s.lanes;p&=a.pendingLanes,d|=p,s.lanes=d,ym(a,d)}}function Lb(a,s){var d=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var C={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};w===null?x=w=C:w=w.next=C,d=d.next}while(d!==null);w===null?x=w=s:w=w.next=s}else x=w=s;d={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,effects:p.effects},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=s:a.next=s,d.lastBaseUpdate=s}function Hc(a,s,d,p){var x=a.updateQueue;zi=!1;var w=x.firstBaseUpdate,C=x.lastBaseUpdate,D=x.shared.pending;if(D!==null){x.shared.pending=null;var R=D,Y=R.next;R.next=null,C===null?w=Y:C.next=Y,C=R;var ce=a.alternate;ce!==null&&(ce=ce.updateQueue,D=ce.lastBaseUpdate,D!==C&&(D===null?ce.firstBaseUpdate=Y:D.next=Y,ce.lastBaseUpdate=R))}if(w!==null){var fe=x.baseState;C=0,ce=Y=R=null,D=w;do{var le=D.lane,xe=D.eventTime;if((p&le)===le){ce!==null&&(ce=ce.next={eventTime:xe,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Se=a,Ee=D;switch(le=s,xe=d,Ee.tag){case 1:if(Se=Ee.payload,typeof Se=="function"){fe=Se.call(xe,fe,le);break e}fe=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ee.payload,le=typeof Se=="function"?Se.call(xe,fe,le):Se,le==null)break e;fe=te({},fe,le);break e;case 2:zi=!0}}D.callback!==null&&D.lane!==0&&(a.flags|=64,le=x.effects,le===null?x.effects=[D]:le.push(D))}else xe={eventTime:xe,lane:le,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ce===null?(Y=ce=xe,R=fe):ce=ce.next=xe,C|=le;if(D=D.next,D===null){if(D=x.shared.pending,D===null)break;le=D,D=le.next,le.next=null,x.lastBaseUpdate=le,x.shared.pending=null}}while(!0);if(ce===null&&(R=fe),x.baseState=R,x.firstBaseUpdate=Y,x.lastBaseUpdate=ce,s=x.shared.interleaved,s!==null){x=s;do C|=x.lane,x=x.next;while(x!==s)}else w===null&&(x.shared.lanes=0);_a|=C,a.lanes=C,a.memoizedState=fe}}function $b(a,s,d){if(a=s.effects,s.effects=null,a!==null)for(s=0;sd?d:4,a(!0);var p=up.transition;up.transition={};try{a(!1),s()}finally{Je=d,up.transition=p}}function n1(){return Wr().memoizedState}function P4(a,s,d){var p=Wi(a);if(d={lane:p,action:d,hasEagerState:!1,eagerState:null,next:null},i1(a))a1(s,d);else if(d=Db(a,s,d,p),d!==null){var x=cr();hn(d,a,p,x),o1(d,s,p)}}function O4(a,s,d){var p=Wi(a),x={lane:p,action:d,hasEagerState:!1,eagerState:null,next:null};if(i1(a))a1(s,x);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var C=s.lastRenderedState,D=w(C,d);if(x.hasEagerState=!0,x.eagerState=D,ln(D,C)){var R=s.interleaved;R===null?(x.next=x,np(s)):(x.next=R.next,R.next=x),s.interleaved=x;return}}catch{}finally{}d=Db(a,s,x,p),d!==null&&(x=cr(),hn(d,a,p,x),o1(d,s,p))}}function i1(a){var s=a.alternate;return a===mt||s!==null&&s===mt}function a1(a,s){Rl=Gc=!0;var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}function o1(a,s,d){if((d&4194240)!==0){var p=s.lanes;p&=a.pendingLanes,d|=p,s.lanes=d,ym(a,d)}}var Qc={readContext:Hr,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},_4={readContext:Hr,useCallback:function(a,s){return En().memoizedState=[a,s===void 0?null:s],a},useContext:Hr,useEffect:Qb,useImperativeHandle:function(a,s,d){return d=d!=null?d.concat([a]):null,Vc(4194308,4,Zb.bind(null,s,a),d)},useLayoutEffect:function(a,s){return Vc(4194308,4,a,s)},useInsertionEffect:function(a,s){return Vc(4,2,a,s)},useMemo:function(a,s){var d=En();return s=s===void 0?null:s,a=a(),d.memoizedState=[a,s],a},useReducer:function(a,s,d){var p=En();return s=d!==void 0?d(s):s,p.memoizedState=p.baseState=s,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:s},p.queue=a,a=a.dispatch=P4.bind(null,mt,a),[p.memoizedState,a]},useRef:function(a){var s=En();return a={current:a},s.memoizedState=a},useState:Vb,useDebugValue:gp,useDeferredValue:function(a){return En().memoizedState=a},useTransition:function(){var a=Vb(!1),s=a[0];return a=C4.bind(null,a[1]),En().memoizedState=a,[s,a]},useMutableSource:function(){},useSyncExternalStore:function(a,s,d){var p=mt,x=En();if(ut){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),It===null)throw Error(r(349));(Oa&30)!==0||Ub(p,s,d)}x.memoizedState=d;var w={value:d,getSnapshot:s};return x.queue=w,Qb(Wb.bind(null,p,w,a),[a]),p.flags|=2048,zl(9,Hb.bind(null,p,w,d,s),void 0,null),d},useId:function(){var a=En(),s=It.identifierPrefix;if(ut){var d=Xn,p=Yn;d=(p&~(1<<32-sn(p)-1)).toString(32)+d,s=":"+s+"R"+d,d=Ll++,0<\/script>",a=a.removeChild(a.firstChild)):typeof p.is=="string"?a=C.createElement(d,{is:p.is}):(a=C.createElement(d),d==="select"&&(C=a,p.multiple?C.multiple=!0:p.size&&(C.size=p.size))):a=C.createElementNS(a,d),a[Sn]=s,a[_l]=p,E1(a,s,!1,!1),s.stateNode=a;e:{switch(C=lm(d,p),d){case"dialog":it("cancel",a),it("close",a),x=p;break;case"iframe":case"object":case"embed":it("load",a),x=p;break;case"video":case"audio":for(x=0;xQo&&(s.flags|=128,p=!0,Bl(w,!1),s.lanes=4194304)}else{if(!p)if(a=Kc(C),a!==null){if(s.flags|=128,p=!0,d=a.updateQueue,d!==null&&(s.updateQueue=d,s.flags|=4),Bl(w,!0),w.tail===null&&w.tailMode==="hidden"&&!C.alternate&&!ut)return rr(s),null}else 2*bt()-w.renderingStartTime>Qo&&d!==1073741824&&(s.flags|=128,p=!0,Bl(w,!1),s.lanes=4194304);w.isBackwards?(C.sibling=s.child,s.child=C):(d=w.last,d!==null?d.sibling=C:s.child=C,w.last=C)}return w.tail!==null?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=bt(),s.sibling=null,d=ht.current,tt(ht,p?d&1|2:d&1),s):(rr(s),null);case 22:case 23:return Fp(),p=s.memoizedState!==null,a!==null&&a.memoizedState!==null!==p&&(s.flags|=8192),p&&(s.mode&1)!==0?(Mr&1073741824)!==0&&(rr(s),s.subtreeFlags&6&&(s.flags|=8192)):rr(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function z4(a,s){switch(Qm(s),s.tag){case 1:return vr(s.type)&&Tc(),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Ko(),at(gr),at(er),lp(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 5:return op(s),null;case 13:if(at(ht),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Bo()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return at(ht),null;case 4:return Ko(),null;case 10:return tp(s.type._context),null;case 22:case 23:return Fp(),null;case 24:return null;default:return null}}var ed=!1,nr=!1,F4=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Vo(a,s){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(p){pt(a,s,p)}else d.current=null}function Cp(a,s,d){try{d()}catch(p){pt(a,s,p)}}var P1=!1;function B4(a,s){if(Fm=bc,a=sb(),Mm(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var C=0,D=-1,R=-1,Y=0,ce=0,fe=a,le=null;t:for(;;){for(var xe;fe!==d||x!==0&&fe.nodeType!==3||(D=C+x),fe!==w||p!==0&&fe.nodeType!==3||(R=C+p),fe.nodeType===3&&(C+=fe.nodeValue.length),(xe=fe.firstChild)!==null;)le=fe,fe=xe;for(;;){if(fe===a)break t;if(le===d&&++Y===x&&(D=C),le===w&&++ce===p&&(R=C),(xe=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=xe}d=D===-1||R===-1?null:{start:D,end:R}}else d=null}d=d||{start:0,end:0}}else d=null;for(Bm={focusedElem:a,selectionRange:d},bc=!1,ke=s;ke!==null;)if(s=ke,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,ke=a;else for(;ke!==null;){s=ke;try{var Se=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ee=Se.memoizedProps,wt=Se.memoizedState,W=s.stateNode,F=W.getSnapshotBeforeUpdate(s.elementType===s.type?Ee:un(s.type,Ee),wt);W.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var V=s.stateNode.containerInfo;V.nodeType===1?V.textContent="":V.nodeType===9&&V.documentElement&&V.removeChild(V.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ge){pt(s,s.return,ge)}if(a=s.sibling,a!==null){a.return=s.return,ke=a;break}ke=s.return}return Se=P1,P1=!1,Se}function Ul(a,s,d){var p=s.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&a)===a){var w=x.destroy;x.destroy=void 0,w!==void 0&&Cp(s,d,w)}x=x.next}while(x!==p)}}function td(a,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var d=s=s.next;do{if((d.tag&a)===a){var p=d.create;d.destroy=p()}d=d.next}while(d!==s)}}function Pp(a){var s=a.ref;if(s!==null){var d=a.stateNode;switch(a.tag){case 5:a=d;break;default:a=d}typeof s=="function"?s(a):s.current=a}}function O1(a){var s=a.alternate;s!==null&&(a.alternate=null,O1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&(delete s[Sn],delete s[_l],delete s[Km],delete s[j4],delete s[S4])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function _1(a){return a.tag===5||a.tag===3||a.tag===4}function M1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||_1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Op(a,s,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,s?d.nodeType===8?d.parentNode.insertBefore(a,s):d.insertBefore(a,s):(d.nodeType===8?(s=d.parentNode,s.insertBefore(a,d)):(s=d,s.appendChild(a)),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=Mc));else if(p!==4&&(a=a.child,a!==null))for(Op(a,s,d),a=a.sibling;a!==null;)Op(a,s,d),a=a.sibling}function _p(a,s,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,s?d.insertBefore(a,s):d.appendChild(a);else if(p!==4&&(a=a.child,a!==null))for(_p(a,s,d),a=a.sibling;a!==null;)_p(a,s,d),a=a.sibling}var Bt=null,cn=!1;function Bi(a,s,d){for(d=d.child;d!==null;)I1(a,s,d),d=d.sibling}function I1(a,s,d){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(mc,d)}catch{}switch(d.tag){case 5:nr||Vo(d,s);case 6:var p=Bt,x=cn;Bt=null,Bi(a,s,d),Bt=p,cn=x,Bt!==null&&(cn?(a=Bt,d=d.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)):Bt.removeChild(d.stateNode));break;case 18:Bt!==null&&(cn?(a=Bt,d=d.stateNode,a.nodeType===8?Wm(a.parentNode,d):a.nodeType===1&&Wm(a,d),bl(a)):Wm(Bt,d.stateNode));break;case 4:p=Bt,x=cn,Bt=d.stateNode.containerInfo,cn=!0,Bi(a,s,d),Bt=p,cn=x;break;case 0:case 11:case 14:case 15:if(!nr&&(p=d.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){x=p=p.next;do{var w=x,C=w.destroy;w=w.tag,C!==void 0&&((w&2)!==0||(w&4)!==0)&&Cp(d,s,C),x=x.next}while(x!==p)}Bi(a,s,d);break;case 1:if(!nr&&(Vo(d,s),p=d.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=d.memoizedProps,p.state=d.memoizedState,p.componentWillUnmount()}catch(D){pt(d,s,D)}Bi(a,s,d);break;case 21:Bi(a,s,d);break;case 22:d.mode&1?(nr=(p=nr)||d.memoizedState!==null,Bi(a,s,d),nr=p):Bi(a,s,d);break;default:Bi(a,s,d)}}function T1(a){var s=a.updateQueue;if(s!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new F4),s.forEach(function(p){var x=Y4.bind(null,a,p);d.has(p)||(d.add(p),p.then(x,x))})}}function dn(a,s){var d=s.deletions;if(d!==null)for(var p=0;px&&(x=C),p&=~w}if(p=x,p=bt()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*H4(p/1960))-p,10a?16:a,Hi===null)var p=!1;else{if(a=Hi,Hi=null,od=0,(qe&6)!==0)throw Error(r(331));var x=qe;for(qe|=4,ke=a.current;ke!==null;){var w=ke,C=w.child;if((ke.flags&16)!==0){var D=w.deletions;if(D!==null){for(var R=0;Rbt()-Tp?Ia(a,0):Ip|=d),br(a,s)}function V1(a,s){s===0&&((a.mode&1)===0?s=1:(s=gc,gc<<=1,(gc&130023424)===0&&(gc=4194304)));var d=cr();a=Zn(a,s),a!==null&&(pl(a,s,d),br(a,d))}function Q4(a){var s=a.memoizedState,d=0;s!==null&&(d=s.retryLane),V1(a,d)}function Y4(a,s){var d=0;switch(a.tag){case 13:var p=a.stateNode,x=a.memoizedState;x!==null&&(d=x.retryLane);break;case 19:p=a.stateNode;break;default:throw Error(r(314))}p!==null&&p.delete(s),V1(a,d)}var q1;q1=function(a,s,d){if(a!==null)if(a.memoizedProps!==s.pendingProps||gr.current)yr=!0;else{if((a.lanes&d)===0&&(s.flags&128)===0)return yr=!1,L4(a,s,d);yr=(a.flags&131072)!==0}else yr=!1,ut&&(s.flags&1048576)!==0&&Ab(s,$c,s.index);switch(s.lanes=0,s.tag){case 2:var p=s.type;Jc(a,s),a=s.pendingProps;var x=$o(s,er.current);Wo(s,d),x=dp(null,s,p,a,x,d);var w=fp();return s.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,vr(p)?(w=!0,Dc(s)):w=!1,s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,ip(s),x.updater=Xc,s.stateNode=x,x._reactInternals=s,yp(s,p,a,d),s=kp(null,s,p,!0,w,d)):(s.tag=0,ut&&w&&qm(s),ur(null,s,x,d),s=s.child),s;case 16:p=s.elementType;e:{switch(Jc(a,s),a=s.pendingProps,x=p._init,p=x(p._payload),s.type=p,x=s.tag=Z4(p),a=un(p,a),x){case 0:s=wp(null,s,p,a,d);break e;case 1:s=b1(null,s,p,a,d);break e;case 11:s=p1(null,s,p,a,d);break e;case 14:s=g1(null,s,p,un(p.type,a),d);break e}throw Error(r(306,p,""))}return s;case 0:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:un(p,x),wp(a,s,p,x,d);case 1:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:un(p,x),b1(a,s,p,x,d);case 3:e:{if(w1(s),a===null)throw Error(r(387));p=s.pendingProps,w=s.memoizedState,x=w.element,Rb(a,s),Wc(s,p,null,d);var C=s.memoizedState;if(p=C.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){x=Go(Error(r(423)),s),s=k1(a,s,p,d,x);break e}else if(p!==x){x=Go(Error(r(424)),s),s=k1(a,s,p,d,x);break e}else for(_r=Di(s.stateNode.containerInfo.firstChild),Or=s,ut=!0,ln=null,d=Tb(s,null,p,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Bo(),p===x){s=ei(a,s,d);break e}ur(a,s,p,d)}s=s.child}return s;case 5:return zb(s),a===null&&Xm(s),p=s.type,x=s.pendingProps,w=a!==null?a.memoizedProps:null,C=x.children,Um(p,x)?C=null:w!==null&&Um(p,w)&&(s.flags|=32),x1(a,s),ur(a,s,C,d),s.child;case 6:return a===null&&Xm(s),null;case 13:return j1(a,s,d);case 4:return ap(s,s.stateNode.containerInfo),p=s.pendingProps,a===null?s.child=Uo(s,null,p,d):ur(a,s,p,d),s.child;case 11:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:un(p,x),p1(a,s,p,x,d);case 7:return ur(a,s,s.pendingProps,d),s.child;case 8:return ur(a,s,s.pendingProps.children,d),s.child;case 12:return ur(a,s,s.pendingProps.children,d),s.child;case 10:e:{if(p=s.type._context,x=s.pendingProps,w=s.memoizedProps,C=x.value,tt(Bc,p._currentValue),p._currentValue=C,w!==null)if(sn(w.value,C)){if(w.children===x.children&&!gr.current){s=ei(a,s,d);break e}}else for(w=s.child,w!==null&&(w.return=s);w!==null;){var D=w.dependencies;if(D!==null){C=w.child;for(var R=D.firstContext;R!==null;){if(R.context===p){if(w.tag===1){R=Jn(-1,d&-d),R.tag=2;var Y=w.updateQueue;if(Y!==null){Y=Y.shared;var ce=Y.pending;ce===null?R.next=R:(R.next=ce.next,ce.next=R),Y.pending=R}}w.lanes|=d,R=w.alternate,R!==null&&(R.lanes|=d),rp(w.return,d,s),D.lanes|=d;break}R=R.next}}else if(w.tag===10)C=w.type===s.type?null:w.child;else if(w.tag===18){if(C=w.return,C===null)throw Error(r(341));C.lanes|=d,D=C.alternate,D!==null&&(D.lanes|=d),rp(C,d,s),C=w.sibling}else C=w.child;if(C!==null)C.return=w;else for(C=w;C!==null;){if(C===s){C=null;break}if(w=C.sibling,w!==null){w.return=C.return,C=w;break}C=C.return}w=C}ur(a,s,x.children,d),s=s.child}return s;case 9:return x=s.type,p=s.pendingProps.children,Wo(s,d),x=Hr(x),p=p(x),s.flags|=1,ur(a,s,p,d),s.child;case 14:return p=s.type,x=un(p,s.pendingProps),x=un(p.type,x),g1(a,s,p,x,d);case 15:return v1(a,s,s.type,s.pendingProps,d);case 17:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:un(p,x),Jc(a,s),s.tag=1,vr(p)?(a=!0,Dc(s)):a=!1,Wo(s,d),l1(s,p,x),yp(s,p,x,d),kp(null,s,p,!0,a,d);case 19:return N1(a,s,d);case 22:return y1(a,s,d)}throw Error(r(156,s.tag))};function Q1(a,s){return Cx(a,s)}function X4(a,s,d,p){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(a,s,d,p){return new X4(a,s,d,p)}function Up(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Z4(a){if(typeof a=="function")return Up(a)?1:0;if(a!=null){if(a=a.$$typeof,a===U)return 11;if(a===pe)return 14}return 2}function Gi(a,s){var d=a.alternate;return d===null?(d=Gr(a.tag,s,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=s,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&14680064,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,s=a.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function cd(a,s,d,p,x,w){var C=2;if(p=a,typeof a=="function")Up(a)&&(C=1);else if(typeof a=="string")C=5;else e:switch(a){case T:return Da(d.children,x,w,s);case B:C=8,x|=8;break;case $:return a=Gr(12,d,s,x|2),a.elementType=$,a.lanes=w,a;case ve:return a=Gr(13,d,s,x),a.elementType=ve,a.lanes=w,a;case ue:return a=Gr(19,d,s,x),a.elementType=ue,a.lanes=w,a;case se:return dd(d,x,w,s);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:C=10;break e;case Q:C=9;break e;case U:C=11;break e;case pe:C=14;break e;case oe:C=16,p=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return s=Gr(C,d,s,x),s.elementType=a,s.type=p,s.lanes=w,s}function Da(a,s,d,p){return a=Gr(7,a,p,s),a.lanes=d,a}function dd(a,s,d,p){return a=Gr(22,a,p,s),a.elementType=se,a.lanes=d,a.stateNode={isHidden:!1},a}function Hp(a,s,d){return a=Gr(6,a,null,s),a.lanes=d,a}function Wp(a,s,d){return s=Gr(4,a.children!==null?a.children:[],a.key,s),s.lanes=d,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}function J4(a,s,d,p,x){this.tag=s,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vm(0),this.expirationTimes=vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vm(0),this.identifierPrefix=p,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Kp(a,s,d,p,x,w,C,D,R){return a=new J4(a,s,d,D,R),s===1?(s=1,w===!0&&(s|=8)):s=0,w=Gr(3,null,null,s),a.current=w,w.stateNode=a,w.memoizedState={element:p,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},ip(w),a}function e3(a,s,d){var p=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Zp.exports=m3(),Zp.exports}var cw;function p3(){if(cw)return xd;cw=1;var e=kN();return xd.createRoot=e.createRoot,xd.hydrateRoot=e.hydrateRoot,xd}var g3=p3();const v3=b0(g3);var Wu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Za,ra,ws,fN,y3=(fN=class extends Wu{constructor(){super();De(this,Za);De(this,ra);De(this,ws);be(this,ws,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,ra)||this.setEventListener(L(this,ws))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ra))==null||t.call(this),be(this,ra,void 0))}setEventListener(t){var r;be(this,ws,t),(r=L(this,ra))==null||r.call(this),be(this,ra,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){L(this,Za)!==t&&(be(this,Za,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,Za)=="boolean"?L(this,Za):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Za=new WeakMap,ra=new WeakMap,ws=new WeakMap,fN),k0=new y3,x3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},na,x0,hN,b3=(hN=class{constructor(){De(this,na,x3);De(this,x0,!1)}setTimeoutProvider(e){be(this,na,e)}setTimeout(e,t){return L(this,na).setTimeout(e,t)}clearTimeout(e){L(this,na).clearTimeout(e)}setInterval(e,t){return L(this,na).setInterval(e,t)}clearInterval(e){L(this,na).clearInterval(e)}},na=new WeakMap,x0=new WeakMap,hN),Ga=new b3;function w3(e){setTimeout(e,0)}var k3=typeof window>"u"||"Deno"in globalThis;function jr(){}function j3(e,t){return typeof e=="function"?e(t):e}function Vg(e){return typeof e=="number"&&e>=0&&e!==1/0}function jN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function da(e,t){return typeof e=="function"?e(t):e}function Dr(e,t){return typeof e=="function"?e(t):e}function dw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:u,stale:c}=e;if(u){if(n){if(t.queryHash!==j0(u,t.options))return!1}else if(!vu(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||o&&!o(t))}function fw(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(gu(t.options.mutationKey)!==gu(o))return!1}else if(!vu(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function j0(e,t){return((t==null?void 0:t.queryKeyHashFn)||gu)(e)}function gu(e){return JSON.stringify(e,(t,r)=>Qg(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function vu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>vu(e[r],t[r])):!1}var S3=Object.prototype.hasOwnProperty;function SN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=hw(e)&&hw(t);if(!n&&!(Qg(e)&&Qg(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),c=u.length,f=n?new Array(c):{};let h=0;for(let m=0;m{Ga.setTimeout(t,e)})}function Yg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?SN(e,t):t}function E3(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A3(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var S0=Symbol();function NN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===S0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function EN(e,t){return typeof e=="function"?e(...t):!!e}function C3(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var yu=(()=>{let e=()=>k3;return{isServer(){return e()},setIsServer(t){e=t}}})();function Xg(){let e,t;const r=new Promise((i,o)=>{e=i,t=o});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var P3=w3;function O3(){let e=[],t=0,r=c=>{c()},n=c=>{c()},i=P3;const o=c=>{t?e.push(c):i(()=>{r(c)})},u=()=>{const c=e;e=[],c.length&&i(()=>{n(()=>{c.forEach(f=>{r(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||u()}return f},batchCalls:c=>(...f)=>{o(()=>{c(...f)})},schedule:o,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{n=c},setScheduler:c=>{i=c}}}var Gt=O3(),ks,ia,js,mN,_3=(mN=class extends Wu{constructor(){super();De(this,ks,!0);De(this,ia);De(this,js);be(this,js,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){L(this,ia)||this.setEventListener(L(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ia))==null||t.call(this),be(this,ia,void 0))}setEventListener(t){var r;be(this,js,t),(r=L(this,ia))==null||r.call(this),be(this,ia,t(this.setOnline.bind(this)))}setOnline(t){L(this,ks)!==t&&(be(this,ks,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return L(this,ks)}},ks=new WeakMap,ia=new WeakMap,js=new WeakMap,mN),rf=new _3;function M3(e){return Math.min(1e3*2**e,3e4)}function AN(e){return(e??"online")==="online"?rf.isOnline():!0}var Zg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function CN(e){let t=!1,r=0,n;const i=Xg(),o=()=>i.status!=="pending",u=k=>{var S;if(!o()){const N=new Zg(k);v(N),(S=e.onCancel)==null||S.call(e,N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>k0.isFocused()&&(e.networkMode==="always"||rf.isOnline())&&e.canRun(),m=()=>AN(e.networkMode)&&e.canRun(),g=k=>{o()||(n==null||n(),i.resolve(k))},v=k=>{o()||(n==null||n(),i.reject(k))},b=()=>new Promise(k=>{var S;n=N=>{(o()||h())&&k(N)},(S=e.onPause)==null||S.call(e)}).then(()=>{var k;n=void 0,o()||(k=e.onContinue)==null||k.call(e)}),j=()=>{if(o())return;let k;const S=r===0?e.initialPromise:void 0;try{k=S??e.fn()}catch(N){k=Promise.reject(N)}Promise.resolve(k).then(g).catch(N=>{var O;if(o())return;const E=e.retry??(yu.isServer()?0:3),A=e.retryDelay??M3,P=typeof A=="function"?A(r,N):A,_=E===!0||typeof E=="number"&&rh()?void 0:b()).then(()=>{t?v(N):j()})})};return{promise:i,status:()=>i.status,cancel:u,continue:()=>(n==null||n(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?j():b().then(j),i)}}var Ja,pN,PN=(pN=class{constructor(){De(this,Ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vg(this.gcTime)&&be(this,Ja,Ga.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yu.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,Ja)!==void 0&&(Ga.clearTimeout(L(this,Ja)),be(this,Ja,void 0))}},Ja=new WeakMap,pN);function I3(e){return{onFetch:(t,r)=>{var m,g,v,b,j;const n=t.options,i=(v=(g=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:g.fetchMore)==null?void 0:v.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],u=((j=t.state.data)==null?void 0:j.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let k=!1;const S=A=>{C3(A,()=>t.signal,()=>k=!0)},N=NN(t.options,t.fetchOptions),E=async(A,P,_)=>{if(k)return Promise.reject(t.signal.reason);if(P==null&&A.pages.length)return Promise.resolve(A);const T=(()=>{const Q={client:t.client,queryKey:t.queryKey,pageParam:P,direction:_?"backward":"forward",meta:t.options.meta};return S(Q),Q})(),B=await N(T),{maxPages:$}=t.options,z=_?A3:E3;return{pages:z(A.pages,B,$),pageParams:z(A.pageParams,P,$)}};if(i&&o.length){const A=i==="backward",P=A?T3:pw,_={pages:o,pageParams:u},O=P(n,_);c=await E(_,O,A)}else{const A=e??o.length;do{const P=f===0?u[0]??n.initialPageParam:pw(n,c);if(f>0&&P==null)break;c=await E(c,P),f++}while(f{var k,S;return(S=(k=t.options).persister)==null?void 0:S.call(k,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function pw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function T3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ss,eo,Ns,qr,to,Dt,zu,ro,Tr,ON,ii,gN,D3=(gN=class extends PN{constructor(t){super();De(this,Tr);De(this,Ss);De(this,eo);De(this,Ns);De(this,qr);De(this,to);De(this,Dt);De(this,zu);De(this,ro);be(this,ro,!1),be(this,zu,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,to,t.client),be(this,qr,L(this,to).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,eo,vw(this.options)),this.state=t.state??L(this,eo),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,Ss)}get promise(){var t;return(t=L(this,Dt))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,zu),...t},t!=null&&t._type&&be(this,Ss,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=vw(this.options);r.data!==void 0&&(this.setState(gw(r.data,r.dataUpdatedAt)),be(this,eo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,qr).remove(this)}setData(t,r){const n=Yg(this.state.data,t,this.options);return He(this,Tr,ii).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){He(this,Tr,ii).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=L(this,Dt))==null?void 0:n.promise;return(i=L(this,Dt))==null||i.cancel(t),r?r.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,eo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Dr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===S0||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>da(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!jN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Dt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Dt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,qr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,Dt)&&(L(this,ro)||He(this,Tr,ON).call(this)?L(this,Dt).cancel({revert:!0}):L(this,Dt).cancelRetry()),this.scheduleGc()),L(this,qr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,Tr,ii).call(this,{type:"invalidate"})}async fetch(t,r){var h,m,g,v,b,j,k,S,N,E,A;if(this.state.fetchStatus!=="idle"&&((h=L(this,Dt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,Dt))return L(this,Dt).continueRetry(),L(this,Dt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const P=this.observers.find(_=>_.options.queryFn);P&&this.setOptions(P.options)}const n=new AbortController,i=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(be(this,ro,!0),n.signal)})},o=()=>{const P=NN(this.options,r),O=(()=>{const T={client:L(this,to),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return be(this,ro,!1),this.options.persister?this.options.persister(P,O,this):P(O)},c=(()=>{const P={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:L(this,to),state:this.state,fetchFn:o};return i(P),P})(),f=L(this,Ss)==="infinite"?I3(this.options.pages):this.options.behavior;f==null||f.onFetch(c,this),be(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&He(this,Tr,ii).call(this,{type:"fetch",meta:(g=c.fetchOptions)==null?void 0:g.meta}),be(this,Dt,CN({initialPromise:r==null?void 0:r.initialPromise,fn:c.fetchFn,onCancel:P=>{P instanceof Zg&&P.revert&&this.setState({...L(this,Ns),fetchStatus:"idle"}),n.abort()},onFail:(P,_)=>{He(this,Tr,ii).call(this,{type:"failed",failureCount:P,error:_})},onPause:()=>{He(this,Tr,ii).call(this,{type:"pause"})},onContinue:()=>{He(this,Tr,ii).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const P=await L(this,Dt).start();if(P===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(P),(b=(v=L(this,qr).config).onSuccess)==null||b.call(v,P,this),(k=(j=L(this,qr).config).onSettled)==null||k.call(j,P,this.state.error,this),P}catch(P){if(P instanceof Zg){if(P.silent)return L(this,Dt).promise;if(P.revert){if(this.state.data===void 0)throw P;return this.state.data}}throw He(this,Tr,ii).call(this,{type:"error",error:P}),(N=(S=L(this,qr).config).onError)==null||N.call(S,P,this),(A=(E=L(this,qr).config).onSettled)==null||A.call(E,this.state.data,P,this),P}finally{this.scheduleGc()}}},Ss=new WeakMap,eo=new WeakMap,Ns=new WeakMap,qr=new WeakMap,to=new WeakMap,Dt=new WeakMap,zu=new WeakMap,ro=new WeakMap,Tr=new WeakSet,ON=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ii=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._N(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...gw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,Ns,t.manual?i:void 0),i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Gt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),L(this,qr).notify({query:this,type:"updated",action:t})})},gN);function _N(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:AN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var kr,Ke,Fu,dr,no,Es,oi,aa,Bu,As,Cs,io,ao,oa,Ps,Xe,lu,Jg,ev,tv,rv,nv,iv,av,MN,vN,R3=(vN=class extends Wu{constructor(t,r){super();De(this,Xe);De(this,kr);De(this,Ke);De(this,Fu);De(this,dr);De(this,no);De(this,Es);De(this,oi);De(this,aa);De(this,Bu);De(this,As);De(this,Cs);De(this,io);De(this,ao);De(this,oa);De(this,Ps,new Set);this.options=r,be(this,kr,t),be(this,aa,null),be(this,oi,Xg()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Ke).addObserver(this),yw(L(this,Ke),this.options)?He(this,Xe,lu).call(this):this.updateResult(),He(this,Xe,rv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ov(L(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ov(L(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,Xe,nv).call(this),He(this,Xe,iv).call(this),L(this,Ke).removeObserver(this)}setOptions(t){const r=this.options,n=L(this,Ke);if(this.options=L(this,kr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dr(this.options.enabled,L(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,Xe,av).call(this),L(this,Ke).setOptions(this.options),r._defaulted&&!qg(this.options,r)&&L(this,kr).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ke),observer:this});const i=this.hasListeners();i&&xw(L(this,Ke),n,this.options,r)&&He(this,Xe,lu).call(this),this.updateResult(),i&&(L(this,Ke)!==n||Dr(this.options.enabled,L(this,Ke))!==Dr(r.enabled,L(this,Ke))||da(this.options.staleTime,L(this,Ke))!==da(r.staleTime,L(this,Ke)))&&He(this,Xe,Jg).call(this);const o=He(this,Xe,ev).call(this);i&&(L(this,Ke)!==n||Dr(this.options.enabled,L(this,Ke))!==Dr(r.enabled,L(this,Ke))||o!==L(this,oa))&&He(this,Xe,tv).call(this,o)}getOptimisticResult(t){const r=L(this,kr).getQueryCache().build(L(this,kr),t),n=this.createResult(r,t);return $3(this,n)&&(be(this,dr,n),be(this,Es,this.options),be(this,no,L(this,Ke).state)),n}getCurrentResult(){return L(this,dr)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,oi).status==="pending"&&L(this,oi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){L(this,Ps).add(t)}getCurrentQuery(){return L(this,Ke)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,kr).defaultQueryOptions(t),n=L(this,kr).getQueryCache().build(L(this,kr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return He(this,Xe,lu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,dr)))}createResult(t,r){var $;const n=L(this,Ke),i=this.options,o=L(this,dr),u=L(this,no),c=L(this,Es),h=t!==n?t.state:L(this,Fu),{state:m}=t;let g={...m},v=!1,b;if(r._optimisticResults){const z=this.hasListeners(),Q=!z&&yw(t,r),U=z&&xw(t,n,r,i);(Q||U)&&(g={...g,..._N(m.data,t.options)}),r._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:j,errorUpdatedAt:k,status:S}=g;b=g.data;let N=!1;if(r.placeholderData!==void 0&&b===void 0&&S==="pending"){let z;o!=null&&o.isPlaceholderData&&r.placeholderData===(c==null?void 0:c.placeholderData)?(z=o.data,N=!0):z=typeof r.placeholderData=="function"?r.placeholderData(($=L(this,Cs))==null?void 0:$.state.data,L(this,Cs)):r.placeholderData,z!==void 0&&(S="success",b=Yg(o==null?void 0:o.data,z,r),v=!0)}if(r.select&&b!==void 0&&!N)if(o&&b===(u==null?void 0:u.data)&&r.select===L(this,Bu))b=L(this,As);else try{be(this,Bu,r.select),b=r.select(b),b=Yg(o==null?void 0:o.data,b,r),be(this,As,b),be(this,aa,null)}catch(z){be(this,aa,z)}L(this,aa)&&(j=L(this,aa),b=L(this,As),k=Date.now(),S="error");const E=g.fetchStatus==="fetching",A=S==="pending",P=S==="error",_=A&&E,O=b!==void 0,B={status:S,fetchStatus:g.fetchStatus,isPending:A,isSuccess:S==="success",isError:P,isInitialLoading:_,isLoading:_,data:b,dataUpdatedAt:g.dataUpdatedAt,error:j,errorUpdatedAt:k,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:P&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:P&&O,isStale:N0(t,r),refetch:this.refetch,promise:L(this,oi),isEnabled:Dr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=B.data!==void 0,Q=B.status==="error"&&!z,U=pe=>{Q?pe.reject(B.error):z&&pe.resolve(B.data)},ve=()=>{const pe=be(this,oi,B.promise=Xg());U(pe)},ue=L(this,oi);switch(ue.status){case"pending":t.queryHash===n.queryHash&&U(ue);break;case"fulfilled":(Q||B.data!==ue.value)&&ve();break;case"rejected":(!Q||B.error!==ue.reason)&&ve();break}}return B}updateResult(){const t=L(this,dr),r=this.createResult(L(this,Ke),this.options);if(be(this,no,L(this,Ke).state),be(this,Es,this.options),L(this,no).data!==void 0&&be(this,Cs,L(this,Ke)),qg(r,t))return;be(this,dr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!L(this,Ps).size)return!0;const u=new Set(o??L(this,Ps));return this.options.throwOnError&&u.add("error"),Object.keys(L(this,dr)).some(c=>{const f=c;return L(this,dr)[f]!==t[f]&&u.has(f)})};He(this,Xe,MN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,Xe,rv).call(this)}},kr=new WeakMap,Ke=new WeakMap,Fu=new WeakMap,dr=new WeakMap,no=new WeakMap,Es=new WeakMap,oi=new WeakMap,aa=new WeakMap,Bu=new WeakMap,As=new WeakMap,Cs=new WeakMap,io=new WeakMap,ao=new WeakMap,oa=new WeakMap,Ps=new WeakMap,Xe=new WeakSet,lu=function(t){He(this,Xe,av).call(this);let r=L(this,Ke).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jr)),r},Jg=function(){He(this,Xe,nv).call(this);const t=da(this.options.staleTime,L(this,Ke));if(yu.isServer()||L(this,dr).isStale||!Vg(t))return;const n=jN(L(this,dr).dataUpdatedAt,t)+1;be(this,io,Ga.setTimeout(()=>{L(this,dr).isStale||this.updateResult()},n))},ev=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ke)):this.options.refetchInterval)??!1},tv=function(t){He(this,Xe,iv).call(this),be(this,oa,t),!(yu.isServer()||Dr(this.options.enabled,L(this,Ke))===!1||!Vg(L(this,oa))||L(this,oa)===0)&&be(this,ao,Ga.setInterval(()=>{(this.options.refetchIntervalInBackground||k0.isFocused())&&He(this,Xe,lu).call(this)},L(this,oa)))},rv=function(){He(this,Xe,Jg).call(this),He(this,Xe,tv).call(this,He(this,Xe,ev).call(this))},nv=function(){L(this,io)!==void 0&&(Ga.clearTimeout(L(this,io)),be(this,io,void 0))},iv=function(){L(this,ao)!==void 0&&(Ga.clearInterval(L(this,ao)),be(this,ao,void 0))},av=function(){const t=L(this,kr).getQueryCache().build(L(this,kr),this.options);if(t===L(this,Ke))return;const r=L(this,Ke);be(this,Ke,t),be(this,Fu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},MN=function(t){Gt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,dr))}),L(this,kr).getQueryCache().notify({query:L(this,Ke),type:"observerResultsUpdated"})})},vN);function L3(e,t){return Dr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Dr(t.retryOnMount,e)===!1)}function yw(e,t){return L3(e,t)||e.state.data!==void 0&&ov(e,t,t.refetchOnMount)}function ov(e,t,r){if(Dr(t.enabled,e)!==!1&&da(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&N0(e,t)}return!1}function xw(e,t,r,n){return(e!==t||Dr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&N0(e,r)}function N0(e,t){return Dr(t.enabled,e)!==!1&&e.isStaleByTime(da(t.staleTime,e))}function $3(e,t){return!qg(e.getCurrentResult(),t)}var Uu,Mn,ir,oo,In,Xi,yN,z3=(yN=class extends PN{constructor(t){super();De(this,In);De(this,Uu);De(this,Mn);De(this,ir);De(this,oo);be(this,Uu,t.client),this.mutationId=t.mutationId,be(this,ir,t.mutationCache),be(this,Mn,[]),this.state=t.state||F3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Mn).includes(t)||(L(this,Mn).push(t),this.clearGcTimeout(),L(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,Mn,L(this,Mn).filter(r=>r!==t)),this.scheduleGc(),L(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Mn).length||(this.state.status==="pending"?this.scheduleGc():L(this,ir).remove(this))}continue(){var t;return((t=L(this,oo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,c,f,h,m,g,v,b,j,k,S,N,E,A,P,_,O,T;const r=()=>{He(this,In,Xi).call(this,{type:"continue"})},n={client:L(this,Uu),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,oo,CN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(B,$)=>{He(this,In,Xi).call(this,{type:"failed",failureCount:B,error:$})},onPause:()=>{He(this,In,Xi).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,ir).canRun(this)}));const i=this.state.status==="pending",o=!L(this,oo).canStart();try{if(i)r();else{He(this,In,Xi).call(this,{type:"pending",variables:t,isPaused:o}),L(this,ir).config.onMutate&&await L(this,ir).config.onMutate(t,this,n);const $=await((c=(u=this.options).onMutate)==null?void 0:c.call(u,t,n));$!==this.state.context&&He(this,In,Xi).call(this,{type:"pending",context:$,variables:t,isPaused:o})}const B=await L(this,oo).start();return await((h=(f=L(this,ir).config).onSuccess)==null?void 0:h.call(f,B,t,this.state.context,this,n)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,B,t,this.state.context,n)),await((b=(v=L(this,ir).config).onSettled)==null?void 0:b.call(v,B,null,this.state.variables,this.state.context,this,n)),await((k=(j=this.options).onSettled)==null?void 0:k.call(j,B,null,t,this.state.context,n)),He(this,In,Xi).call(this,{type:"success",data:B}),B}catch(B){try{await((N=(S=L(this,ir).config).onError)==null?void 0:N.call(S,B,t,this.state.context,this,n))}catch($){Promise.reject($)}try{await((A=(E=this.options).onError)==null?void 0:A.call(E,B,t,this.state.context,n))}catch($){Promise.reject($)}try{await((_=(P=L(this,ir).config).onSettled)==null?void 0:_.call(P,void 0,B,this.state.variables,this.state.context,this,n))}catch($){Promise.reject($)}try{await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,B,t,this.state.context,n))}catch($){Promise.reject($)}throw He(this,In,Xi).call(this,{type:"error",error:B}),B}finally{L(this,ir).runNext(this)}}},Uu=new WeakMap,Mn=new WeakMap,ir=new WeakMap,oo=new WeakMap,In=new WeakSet,Xi=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Gt.batch(()=>{L(this,Mn).forEach(n=>{n.onMutationUpdate(t)}),L(this,ir).notify({mutation:this,type:"updated",action:t})})},yN);function F3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var si,mn,Hu,xN,B3=(xN=class extends Wu{constructor(t={}){super();De(this,si);De(this,mn);De(this,Hu);this.config=t,be(this,si,new Set),be(this,mn,new Map),be(this,Hu,0)}build(t,r,n){const i=new z3({client:t,mutationCache:this,mutationId:++yd(this,Hu)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){L(this,si).add(t);const r=bd(t);if(typeof r=="string"){const n=L(this,mn).get(r);n?n.push(t):L(this,mn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,si).delete(t)){const r=bd(t);if(typeof r=="string"){const n=L(this,mn).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&L(this,mn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=bd(t);if(typeof r=="string"){const n=L(this,mn).get(r),i=n==null?void 0:n.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=bd(t);if(typeof r=="string"){const i=(n=L(this,mn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Gt.batch(()=>{L(this,si).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,si).clear(),L(this,mn).clear()})}getAll(){return Array.from(L(this,si))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fw(r,n))}findAll(t={}){return this.getAll().filter(r=>fw(t,r))}notify(t){Gt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Gt.batch(()=>Promise.all(t.map(r=>r.continue().catch(jr))))}},si=new WeakMap,mn=new WeakMap,Hu=new WeakMap,xN);function bd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Tn,bN,U3=(bN=class extends Wu{constructor(t={}){super();De(this,Tn);this.config=t,be(this,Tn,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??j0(i,r);let u=this.get(o);return u||(u=new D3({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(u)),u}add(t){L(this,Tn).has(t.queryHash)||(L(this,Tn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,Tn).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,Tn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Tn).get(t)}getAll(){return[...L(this,Tn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>dw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>dw(t,n)):r}notify(t){Gt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tn=new WeakMap,bN),gt,sa,la,Os,_s,ua,Ms,Is,wN,H3=(wN=class{constructor(e={}){De(this,gt);De(this,sa);De(this,la);De(this,Os);De(this,_s);De(this,ua);De(this,Ms);De(this,Is);be(this,gt,e.queryCache||new U3),be(this,sa,e.mutationCache||new B3),be(this,la,e.defaultOptions||{}),be(this,Os,new Map),be(this,_s,new Map),be(this,ua,0)}mount(){yd(this,ua)._++,L(this,ua)===1&&(be(this,Ms,k0.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,gt).onFocus())})),be(this,Is,rf.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,gt).onOnline())})))}unmount(){var e,t;yd(this,ua)._--,L(this,ua)===0&&((e=L(this,Ms))==null||e.call(this),be(this,Ms,void 0),(t=L(this,Is))==null||t.call(this),be(this,Is,void 0))}isFetching(e){return L(this,gt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,sa).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,gt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=L(this,gt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(da(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return L(this,gt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=L(this,gt).get(n.queryHash),o=i==null?void 0:i.state.data,u=j3(t,o);if(u!==void 0)return L(this,gt).build(this,n).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Gt.batch(()=>L(this,gt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,gt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,gt);Gt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,gt);return Gt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Gt.batch(()=>L(this,gt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(jr).catch(jr)}invalidateQueries(e,t={}){return Gt.batch(()=>(L(this,gt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Gt.batch(()=>L(this,gt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(jr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,gt).build(this,t);return r.isStaleByTime(da(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return rf.isOnline()?L(this,sa).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,gt)}getMutationCache(){return L(this,sa)}getDefaultOptions(){return L(this,la)}setDefaultOptions(e){be(this,la,e)}setQueryDefaults(e,t){L(this,Os).set(gu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,Os).values()],r={};return t.forEach(n=>{vu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){L(this,_s).set(gu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,_s).values()],r={};return t.forEach(n=>{vu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,la).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=j0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===S0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,la).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,gt).clear(),L(this,sa).clear()}},gt=new WeakMap,sa=new WeakMap,la=new WeakMap,Os=new WeakMap,_s=new WeakMap,ua=new WeakMap,Ms=new WeakMap,Is=new WeakMap,wN),IN=y.createContext(void 0),Kn=e=>{const t=y.useContext(IN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},W3=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(IN.Provider,{value:e,children:t})),TN=y.createContext(!1),K3=()=>y.useContext(TN);TN.Provider;function G3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var V3=y.createContext(G3()),q3=()=>y.useContext(V3),Q3=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?EN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Y3=e=>{y.useEffect(()=>{e.clearReset()},[e])},X3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||EN(r,[e.error,n])),Z3=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},J3=(e,t)=>e.isLoading&&e.isFetching&&!t,eM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function tM(e,t,r){var b,j,k,S;const n=K3(),i=q3(),o=Kn(),u=o.defaultQueryOptions(e);(j=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||j.call(b,u);const c=o.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=n?"isRestoring":f?"optimistic":void 0,Z3(u),Q3(u,i,c),Y3(i);const h=!o.getQueryCache().get(u.queryHash),[m]=y.useState(()=>new t(o,u)),g=m.getOptimisticResult(u),v=!n&&f;if(y.useSyncExternalStore(y.useCallback(N=>{const E=v?m.subscribe(Gt.batchCalls(N)):jr;return m.updateResult(),E},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),y.useEffect(()=>{m.setOptions(u)},[u,m]),eM(u,g))throw bw(u,m,i);if(X3({result:g,errorResetBoundary:i,throwOnError:u.throwOnError,query:c,suspense:u.suspense}))throw g.error;if((S=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||S.call(k,u,g),u.experimental_prefetchInRender&&!yu.isServer()&&J3(g,n)){const N=h?bw(u,m,i):c==null?void 0:c.promise;N==null||N.catch(jr).finally(()=>{m.updateResult()})}return u.notifyOnChangeProps?g:m.trackResult(g)}function Yt(e,t){return tM(e,R3)}/** +`+w.stack}return{value:a,source:s,stack:x,digest:null}}function xp(a,s,d){return{value:a,source:null,stack:d??null,digest:s??null}}function bp(a,s){try{console.error(s.value)}catch(d){setTimeout(function(){throw d})}}var T4=typeof WeakMap=="function"?WeakMap:Map;function c1(a,s,d){d=Jn(-1,d),d.tag=3,d.payload={element:null};var p=s.value;return d.callback=function(){nd||(nd=!0,Dp=p),bp(a,s)},d}function d1(a,s,d){d=Jn(-1,d),d.tag=3;var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var x=s.value;d.payload=function(){return p(x)},d.callback=function(){bp(a,s)}}var w=a.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(d.callback=function(){bp(a,s),typeof p!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var C=s.stack;this.componentDidCatch(s.value,{componentStack:C!==null?C:""})}),d}function f1(a,s,d){var p=a.pingCache;if(p===null){p=a.pingCache=new T4;var x=new Set;p.set(s,x)}else x=p.get(s),x===void 0&&(x=new Set,p.set(s,x));x.has(d)||(x.add(d),a=q4.bind(null,a,s,d),s.then(a,a))}function h1(a){do{var s;if((s=a.tag===13)&&(s=a.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return a;a=a.return}while(a!==null);return null}function m1(a,s,d,p,x){return(a.mode&1)===0?(a===s?a.flags|=65536:(a.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(s=Jn(-1,1),s.tag=2,Fi(d,s,1))),d.lanes|=1),a):(a.flags|=65536,a.lanes=x,a)}var D4=P.ReactCurrentOwner,yr=!1;function ur(a,s,d,p){s.child=a===null?Tb(s,null,d,p):Uo(s,a.child,d,p)}function p1(a,s,d,p,x){d=d.render;var w=s.ref;return Wo(s,x),p=dp(a,s,d,p,w,x),d=fp(),a!==null&&!yr?(s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~x,ei(a,s,x)):(ut&&d&&qm(s),s.flags|=1,ur(a,s,p,x),s.child)}function g1(a,s,d,p,x){if(a===null){var w=d.type;return typeof w=="function"&&!Up(w)&&w.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(s.tag=15,s.type=w,v1(a,s,w,p,x)):(a=ud(d.type,null,p,s,s.mode,x),a.ref=s.ref,a.return=s,s.child=a)}if(w=a.child,(a.lanes&x)===0){var C=w.memoizedProps;if(d=d.compare,d=d!==null?d:Nl,d(C,p)&&a.ref===s.ref)return ei(a,s,x)}return s.flags|=1,a=Gi(w,p),a.ref=s.ref,a.return=s,s.child=a}function v1(a,s,d,p,x){if(a!==null){var w=a.memoizedProps;if(Nl(w,p)&&a.ref===s.ref)if(yr=!1,s.pendingProps=p=w,(a.lanes&x)!==0)(a.flags&131072)!==0&&(yr=!0);else return s.lanes=a.lanes,ei(a,s,x)}return wp(a,s,d,p,x)}function y1(a,s,d){var p=s.pendingProps,x=p.children,w=a!==null?a.memoizedState:null;if(p.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(qo,Mr),Mr|=d;else{if((d&1073741824)===0)return a=w!==null?w.baseLanes|d:d,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:a,cachePool:null,transitions:null},s.updateQueue=null,tt(qo,Mr),Mr|=a,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=w!==null?w.baseLanes:d,tt(qo,Mr),Mr|=p}else w!==null?(p=w.baseLanes|d,s.memoizedState=null):p=d,tt(qo,Mr),Mr|=p;return ur(a,s,x,d),s.child}function x1(a,s){var d=s.ref;(a===null&&d!==null||a!==null&&a.ref!==d)&&(s.flags|=512,s.flags|=2097152)}function wp(a,s,d,p,x){var w=vr(d)?Na:er.current;return w=$o(s,w),Wo(s,x),d=dp(a,s,d,p,w,x),p=fp(),a!==null&&!yr?(s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~x,ei(a,s,x)):(ut&&p&&qm(s),s.flags|=1,ur(a,s,d,x),s.child)}function b1(a,s,d,p,x){if(vr(d)){var w=!0;Tc(s)}else w=!1;if(Wo(s,x),s.stateNode===null)Zc(a,s),l1(s,d,p),yp(s,d,p,x),p=!0;else if(a===null){var C=s.stateNode,D=s.memoizedProps;C.props=D;var R=C.context,Y=d.contextType;typeof Y=="object"&&Y!==null?Y=Hr(Y):(Y=vr(d)?Na:er.current,Y=$o(s,Y));var ce=d.getDerivedStateFromProps,fe=typeof ce=="function"||typeof C.getSnapshotBeforeUpdate=="function";fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(D!==p||R!==Y)&&u1(s,C,p,Y),zi=!1;var le=s.memoizedState;C.state=le,Hc(s,p,C,x),R=s.memoizedState,D!==p||le!==R||gr.current||zi?(typeof ce=="function"&&(vp(s,d,ce,p),R=s.memoizedState),(D=zi||s1(s,d,D,p,le,R,Y))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(s.flags|=4194308)):(typeof C.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=R),C.props=p,C.state=R,C.context=Y,p=D):(typeof C.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{C=s.stateNode,Rb(a,s),D=s.memoizedProps,Y=s.type===s.elementType?D:cn(s.type,D),C.props=Y,fe=s.pendingProps,le=C.context,R=d.contextType,typeof R=="object"&&R!==null?R=Hr(R):(R=vr(d)?Na:er.current,R=$o(s,R));var xe=d.getDerivedStateFromProps;(ce=typeof xe=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(D!==fe||le!==R)&&u1(s,C,p,R),zi=!1,le=s.memoizedState,C.state=le,Hc(s,p,C,x);var Se=s.memoizedState;D!==fe||le!==Se||gr.current||zi?(typeof xe=="function"&&(vp(s,d,xe,p),Se=s.memoizedState),(Y=zi||s1(s,d,Y,p,le,Se,R)||!1)?(ce||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(p,Se,R),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(p,Se,R)),typeof C.componentDidUpdate=="function"&&(s.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof C.componentDidUpdate!="function"||D===a.memoizedProps&&le===a.memoizedState||(s.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||D===a.memoizedProps&&le===a.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=Se),C.props=p,C.state=Se,C.context=R,p=Y):(typeof C.componentDidUpdate!="function"||D===a.memoizedProps&&le===a.memoizedState||(s.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||D===a.memoizedProps&&le===a.memoizedState||(s.flags|=1024),p=!1)}return kp(a,s,d,p,w,x)}function kp(a,s,d,p,x,w){x1(a,s);var C=(s.flags&128)!==0;if(!p&&!C)return x&&Nb(s,d,!1),ei(a,s,w);p=s.stateNode,D4.current=s;var D=C&&typeof d.getDerivedStateFromError!="function"?null:p.render();return s.flags|=1,a!==null&&C?(s.child=Uo(s,a.child,null,w),s.child=Uo(s,null,D,w)):ur(a,s,D,w),s.memoizedState=p.state,x&&Nb(s,d,!0),s.child}function w1(a){var s=a.stateNode;s.pendingContext?jb(a,s.pendingContext,s.pendingContext!==s.context):s.context&&jb(a,s.context,!1),ap(a,s.containerInfo)}function k1(a,s,d,p,x){return Bo(),Zm(x),s.flags|=256,ur(a,s,d,p),s.child}var jp={dehydrated:null,treeContext:null,retryLane:0};function Sp(a){return{baseLanes:a,cachePool:null,transitions:null}}function j1(a,s,d){var p=s.pendingProps,x=ht.current,w=!1,C=(s.flags&128)!==0,D;if((D=C)||(D=a!==null&&a.memoizedState===null?!1:(x&2)!==0),D?(w=!0,s.flags&=-129):(a===null||a.memoizedState!==null)&&(x|=1),tt(ht,x&1),a===null)return Xm(s),a=s.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((s.mode&1)===0?s.lanes=1:a.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(C=p.children,a=p.fallback,w?(p=s.mode,w=s.child,C={mode:"hidden",children:C},(p&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=C):w=cd(C,p,0,null),a=Da(a,p,d,null),w.return=s,a.return=s,w.sibling=a,s.child=w,s.child.memoizedState=Sp(d),s.memoizedState=jp,a):Np(s,C));if(x=a.memoizedState,x!==null&&(D=x.dehydrated,D!==null))return R4(a,s,C,p,D,x,d);if(w){w=p.fallback,C=s.mode,x=a.child,D=x.sibling;var R={mode:"hidden",children:p.children};return(C&1)===0&&s.child!==x?(p=s.child,p.childLanes=0,p.pendingProps=R,s.deletions=null):(p=Gi(x,R),p.subtreeFlags=x.subtreeFlags&14680064),D!==null?w=Gi(D,w):(w=Da(w,C,d,null),w.flags|=2),w.return=s,p.return=s,p.sibling=w,s.child=p,p=w,w=s.child,C=a.child.memoizedState,C=C===null?Sp(d):{baseLanes:C.baseLanes|d,cachePool:null,transitions:C.transitions},w.memoizedState=C,w.childLanes=a.childLanes&~d,s.memoizedState=jp,p}return w=a.child,a=w.sibling,p=Gi(w,{mode:"visible",children:p.children}),(s.mode&1)===0&&(p.lanes=d),p.return=s,p.sibling=null,a!==null&&(d=s.deletions,d===null?(s.deletions=[a],s.flags|=16):d.push(a)),s.child=p,s.memoizedState=null,p}function Np(a,s){return s=cd({mode:"visible",children:s},a.mode,0,null),s.return=a,a.child=s}function Xc(a,s,d,p){return p!==null&&Zm(p),Uo(s,a.child,null,d),a=Np(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function R4(a,s,d,p,x,w,C){if(d)return s.flags&256?(s.flags&=-257,p=xp(Error(r(422))),Xc(a,s,C,p)):s.memoizedState!==null?(s.child=a.child,s.flags|=128,null):(w=p.fallback,x=s.mode,p=cd({mode:"visible",children:p.children},x,0,null),w=Da(w,x,C,null),w.flags|=2,p.return=s,w.return=s,p.sibling=w,s.child=p,(s.mode&1)!==0&&Uo(s,a.child,null,C),s.child.memoizedState=Sp(C),s.memoizedState=jp,w);if((s.mode&1)===0)return Xc(a,s,C,null);if(x.data==="$!"){if(p=x.nextSibling&&x.nextSibling.dataset,p)var D=p.dgst;return p=D,w=Error(r(419)),p=xp(w,p,void 0),Xc(a,s,C,p)}if(D=(C&a.childLanes)!==0,yr||D){if(p=It,p!==null){switch(C&-C){case 4:x=2;break;case 16:x=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(p.suspendedLanes|C))!==0?0:x,x!==0&&x!==w.retryLane&&(w.retryLane=x,Zn(a,x),hn(p,a,x,-1))}return Bp(),p=xp(Error(r(421))),Xc(a,s,C,p)}return x.data==="$?"?(s.flags|=128,s.child=a.child,s=Q4.bind(null,a),x._reactRetry=s,null):(a=w.treeContext,_r=Di(x.nextSibling),Or=s,ut=!0,un=null,a!==null&&(Br[Ur++]=Yn,Br[Ur++]=Xn,Br[Ur++]=Ea,Yn=a.id,Xn=a.overflow,Ea=s),s=Np(s,p.children),s.flags|=4096,s)}function S1(a,s,d){a.lanes|=s;var p=a.alternate;p!==null&&(p.lanes|=s),rp(a.return,s,d)}function Ep(a,s,d,p,x){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:x}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=p,w.tail=d,w.tailMode=x)}function N1(a,s,d){var p=s.pendingProps,x=p.revealOrder,w=p.tail;if(ur(a,s,p.children,d),p=ht.current,(p&2)!==0)p=p&1|2,s.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&S1(a,d,s);else if(a.tag===19)S1(a,d,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}p&=1}if(tt(ht,p),(s.mode&1)===0)s.memoizedState=null;else switch(x){case"forwards":for(d=s.child,x=null;d!==null;)a=d.alternate,a!==null&&Wc(a)===null&&(x=d),d=d.sibling;d=x,d===null?(x=s.child,s.child=null):(x=d.sibling,d.sibling=null),Ep(s,!1,x,d,w);break;case"backwards":for(d=null,x=s.child,s.child=null;x!==null;){if(a=x.alternate,a!==null&&Wc(a)===null){s.child=x;break}a=x.sibling,x.sibling=d,d=x,x=a}Ep(s,!0,d,null,w);break;case"together":Ep(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Zc(a,s){(s.mode&1)===0&&a!==null&&(a.alternate=null,s.alternate=null,s.flags|=2)}function ei(a,s,d){if(a!==null&&(s.dependencies=a.dependencies),_a|=s.lanes,(d&s.childLanes)===0)return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,d=Gi(a,a.pendingProps),s.child=d,d.return=s;a.sibling!==null;)a=a.sibling,d=d.sibling=Gi(a,a.pendingProps),d.return=s;d.sibling=null}return s.child}function L4(a,s,d){switch(s.tag){case 3:w1(s),Bo();break;case 5:zb(s);break;case 1:vr(s.type)&&Tc(s);break;case 4:ap(s,s.stateNode.containerInfo);break;case 10:var p=s.type._context,x=s.memoizedProps.value;tt(Fc,p._currentValue),p._currentValue=x;break;case 13:if(p=s.memoizedState,p!==null)return p.dehydrated!==null?(tt(ht,ht.current&1),s.flags|=128,null):(d&s.child.childLanes)!==0?j1(a,s,d):(tt(ht,ht.current&1),a=ei(a,s,d),a!==null?a.sibling:null);tt(ht,ht.current&1);break;case 19:if(p=(d&s.childLanes)!==0,(a.flags&128)!==0){if(p)return N1(a,s,d);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),tt(ht,ht.current),p)break;return null;case 22:case 23:return s.lanes=0,y1(a,s,d)}return ei(a,s,d)}var E1,Ap,A1,C1;E1=function(a,s){for(var d=s.child;d!==null;){if(d.tag===5||d.tag===6)a.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===s)break;for(;d.sibling===null;){if(d.return===null||d.return===s)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Ap=function(){},A1=function(a,s,d,p){var x=a.memoizedProps;if(x!==p){a=s.stateNode,Pa(Nn.current);var w=null;switch(d){case"input":x=Ue(a,x),p=Ue(a,p),w=[];break;case"select":x=te({},x,{value:void 0}),p=te({},p,{value:void 0}),w=[];break;case"textarea":x=nt(a,x),p=nt(a,p),w=[];break;default:typeof x.onClick!="function"&&typeof p.onClick=="function"&&(a.onclick=_c)}sm(d,p);var C;d=null;for(Y in x)if(!p.hasOwnProperty(Y)&&x.hasOwnProperty(Y)&&x[Y]!=null)if(Y==="style"){var D=x[Y];for(C in D)D.hasOwnProperty(C)&&(d||(d={}),d[C]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(i.hasOwnProperty(Y)?w||(w=[]):(w=w||[]).push(Y,null));for(Y in p){var R=p[Y];if(D=x!=null?x[Y]:void 0,p.hasOwnProperty(Y)&&R!==D&&(R!=null||D!=null))if(Y==="style")if(D){for(C in D)!D.hasOwnProperty(C)||R&&R.hasOwnProperty(C)||(d||(d={}),d[C]="");for(C in R)R.hasOwnProperty(C)&&D[C]!==R[C]&&(d||(d={}),d[C]=R[C])}else d||(w||(w=[]),w.push(Y,d)),d=R;else Y==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,D=D?D.__html:void 0,R!=null&&D!==R&&(w=w||[]).push(Y,R)):Y==="children"?typeof R!="string"&&typeof R!="number"||(w=w||[]).push(Y,""+R):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(i.hasOwnProperty(Y)?(R!=null&&Y==="onScroll"&&it("scroll",a),w||D===R||(w=[])):(w=w||[]).push(Y,R))}d&&(w=w||[]).push("style",d);var Y=w;(s.updateQueue=Y)&&(s.flags|=4)}},C1=function(a,s,d,p){d!==p&&(s.flags|=4)};function Fl(a,s){if(!ut)switch(a.tailMode){case"hidden":s=a.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function rr(a){var s=a.alternate!==null&&a.alternate.child===a.child,d=0,p=0;if(s)for(var x=a.child;x!==null;)d|=x.lanes|x.childLanes,p|=x.subtreeFlags&14680064,p|=x.flags&14680064,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)d|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=p,a.childLanes=d,s}function $4(a,s,d){var p=s.pendingProps;switch(Qm(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rr(s),null;case 1:return vr(s.type)&&Ic(),rr(s),null;case 3:return p=s.stateNode,Ko(),at(gr),at(er),lp(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(a===null||a.child===null)&&($c(s)?s.flags|=4:a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,un!==null&&($p(un),un=null))),Ap(a,s),rr(s),null;case 5:op(s);var x=Pa(Dl.current);if(d=s.type,a!==null&&s.stateNode!=null)A1(a,s,d,p,x),a.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!p){if(s.stateNode===null)throw Error(r(166));return rr(s),null}if(a=Pa(Nn.current),$c(s)){p=s.stateNode,d=s.type;var w=s.memoizedProps;switch(p[Sn]=s,p[Ol]=w,a=(s.mode&1)!==0,d){case"dialog":it("cancel",p),it("close",p);break;case"iframe":case"object":case"embed":it("load",p);break;case"video":case"audio":for(x=0;x<\/script>",a=a.removeChild(a.firstChild)):typeof p.is=="string"?a=C.createElement(d,{is:p.is}):(a=C.createElement(d),d==="select"&&(C=a,p.multiple?C.multiple=!0:p.size&&(C.size=p.size))):a=C.createElementNS(a,d),a[Sn]=s,a[Ol]=p,E1(a,s,!1,!1),s.stateNode=a;e:{switch(C=lm(d,p),d){case"dialog":it("cancel",a),it("close",a),x=p;break;case"iframe":case"object":case"embed":it("load",a),x=p;break;case"video":case"audio":for(x=0;xQo&&(s.flags|=128,p=!0,Fl(w,!1),s.lanes=4194304)}else{if(!p)if(a=Wc(C),a!==null){if(s.flags|=128,p=!0,d=a.updateQueue,d!==null&&(s.updateQueue=d,s.flags|=4),Fl(w,!0),w.tail===null&&w.tailMode==="hidden"&&!C.alternate&&!ut)return rr(s),null}else 2*bt()-w.renderingStartTime>Qo&&d!==1073741824&&(s.flags|=128,p=!0,Fl(w,!1),s.lanes=4194304);w.isBackwards?(C.sibling=s.child,s.child=C):(d=w.last,d!==null?d.sibling=C:s.child=C,w.last=C)}return w.tail!==null?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=bt(),s.sibling=null,d=ht.current,tt(ht,p?d&1|2:d&1),s):(rr(s),null);case 22:case 23:return Fp(),p=s.memoizedState!==null,a!==null&&a.memoizedState!==null!==p&&(s.flags|=8192),p&&(s.mode&1)!==0?(Mr&1073741824)!==0&&(rr(s),s.subtreeFlags&6&&(s.flags|=8192)):rr(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function z4(a,s){switch(Qm(s),s.tag){case 1:return vr(s.type)&&Ic(),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Ko(),at(gr),at(er),lp(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 5:return op(s),null;case 13:if(at(ht),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Bo()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return at(ht),null;case 4:return Ko(),null;case 10:return tp(s.type._context),null;case 22:case 23:return Fp(),null;case 24:return null;default:return null}}var Jc=!1,nr=!1,F4=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Vo(a,s){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(p){pt(a,s,p)}else d.current=null}function Cp(a,s,d){try{d()}catch(p){pt(a,s,p)}}var P1=!1;function B4(a,s){if(Fm=xc,a=sb(),Mm(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var C=0,D=-1,R=-1,Y=0,ce=0,fe=a,le=null;t:for(;;){for(var xe;fe!==d||x!==0&&fe.nodeType!==3||(D=C+x),fe!==w||p!==0&&fe.nodeType!==3||(R=C+p),fe.nodeType===3&&(C+=fe.nodeValue.length),(xe=fe.firstChild)!==null;)le=fe,fe=xe;for(;;){if(fe===a)break t;if(le===d&&++Y===x&&(D=C),le===w&&++ce===p&&(R=C),(xe=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=xe}d=D===-1||R===-1?null:{start:D,end:R}}else d=null}d=d||{start:0,end:0}}else d=null;for(Bm={focusedElem:a,selectionRange:d},xc=!1,ke=s;ke!==null;)if(s=ke,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,ke=a;else for(;ke!==null;){s=ke;try{var Se=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ee=Se.memoizedProps,wt=Se.memoizedState,W=s.stateNode,F=W.getSnapshotBeforeUpdate(s.elementType===s.type?Ee:cn(s.type,Ee),wt);W.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var V=s.stateNode.containerInfo;V.nodeType===1?V.textContent="":V.nodeType===9&&V.documentElement&&V.removeChild(V.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ge){pt(s,s.return,ge)}if(a=s.sibling,a!==null){a.return=s.return,ke=a;break}ke=s.return}return Se=P1,P1=!1,Se}function Bl(a,s,d){var p=s.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&a)===a){var w=x.destroy;x.destroy=void 0,w!==void 0&&Cp(s,d,w)}x=x.next}while(x!==p)}}function ed(a,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var d=s=s.next;do{if((d.tag&a)===a){var p=d.create;d.destroy=p()}d=d.next}while(d!==s)}}function Pp(a){var s=a.ref;if(s!==null){var d=a.stateNode;switch(a.tag){case 5:a=d;break;default:a=d}typeof s=="function"?s(a):s.current=a}}function O1(a){var s=a.alternate;s!==null&&(a.alternate=null,O1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&(delete s[Sn],delete s[Ol],delete s[Km],delete s[j4],delete s[S4])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function _1(a){return a.tag===5||a.tag===3||a.tag===4}function M1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||_1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Op(a,s,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,s?d.nodeType===8?d.parentNode.insertBefore(a,s):d.insertBefore(a,s):(d.nodeType===8?(s=d.parentNode,s.insertBefore(a,d)):(s=d,s.appendChild(a)),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=_c));else if(p!==4&&(a=a.child,a!==null))for(Op(a,s,d),a=a.sibling;a!==null;)Op(a,s,d),a=a.sibling}function _p(a,s,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,s?d.insertBefore(a,s):d.appendChild(a);else if(p!==4&&(a=a.child,a!==null))for(_p(a,s,d),a=a.sibling;a!==null;)_p(a,s,d),a=a.sibling}var Bt=null,dn=!1;function Bi(a,s,d){for(d=d.child;d!==null;)I1(a,s,d),d=d.sibling}function I1(a,s,d){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(hc,d)}catch{}switch(d.tag){case 5:nr||Vo(d,s);case 6:var p=Bt,x=dn;Bt=null,Bi(a,s,d),Bt=p,dn=x,Bt!==null&&(dn?(a=Bt,d=d.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)):Bt.removeChild(d.stateNode));break;case 18:Bt!==null&&(dn?(a=Bt,d=d.stateNode,a.nodeType===8?Wm(a.parentNode,d):a.nodeType===1&&Wm(a,d),xl(a)):Wm(Bt,d.stateNode));break;case 4:p=Bt,x=dn,Bt=d.stateNode.containerInfo,dn=!0,Bi(a,s,d),Bt=p,dn=x;break;case 0:case 11:case 14:case 15:if(!nr&&(p=d.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){x=p=p.next;do{var w=x,C=w.destroy;w=w.tag,C!==void 0&&((w&2)!==0||(w&4)!==0)&&Cp(d,s,C),x=x.next}while(x!==p)}Bi(a,s,d);break;case 1:if(!nr&&(Vo(d,s),p=d.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=d.memoizedProps,p.state=d.memoizedState,p.componentWillUnmount()}catch(D){pt(d,s,D)}Bi(a,s,d);break;case 21:Bi(a,s,d);break;case 22:d.mode&1?(nr=(p=nr)||d.memoizedState!==null,Bi(a,s,d),nr=p):Bi(a,s,d);break;default:Bi(a,s,d)}}function T1(a){var s=a.updateQueue;if(s!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new F4),s.forEach(function(p){var x=Y4.bind(null,a,p);d.has(p)||(d.add(p),p.then(x,x))})}}function fn(a,s){var d=s.deletions;if(d!==null)for(var p=0;px&&(x=C),p&=~w}if(p=x,p=bt()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*H4(p/1960))-p,10a?16:a,Hi===null)var p=!1;else{if(a=Hi,Hi=null,ad=0,(qe&6)!==0)throw Error(r(331));var x=qe;for(qe|=4,ke=a.current;ke!==null;){var w=ke,C=w.child;if((ke.flags&16)!==0){var D=w.deletions;if(D!==null){for(var R=0;Rbt()-Tp?Ia(a,0):Ip|=d),br(a,s)}function V1(a,s){s===0&&((a.mode&1)===0?s=1:(s=pc,pc<<=1,(pc&130023424)===0&&(pc=4194304)));var d=cr();a=Zn(a,s),a!==null&&(ml(a,s,d),br(a,d))}function Q4(a){var s=a.memoizedState,d=0;s!==null&&(d=s.retryLane),V1(a,d)}function Y4(a,s){var d=0;switch(a.tag){case 13:var p=a.stateNode,x=a.memoizedState;x!==null&&(d=x.retryLane);break;case 19:p=a.stateNode;break;default:throw Error(r(314))}p!==null&&p.delete(s),V1(a,d)}var q1;q1=function(a,s,d){if(a!==null)if(a.memoizedProps!==s.pendingProps||gr.current)yr=!0;else{if((a.lanes&d)===0&&(s.flags&128)===0)return yr=!1,L4(a,s,d);yr=(a.flags&131072)!==0}else yr=!1,ut&&(s.flags&1048576)!==0&&Ab(s,Lc,s.index);switch(s.lanes=0,s.tag){case 2:var p=s.type;Zc(a,s),a=s.pendingProps;var x=$o(s,er.current);Wo(s,d),x=dp(null,s,p,a,x,d);var w=fp();return s.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,vr(p)?(w=!0,Tc(s)):w=!1,s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,ip(s),x.updater=Yc,s.stateNode=x,x._reactInternals=s,yp(s,p,a,d),s=kp(null,s,p,!0,w,d)):(s.tag=0,ut&&w&&qm(s),ur(null,s,x,d),s=s.child),s;case 16:p=s.elementType;e:{switch(Zc(a,s),a=s.pendingProps,x=p._init,p=x(p._payload),s.type=p,x=s.tag=Z4(p),a=cn(p,a),x){case 0:s=wp(null,s,p,a,d);break e;case 1:s=b1(null,s,p,a,d);break e;case 11:s=p1(null,s,p,a,d);break e;case 14:s=g1(null,s,p,cn(p.type,a),d);break e}throw Error(r(306,p,""))}return s;case 0:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:cn(p,x),wp(a,s,p,x,d);case 1:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:cn(p,x),b1(a,s,p,x,d);case 3:e:{if(w1(s),a===null)throw Error(r(387));p=s.pendingProps,w=s.memoizedState,x=w.element,Rb(a,s),Hc(s,p,null,d);var C=s.memoizedState;if(p=C.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){x=Go(Error(r(423)),s),s=k1(a,s,p,d,x);break e}else if(p!==x){x=Go(Error(r(424)),s),s=k1(a,s,p,d,x);break e}else for(_r=Di(s.stateNode.containerInfo.firstChild),Or=s,ut=!0,un=null,d=Tb(s,null,p,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Bo(),p===x){s=ei(a,s,d);break e}ur(a,s,p,d)}s=s.child}return s;case 5:return zb(s),a===null&&Xm(s),p=s.type,x=s.pendingProps,w=a!==null?a.memoizedProps:null,C=x.children,Um(p,x)?C=null:w!==null&&Um(p,w)&&(s.flags|=32),x1(a,s),ur(a,s,C,d),s.child;case 6:return a===null&&Xm(s),null;case 13:return j1(a,s,d);case 4:return ap(s,s.stateNode.containerInfo),p=s.pendingProps,a===null?s.child=Uo(s,null,p,d):ur(a,s,p,d),s.child;case 11:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:cn(p,x),p1(a,s,p,x,d);case 7:return ur(a,s,s.pendingProps,d),s.child;case 8:return ur(a,s,s.pendingProps.children,d),s.child;case 12:return ur(a,s,s.pendingProps.children,d),s.child;case 10:e:{if(p=s.type._context,x=s.pendingProps,w=s.memoizedProps,C=x.value,tt(Fc,p._currentValue),p._currentValue=C,w!==null)if(ln(w.value,C)){if(w.children===x.children&&!gr.current){s=ei(a,s,d);break e}}else for(w=s.child,w!==null&&(w.return=s);w!==null;){var D=w.dependencies;if(D!==null){C=w.child;for(var R=D.firstContext;R!==null;){if(R.context===p){if(w.tag===1){R=Jn(-1,d&-d),R.tag=2;var Y=w.updateQueue;if(Y!==null){Y=Y.shared;var ce=Y.pending;ce===null?R.next=R:(R.next=ce.next,ce.next=R),Y.pending=R}}w.lanes|=d,R=w.alternate,R!==null&&(R.lanes|=d),rp(w.return,d,s),D.lanes|=d;break}R=R.next}}else if(w.tag===10)C=w.type===s.type?null:w.child;else if(w.tag===18){if(C=w.return,C===null)throw Error(r(341));C.lanes|=d,D=C.alternate,D!==null&&(D.lanes|=d),rp(C,d,s),C=w.sibling}else C=w.child;if(C!==null)C.return=w;else for(C=w;C!==null;){if(C===s){C=null;break}if(w=C.sibling,w!==null){w.return=C.return,C=w;break}C=C.return}w=C}ur(a,s,x.children,d),s=s.child}return s;case 9:return x=s.type,p=s.pendingProps.children,Wo(s,d),x=Hr(x),p=p(x),s.flags|=1,ur(a,s,p,d),s.child;case 14:return p=s.type,x=cn(p,s.pendingProps),x=cn(p.type,x),g1(a,s,p,x,d);case 15:return v1(a,s,s.type,s.pendingProps,d);case 17:return p=s.type,x=s.pendingProps,x=s.elementType===p?x:cn(p,x),Zc(a,s),s.tag=1,vr(p)?(a=!0,Tc(s)):a=!1,Wo(s,d),l1(s,p,x),yp(s,p,x,d),kp(null,s,p,!0,a,d);case 19:return N1(a,s,d);case 22:return y1(a,s,d)}throw Error(r(156,s.tag))};function Q1(a,s){return Cx(a,s)}function X4(a,s,d,p){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(a,s,d,p){return new X4(a,s,d,p)}function Up(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Z4(a){if(typeof a=="function")return Up(a)?1:0;if(a!=null){if(a=a.$$typeof,a===U)return 11;if(a===pe)return 14}return 2}function Gi(a,s){var d=a.alternate;return d===null?(d=Gr(a.tag,s,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=s,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&14680064,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,s=a.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function ud(a,s,d,p,x,w){var C=2;if(p=a,typeof a=="function")Up(a)&&(C=1);else if(typeof a=="string")C=5;else e:switch(a){case T:return Da(d.children,x,w,s);case B:C=8,x|=8;break;case $:return a=Gr(12,d,s,x|2),a.elementType=$,a.lanes=w,a;case ve:return a=Gr(13,d,s,x),a.elementType=ve,a.lanes=w,a;case ue:return a=Gr(19,d,s,x),a.elementType=ue,a.lanes=w,a;case se:return cd(d,x,w,s);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:C=10;break e;case Q:C=9;break e;case U:C=11;break e;case pe:C=14;break e;case oe:C=16,p=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return s=Gr(C,d,s,x),s.elementType=a,s.type=p,s.lanes=w,s}function Da(a,s,d,p){return a=Gr(7,a,p,s),a.lanes=d,a}function cd(a,s,d,p){return a=Gr(22,a,p,s),a.elementType=se,a.lanes=d,a.stateNode={isHidden:!1},a}function Hp(a,s,d){return a=Gr(6,a,null,s),a.lanes=d,a}function Wp(a,s,d){return s=Gr(4,a.children!==null?a.children:[],a.key,s),s.lanes=d,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}function J4(a,s,d,p,x){this.tag=s,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vm(0),this.expirationTimes=vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vm(0),this.identifierPrefix=p,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Kp(a,s,d,p,x,w,C,D,R){return a=new J4(a,s,d,D,R),s===1?(s=1,w===!0&&(s|=8)):s=0,w=Gr(3,null,null,s),a.current=w,w.stateNode=a,w.memoizedState={element:p,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},ip(w),a}function e3(a,s,d){var p=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Zp.exports=m3(),Zp.exports}var cw;function p3(){if(cw)return yd;cw=1;var e=kN();return yd.createRoot=e.createRoot,yd.hydrateRoot=e.hydrateRoot,yd}var g3=p3();const v3=b0(g3);var Hu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Za,ra,ws,fN,y3=(fN=class extends Hu{constructor(){super();De(this,Za);De(this,ra);De(this,ws);be(this,ws,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,ra)||this.setEventListener(L(this,ws))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ra))==null||t.call(this),be(this,ra,void 0))}setEventListener(t){var r;be(this,ws,t),(r=L(this,ra))==null||r.call(this),be(this,ra,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){L(this,Za)!==t&&(be(this,Za,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,Za)=="boolean"?L(this,Za):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Za=new WeakMap,ra=new WeakMap,ws=new WeakMap,fN),k0=new y3,x3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},na,x0,hN,b3=(hN=class{constructor(){De(this,na,x3);De(this,x0,!1)}setTimeoutProvider(e){be(this,na,e)}setTimeout(e,t){return L(this,na).setTimeout(e,t)}clearTimeout(e){L(this,na).clearTimeout(e)}setInterval(e,t){return L(this,na).setInterval(e,t)}clearInterval(e){L(this,na).clearInterval(e)}},na=new WeakMap,x0=new WeakMap,hN),Ga=new b3;function w3(e){setTimeout(e,0)}var k3=typeof window>"u"||"Deno"in globalThis;function jr(){}function j3(e,t){return typeof e=="function"?e(t):e}function Vg(e){return typeof e=="number"&&e>=0&&e!==1/0}function jN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function da(e,t){return typeof e=="function"?e(t):e}function Dr(e,t){return typeof e=="function"?e(t):e}function dw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:u,stale:c}=e;if(u){if(n){if(t.queryHash!==j0(u,t.options))return!1}else if(!gu(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||o&&!o(t))}function fw(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(pu(t.options.mutationKey)!==pu(o))return!1}else if(!gu(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function j0(e,t){return((t==null?void 0:t.queryKeyHashFn)||pu)(e)}function pu(e){return JSON.stringify(e,(t,r)=>Qg(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function gu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>gu(e[r],t[r])):!1}var S3=Object.prototype.hasOwnProperty;function SN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=hw(e)&&hw(t);if(!n&&!(Qg(e)&&Qg(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),c=u.length,f=n?new Array(c):{};let h=0;for(let m=0;m{Ga.setTimeout(t,e)})}function Yg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?SN(e,t):t}function E3(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A3(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var S0=Symbol();function NN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===S0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function EN(e,t){return typeof e=="function"?e(...t):!!e}function C3(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var vu=(()=>{let e=()=>k3;return{isServer(){return e()},setIsServer(t){e=t}}})();function Xg(){let e,t;const r=new Promise((i,o)=>{e=i,t=o});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var P3=w3;function O3(){let e=[],t=0,r=c=>{c()},n=c=>{c()},i=P3;const o=c=>{t?e.push(c):i(()=>{r(c)})},u=()=>{const c=e;e=[],c.length&&i(()=>{n(()=>{c.forEach(f=>{r(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||u()}return f},batchCalls:c=>(...f)=>{o(()=>{c(...f)})},schedule:o,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{n=c},setScheduler:c=>{i=c}}}var Gt=O3(),ks,ia,js,mN,_3=(mN=class extends Hu{constructor(){super();De(this,ks,!0);De(this,ia);De(this,js);be(this,js,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){L(this,ia)||this.setEventListener(L(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ia))==null||t.call(this),be(this,ia,void 0))}setEventListener(t){var r;be(this,js,t),(r=L(this,ia))==null||r.call(this),be(this,ia,t(this.setOnline.bind(this)))}setOnline(t){L(this,ks)!==t&&(be(this,ks,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return L(this,ks)}},ks=new WeakMap,ia=new WeakMap,js=new WeakMap,mN),tf=new _3;function M3(e){return Math.min(1e3*2**e,3e4)}function AN(e){return(e??"online")==="online"?tf.isOnline():!0}var Zg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function CN(e){let t=!1,r=0,n;const i=Xg(),o=()=>i.status!=="pending",u=k=>{var S;if(!o()){const N=new Zg(k);v(N),(S=e.onCancel)==null||S.call(e,N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>k0.isFocused()&&(e.networkMode==="always"||tf.isOnline())&&e.canRun(),m=()=>AN(e.networkMode)&&e.canRun(),g=k=>{o()||(n==null||n(),i.resolve(k))},v=k=>{o()||(n==null||n(),i.reject(k))},b=()=>new Promise(k=>{var S;n=N=>{(o()||h())&&k(N)},(S=e.onPause)==null||S.call(e)}).then(()=>{var k;n=void 0,o()||(k=e.onContinue)==null||k.call(e)}),j=()=>{if(o())return;let k;const S=r===0?e.initialPromise:void 0;try{k=S??e.fn()}catch(N){k=Promise.reject(N)}Promise.resolve(k).then(g).catch(N=>{var O;if(o())return;const E=e.retry??(vu.isServer()?0:3),A=e.retryDelay??M3,P=typeof A=="function"?A(r,N):A,_=E===!0||typeof E=="number"&&rh()?void 0:b()).then(()=>{t?v(N):j()})})};return{promise:i,status:()=>i.status,cancel:u,continue:()=>(n==null||n(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?j():b().then(j),i)}}var Ja,pN,PN=(pN=class{constructor(){De(this,Ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vg(this.gcTime)&&be(this,Ja,Ga.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vu.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,Ja)!==void 0&&(Ga.clearTimeout(L(this,Ja)),be(this,Ja,void 0))}},Ja=new WeakMap,pN);function I3(e){return{onFetch:(t,r)=>{var m,g,v,b,j;const n=t.options,i=(v=(g=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:g.fetchMore)==null?void 0:v.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],u=((j=t.state.data)==null?void 0:j.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let k=!1;const S=A=>{C3(A,()=>t.signal,()=>k=!0)},N=NN(t.options,t.fetchOptions),E=async(A,P,_)=>{if(k)return Promise.reject(t.signal.reason);if(P==null&&A.pages.length)return Promise.resolve(A);const T=(()=>{const Q={client:t.client,queryKey:t.queryKey,pageParam:P,direction:_?"backward":"forward",meta:t.options.meta};return S(Q),Q})(),B=await N(T),{maxPages:$}=t.options,z=_?A3:E3;return{pages:z(A.pages,B,$),pageParams:z(A.pageParams,P,$)}};if(i&&o.length){const A=i==="backward",P=A?T3:pw,_={pages:o,pageParams:u},O=P(n,_);c=await E(_,O,A)}else{const A=e??o.length;do{const P=f===0?u[0]??n.initialPageParam:pw(n,c);if(f>0&&P==null)break;c=await E(c,P),f++}while(f{var k,S;return(S=(k=t.options).persister)==null?void 0:S.call(k,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function pw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function T3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ss,eo,Ns,qr,to,Dt,$u,ro,Tr,ON,ii,gN,D3=(gN=class extends PN{constructor(t){super();De(this,Tr);De(this,Ss);De(this,eo);De(this,Ns);De(this,qr);De(this,to);De(this,Dt);De(this,$u);De(this,ro);be(this,ro,!1),be(this,$u,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,to,t.client),be(this,qr,L(this,to).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,eo,vw(this.options)),this.state=t.state??L(this,eo),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,Ss)}get promise(){var t;return(t=L(this,Dt))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,$u),...t},t!=null&&t._type&&be(this,Ss,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=vw(this.options);r.data!==void 0&&(this.setState(gw(r.data,r.dataUpdatedAt)),be(this,eo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,qr).remove(this)}setData(t,r){const n=Yg(this.state.data,t,this.options);return He(this,Tr,ii).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){He(this,Tr,ii).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=L(this,Dt))==null?void 0:n.promise;return(i=L(this,Dt))==null||i.cancel(t),r?r.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,eo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Dr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===S0||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>da(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!jN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Dt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Dt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,qr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,Dt)&&(L(this,ro)||He(this,Tr,ON).call(this)?L(this,Dt).cancel({revert:!0}):L(this,Dt).cancelRetry()),this.scheduleGc()),L(this,qr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,Tr,ii).call(this,{type:"invalidate"})}async fetch(t,r){var h,m,g,v,b,j,k,S,N,E,A;if(this.state.fetchStatus!=="idle"&&((h=L(this,Dt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,Dt))return L(this,Dt).continueRetry(),L(this,Dt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const P=this.observers.find(_=>_.options.queryFn);P&&this.setOptions(P.options)}const n=new AbortController,i=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(be(this,ro,!0),n.signal)})},o=()=>{const P=NN(this.options,r),O=(()=>{const T={client:L(this,to),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return be(this,ro,!1),this.options.persister?this.options.persister(P,O,this):P(O)},c=(()=>{const P={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:L(this,to),state:this.state,fetchFn:o};return i(P),P})(),f=L(this,Ss)==="infinite"?I3(this.options.pages):this.options.behavior;f==null||f.onFetch(c,this),be(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&He(this,Tr,ii).call(this,{type:"fetch",meta:(g=c.fetchOptions)==null?void 0:g.meta}),be(this,Dt,CN({initialPromise:r==null?void 0:r.initialPromise,fn:c.fetchFn,onCancel:P=>{P instanceof Zg&&P.revert&&this.setState({...L(this,Ns),fetchStatus:"idle"}),n.abort()},onFail:(P,_)=>{He(this,Tr,ii).call(this,{type:"failed",failureCount:P,error:_})},onPause:()=>{He(this,Tr,ii).call(this,{type:"pause"})},onContinue:()=>{He(this,Tr,ii).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const P=await L(this,Dt).start();if(P===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(P),(b=(v=L(this,qr).config).onSuccess)==null||b.call(v,P,this),(k=(j=L(this,qr).config).onSettled)==null||k.call(j,P,this.state.error,this),P}catch(P){if(P instanceof Zg){if(P.silent)return L(this,Dt).promise;if(P.revert){if(this.state.data===void 0)throw P;return this.state.data}}throw He(this,Tr,ii).call(this,{type:"error",error:P}),(N=(S=L(this,qr).config).onError)==null||N.call(S,P,this),(A=(E=L(this,qr).config).onSettled)==null||A.call(E,this.state.data,P,this),P}finally{this.scheduleGc()}}},Ss=new WeakMap,eo=new WeakMap,Ns=new WeakMap,qr=new WeakMap,to=new WeakMap,Dt=new WeakMap,$u=new WeakMap,ro=new WeakMap,Tr=new WeakSet,ON=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ii=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._N(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...gw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,Ns,t.manual?i:void 0),i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Gt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),L(this,qr).notify({query:this,type:"updated",action:t})})},gN);function _N(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:AN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var kr,Ke,zu,dr,no,Es,oi,aa,Fu,As,Cs,io,ao,oa,Ps,Xe,su,Jg,ev,tv,rv,nv,iv,av,MN,vN,R3=(vN=class extends Hu{constructor(t,r){super();De(this,Xe);De(this,kr);De(this,Ke);De(this,zu);De(this,dr);De(this,no);De(this,Es);De(this,oi);De(this,aa);De(this,Fu);De(this,As);De(this,Cs);De(this,io);De(this,ao);De(this,oa);De(this,Ps,new Set);this.options=r,be(this,kr,t),be(this,aa,null),be(this,oi,Xg()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Ke).addObserver(this),yw(L(this,Ke),this.options)?He(this,Xe,su).call(this):this.updateResult(),He(this,Xe,rv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ov(L(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ov(L(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,Xe,nv).call(this),He(this,Xe,iv).call(this),L(this,Ke).removeObserver(this)}setOptions(t){const r=this.options,n=L(this,Ke);if(this.options=L(this,kr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dr(this.options.enabled,L(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,Xe,av).call(this),L(this,Ke).setOptions(this.options),r._defaulted&&!qg(this.options,r)&&L(this,kr).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ke),observer:this});const i=this.hasListeners();i&&xw(L(this,Ke),n,this.options,r)&&He(this,Xe,su).call(this),this.updateResult(),i&&(L(this,Ke)!==n||Dr(this.options.enabled,L(this,Ke))!==Dr(r.enabled,L(this,Ke))||da(this.options.staleTime,L(this,Ke))!==da(r.staleTime,L(this,Ke)))&&He(this,Xe,Jg).call(this);const o=He(this,Xe,ev).call(this);i&&(L(this,Ke)!==n||Dr(this.options.enabled,L(this,Ke))!==Dr(r.enabled,L(this,Ke))||o!==L(this,oa))&&He(this,Xe,tv).call(this,o)}getOptimisticResult(t){const r=L(this,kr).getQueryCache().build(L(this,kr),t),n=this.createResult(r,t);return $3(this,n)&&(be(this,dr,n),be(this,Es,this.options),be(this,no,L(this,Ke).state)),n}getCurrentResult(){return L(this,dr)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,oi).status==="pending"&&L(this,oi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){L(this,Ps).add(t)}getCurrentQuery(){return L(this,Ke)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,kr).defaultQueryOptions(t),n=L(this,kr).getQueryCache().build(L(this,kr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return He(this,Xe,su).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,dr)))}createResult(t,r){var $;const n=L(this,Ke),i=this.options,o=L(this,dr),u=L(this,no),c=L(this,Es),h=t!==n?t.state:L(this,zu),{state:m}=t;let g={...m},v=!1,b;if(r._optimisticResults){const z=this.hasListeners(),Q=!z&&yw(t,r),U=z&&xw(t,n,r,i);(Q||U)&&(g={...g,..._N(m.data,t.options)}),r._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:j,errorUpdatedAt:k,status:S}=g;b=g.data;let N=!1;if(r.placeholderData!==void 0&&b===void 0&&S==="pending"){let z;o!=null&&o.isPlaceholderData&&r.placeholderData===(c==null?void 0:c.placeholderData)?(z=o.data,N=!0):z=typeof r.placeholderData=="function"?r.placeholderData(($=L(this,Cs))==null?void 0:$.state.data,L(this,Cs)):r.placeholderData,z!==void 0&&(S="success",b=Yg(o==null?void 0:o.data,z,r),v=!0)}if(r.select&&b!==void 0&&!N)if(o&&b===(u==null?void 0:u.data)&&r.select===L(this,Fu))b=L(this,As);else try{be(this,Fu,r.select),b=r.select(b),b=Yg(o==null?void 0:o.data,b,r),be(this,As,b),be(this,aa,null)}catch(z){be(this,aa,z)}L(this,aa)&&(j=L(this,aa),b=L(this,As),k=Date.now(),S="error");const E=g.fetchStatus==="fetching",A=S==="pending",P=S==="error",_=A&&E,O=b!==void 0,B={status:S,fetchStatus:g.fetchStatus,isPending:A,isSuccess:S==="success",isError:P,isInitialLoading:_,isLoading:_,data:b,dataUpdatedAt:g.dataUpdatedAt,error:j,errorUpdatedAt:k,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:P&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:P&&O,isStale:N0(t,r),refetch:this.refetch,promise:L(this,oi),isEnabled:Dr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=B.data!==void 0,Q=B.status==="error"&&!z,U=pe=>{Q?pe.reject(B.error):z&&pe.resolve(B.data)},ve=()=>{const pe=be(this,oi,B.promise=Xg());U(pe)},ue=L(this,oi);switch(ue.status){case"pending":t.queryHash===n.queryHash&&U(ue);break;case"fulfilled":(Q||B.data!==ue.value)&&ve();break;case"rejected":(!Q||B.error!==ue.reason)&&ve();break}}return B}updateResult(){const t=L(this,dr),r=this.createResult(L(this,Ke),this.options);if(be(this,no,L(this,Ke).state),be(this,Es,this.options),L(this,no).data!==void 0&&be(this,Cs,L(this,Ke)),qg(r,t))return;be(this,dr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!L(this,Ps).size)return!0;const u=new Set(o??L(this,Ps));return this.options.throwOnError&&u.add("error"),Object.keys(L(this,dr)).some(c=>{const f=c;return L(this,dr)[f]!==t[f]&&u.has(f)})};He(this,Xe,MN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,Xe,rv).call(this)}},kr=new WeakMap,Ke=new WeakMap,zu=new WeakMap,dr=new WeakMap,no=new WeakMap,Es=new WeakMap,oi=new WeakMap,aa=new WeakMap,Fu=new WeakMap,As=new WeakMap,Cs=new WeakMap,io=new WeakMap,ao=new WeakMap,oa=new WeakMap,Ps=new WeakMap,Xe=new WeakSet,su=function(t){He(this,Xe,av).call(this);let r=L(this,Ke).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jr)),r},Jg=function(){He(this,Xe,nv).call(this);const t=da(this.options.staleTime,L(this,Ke));if(vu.isServer()||L(this,dr).isStale||!Vg(t))return;const n=jN(L(this,dr).dataUpdatedAt,t)+1;be(this,io,Ga.setTimeout(()=>{L(this,dr).isStale||this.updateResult()},n))},ev=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ke)):this.options.refetchInterval)??!1},tv=function(t){He(this,Xe,iv).call(this),be(this,oa,t),!(vu.isServer()||Dr(this.options.enabled,L(this,Ke))===!1||!Vg(L(this,oa))||L(this,oa)===0)&&be(this,ao,Ga.setInterval(()=>{(this.options.refetchIntervalInBackground||k0.isFocused())&&He(this,Xe,su).call(this)},L(this,oa)))},rv=function(){He(this,Xe,Jg).call(this),He(this,Xe,tv).call(this,He(this,Xe,ev).call(this))},nv=function(){L(this,io)!==void 0&&(Ga.clearTimeout(L(this,io)),be(this,io,void 0))},iv=function(){L(this,ao)!==void 0&&(Ga.clearInterval(L(this,ao)),be(this,ao,void 0))},av=function(){const t=L(this,kr).getQueryCache().build(L(this,kr),this.options);if(t===L(this,Ke))return;const r=L(this,Ke);be(this,Ke,t),be(this,zu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},MN=function(t){Gt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,dr))}),L(this,kr).getQueryCache().notify({query:L(this,Ke),type:"observerResultsUpdated"})})},vN);function L3(e,t){return Dr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Dr(t.retryOnMount,e)===!1)}function yw(e,t){return L3(e,t)||e.state.data!==void 0&&ov(e,t,t.refetchOnMount)}function ov(e,t,r){if(Dr(t.enabled,e)!==!1&&da(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&N0(e,t)}return!1}function xw(e,t,r,n){return(e!==t||Dr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&N0(e,r)}function N0(e,t){return Dr(t.enabled,e)!==!1&&e.isStaleByTime(da(t.staleTime,e))}function $3(e,t){return!qg(e.getCurrentResult(),t)}var Bu,Mn,ir,oo,In,Xi,yN,z3=(yN=class extends PN{constructor(t){super();De(this,In);De(this,Bu);De(this,Mn);De(this,ir);De(this,oo);be(this,Bu,t.client),this.mutationId=t.mutationId,be(this,ir,t.mutationCache),be(this,Mn,[]),this.state=t.state||F3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Mn).includes(t)||(L(this,Mn).push(t),this.clearGcTimeout(),L(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,Mn,L(this,Mn).filter(r=>r!==t)),this.scheduleGc(),L(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Mn).length||(this.state.status==="pending"?this.scheduleGc():L(this,ir).remove(this))}continue(){var t;return((t=L(this,oo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,c,f,h,m,g,v,b,j,k,S,N,E,A,P,_,O,T;const r=()=>{He(this,In,Xi).call(this,{type:"continue"})},n={client:L(this,Bu),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,oo,CN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(B,$)=>{He(this,In,Xi).call(this,{type:"failed",failureCount:B,error:$})},onPause:()=>{He(this,In,Xi).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,ir).canRun(this)}));const i=this.state.status==="pending",o=!L(this,oo).canStart();try{if(i)r();else{He(this,In,Xi).call(this,{type:"pending",variables:t,isPaused:o}),L(this,ir).config.onMutate&&await L(this,ir).config.onMutate(t,this,n);const $=await((c=(u=this.options).onMutate)==null?void 0:c.call(u,t,n));$!==this.state.context&&He(this,In,Xi).call(this,{type:"pending",context:$,variables:t,isPaused:o})}const B=await L(this,oo).start();return await((h=(f=L(this,ir).config).onSuccess)==null?void 0:h.call(f,B,t,this.state.context,this,n)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,B,t,this.state.context,n)),await((b=(v=L(this,ir).config).onSettled)==null?void 0:b.call(v,B,null,this.state.variables,this.state.context,this,n)),await((k=(j=this.options).onSettled)==null?void 0:k.call(j,B,null,t,this.state.context,n)),He(this,In,Xi).call(this,{type:"success",data:B}),B}catch(B){try{await((N=(S=L(this,ir).config).onError)==null?void 0:N.call(S,B,t,this.state.context,this,n))}catch($){Promise.reject($)}try{await((A=(E=this.options).onError)==null?void 0:A.call(E,B,t,this.state.context,n))}catch($){Promise.reject($)}try{await((_=(P=L(this,ir).config).onSettled)==null?void 0:_.call(P,void 0,B,this.state.variables,this.state.context,this,n))}catch($){Promise.reject($)}try{await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,B,t,this.state.context,n))}catch($){Promise.reject($)}throw He(this,In,Xi).call(this,{type:"error",error:B}),B}finally{L(this,ir).runNext(this)}}},Bu=new WeakMap,Mn=new WeakMap,ir=new WeakMap,oo=new WeakMap,In=new WeakSet,Xi=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Gt.batch(()=>{L(this,Mn).forEach(n=>{n.onMutationUpdate(t)}),L(this,ir).notify({mutation:this,type:"updated",action:t})})},yN);function F3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var si,pn,Uu,xN,B3=(xN=class extends Hu{constructor(t={}){super();De(this,si);De(this,pn);De(this,Uu);this.config=t,be(this,si,new Set),be(this,pn,new Map),be(this,Uu,0)}build(t,r,n){const i=new z3({client:t,mutationCache:this,mutationId:++vd(this,Uu)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){L(this,si).add(t);const r=xd(t);if(typeof r=="string"){const n=L(this,pn).get(r);n?n.push(t):L(this,pn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,si).delete(t)){const r=xd(t);if(typeof r=="string"){const n=L(this,pn).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&L(this,pn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xd(t);if(typeof r=="string"){const n=L(this,pn).get(r),i=n==null?void 0:n.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=xd(t);if(typeof r=="string"){const i=(n=L(this,pn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Gt.batch(()=>{L(this,si).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,si).clear(),L(this,pn).clear()})}getAll(){return Array.from(L(this,si))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fw(r,n))}findAll(t={}){return this.getAll().filter(r=>fw(t,r))}notify(t){Gt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Gt.batch(()=>Promise.all(t.map(r=>r.continue().catch(jr))))}},si=new WeakMap,pn=new WeakMap,Uu=new WeakMap,xN);function xd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Tn,bN,U3=(bN=class extends Hu{constructor(t={}){super();De(this,Tn);this.config=t,be(this,Tn,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??j0(i,r);let u=this.get(o);return u||(u=new D3({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(u)),u}add(t){L(this,Tn).has(t.queryHash)||(L(this,Tn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,Tn).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,Tn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Tn).get(t)}getAll(){return[...L(this,Tn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>dw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>dw(t,n)):r}notify(t){Gt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tn=new WeakMap,bN),gt,sa,la,Os,_s,ua,Ms,Is,wN,H3=(wN=class{constructor(e={}){De(this,gt);De(this,sa);De(this,la);De(this,Os);De(this,_s);De(this,ua);De(this,Ms);De(this,Is);be(this,gt,e.queryCache||new U3),be(this,sa,e.mutationCache||new B3),be(this,la,e.defaultOptions||{}),be(this,Os,new Map),be(this,_s,new Map),be(this,ua,0)}mount(){vd(this,ua)._++,L(this,ua)===1&&(be(this,Ms,k0.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,gt).onFocus())})),be(this,Is,tf.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,gt).onOnline())})))}unmount(){var e,t;vd(this,ua)._--,L(this,ua)===0&&((e=L(this,Ms))==null||e.call(this),be(this,Ms,void 0),(t=L(this,Is))==null||t.call(this),be(this,Is,void 0))}isFetching(e){return L(this,gt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,sa).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,gt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=L(this,gt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(da(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return L(this,gt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=L(this,gt).get(n.queryHash),o=i==null?void 0:i.state.data,u=j3(t,o);if(u!==void 0)return L(this,gt).build(this,n).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Gt.batch(()=>L(this,gt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,gt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,gt);Gt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,gt);return Gt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Gt.batch(()=>L(this,gt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(jr).catch(jr)}invalidateQueries(e,t={}){return Gt.batch(()=>(L(this,gt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Gt.batch(()=>L(this,gt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(jr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,gt).build(this,t);return r.isStaleByTime(da(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return tf.isOnline()?L(this,sa).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,gt)}getMutationCache(){return L(this,sa)}getDefaultOptions(){return L(this,la)}setDefaultOptions(e){be(this,la,e)}setQueryDefaults(e,t){L(this,Os).set(pu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,Os).values()],r={};return t.forEach(n=>{gu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){L(this,_s).set(pu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,_s).values()],r={};return t.forEach(n=>{gu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,la).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=j0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===S0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,la).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,gt).clear(),L(this,sa).clear()}},gt=new WeakMap,sa=new WeakMap,la=new WeakMap,Os=new WeakMap,_s=new WeakMap,ua=new WeakMap,Ms=new WeakMap,Is=new WeakMap,wN),IN=y.createContext(void 0),Kn=e=>{const t=y.useContext(IN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},W3=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(IN.Provider,{value:e,children:t})),TN=y.createContext(!1),K3=()=>y.useContext(TN);TN.Provider;function G3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var V3=y.createContext(G3()),q3=()=>y.useContext(V3),Q3=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?EN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Y3=e=>{y.useEffect(()=>{e.clearReset()},[e])},X3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||EN(r,[e.error,n])),Z3=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},J3=(e,t)=>e.isLoading&&e.isFetching&&!t,eM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function tM(e,t,r){var b,j,k,S;const n=K3(),i=q3(),o=Kn(),u=o.defaultQueryOptions(e);(j=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||j.call(b,u);const c=o.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=n?"isRestoring":f?"optimistic":void 0,Z3(u),Q3(u,i,c),Y3(i);const h=!o.getQueryCache().get(u.queryHash),[m]=y.useState(()=>new t(o,u)),g=m.getOptimisticResult(u),v=!n&&f;if(y.useSyncExternalStore(y.useCallback(N=>{const E=v?m.subscribe(Gt.batchCalls(N)):jr;return m.updateResult(),E},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),y.useEffect(()=>{m.setOptions(u)},[u,m]),eM(u,g))throw bw(u,m,i);if(X3({result:g,errorResetBoundary:i,throwOnError:u.throwOnError,query:c,suspense:u.suspense}))throw g.error;if((S=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||S.call(k,u,g),u.experimental_prefetchInRender&&!vu.isServer()&&J3(g,n)){const N=h?bw(u,m,i):c==null?void 0:c.promise;N==null||N.catch(jr).finally(()=>{m.updateResult()})}return u.notifyOnChangeProps?g:m.trackResult(g)}function Yt(e,t){return tM(e,R3)}/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -67,17 +67,22 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. + */const aM=he("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. */const RN=he("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nf=he("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const rf=he("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aM=he("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** + */const oM=he("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -92,32 +97,32 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oM=he("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/** + */const sM=he("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yn=he("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"}]]);/** + */const Jr=he("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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sM=he("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const lM=he("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const af=he("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const nf=he("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lM=he("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/** + */const uM=he("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uM=he("BrainCog",[["path",{d:"M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588 4 4 0 0 0 7.636 2.106 3.2 3.2 0 0 0 .164-.546c.028-.13.306-.13.335 0a3.2 3.2 0 0 0 .163.546 4 4 0 0 0 7.636-2.106 4 4 0 0 0 .556-6.588 4 4 0 0 0-2.526-5.77A3 3 0 1 0 12 5",key:"1kgmhc"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m15.7 10.4-.9.4",key:"ayzo6p"}],["path",{d:"m9.2 13.2-.9.4",key:"1uzb3g"}],["path",{d:"m13.6 15.7-.4-.9",key:"11ifqf"}],["path",{d:"m10.8 9.2-.4-.9",key:"1pmk2v"}],["path",{d:"m15.7 13.5-.9-.4",key:"7ng02m"}],["path",{d:"m9.2 10.9-.9-.4",key:"1x66zd"}],["path",{d:"m10.5 15.7.4-.9",key:"3js94g"}],["path",{d:"m13.1 9.2.4-.9",key:"18n7mc"}]]);/** + */const cM=he("BrainCog",[["path",{d:"M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588 4 4 0 0 0 7.636 2.106 3.2 3.2 0 0 0 .164-.546c.028-.13.306-.13.335 0a3.2 3.2 0 0 0 .163.546 4 4 0 0 0 7.636-2.106 4 4 0 0 0 .556-6.588 4 4 0 0 0-2.526-5.77A3 3 0 1 0 12 5",key:"1kgmhc"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m15.7 10.4-.9.4",key:"ayzo6p"}],["path",{d:"m9.2 13.2-.9.4",key:"1uzb3g"}],["path",{d:"m13.6 15.7-.4-.9",key:"11ifqf"}],["path",{d:"m10.8 9.2-.4-.9",key:"1pmk2v"}],["path",{d:"m15.7 13.5-.9-.4",key:"7ng02m"}],["path",{d:"m9.2 10.9-.9-.4",key:"1x66zd"}],["path",{d:"m10.5 15.7.4-.9",key:"3js94g"}],["path",{d:"m13.1 9.2.4-.9",key:"18n7mc"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -127,7 +132,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cM=he("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** + */const dM=he("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -142,12 +147,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dM=he("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const fM=he("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ku=he("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const Wu=he("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -157,7 +162,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fM=he("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/** + */const hM=he("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -167,12 +172,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hM=he("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const mM=he("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mM=he("CircleX",[["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"}]]);/** + */const pM=he("CircleX",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -182,7 +187,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pM=he("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const gM=he("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -192,7 +197,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gM=he("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** + */const vM=he("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -202,7 +207,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vM=he("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** + */const yM=he("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -217,7 +222,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yM=he("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const xM=he("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -237,37 +242,37 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xu=he("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const yu=he("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xM=he("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const bM=he("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bM=he("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** + */const wM=he("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wM=he("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const kM=he("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kM=he("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** + */const jM=he("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jM=he("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/** + */const SM=he("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SM=he("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const NM=he("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -282,7 +287,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NM=he("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** + */const EM=he("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -292,12 +297,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EM=he("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** + */const AM=he("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AM=he("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** + */const CM=he("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -307,27 +312,27 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CM=he("LayoutDashboard",[["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"}]]);/** + */const PM=he("LayoutDashboard",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PM=he("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** + */const OM=he("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OM=he("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** + */const _M=he("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _M=he("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** + */const MM=he("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qs=he("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const Vs=he("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -337,17 +342,17 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MM=he("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const IM=he("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IM=he("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** + */const TM=he("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TM=he("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** + */const DM=he("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -357,7 +362,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DM=he("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"}]]);/** + */const RM=he("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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -372,7 +377,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bu=he("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** + */const xu=he("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -382,7 +387,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RM=he("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const LM=he("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -392,7 +397,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LM=he("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/** + */const $M=he("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -402,17 +407,17 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $M=he("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const zM=he("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zM=he("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** + */const FM=he("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FM=he("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** + */const BM=he("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -422,7 +427,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BM=he("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** + */const UM=he("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -432,7 +437,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UM=he("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** + */const HM=he("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -447,12 +452,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HM=he("ShieldQuestion",[["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.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const WM=he("ShieldQuestion",[["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.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qs=he("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"}]]);/** + */const qs=he("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -462,12 +467,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WM=he("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** + */const KM=he("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KM=he("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** + */const GM=he("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -477,17 +482,17 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rs=he("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/** + */const af=he("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GM=he("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** + */const VM=he("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VM=he("Telescope",[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]);/** + */const qM=he("Telescope",[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -507,12 +512,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qM=he("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + */const QM=he("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gu=he("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const Ku=he("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -522,8 +527,8 @@ Error generating stack: `+w.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ga=he("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),uu=[{id:"dashboard",label:"Cockpit",hint:"Deine Box auf einen Blick",icon:CM},{id:"models",label:"Modelle",hint:"Speicher, laden & Rollen",icon:af},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:xa},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:bu},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:yn},{id:"terminal",label:"Hermes-Terminal",hint:"Interaktives Hermes-Agent-Terminal",icon:Rs},{id:"konsole",label:"Konsole",hint:"Direkte Box-Shell (SSH-artig)",icon:Rs},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:hM}];var Nw=1,QM=.9,YM=.8,XM=.17,tg=.1,rg=.999,ZM=.9999,JM=.99,eI=/[\\\/_+.#"@\[\(\{&]/,tI=/[\\\/_+.#"@\[\(\{&]/g,rI=/[\s-]/,XN=/[\s-]/g;function dv(e,t,r,n,i,o,u){if(o===t.length)return i===e.length?Nw:JM;var c=`${i},${o}`;if(u[c]!==void 0)return u[c];for(var f=n.charAt(o),h=r.indexOf(f,i),m=0,g,v,b,j;h>=0;)g=dv(e,t,r,n,h+1,o+1,u),g>m&&(h===i?g*=Nw:eI.test(e.charAt(h-1))?(g*=YM,b=e.slice(i,h-1).match(tI),b&&i>0&&(g*=Math.pow(rg,b.length))):rI.test(e.charAt(h-1))?(g*=QM,j=e.slice(i,h-1).match(XN),j&&i>0&&(g*=Math.pow(rg,j.length))):(g*=XM,i>0&&(g*=Math.pow(rg,h-i))),e.charAt(h)!==t.charAt(o)&&(g*=ZM)),(gg&&(g=v*tg)),g>m&&(m=g),h=r.indexOf(f,h+1);return u[c]=m,m}function Ew(e){return e.toLowerCase().replace(XN," ")}function nI(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,dv(e,t,Ew(e),Ew(t),0,0,{})}function ha(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Aw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ls(...e){return t=>{let r=!1;const n=e.map(i=>{const o=Aw(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{var N;const{scope:v,children:b,...j}=g,k=((N=v==null?void 0:v[e])==null?void 0:N[f])||c,S=y.useMemo(()=>j,Object.values(j));return l.jsx(k.Provider,{value:S,children:b})};h.displayName=o+"Provider";function m(g,v){var k;const b=((k=v==null?void 0:v[e])==null?void 0:k[f])||c,j=y.useContext(b);if(j)return j;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,m]}const i=()=>{const o=r.map(u=>y.createContext(u));return function(c){const f=(c==null?void 0:c[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return i.scopeName=e,[n,aI(i,...t)]}function aI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const u=n.reduce((c,{useScope:f,scopeName:h})=>{const g=f(o)[`__scope${h}`];return{...c,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var wu=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},oI=ah[" useId ".trim().toString()]||(()=>{}),sI=0;function fi(e){const[t,r]=y.useState(oI());return wu(()=>{r(n=>n??String(sI++))},[e]),t?`radix-${t}`:""}var lI=ah[" useInsertionEffect ".trim().toString()]||wu;function uI({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,u]=cI({defaultProp:t,onChange:r}),c=e!==void 0,f=c?e:i;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const g=m.current;g!==c&&console.warn(`${n} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,n])}const h=y.useCallback(m=>{var g;if(c){const v=dI(m)?m(e):m;v!==e&&((g=u.current)==null||g.call(u,v))}else o(m)},[c,e,o,u]);return[f,h]}function cI({defaultProp:e,onChange:t}){const[r,n]=y.useState(e),i=y.useRef(r),o=y.useRef(t);return lI(()=>{o.current=t},[t]),y.useEffect(()=>{var u;i.current!==r&&((u=o.current)==null||u.call(o,r),i.current=r)},[r,i]),[r,n,o]}function dI(e){return typeof e=="function"}var ch=kN();function ZN(e){const t=y.forwardRef((r,n)=>{let{children:i,...o}=r,u=null,c=!1;const f=[];Cw(i)&&typeof wd=="function"&&(i=wd(i._payload)),y.Children.forEach(i,v=>{var b;if(gI(v)){c=!0;const j=v;let k="child"in j.props?j.props.child:j.props.children;Cw(k)&&typeof wd=="function"&&(k=wd(k._payload)),u=hI(j,k),f.push((b=u==null?void 0:u.props)==null?void 0:b.children)}else f.push(v)}),u?u=y.cloneElement(u,void 0,f):!c&&y.Children.count(i)===1&&y.isValidElement(i)&&(u=i);const h=u?pI(u):void 0,m=wo(n,h);if(!u){if(i||i===0)throw new Error(c?bI(e):xI(e));return i}const g=mI(o,u.props??{});return u.type!==y.Fragment&&(g.ref=n?m:h),y.cloneElement(u,g)});return t.displayName=`${e}.Slot`,t}var fI=Symbol.for("radix.slottable"),hI=(e,t)=>{if("child"in e.props){const r=e.props.child;return y.isValidElement(r)?y.cloneElement(r,void 0,e.props.children(r.props.children)):null}return y.isValidElement(t)?t:null};function mI(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...c)=>{const f=o(...c);return i(...c),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function pI(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function gI(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fI}var vI=Symbol.for("react.lazy");function Cw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===vI&&"_payload"in e&&yI(e._payload)}function yI(e){return typeof e=="object"&&e!==null&&"then"in e}var xI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,bI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,wd=ah[" use ".trim().toString()],wI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xt=wI.reduce((e,t)=>{const r=ZN(`Primitive.${t}`),n=y.forwardRef((i,o)=>{const{asChild:u,...c}=i,f=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(f,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function kI(e,t){e&&ch.flushSync(()=>e.dispatchEvent(t))}function ku(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}function jI(e,t=globalThis==null?void 0:globalThis.document){const r=ku(e);y.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var SI="DismissableLayer",fv="dismissableLayer.update",NI="dismissableLayer.pointerDownOutside",EI="dismissableLayer.focusOutside",Pw,E0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),JN=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:c,onDismiss:f,...h}=e,m=y.useContext(E0),[g,v]=y.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=y.useState({}),k=wo(t,$=>v($)),S=Array.from(m.layers),[N]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(N),A=g?S.indexOf(g):-1,P=m.layersWithOutsidePointerEventsDisabled.size>0,_=A>=E,O=y.useRef(!1),T=OI($=>{const z=$.target;if(!(z instanceof Node))return;const Q=[...m.branches].some(U=>U.contains(z));!_||Q||(o==null||o($),c==null||c($),$.defaultPrevented||f==null||f())},{ownerDocument:b,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces}),B=_I($=>{if(n&&O.current)return;const z=$.target;[...m.branches].some(U=>U.contains(z))||(u==null||u($),c==null||c($),$.defaultPrevented||f==null||f())},b);return jI($=>{A===m.layers.size-1&&(i==null||i($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),y.useEffect(()=>{if(g)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Pw=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Ow(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(g),m.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=Pw))}},[g,b,r,m]),y.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Ow())},[g,m]),y.useEffect(()=>{const $=()=>j({});return document.addEventListener(fv,$),()=>document.removeEventListener(fv,$)},[]),l.jsx(Xt.div,{...h,ref:k,style:{pointerEvents:P?_?"auto":"none":void 0,...e.style},onFocusCapture:ha(e.onFocusCapture,B.onFocusCapture),onBlurCapture:ha(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ha(e.onPointerDownCapture,T.onPointerDownCapture)})});JN.displayName=SI;var AI="DismissableLayerBranch",CI=y.forwardRef((e,t)=>{const r=y.useContext(E0),n=y.useRef(null),i=wo(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(Xt.div,{...e,ref:i})});CI.displayName=AI;function PI(){const e=y.useContext(E0),[t,r]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function OI(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,u=ku(e),c=y.useRef(!1),f=y.useRef(!1),h=y.useRef(new Map),m=y.useRef(()=>{});return y.useEffect(()=>{function g(){f.current=!1,i.current=!1,h.current.clear()}function v(){return Array.from(h.current.values()).some(Boolean)}function b(E){if(!f.current)return;const A=E.target;A instanceof Node&&[...o].some(_=>_.contains(A))||h.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function j(E){f.current&&h.current.set(E.type,!1)}const k=E=>{if(E.target&&!c.current){let A=function(){r.removeEventListener("click",m.current);const _=v();g(),_||e5(NI,u,P,{discrete:!0})};const P={originalEvent:E};f.current=!0,i.current=n&&E.button===0,h.current.clear(),!n||E.button!==0?A():(r.removeEventListener("click",m.current),m.current=A,r.addEventListener("click",m.current,{once:!0}))}else r.removeEventListener("click",m.current),g();c.current=!1},S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of S)r.addEventListener(E,b,!0),r.addEventListener(E,j);const N=window.setTimeout(()=>{r.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(N),r.removeEventListener("pointerdown",k),r.removeEventListener("click",m.current);for(const E of S)r.removeEventListener(E,b,!0),r.removeEventListener(E,j)}},[r,u,n,i,o]),{onPointerDownCapture:()=>c.current=!0}}function _I(e,t=globalThis==null?void 0:globalThis.document){const r=ku(e),n=y.useRef(!1);return y.useEffect(()=>{const i=o=>{o.target&&!n.current&&e5(EI,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ow(){const e=new CustomEvent(fv);document.dispatchEvent(e)}function e5(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?kI(i,o):i.dispatchEvent(o)}var ng="focusScope.autoFocusOnMount",ig="focusScope.autoFocusOnUnmount",_w={bubbles:!1,cancelable:!0},MI="FocusScope",t5=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...u}=e,[c,f]=y.useState(null),h=ku(i),m=ku(o),g=y.useRef(null),v=wo(t,k=>f(k)),b=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let k=function(A){if(b.paused||!c)return;const P=A.target;c.contains(P)?g.current=P:Zi(g.current,{select:!0})},S=function(A){if(b.paused||!c)return;const P=A.relatedTarget;P!==null&&(c.contains(P)||Zi(g.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&Zi(c)};document.addEventListener("focusin",k),document.addEventListener("focusout",S);const E=new MutationObserver(N);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),E.disconnect()}}},[n,c,b.paused]),y.useEffect(()=>{if(c){Iw.add(b);const k=document.activeElement;if(!c.contains(k)){const N=new CustomEvent(ng,_w);c.addEventListener(ng,h),c.dispatchEvent(N),N.defaultPrevented||(II($I(r5(c)),{select:!0}),document.activeElement===k&&Zi(c))}return()=>{c.removeEventListener(ng,h),setTimeout(()=>{const N=new CustomEvent(ig,_w);c.addEventListener(ig,m),c.dispatchEvent(N),N.defaultPrevented||Zi(k??document.body,{select:!0}),c.removeEventListener(ig,m),Iw.remove(b)},0)}}},[c,h,m,b]);const j=y.useCallback(k=>{if(!r&&!n||b.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,N=document.activeElement;if(S&&N){const E=k.currentTarget,[A,P]=TI(E);A&&P?!k.shiftKey&&N===P?(k.preventDefault(),r&&Zi(A,{select:!0})):k.shiftKey&&N===A&&(k.preventDefault(),r&&Zi(P,{select:!0})):N===E&&k.preventDefault()}},[r,n,b.paused]);return l.jsx(Xt.div,{tabIndex:-1,...u,ref:v,onKeyDown:j})});t5.displayName=MI;function II(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Zi(n,{select:t}),document.activeElement!==r)return}function TI(e){const t=r5(e),r=Mw(t,e),n=Mw(t.reverse(),e);return[r,n]}function r5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Mw(e,t){for(const r of e)if(!DI(r,{upTo:t}))return r}function DI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function RI(e){return e instanceof HTMLInputElement&&"select"in e}function Zi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&RI(e)&&t&&e.select()}}var Iw=LI();function LI(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Tw(e,t),e.unshift(t)},remove(t){var r;e=Tw(e,t),(r=e[0])==null||r.resume()}}}function Tw(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function $I(e){return e.filter(t=>t.tagName!=="A")}var zI="Portal",n5=y.forwardRef((e,t)=>{var c;const{container:r,...n}=e,[i,o]=y.useState(!1);wu(()=>o(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?ch.createPortal(l.jsx(Xt.div,{...n,ref:t}),u):null});n5.displayName=zI;function FI(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var dh=e=>{const{present:t,children:r}=e,n=BI(t),i=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=UI(n.ref,HI(i));return typeof r=="function"||n.isPresent?y.cloneElement(i,{ref:o}):null};dh.displayName="Presence";function BI(e){const[t,r]=y.useState(),n=y.useRef(null),i=y.useRef(e),o=y.useRef("none"),u=e?"mounted":"unmounted",[c,f]=FI(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const h=kd(n.current);o.current=c==="mounted"?h:"none"},[c]),wu(()=>{const h=n.current,m=i.current;if(m!==e){const v=o.current,b=kd(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&v!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),wu(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=b=>{const k=kd(n.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(f("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},v=b=>{b.target===t&&(o.current=kd(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:y.useCallback(h=>{n.current=h?getComputedStyle(h):null,r(h)},[])}}function Dw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function UI(...e){const t=y.useRef(e);return t.current=e,y.useCallback(r=>{const n=t.current;let i=!1;const o=n.map(u=>{const c=Dw(u,r);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let u=0;u{Cn||(Cn={start:Rw(),end:Rw()});const{start:e,end:t}=Cn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),jd++,()=>{jd===1&&(Cn==null||Cn.start.remove(),Cn==null||Cn.end.remove(),Cn=null),jd=Math.max(0,jd-1)}},[])}function Rw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Dn=function(){return Dn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return sT;var t=lT(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},cT=s5(),gs="data-scroll-locked",dT=function(e,t,r,n){var i=e.left,o=e.top,u=e.right,c=e.gap;return r===void 0&&(r="margin"),` - .`.concat(GI,` { + */const ga=he("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),lu=[{id:"dashboard",label:"Cockpit",hint:"Deine Box auf einen Blick",icon:PM},{id:"models",label:"Modelle",hint:"Speicher, laden & Rollen",icon:nf},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:xa},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:xu},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:Jr},{id:"terminal",label:"Hermes GUI",hint:"Eingebaute Hermes-Weboberfläche (Threads & Tool-Calls)",icon:aM},{id:"konsole",label:"Konsole",hint:"Direkte Box-Shell (SSH-artig)",icon:af},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:mM}];var Nw=1,YM=.9,XM=.8,ZM=.17,tg=.1,rg=.999,JM=.9999,eI=.99,tI=/[\\\/_+.#"@\[\(\{&]/,rI=/[\\\/_+.#"@\[\(\{&]/g,nI=/[\s-]/,XN=/[\s-]/g;function dv(e,t,r,n,i,o,u){if(o===t.length)return i===e.length?Nw:eI;var c=`${i},${o}`;if(u[c]!==void 0)return u[c];for(var f=n.charAt(o),h=r.indexOf(f,i),m=0,g,v,b,j;h>=0;)g=dv(e,t,r,n,h+1,o+1,u),g>m&&(h===i?g*=Nw:tI.test(e.charAt(h-1))?(g*=XM,b=e.slice(i,h-1).match(rI),b&&i>0&&(g*=Math.pow(rg,b.length))):nI.test(e.charAt(h-1))?(g*=YM,j=e.slice(i,h-1).match(XN),j&&i>0&&(g*=Math.pow(rg,j.length))):(g*=ZM,i>0&&(g*=Math.pow(rg,h-i))),e.charAt(h)!==t.charAt(o)&&(g*=JM)),(gg&&(g=v*tg)),g>m&&(m=g),h=r.indexOf(f,h+1);return u[c]=m,m}function Ew(e){return e.toLowerCase().replace(XN," ")}function iI(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,dv(e,t,Ew(e),Ew(t),0,0,{})}function ha(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Aw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rs(...e){return t=>{let r=!1;const n=e.map(i=>{const o=Aw(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{var N;const{scope:v,children:b,...j}=g,k=((N=v==null?void 0:v[e])==null?void 0:N[f])||c,S=y.useMemo(()=>j,Object.values(j));return l.jsx(k.Provider,{value:S,children:b})};h.displayName=o+"Provider";function m(g,v){var k;const b=((k=v==null?void 0:v[e])==null?void 0:k[f])||c,j=y.useContext(b);if(j)return j;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,m]}const i=()=>{const o=r.map(u=>y.createContext(u));return function(c){const f=(c==null?void 0:c[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return i.scopeName=e,[n,oI(i,...t)]}function oI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const u=n.reduce((c,{useScope:f,scopeName:h})=>{const g=f(o)[`__scope${h}`];return{...c,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var bu=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},sI=ah[" useId ".trim().toString()]||(()=>{}),lI=0;function fi(e){const[t,r]=y.useState(sI());return bu(()=>{r(n=>n??String(lI++))},[e]),t?`radix-${t}`:""}var uI=ah[" useInsertionEffect ".trim().toString()]||bu;function cI({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,u]=dI({defaultProp:t,onChange:r}),c=e!==void 0,f=c?e:i;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const g=m.current;g!==c&&console.warn(`${n} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,n])}const h=y.useCallback(m=>{var g;if(c){const v=fI(m)?m(e):m;v!==e&&((g=u.current)==null||g.call(u,v))}else o(m)},[c,e,o,u]);return[f,h]}function dI({defaultProp:e,onChange:t}){const[r,n]=y.useState(e),i=y.useRef(r),o=y.useRef(t);return uI(()=>{o.current=t},[t]),y.useEffect(()=>{var u;i.current!==r&&((u=o.current)==null||u.call(o,r),i.current=r)},[r,i]),[r,n,o]}function fI(e){return typeof e=="function"}var ch=kN();function ZN(e){const t=y.forwardRef((r,n)=>{let{children:i,...o}=r,u=null,c=!1;const f=[];Cw(i)&&typeof bd=="function"&&(i=bd(i._payload)),y.Children.forEach(i,v=>{var b;if(vI(v)){c=!0;const j=v;let k="child"in j.props?j.props.child:j.props.children;Cw(k)&&typeof bd=="function"&&(k=bd(k._payload)),u=mI(j,k),f.push((b=u==null?void 0:u.props)==null?void 0:b.children)}else f.push(v)}),u?u=y.cloneElement(u,void 0,f):!c&&y.Children.count(i)===1&&y.isValidElement(i)&&(u=i);const h=u?gI(u):void 0,m=wo(n,h);if(!u){if(i||i===0)throw new Error(c?wI(e):bI(e));return i}const g=pI(o,u.props??{});return u.type!==y.Fragment&&(g.ref=n?m:h),y.cloneElement(u,g)});return t.displayName=`${e}.Slot`,t}var hI=Symbol.for("radix.slottable"),mI=(e,t)=>{if("child"in e.props){const r=e.props.child;return y.isValidElement(r)?y.cloneElement(r,void 0,e.props.children(r.props.children)):null}return y.isValidElement(t)?t:null};function pI(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...c)=>{const f=o(...c);return i(...c),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function gI(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function vI(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hI}var yI=Symbol.for("react.lazy");function Cw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===yI&&"_payload"in e&&xI(e._payload)}function xI(e){return typeof e=="object"&&e!==null&&"then"in e}var bI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,wI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,bd=ah[" use ".trim().toString()],kI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xt=kI.reduce((e,t)=>{const r=ZN(`Primitive.${t}`),n=y.forwardRef((i,o)=>{const{asChild:u,...c}=i,f=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(f,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function jI(e,t){e&&ch.flushSync(()=>e.dispatchEvent(t))}function wu(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}function SI(e,t=globalThis==null?void 0:globalThis.document){const r=wu(e);y.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var NI="DismissableLayer",fv="dismissableLayer.update",EI="dismissableLayer.pointerDownOutside",AI="dismissableLayer.focusOutside",Pw,E0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),JN=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:c,onDismiss:f,...h}=e,m=y.useContext(E0),[g,v]=y.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=y.useState({}),k=wo(t,$=>v($)),S=Array.from(m.layers),[N]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(N),A=g?S.indexOf(g):-1,P=m.layersWithOutsidePointerEventsDisabled.size>0,_=A>=E,O=y.useRef(!1),T=_I($=>{const z=$.target;if(!(z instanceof Node))return;const Q=[...m.branches].some(U=>U.contains(z));!_||Q||(o==null||o($),c==null||c($),$.defaultPrevented||f==null||f())},{ownerDocument:b,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces}),B=MI($=>{if(n&&O.current)return;const z=$.target;[...m.branches].some(U=>U.contains(z))||(u==null||u($),c==null||c($),$.defaultPrevented||f==null||f())},b);return SI($=>{A===m.layers.size-1&&(i==null||i($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),y.useEffect(()=>{if(g)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Pw=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Ow(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(g),m.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=Pw))}},[g,b,r,m]),y.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Ow())},[g,m]),y.useEffect(()=>{const $=()=>j({});return document.addEventListener(fv,$),()=>document.removeEventListener(fv,$)},[]),l.jsx(Xt.div,{...h,ref:k,style:{pointerEvents:P?_?"auto":"none":void 0,...e.style},onFocusCapture:ha(e.onFocusCapture,B.onFocusCapture),onBlurCapture:ha(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ha(e.onPointerDownCapture,T.onPointerDownCapture)})});JN.displayName=NI;var CI="DismissableLayerBranch",PI=y.forwardRef((e,t)=>{const r=y.useContext(E0),n=y.useRef(null),i=wo(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(Xt.div,{...e,ref:i})});PI.displayName=CI;function OI(){const e=y.useContext(E0),[t,r]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function _I(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,u=wu(e),c=y.useRef(!1),f=y.useRef(!1),h=y.useRef(new Map),m=y.useRef(()=>{});return y.useEffect(()=>{function g(){f.current=!1,i.current=!1,h.current.clear()}function v(){return Array.from(h.current.values()).some(Boolean)}function b(E){if(!f.current)return;const A=E.target;A instanceof Node&&[...o].some(_=>_.contains(A))||h.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function j(E){f.current&&h.current.set(E.type,!1)}const k=E=>{if(E.target&&!c.current){let A=function(){r.removeEventListener("click",m.current);const _=v();g(),_||e5(EI,u,P,{discrete:!0})};const P={originalEvent:E};f.current=!0,i.current=n&&E.button===0,h.current.clear(),!n||E.button!==0?A():(r.removeEventListener("click",m.current),m.current=A,r.addEventListener("click",m.current,{once:!0}))}else r.removeEventListener("click",m.current),g();c.current=!1},S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of S)r.addEventListener(E,b,!0),r.addEventListener(E,j);const N=window.setTimeout(()=>{r.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(N),r.removeEventListener("pointerdown",k),r.removeEventListener("click",m.current);for(const E of S)r.removeEventListener(E,b,!0),r.removeEventListener(E,j)}},[r,u,n,i,o]),{onPointerDownCapture:()=>c.current=!0}}function MI(e,t=globalThis==null?void 0:globalThis.document){const r=wu(e),n=y.useRef(!1);return y.useEffect(()=>{const i=o=>{o.target&&!n.current&&e5(AI,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ow(){const e=new CustomEvent(fv);document.dispatchEvent(e)}function e5(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?jI(i,o):i.dispatchEvent(o)}var ng="focusScope.autoFocusOnMount",ig="focusScope.autoFocusOnUnmount",_w={bubbles:!1,cancelable:!0},II="FocusScope",t5=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...u}=e,[c,f]=y.useState(null),h=wu(i),m=wu(o),g=y.useRef(null),v=wo(t,k=>f(k)),b=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let k=function(A){if(b.paused||!c)return;const P=A.target;c.contains(P)?g.current=P:Zi(g.current,{select:!0})},S=function(A){if(b.paused||!c)return;const P=A.relatedTarget;P!==null&&(c.contains(P)||Zi(g.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&Zi(c)};document.addEventListener("focusin",k),document.addEventListener("focusout",S);const E=new MutationObserver(N);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),E.disconnect()}}},[n,c,b.paused]),y.useEffect(()=>{if(c){Iw.add(b);const k=document.activeElement;if(!c.contains(k)){const N=new CustomEvent(ng,_w);c.addEventListener(ng,h),c.dispatchEvent(N),N.defaultPrevented||(TI(zI(r5(c)),{select:!0}),document.activeElement===k&&Zi(c))}return()=>{c.removeEventListener(ng,h),setTimeout(()=>{const N=new CustomEvent(ig,_w);c.addEventListener(ig,m),c.dispatchEvent(N),N.defaultPrevented||Zi(k??document.body,{select:!0}),c.removeEventListener(ig,m),Iw.remove(b)},0)}}},[c,h,m,b]);const j=y.useCallback(k=>{if(!r&&!n||b.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,N=document.activeElement;if(S&&N){const E=k.currentTarget,[A,P]=DI(E);A&&P?!k.shiftKey&&N===P?(k.preventDefault(),r&&Zi(A,{select:!0})):k.shiftKey&&N===A&&(k.preventDefault(),r&&Zi(P,{select:!0})):N===E&&k.preventDefault()}},[r,n,b.paused]);return l.jsx(Xt.div,{tabIndex:-1,...u,ref:v,onKeyDown:j})});t5.displayName=II;function TI(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Zi(n,{select:t}),document.activeElement!==r)return}function DI(e){const t=r5(e),r=Mw(t,e),n=Mw(t.reverse(),e);return[r,n]}function r5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Mw(e,t){for(const r of e)if(!RI(r,{upTo:t}))return r}function RI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function LI(e){return e instanceof HTMLInputElement&&"select"in e}function Zi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&LI(e)&&t&&e.select()}}var Iw=$I();function $I(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Tw(e,t),e.unshift(t)},remove(t){var r;e=Tw(e,t),(r=e[0])==null||r.resume()}}}function Tw(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function zI(e){return e.filter(t=>t.tagName!=="A")}var FI="Portal",n5=y.forwardRef((e,t)=>{var c;const{container:r,...n}=e,[i,o]=y.useState(!1);bu(()=>o(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?ch.createPortal(l.jsx(Xt.div,{...n,ref:t}),u):null});n5.displayName=FI;function BI(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var dh=e=>{const{present:t,children:r}=e,n=UI(t),i=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=HI(n.ref,WI(i));return typeof r=="function"||n.isPresent?y.cloneElement(i,{ref:o}):null};dh.displayName="Presence";function UI(e){const[t,r]=y.useState(),n=y.useRef(null),i=y.useRef(e),o=y.useRef("none"),u=e?"mounted":"unmounted",[c,f]=BI(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const h=wd(n.current);o.current=c==="mounted"?h:"none"},[c]),bu(()=>{const h=n.current,m=i.current;if(m!==e){const v=o.current,b=wd(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&v!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),bu(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=b=>{const k=wd(n.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(f("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},v=b=>{b.target===t&&(o.current=wd(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:y.useCallback(h=>{n.current=h?getComputedStyle(h):null,r(h)},[])}}function Dw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function HI(...e){const t=y.useRef(e);return t.current=e,y.useCallback(r=>{const n=t.current;let i=!1;const o=n.map(u=>{const c=Dw(u,r);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let u=0;u{Cn||(Cn={start:Rw(),end:Rw()});const{start:e,end:t}=Cn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),kd++,()=>{kd===1&&(Cn==null||Cn.start.remove(),Cn==null||Cn.end.remove(),Cn=null),kd=Math.max(0,kd-1)}},[])}function Rw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Dn=function(){return Dn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return lT;var t=uT(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},dT=s5(),gs="data-scroll-locked",fT=function(e,t,r,n){var i=e.left,o=e.top,u=e.right,c=e.gap;return r===void 0&&(r="margin"),` + .`.concat(VI,` { overflow: hidden `).concat(n,`; padding-right: `).concat(c,"px ").concat(n,`; } @@ -540,45 +545,45 @@ Error generating stack: `+w.message+` `),r==="padding"&&"padding-right: ".concat(c,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(Gd,` { + .`).concat(Kd,` { right: `).concat(c,"px ").concat(n,`; } - .`).concat(Vd,` { + .`).concat(Gd,` { margin-right: `).concat(c,"px ").concat(n,`; } - .`).concat(Gd," .").concat(Gd,` { + .`).concat(Kd," .").concat(Kd,` { right: 0 `).concat(n,`; } - .`).concat(Vd," .").concat(Vd,` { + .`).concat(Gd," .").concat(Gd,` { margin-right: 0 `).concat(n,`; } body[`).concat(gs,`] { - `).concat(VI,": ").concat(c,`px; + `).concat(qI,": ").concat(c,`px; } -`)},$w=function(){var e=parseInt(document.body.getAttribute(gs)||"0",10);return isFinite(e)?e:0},fT=function(){y.useEffect(function(){return document.body.setAttribute(gs,($w()+1).toString()),function(){var e=$w()-1;e<=0?document.body.removeAttribute(gs):document.body.setAttribute(gs,e.toString())}},[])},hT=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;fT();var o=y.useMemo(function(){return uT(i)},[i]);return y.createElement(cT,{styles:dT(o,!t,i,r?"":"!important")})},hv=!1;if(typeof window<"u")try{var Sd=Object.defineProperty({},"passive",{get:function(){return hv=!0,!0}});window.addEventListener("test",Sd,Sd),window.removeEventListener("test",Sd,Sd)}catch{hv=!1}var Zo=hv?{passive:!1}:!1,mT=function(e){return e.tagName==="TEXTAREA"},l5=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mT(e)&&r[t]==="visible")},pT=function(e){return l5(e,"overflowY")},gT=function(e){return l5(e,"overflowX")},zw=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=u5(e,n);if(i){var o=c5(e,n),u=o[1],c=o[2];if(u>c)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vT=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yT=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},u5=function(e,t){return e==="v"?pT(t):gT(t)},c5=function(e,t){return e==="v"?vT(t):yT(t)},xT=function(e,t){return e==="h"&&t==="rtl"?-1:1},bT=function(e,t,r,n,i){var o=xT(e,window.getComputedStyle(t).direction),u=o*n,c=r.target,f=t.contains(c),h=!1,m=u>0,g=0,v=0;do{if(!c)break;var b=c5(e,c),j=b[0],k=b[1],S=b[2],N=k-S-o*j;(j||N)&&u5(e,c)&&(g+=N,v+=j);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(g)<1||!m&&Math.abs(v)<1)&&(h=!0),h},Nd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fw=function(e){return[e.deltaX,e.deltaY]},Bw=function(e){return e&&"current"in e?e.current:e},wT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kT=function(e){return` +`)},$w=function(){var e=parseInt(document.body.getAttribute(gs)||"0",10);return isFinite(e)?e:0},hT=function(){y.useEffect(function(){return document.body.setAttribute(gs,($w()+1).toString()),function(){var e=$w()-1;e<=0?document.body.removeAttribute(gs):document.body.setAttribute(gs,e.toString())}},[])},mT=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;hT();var o=y.useMemo(function(){return cT(i)},[i]);return y.createElement(dT,{styles:fT(o,!t,i,r?"":"!important")})},hv=!1;if(typeof window<"u")try{var jd=Object.defineProperty({},"passive",{get:function(){return hv=!0,!0}});window.addEventListener("test",jd,jd),window.removeEventListener("test",jd,jd)}catch{hv=!1}var Zo=hv?{passive:!1}:!1,pT=function(e){return e.tagName==="TEXTAREA"},l5=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!pT(e)&&r[t]==="visible")},gT=function(e){return l5(e,"overflowY")},vT=function(e){return l5(e,"overflowX")},zw=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=u5(e,n);if(i){var o=c5(e,n),u=o[1],c=o[2];if(u>c)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},yT=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},xT=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},u5=function(e,t){return e==="v"?gT(t):vT(t)},c5=function(e,t){return e==="v"?yT(t):xT(t)},bT=function(e,t){return e==="h"&&t==="rtl"?-1:1},wT=function(e,t,r,n,i){var o=bT(e,window.getComputedStyle(t).direction),u=o*n,c=r.target,f=t.contains(c),h=!1,m=u>0,g=0,v=0;do{if(!c)break;var b=c5(e,c),j=b[0],k=b[1],S=b[2],N=k-S-o*j;(j||N)&&u5(e,c)&&(g+=N,v+=j);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(g)<1||!m&&Math.abs(v)<1)&&(h=!0),h},Sd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fw=function(e){return[e.deltaX,e.deltaY]},Bw=function(e){return e&&"current"in e?e.current:e},kT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jT=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},jT=0,Jo=[];function ST(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),i=y.useState(jT++)[0],o=y.useState(s5)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var k=KI([e.lockRef.current],(e.shards||[]).map(Bw),!0).filter(Boolean);return k.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),k.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=y.useCallback(function(k,S){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!u.current.allowPinchZoom;var N=Nd(k),E=r.current,A="deltaX"in k?k.deltaX:E[0]-N[0],P="deltaY"in k?k.deltaY:E[1]-N[1],_,O=k.target,T=Math.abs(A)>Math.abs(P)?"h":"v";if("touches"in k&&T==="h"&&O.type==="range")return!1;var B=window.getSelection(),$=B&&B.anchorNode,z=$?$===O||$.contains(O):!1;if(z)return!1;var Q=zw(T,O);if(!Q)return!0;if(Q?_=T:(_=T==="v"?"h":"v",Q=zw(T,O)),!Q)return!1;if(!n.current&&"changedTouches"in k&&(A||P)&&(n.current=_),!_)return!0;var U=n.current||_;return bT(U,S,k,U==="h"?A:P)},[]),f=y.useCallback(function(k){var S=k;if(!(!Jo.length||Jo[Jo.length-1]!==o)){var N="deltaY"in S?Fw(S):Nd(S),E=t.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&wT(_.delta,N)})[0];if(E&&E.should){S.cancelable&&S.preventDefault();return}if(!E){var A=(u.current.shards||[]).map(Bw).filter(Boolean).filter(function(_){return _.contains(S.target)}),P=A.length>0?c(S,A[0]):!u.current.noIsolation;P&&S.cancelable&&S.preventDefault()}}},[]),h=y.useCallback(function(k,S,N,E){var A={name:k,delta:S,target:N,should:E,shadowParent:NT(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(P){return P!==A})},1)},[]),m=y.useCallback(function(k){r.current=Nd(k),n.current=void 0},[]),g=y.useCallback(function(k){h(k.type,Fw(k),k.target,c(k,e.lockRef.current))},[]),v=y.useCallback(function(k){h(k.type,Nd(k),k.target,c(k,e.lockRef.current))},[]);y.useEffect(function(){return Jo.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Zo),document.addEventListener("touchmove",f,Zo),document.addEventListener("touchstart",m,Zo),function(){Jo=Jo.filter(function(k){return k!==o}),document.removeEventListener("wheel",f,Zo),document.removeEventListener("touchmove",f,Zo),document.removeEventListener("touchstart",m,Zo)}},[]);var b=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(o,{styles:kT(i)}):null,b?y.createElement(hT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function NT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ET=eT(o5,ST);var d5=y.forwardRef(function(e,t){return y.createElement(fh,Dn({},e,{ref:t,sideCar:ET}))});d5.classNames=fh.classNames;var AT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},es=new WeakMap,Ed=new WeakMap,Ad={},lg=0,f5=function(e){return e&&(e.host||f5(e.parentNode))},CT=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=f5(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},PT=function(e,t,r,n){var i=CT(t,Array.isArray(e)?e:[e]);Ad[r]||(Ad[r]=new WeakMap);var o=Ad[r],u=[],c=new Set,f=new Set(i),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};i.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))m(v);else try{var b=v.getAttribute(n),j=b!==null&&b!=="false",k=(es.get(v)||0)+1,S=(o.get(v)||0)+1;es.set(v,k),o.set(v,S),u.push(v),k===1&&j&&Ed.set(v,!0),S===1&&v.setAttribute(r,"true"),j||v.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",v,N)}})};return m(t),c.clear(),lg++,function(){u.forEach(function(g){var v=es.get(g)-1,b=o.get(g)-1;es.set(g,v),o.set(g,b),v||(Ed.has(g)||g.removeAttribute(n),Ed.delete(g)),b||g.removeAttribute(r)}),lg--,lg||(es=new WeakMap,es=new WeakMap,Ed=new WeakMap,Ad={})}},OT=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=AT(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),PT(n,i,r,"aria-hidden")):function(){return null}},hh="Dialog",[h5]=iI(hh),[_T,wn]=h5(hh),m5=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:u=!0}=e,c=y.useRef(null),f=y.useRef(null),[h,m]=uI({prop:n,defaultProp:i??!1,onChange:o,caller:hh});return l.jsx(_T,{scope:t,triggerRef:c,contentRef:f,contentId:fi(),titleId:fi(),descriptionId:fi(),open:h,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(g=>!g),[m]),modal:u,children:r})};m5.displayName=hh;var p5="DialogTrigger",MT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(p5,r),o=wo(t,i.triggerRef);return l.jsx(Xt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":C0(i.open),...n,ref:o,onClick:ha(e.onClick,i.onOpenToggle)})});MT.displayName=p5;var A0="DialogPortal",[IT,g5]=h5(A0,{forceMount:void 0}),v5=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=wn(A0,t);return l.jsx(IT,{scope:t,forceMount:r,children:y.Children.map(n,u=>l.jsx(dh,{present:r||o.open,children:l.jsx(n5,{asChild:!0,container:i,children:u})}))})};v5.displayName=A0;var sf="DialogOverlay",y5=y.forwardRef((e,t)=>{const r=g5(sf,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=wn(sf,e.__scopeDialog);return o.modal?l.jsx(dh,{present:n||o.open,children:l.jsx(DT,{...i,ref:t})}):null});y5.displayName=sf;var TT=ZN("DialogOverlay.RemoveScroll"),DT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(sf,r),o=PI(),u=wo(t,o);return l.jsx(d5,{as:TT,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Xt.div,{"data-state":C0(i.open),...n,ref:u,style:{pointerEvents:"auto",...n.style}})})}),$s="DialogContent",x5=y.forwardRef((e,t)=>{const r=g5($s,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=wn($s,e.__scopeDialog);return l.jsx(dh,{present:n||o.open,children:o.modal?l.jsx(RT,{...i,ref:t}):l.jsx(LT,{...i,ref:t})})});x5.displayName=$s;var RT=y.forwardRef((e,t)=>{const r=wn($s,e.__scopeDialog),n=y.useRef(null),i=wo(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return OT(o)},[]),l.jsx(b5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ha(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ha(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&o.preventDefault()}),onFocusOutside:ha(e.onFocusOutside,o=>o.preventDefault())})}),LT=y.forwardRef((e,t)=>{const r=wn($s,e.__scopeDialog),n=y.useRef(!1),i=y.useRef(!1);return l.jsx(b5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(n.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),b5=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...u}=e,c=wn($s,r);return WI(),l.jsx(l.Fragment,{children:l.jsx(t5,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:l.jsx(JN,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":C0(c.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),w5="DialogTitle",$T=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(w5,r);return l.jsx(Xt.h2,{id:i.titleId,...n,ref:t})});$T.displayName=w5;var k5="DialogDescription",zT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(k5,r);return l.jsx(Xt.p,{id:i.descriptionId,...n,ref:t})});zT.displayName=k5;var j5="DialogClose",FT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(j5,r);return l.jsx(Xt.button,{type:"button",...n,ref:t,onClick:ha(e.onClick,()=>i.onOpenChange(!1))})});FT.displayName=j5;function C0(e){return e?"open":"closed"}var ql='[cmdk-group=""]',ug='[cmdk-group-items=""]',BT='[cmdk-group-heading=""]',S5='[cmdk-item=""]',Uw=`${S5}:not([aria-disabled="true"])`,mv="cmdk-item-select",us="data-value",UT=(e,t,r)=>nI(e,t,r),N5=y.createContext(void 0),Vu=()=>y.useContext(N5),E5=y.createContext(void 0),P0=()=>y.useContext(E5),A5=y.createContext(void 0),C5=y.forwardRef((e,t)=>{let r=cs(()=>{var M,H;return{search:"",value:(H=(M=e.value)!=null?M:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=cs(()=>new Set),i=cs(()=>new Map),o=cs(()=>new Map),u=cs(()=>new Set),c=P5(e),{label:f,children:h,value:m,onValueChange:g,filter:v,shouldFilter:b,loop:j,disablePointerSelection:k=!1,vimBindings:S=!0,...N}=e,E=fi(),A=fi(),P=fi(),_=y.useRef(null),O=JT();fo(()=>{if(m!==void 0){let M=m.trim();r.current.value=M,T.emit()}},[m]),fo(()=>{O(6,ve)},[]);let T=y.useMemo(()=>({subscribe:M=>(u.current.add(M),()=>u.current.delete(M)),snapshot:()=>r.current,setState:(M,H,ie)=>{var J,Z,ae,me;if(!Object.is(r.current[M],H)){if(r.current[M]=H,M==="search")U(),z(),O(1,Q);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(P);re?re.focus():(J=document.getElementById(E))==null||J.focus()}if(O(7,()=>{var re;r.current.selectedItemId=(re=ue())==null?void 0:re.id,T.emit()}),ie||O(5,ve),((Z=c.current)==null?void 0:Z.value)!==void 0){let re=H??"";(me=(ae=c.current).onValueChange)==null||me.call(ae,re);return}}T.emit()}},emit:()=>{u.current.forEach(M=>M())}}),[]),B=y.useMemo(()=>({value:(M,H,ie)=>{var J;H!==((J=o.current.get(M))==null?void 0:J.value)&&(o.current.set(M,{value:H,keywords:ie}),r.current.filtered.items.set(M,$(H,ie)),O(2,()=>{z(),T.emit()}))},item:(M,H)=>(n.current.add(M),H&&(i.current.has(H)?i.current.get(H).add(M):i.current.set(H,new Set([M]))),O(3,()=>{U(),z(),r.current.value||Q(),T.emit()}),()=>{o.current.delete(M),n.current.delete(M),r.current.filtered.items.delete(M);let ie=ue();O(4,()=>{U(),(ie==null?void 0:ie.getAttribute("id"))===M&&Q(),T.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>c.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:E,inputId:P,labelId:A,listInnerRef:_}),[]);function $(M,H){var ie,J;let Z=(J=(ie=c.current)==null?void 0:ie.filter)!=null?J:UT;return M?Z(M,r.current.search,H):0}function z(){if(!r.current.search||c.current.shouldFilter===!1)return;let M=r.current.filtered.items,H=[];r.current.filtered.groups.forEach(J=>{let Z=i.current.get(J),ae=0;Z.forEach(me=>{let re=M.get(me);ae=Math.max(re,ae)}),H.push([J,ae])});let ie=_.current;pe().sort((J,Z)=>{var ae,me;let re=J.getAttribute("id"),ye=Z.getAttribute("id");return((ae=M.get(ye))!=null?ae:0)-((me=M.get(re))!=null?me:0)}).forEach(J=>{let Z=J.closest(ug);Z?Z.appendChild(J.parentElement===Z?J:J.closest(`${ug} > *`)):ie.appendChild(J.parentElement===ie?J:J.closest(`${ug} > *`))}),H.sort((J,Z)=>Z[1]-J[1]).forEach(J=>{var Z;let ae=(Z=_.current)==null?void 0:Z.querySelector(`${ql}[${us}="${encodeURIComponent(J[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function Q(){let M=pe().find(ie=>ie.getAttribute("aria-disabled")!=="true"),H=M==null?void 0:M.getAttribute(us);T.setState("value",H||void 0)}function U(){var M,H,ie,J;if(!r.current.search||c.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let Z=0;for(let ae of n.current){let me=(H=(M=o.current.get(ae))==null?void 0:M.value)!=null?H:"",re=(J=(ie=o.current.get(ae))==null?void 0:ie.keywords)!=null?J:[],ye=$(me,re);r.current.filtered.items.set(ae,ye),ye>0&&Z++}for(let[ae,me]of i.current)for(let re of me)if(r.current.filtered.items.get(re)>0){r.current.filtered.groups.add(ae);break}r.current.filtered.count=Z}function ve(){var M,H,ie;let J=ue();J&&(((M=J.parentElement)==null?void 0:M.firstChild)===J&&((ie=(H=J.closest(ql))==null?void 0:H.querySelector(BT))==null||ie.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function ue(){var M;return(M=_.current)==null?void 0:M.querySelector(`${S5}[aria-selected="true"]`)}function pe(){var M;return Array.from(((M=_.current)==null?void 0:M.querySelectorAll(Uw))||[])}function oe(M){let H=pe()[M];H&&T.setState("value",H.getAttribute(us))}function se(M){var H;let ie=ue(),J=pe(),Z=J.findIndex(me=>me===ie),ae=J[Z+M];(H=c.current)!=null&&H.loop&&(ae=Z+M<0?J[J.length-1]:Z+M===J.length?J[0]:J[Z+M]),ae&&T.setState("value",ae.getAttribute(us))}function X(M){let H=ue(),ie=H==null?void 0:H.closest(ql),J;for(;ie&&!J;)ie=M>0?XT(ie,ql):ZT(ie,ql),J=ie==null?void 0:ie.querySelector(Uw);J?T.setState("value",J.getAttribute(us)):se(M)}let ne=()=>oe(pe().length-1),te=M=>{M.preventDefault(),M.metaKey?ne():M.altKey?X(1):se(1)},I=M=>{M.preventDefault(),M.metaKey?oe(0):M.altKey?X(-1):se(-1)};return y.createElement(Xt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:M=>{var H;(H=N.onKeyDown)==null||H.call(N,M);let ie=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||ie))switch(M.key){case"n":case"j":{S&&M.ctrlKey&&te(M);break}case"ArrowDown":{te(M);break}case"p":case"k":{S&&M.ctrlKey&&I(M);break}case"ArrowUp":{I(M);break}case"Home":{M.preventDefault(),oe(0);break}case"End":{M.preventDefault(),ne();break}case"Enter":{M.preventDefault();let J=ue();if(J){let Z=new Event(mv);J.dispatchEvent(Z)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:tD},f),mh(e,M=>y.createElement(E5.Provider,{value:T},y.createElement(N5.Provider,{value:B},M))))}),HT=y.forwardRef((e,t)=>{var r,n;let i=fi(),o=y.useRef(null),u=y.useContext(A5),c=Vu(),f=P5(e),h=(n=(r=f.current)==null?void 0:r.forceMount)!=null?n:u==null?void 0:u.forceMount;fo(()=>{if(!h)return c.item(i,u==null?void 0:u.id)},[h]);let m=O5(i,o,[e.value,e.children,o],e.keywords),g=P0(),v=va(O=>O.value&&O.value===m.current),b=va(O=>h||c.filter()===!1?!0:O.search?O.filtered.items.get(i)>0:!0);y.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(mv,j),()=>O.removeEventListener(mv,j)},[b,e.onSelect,e.disabled]);function j(){var O,T;k(),(T=(O=f.current).onSelect)==null||T.call(O,m.current)}function k(){g.setState("value",m.current,!0)}if(!b)return null;let{disabled:S,value:N,onSelect:E,forceMount:A,keywords:P,..._}=e;return y.createElement(Xt.div,{ref:Ls(o,t),..._,id:i,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!v,"data-disabled":!!S,"data-selected":!!v,onPointerMove:S||c.getDisablePointerSelection()?void 0:k,onClick:S?void 0:j},e.children)}),WT=y.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...o}=e,u=fi(),c=y.useRef(null),f=y.useRef(null),h=fi(),m=Vu(),g=va(b=>i||m.filter()===!1?!0:b.search?b.filtered.groups.has(u):!0);fo(()=>m.group(u),[]),O5(u,c,[e.value,e.heading,f]);let v=y.useMemo(()=>({id:u,forceMount:i}),[i]);return y.createElement(Xt.div,{ref:Ls(c,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&y.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),mh(e,b=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},y.createElement(A5.Provider,{value:v},b))))}),KT=y.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=y.useRef(null),o=va(u=>!u.search);return!r&&!o?null:y.createElement(Xt.div,{ref:Ls(i,t),...n,"cmdk-separator":"",role:"separator"})}),GT=y.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,o=P0(),u=va(h=>h.search),c=va(h=>h.selectedItemId),f=Vu();return y.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),y.createElement(Xt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:i?e.value:u,onChange:h=>{i||o.setState("search",h.target.value),r==null||r(h.target.value)}})}),VT=y.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,o=y.useRef(null),u=y.useRef(null),c=va(h=>h.selectedItemId),f=Vu();return y.useEffect(()=>{if(u.current&&o.current){let h=u.current,m=o.current,g,v=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let b=h.offsetHeight;m.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(g),v.unobserve(h)}}},[]),y.createElement(Xt.div,{ref:Ls(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:f.listId},mh(e,h=>y.createElement("div",{ref:Ls(u,f.listInnerRef),"cmdk-list-sizer":""},h)))}),qT=y.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:o,container:u,...c}=e;return y.createElement(m5,{open:r,onOpenChange:n},y.createElement(v5,{container:u},y.createElement(y5,{"cmdk-overlay":"",className:i}),y.createElement(x5,{"aria-label":e.label,"cmdk-dialog":"",className:o},y.createElement(C5,{ref:t,...c}))))}),QT=y.forwardRef((e,t)=>va(r=>r.filtered.count===0)?y.createElement(Xt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),YT=y.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...o}=e;return y.createElement(Xt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},mh(e,u=>y.createElement("div",{"aria-hidden":!0},u)))}),ts=Object.assign(C5,{List:VT,Item:HT,Input:GT,Group:WT,Separator:KT,Dialog:qT,Empty:QT,Loading:YT});function XT(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ZT(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function P5(e){let t=y.useRef(e);return fo(()=>{t.current=e}),t}var fo=typeof window>"u"?y.useEffect:y.useLayoutEffect;function cs(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function va(e){let t=P0(),r=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,r,r)}function O5(e,t,r,n=[]){let i=y.useRef(),o=Vu();return fo(()=>{var u;let c=(()=>{var h;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():i.current}})(),f=n.map(h=>h.trim());o.value(e,c,f),(u=t.current)==null||u.setAttribute(us,c),i.current=c}),i}var JT=()=>{let[e,t]=y.useState(),r=cs(()=>new Map);return fo(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function eD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function mh({asChild:e,children:t},r){return e&&y.isValidElement(t)?y.cloneElement(eD(t),{ref:t.ref},r(t.props.children)):r(t)}var tD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function rD({onNavigate:e}){const[t,r]=y.useState(!1);return y.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&(i.preventDefault(),r(o=>!o))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),l.jsx(ts.Dialog,{open:t,onOpenChange:r,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh] overscroll-contain",onClick:()=>r(!1),children:l.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:n=>n.stopPropagation(),children:[l.jsx(ts.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),l.jsxs(ts.List,{className:"max-h-80 overflow-y-auto p-2",children:[l.jsx(ts.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),l.jsx(ts.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:uu.map(n=>l.jsxs(ts.Item,{value:`${n.label} ${n.hint}`,onSelect:()=>{e(n.id),r(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[l.jsx(n.icon,{className:"h-4 w-4 text-primary"}),l.jsx("span",{children:n.label}),l.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:n.hint})]},n.id))})]})]})})}const _5="mc_expert_mode",pv="mc-expert-mode-change",nD=()=>{try{return localStorage.getItem(_5)==="true"}catch{return!1}};function iD(e){return window.addEventListener(pv,e),window.addEventListener("storage",e),()=>{window.removeEventListener(pv,e),window.removeEventListener("storage",e)}}function Hw(e){localStorage.setItem(_5,String(e)),window.dispatchEvent(new Event(pv))}function O0(){return y.useSyncExternalStore(iD,nD,()=>!1)}function M5(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=sD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{const c=u.split(_0);return c[0]===""&&c.length!==1&&c.shift(),I5(c,t)||oD(u)},getConflictingClassGroupIds:(u,c)=>{const f=r[u]||[];return c&&n[u]?[...f,...n[u]]:f}}},I5=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?I5(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(_0);return(u=t.validators.find(({validator:c})=>c(o)))==null?void 0:u.classGroupId},Ww=/^\[(.+)\]$/,oD=e=>{if(Ww.test(e)){const t=Ww.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},sD=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return uD(Object.entries(e.classGroups),r).forEach(([o,u])=>{gv(u,n,o,t)}),n},gv=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Kw(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(lD(i)){gv(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,u])=>{gv(u,Kw(t,o),r,n)})})},Kw=(e,t)=>{let r=e;return t.split(_0).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},lD=e=>e.isThemeGetter,uD=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([u,c])=>[t+u,c])):o);return[r,i]}):e,cD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,u)=>{r.set(o,u),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let u=r.get(o);if(u!==void 0)return u;if((u=n.get(o))!==void 0)return i(o,u),u},set(o,u){r.has(o)?r.set(o,u):i(o,u)}}},T5="!",dD=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,u=c=>{const f=[];let h=0,m=0,g;for(let S=0;Sm?g-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:k}};return r?c=>r({className:c,parseClassName:u}):u},fD=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},hD=e=>({cache:cD(e.cacheSize),parseClassName:dD(e),...aD(e)}),mD=/\s+/,pD=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],u=e.trim().split(mD);let c="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{modifiers:m,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:b}=r(h);let j=!!b,k=n(j?v.substring(0,b):v);if(!k){if(!j){c=h+(c.length>0?" "+c:c);continue}if(k=n(v),!k){c=h+(c.length>0?" "+c:c);continue}j=!1}const S=fD(m).join(":"),N=g?S+T5:S,E=N+k;if(o.includes(E))continue;o.push(E);const A=i(k,j);for(let P=0;P0?" "+c:c)}return c};function gD(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;ng(m),e());return r=hD(h),n=r.cache.get,i=r.cache.set,o=c,c(f)}function c(f){const h=n(f);if(h)return h;const m=pD(f,r);return i(f,m),m}return function(){return o(gD.apply(null,arguments))}}const ot=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},R5=/^\[(?:([a-z-]+):)?(.+)\]$/i,yD=/^\d+\/\d+$/,xD=new Set(["px","full","screen"]),bD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ri=e=>vs(e)||xD.has(e)||yD.test(e),qi=e=>Ys(e,"length",MD),vs=e=>!!e&&!Number.isNaN(Number(e)),cg=e=>Ys(e,"number",vs),Ql=e=>!!e&&Number.isInteger(Number(e)),ND=e=>e.endsWith("%")&&vs(e.slice(0,-1)),$e=e=>R5.test(e),Qi=e=>bD.test(e),ED=new Set(["length","size","percentage"]),AD=e=>Ys(e,ED,L5),CD=e=>Ys(e,"position",L5),PD=new Set(["image","url"]),OD=e=>Ys(e,PD,TD),_D=e=>Ys(e,"",ID),Yl=()=>!0,Ys=(e,t,r)=>{const n=R5.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},MD=e=>wD.test(e)&&!kD.test(e),L5=()=>!1,ID=e=>jD.test(e),TD=e=>SD.test(e),DD=()=>{const e=ot("colors"),t=ot("spacing"),r=ot("blur"),n=ot("brightness"),i=ot("borderColor"),o=ot("borderRadius"),u=ot("borderSpacing"),c=ot("borderWidth"),f=ot("contrast"),h=ot("grayscale"),m=ot("hueRotate"),g=ot("invert"),v=ot("gap"),b=ot("gradientColorStops"),j=ot("gradientColorStopPositions"),k=ot("inset"),S=ot("margin"),N=ot("opacity"),E=ot("padding"),A=ot("saturate"),P=ot("scale"),_=ot("sepia"),O=ot("skew"),T=ot("space"),B=ot("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",$e,t],U=()=>[$e,t],ve=()=>["",ri,qi],ue=()=>["auto",vs,$e],pe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",$e],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[vs,$e];return{cacheSize:500,separator:":",theme:{colors:[Yl],spacing:[ri,qi],blur:["none","",Qi,$e],brightness:I(),borderColor:[e],borderRadius:["none","","full",Qi,$e],borderSpacing:U(),borderWidth:ve(),contrast:I(),grayscale:ne(),hueRotate:I(),invert:ne(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[ND,qi],inset:Q(),margin:Q(),opacity:I(),padding:U(),saturate:I(),scale:I(),sepia:ne(),skew:I(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Qi]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...pe(),$e]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ql,$e]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Ql,$e]}],"grid-cols":[{"grid-cols":[Yl]}],"col-start-end":[{col:["auto",{span:["full",Ql,$e]},$e]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[Yl]}],"row-start-end":[{row:["auto",{span:[Ql,$e]},$e]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Qi]},Qi]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qi,qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cg]}],"font-family":[{font:[Yl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",vs,cg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ri,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ri,qi]}],"underline-offset":[{"underline-offset":["auto",ri,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...pe(),CD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",AD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:oe()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[ri,$e]}],"outline-w":[{outline:[ri,qi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[ri,qi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qi,_D]}],"shadow-color":[{shadow:[Yl]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Qi,$e]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[g]}],saturate:[{saturate:[A]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Ql,$e]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ri,qi,cg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},RD=vD(DD);function ee(...e){return RD(rt(e))}function lf(e){return e?e.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function $5(){const e=O0();return l.jsxs("div",{className:"flex items-center rounded-md border border-border/40 bg-background/40 p-0.5",role:"group","aria-label":"Ansichtsmodus",title:"Einfach zeigt nur das Wichtigste. Experte zeigt alle technischen Details.",children:[l.jsxs("button",{onClick:()=>Hw(!1),"aria-pressed":!e,className:ee("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary/15 text-primary shadow-sm"),children:[l.jsx(fs,{className:"h-3.5 w-3.5"})," Einfach"]}),l.jsxs("button",{onClick:()=>Hw(!0),"aria-pressed":e,className:ee("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.jsx(WM,{className:"h-3.5 w-3.5"})," Experte"]})]})}async function we(e,t){var f;const r={"Content-Type":"application/json",...t==null?void 0:t.headers},n=localStorage.getItem("mc_sudo_password"),i=localStorage.getItem("mc_hf_token");n&&(r["X-Sudo-Password"]=n);let o=t==null?void 0:t.body;if((((f=t==null?void 0:t.method)==null?void 0:f.toUpperCase())||"GET")==="POST"){if(typeof o=="string")try{const h=JSON.parse(o);let m=!1;n&&!("sudo_password"in h)&&(h.sudo_password=n,m=!0),i&&!("hf_token"in h)&&(h.hf_token=i,m=!0),m&&(o=JSON.stringify(h))}catch{}else if(!o){const h={};n&&(h.sudo_password=n),i&&(h.hf_token=i),Object.keys(h).length>0&&(o=JSON.stringify(h))}}const c=await fetch(e,{...t,headers:r,body:o});if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.json()}const z5=(e,t,r=!1,n=!0)=>we("/api/groups",{method:"PUT",body:JSON.stringify({group:e,members:t,swap:r,persist:n})}),LD=e=>we("/api/routing/policy",{method:"PUT",body:JSON.stringify(e)}),Be={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],groups:["groups"],routing:["routing"],routingPolicy:["routing-policy"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:e=>["drafts",e??""],connect:e=>["connect",e??""],connectHealth:["connect-health"],memory:(e,t)=>["memory",e??"",t??""],memoryGraph:["memory-graph"],voiceTrace:["voice-trace"]},$D=(e=!0)=>Yt({queryKey:Be.memoryGraph,queryFn:()=>we("/api/memory/graph"),enabled:e}),M0=()=>Yt({queryKey:Be.health,queryFn:()=>we("/api/health"),refetchInterval:1e4}),ko=(e=5e3)=>Yt({queryKey:Be.systemStatus,queryFn:()=>we("/api/system/status"),refetchInterval:e}),F5=(e=3e3)=>Yt({queryKey:Be.services,queryFn:()=>we("/api/system/services"),refetchInterval:e}),wi=(e=4e3)=>Yt({queryKey:Be.models,queryFn:()=>we("/api/models"),refetchInterval:e}),I0=(e=8e3)=>Yt({queryKey:Be.groups,queryFn:()=>we("/api/groups"),refetchInterval:e}),zD=()=>Yt({queryKey:Be.routingPolicy,queryFn:()=>we("/api/routing/policy")}),FD=(e=2e3)=>Yt({queryKey:Be.jobs,queryFn:()=>we("/api/jobs"),refetchInterval:e,select:t=>t.jobs??[]}),B5=(e=3e3)=>Yt({queryKey:Be.tokenStats,queryFn:()=>we("/api/system/token-stats"),refetchInterval:e}),ph=(e=5e3)=>Yt({queryKey:Be.agentStatus,queryFn:()=>we("/api/agent/status"),refetchInterval:e}),U5=(e=6e4)=>Yt({queryKey:Be.hermesBrain,queryFn:()=>we("/api/agent/brain"),refetchInterval:e}),gh=e=>Yt({queryKey:Be.updates,queryFn:()=>we("/api/maintenance/updates"),refetchInterval:e}),BD=()=>Yt({queryKey:Be.discover,queryFn:()=>we("/api/discover")}),UD=e=>Yt({queryKey:Be.drafts(e),queryFn:()=>we(`/api/models/drafts?target=${encodeURIComponent(e??"")}`),enabled:!!e}),HD=e=>Yt({queryKey:Be.connect(e),queryFn:()=>we(e?`/api/connect?${e}`:"/api/connect")}),H5=()=>Yt({queryKey:Be.connectHealth,queryFn:()=>we("/api/connect/health"),refetchInterval:15e3}),vv=e=>Yt({queryKey:Be.memory(e==null?void 0:e.q,e==null?void 0:e.category),queryFn:()=>{const t=new URLSearchParams;return e!=null&&e.q&&t.set("q",e.q),e!=null&&e.category&&t.set("category",e.category),we(`/api/memory?${t}`)},select:t=>e!=null&&e.limit?t.slice(0,e.limit):t});function W5({type:e,title:t,message:r,defaultValue:n,autoValue:i,autoLabel:o,onConfirm:u,onCancel:c}){const f=y.useRef(null);return l.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":t,children:l.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:t}),l.jsx("button",{onClick:c||(()=>u()),"aria-label":"Schließen",className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r}),e==="prompt"&&l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{ref:f,type:"text",defaultValue:n,"aria-label":t,className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var m;h.key==="Enter"&&u((m=f.current)==null?void 0:m.value)}}),i!==void 0&&l.jsx("button",{type:"button",onClick:()=>{f.current&&(f.current.value=i)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:o||"Auto"})]}),l.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(e==="confirm"||e==="prompt")&&l.jsx("button",{onClick:c,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),l.jsx("button",{onClick:()=>{var m;const h=e==="prompt"?(m=f.current)==null?void 0:m.value:void 0;u(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:e==="confirm"?"Ja, fortfahren":e==="prompt"?"Übernehmen":"OK"})]})]})})}function ba(){const[e,t]=y.useState(null),r=y.useCallback(()=>t(null),[]),n=y.useCallback((c,f,h)=>{t({type:"alert",title:c,message:f,onConfirm:()=>{t(null),h==null||h()}})},[]),i=y.useCallback((c,f,h,m)=>{t({type:"confirm",title:c,message:f,onConfirm:()=>{t(null),h()},onCancel:()=>{t(null),m==null||m()}})},[]),o=y.useCallback((c,f,h,m,g,v)=>{t({type:"prompt",title:c,message:f,defaultValue:h,autoValue:v==null?void 0:v.autoValue,autoLabel:v==null?void 0:v.autoLabel,onConfirm:b=>{t(null),m(b)},onCancel:()=>{t(null),g==null||g()}})},[]),u=e?l.jsx(W5,{...e}):null;return{showAlert:n,showConfirm:i,showPrompt:o,close:r,dialogElement:u}}function Qr(e){return(e/1024**3).toFixed(1)}function yv(e){return e?e>1024**3?`${(e/1024**3).toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`:""}function or(e){if(!e)return"—";const t=e/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`}function WD(e){if(!e)return"";const t=Math.floor(e/60);return t>0?`${t} min`:`${e} s`}function xv(e){return e?`${Math.round(e/1024)}k`:"—"}function KD(){const e=Kn(),{data:t=[]}=FD(2e3),{showAlert:r,dialogElement:n}=ba();async function i(c){try{await we(`/api/jobs/${c}/cancel`,{method:"POST"}),e.invalidateQueries({queryKey:Be.jobs})}catch(f){r("Fehler",f.message)}}const o=t.filter(c=>c.state==="running"||c.state==="queued"),u=t.filter(c=>c.state!=="running"&&c.state!=="queued").slice(-3);return o.length===0&&u.length===0?null:l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[l.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),o.map(c=>l.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:c.label}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-muted-foreground font-mono",children:[c.progress??0,"% • ",yv(c.done_bytes),"/",yv(c.total_bytes),c.eta_s?` • ETA ${WD(c.eta_s)}`:""]}),l.jsx("button",{onClick:()=>i(c.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),l.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${c.progress??0}%`}})})]},c.id)),u.map(c=>l.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[l.jsx("span",{className:"truncate",children:c.label}),l.jsx("span",{className:ee("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",c.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:c.state})]},c.id)),n]})}function Ra({children:e,tone:t="muted"}){const r={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return l.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${r[t]}`,children:e})}function bv({caps:e}){return e?l.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[e.coder&&l.jsx(Ra,{children:"💻 Code"}),e.vision&&l.jsx(Ra,{children:"👁 Bild"}),e.reasoning&&l.jsx(Ra,{children:"🧠 Reason"}),e.moe&&l.jsxs(Ra,{tone:"primary",children:["🧩 MoE",e.active_b?`·${e.active_b}b`:""]}),e.tools==="yes"&&l.jsx(Ra,{tone:"primary",children:"🛠 Tools"}),e.tools==="likely"&&l.jsx(Ra,{tone:"warn",children:"🛠 Tools?"}),e.embedding&&l.jsx(Ra,{children:"🔢 Embed"})]}):null}const T0=[{role:"hermes",label:"Lucys Hirn",short:"Hirn",icon:xa,desc:"Lucys Alltags-Verstand — denkt und redet mit dir. Immer bereit.",tone:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25",protected:!0},{role:"embed",label:"Lucys Gedächtnis",short:"Gedächtnis",icon:LN,desc:"Merkt sich Wichtiges und findet es später wieder.",tone:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",protected:!0},{role:"vision",label:"Lucys Augen",short:"Augen",icon:xu,desc:"Sieht Bilder und Screenshots und beschreibt, was drauf ist.",tone:"bg-pink-500/15 text-pink-400 border-pink-500/25"},{role:"heavy",label:"Großes Hirn",short:"Groß",icon:uM,desc:"Das schwere Geschütz — wird für besonders knifflige Fragen dazugeholt.",tone:"bg-amber-500/15 text-amber-400 border-amber-500/25"},{role:"coder-lite",label:"Programmierer (schnell)",short:"Code schnell",icon:Ts,desc:"Schnelles Programmieren im Alltag.",tone:"bg-violet-500/15 text-violet-400 border-violet-500/25"},{role:"coder",label:"Programmierer (gründlich)",short:"Code gründlich",icon:Ts,desc:"Schreibt und prüft Code besonders sorgfältig — für schwere Coding-Aufgaben.",tone:"bg-fuchsia-500/15 text-fuchsia-400 border-fuchsia-500/25"},{role:"scout",label:"Späher",short:"Späher",icon:VM,desc:"Schneller erster Blick und grobe Einschätzung.",tone:"bg-teal-500/15 text-teal-400 border-teal-500/25"}],GD=T0.map(e=>e.role),Gw=Object.fromEntries(T0.map(e=>[e.role,e])),Vw=e=>({role:e||"?",label:e||"unbekannt",short:e||"?",icon:xa,desc:"Rolle ohne hinterlegten Klartext-Namen.",tone:"bg-slate-500/15 text-slate-300 border-slate-500/25"}),VD={fast:"hermes",coder_lite:"coder-lite"};function ct(e){return e&&(Gw[e]||Gw[VD[e]])||Vw(e)}function so({role:e,dense:t=!1,className:r}){const n=ct(e),i=n.icon;return l.jsxs("span",{className:ee("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-semibold border tracking-wide",n.tone,r),title:`${n.desc} (${n.role})`,children:[l.jsx(i,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),t?n.short:n.label]})}function qD({fit:e}){const t={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[e.level];return l.jsxs("span",{className:ee("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",t),children:[e.text," • ",e.req_gb," GB RAM"]})}function uf(e){const t=e.toLowerCase();return t.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:t.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:t.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:t.includes("mistral")||t.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:t.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:t.includes("hermes")||t.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:t.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function K5({model:e,onClose:t,onChanged:r}){var k,S;const{data:n,isLoading:i}=UD(e.gguf_path),[o,u]=y.useState(null),[c,f]=y.useState(""),h=n==null?void 0:n.target_vocab,m=(n==null?void 0:n.drafts)??[],g=m.filter(N=>N.compatible===!0),v=e.spec_draft_model;async function b(N){u(N??"__clear__"),f("");try{await we(`/api/models/${encodeURIComponent(e.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:N})}),r(),t()}catch(E){f(String((E==null?void 0:E.message)||E)),u(null)}}const j=N=>{var E;return N?`${N.pre??"?"} · ${((E=N.n_vocab)==null?void 0:E.toLocaleString())??"?"} Tokens`:"—"};return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[l.jsx(ga,{className:"h-4 w-4"})," Speculative Draft"]}),l.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',l.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),l.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:(k=e.name.split("/").pop())==null?void 0:k.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-foreground",children:["Vocab: ",j(h)]})]}),e.spec_active&&v&&l.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[l.jsx(qt,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",v]}),l.jsx("button",{onClick:()=>b(null),disabled:o!==null,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(n!=null&&n.target_exists)&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[l.jsx(Er,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),l.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:i?l.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):m.length===0?l.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",l.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):m.map(N=>{var P,_;const E=N.filename===v,A=N.compatible===!0;return l.jsxs("div",{className:ee("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",A?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",E&&"border-primary/40 bg-primary/10"),children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate flex items-center gap-1.5",children:[N.filename,N.mtp&&l.jsx("span",{className:"shrink-0 rounded bg-indigo-500/15 px-1.5 py-0.5 text-[8px] font-bold uppercase tracking-wider text-indigo-400 border border-indigo-500/25",title:"MTP-Kopf (Multi-Token-Prediction) — by-construction vocab-identisch, höchste Akzeptanzrate",children:"MTP"})]}),l.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[or(N.size_bytes)," · Vocab: ",j(N.vocab)]})]}),A?E?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[l.jsx(qt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("button",{onClick:()=>b(N.path),disabled:o!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):l.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:N.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(P=N.vocab)==null?void 0:P.pre}/${(_=N.vocab)==null?void 0:_.n_vocab} ≠ Modell ${h==null?void 0:h.pre}/${h==null?void 0:h.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[l.jsx(Er,{className:"h-3.5 w-3.5"})," ",N.compatible===!1?"Vocab ≠":"n/a"]})]},N.path)})}),!i&&(n==null?void 0:n.target_exists)&&m.length>0&&g.length===0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",l.jsx("span",{className:"font-mono",children:h==null?void 0:h.pre}),", n_vocab=",l.jsx("span",{className:"font-mono",children:(S=h==null?void 0:h.n_vocab)==null?void 0:S.toLocaleString()}),")."]}),c&&l.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:c})]})})}const qw={hermes:{bar:"bg-indigo-500",dot:"bg-indigo-500",text:"text-indigo-400"},embed:{bar:"bg-emerald-500",dot:"bg-emerald-500",text:"text-emerald-400"},vision:{bar:"bg-pink-500",dot:"bg-pink-500",text:"text-pink-400"},heavy:{bar:"bg-amber-500",dot:"bg-amber-500",text:"text-amber-400"},"coder-lite":{bar:"bg-violet-500",dot:"bg-violet-500",text:"text-violet-400"},coder:{bar:"bg-fuchsia-500",dot:"bg-fuchsia-500",text:"text-fuchsia-400"},scout:{bar:"bg-teal-500",dot:"bg-teal-500",text:"text-teal-400"}},QD={fast:"hermes",coder_lite:"coder-lite"},Qw={bar:"bg-slate-400",dot:"bg-slate-400",text:"text-slate-300"};function cf(e){return e&&(qw[e]||qw[QD[e]])||Qw}const Yw=1024**3,Xw=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function YD({running:e,capacityBytes:t,realUsedBytes:r,selected:n,onSelect:i}){const o=t>2*Yw?t:124*Yw,u=e.reduce((h,m)=>h+(m.size_bytes||0),0),c=Math.max(0,o-u),f=c/o*100;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-end justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fa,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Arbeitsspeicher"}),l.jsxs("div",{className:"font-space text-xl font-bold tracking-tight text-foreground",children:[Qr(o)," GB ",l.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"gesamt"})]})]})]}),l.jsxs("div",{className:"text-right text-[11px] font-mono text-muted-foreground",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"font-bold text-foreground",children:[Qr(u)," GB"]})," Modelle geladen"]}),r>0&&l.jsxs("div",{children:[Qr(r)," GB real belegt (inkl. KV-Cache)"]}),l.jsxs("div",{className:"text-emerald-400",children:[Qr(c)," GB frei"]})]})]}),l.jsx("div",{className:"flex h-12 w-full overflow-hidden rounded-xl border border-border/40 bg-background/50 p-1",children:e.length===0?l.jsx("div",{className:"flex w-full items-center justify-center text-[11px] italic text-muted-foreground/60",children:"Kein Modell geladen — Auto-Swap holt bei Anfrage automatisch das passende."}):l.jsxs(l.Fragment,{children:[e.map(h=>{const m=(h.size_bytes||0)/o*100,g=cf(h.role),v=n===h.name;return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),style:{width:`${m}%`},title:`${ct(h.role).label} · ${Xw(h.name)} · ${or(h.size_bytes)}`,className:ee("group flex h-full min-w-[2.5rem] shrink-0 flex-col justify-center gap-0.5 rounded-lg px-2 text-left text-white transition-all",g.bar,v?"ring-2 ring-white/70":"opacity-90 hover:opacity-100"),children:[l.jsx("span",{className:"truncate font-space text-[10px] font-bold leading-tight tracking-wide",children:ct(h.role).short}),l.jsx("span",{className:"truncate font-mono text-[9px] leading-tight opacity-85",children:or(h.size_bytes)})]},h.name)}),f>1.5&&l.jsx("div",{style:{width:`${f}%`},className:"flex h-full min-w-[2rem] items-center justify-center rounded-lg text-[9px] font-mono text-muted-foreground/50",title:`${Qr(c)} GB frei`,children:"frei"})]})}),e.length>0&&l.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5",children:[e.map(h=>{const m=cf(h.role);return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[l.jsx("span",{className:ee("h-2.5 w-2.5 rounded-sm",m.dot)}),l.jsx("span",{className:ee("font-semibold",m.text),children:ct(h.role).short}),l.jsx("span",{className:"font-mono text-muted-foreground/70",children:Xw(h.name)})]},h.name)}),l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60",children:[l.jsx("span",{className:"h-2.5 w-2.5 rounded-sm border border-border/50 bg-background/50"})," frei · ",Qr(c)," GB"]})]})]})}const Zw=1024**3,Ua=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function XD(){var M,H,ie,J;const e=Kn(),{data:t,isLoading:r,error:n}=wi(4e3),{data:i}=ko(),{data:o}=I0(),{showAlert:u,showConfirm:c,showPrompt:f,dialogElement:h}=ba(),m=O0(),g=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=Z=>!!ct(Z).protected,j=(M=o==null?void 0:o.groups)==null?void 0:M.brains,k=(j==null?void 0:j.members)??[],S=Z=>k.includes(Z),[N,E]=y.useState(null),[A,P]=y.useState(""),[_,O]=y.useState("all"),[T,B]=y.useState(null),$=()=>{e.invalidateQueries({queryKey:Be.models}),e.invalidateQueries({queryKey:Be.routing}),e.invalidateQueries({queryKey:Be.groups})},z=g.filter(Z=>v.includes(Z.name)),Q=((H=i==null?void 0:i.gpu)==null?void 0:H.gtt_total)||((ie=i==null?void 0:i.gpu)==null?void 0:ie.vram_total)||0,U=((J=i==null?void 0:i.gpu)==null?void 0:J.gtt_used)||0,ve=Q>2*Zw?Q:124*Zw,ue=y.useMemo(()=>{const Z=A.trim().toLowerCase();return g.filter(ae=>_==="in_use"?!!ae.role||v.includes(ae.name):!0).filter(ae=>Z?ae.name.toLowerCase().includes(Z):!0).sort((ae,me)=>{const re=v.includes(ae.name)?0:1,ye=v.includes(me.name)?0:1;return re!==ye?re-ye:Ua(ae.name).localeCompare(Ua(me.name))})},[g,v,_,A]),pe=g.find(Z=>Z.name===N)??null;async function oe(Z){try{await we(`/api/models/${encodeURIComponent(Z)}/load`,{method:"POST"}),$()}catch(ae){u("Fehler",`Laden fehlgeschlagen: ${ae.message||ae}`)}}async function se(Z){const ae=k.some(me=>v.includes(me));if(j&&ae&&!S(Z)){const me=k.filter(re=>v.includes(re)).map(Ua).join(", ");c("Verdrängt das Hirn?",`„${Ua(Z)}" ist nicht ko-resident. Beim Laden wirft es das warme Hirn (${me}) raus — Lucy verliert Hirn bzw. Augen. +`)},ST=0,Jo=[];function NT(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),i=y.useState(ST++)[0],o=y.useState(s5)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var k=GI([e.lockRef.current],(e.shards||[]).map(Bw),!0).filter(Boolean);return k.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),k.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=y.useCallback(function(k,S){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!u.current.allowPinchZoom;var N=Sd(k),E=r.current,A="deltaX"in k?k.deltaX:E[0]-N[0],P="deltaY"in k?k.deltaY:E[1]-N[1],_,O=k.target,T=Math.abs(A)>Math.abs(P)?"h":"v";if("touches"in k&&T==="h"&&O.type==="range")return!1;var B=window.getSelection(),$=B&&B.anchorNode,z=$?$===O||$.contains(O):!1;if(z)return!1;var Q=zw(T,O);if(!Q)return!0;if(Q?_=T:(_=T==="v"?"h":"v",Q=zw(T,O)),!Q)return!1;if(!n.current&&"changedTouches"in k&&(A||P)&&(n.current=_),!_)return!0;var U=n.current||_;return wT(U,S,k,U==="h"?A:P)},[]),f=y.useCallback(function(k){var S=k;if(!(!Jo.length||Jo[Jo.length-1]!==o)){var N="deltaY"in S?Fw(S):Sd(S),E=t.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&kT(_.delta,N)})[0];if(E&&E.should){S.cancelable&&S.preventDefault();return}if(!E){var A=(u.current.shards||[]).map(Bw).filter(Boolean).filter(function(_){return _.contains(S.target)}),P=A.length>0?c(S,A[0]):!u.current.noIsolation;P&&S.cancelable&&S.preventDefault()}}},[]),h=y.useCallback(function(k,S,N,E){var A={name:k,delta:S,target:N,should:E,shadowParent:ET(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(P){return P!==A})},1)},[]),m=y.useCallback(function(k){r.current=Sd(k),n.current=void 0},[]),g=y.useCallback(function(k){h(k.type,Fw(k),k.target,c(k,e.lockRef.current))},[]),v=y.useCallback(function(k){h(k.type,Sd(k),k.target,c(k,e.lockRef.current))},[]);y.useEffect(function(){return Jo.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Zo),document.addEventListener("touchmove",f,Zo),document.addEventListener("touchstart",m,Zo),function(){Jo=Jo.filter(function(k){return k!==o}),document.removeEventListener("wheel",f,Zo),document.removeEventListener("touchmove",f,Zo),document.removeEventListener("touchstart",m,Zo)}},[]);var b=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(o,{styles:jT(i)}):null,b?y.createElement(mT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ET(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AT=tT(o5,NT);var d5=y.forwardRef(function(e,t){return y.createElement(fh,Dn({},e,{ref:t,sideCar:AT}))});d5.classNames=fh.classNames;var CT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},es=new WeakMap,Nd=new WeakMap,Ed={},lg=0,f5=function(e){return e&&(e.host||f5(e.parentNode))},PT=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=f5(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},OT=function(e,t,r,n){var i=PT(t,Array.isArray(e)?e:[e]);Ed[r]||(Ed[r]=new WeakMap);var o=Ed[r],u=[],c=new Set,f=new Set(i),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};i.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))m(v);else try{var b=v.getAttribute(n),j=b!==null&&b!=="false",k=(es.get(v)||0)+1,S=(o.get(v)||0)+1;es.set(v,k),o.set(v,S),u.push(v),k===1&&j&&Nd.set(v,!0),S===1&&v.setAttribute(r,"true"),j||v.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",v,N)}})};return m(t),c.clear(),lg++,function(){u.forEach(function(g){var v=es.get(g)-1,b=o.get(g)-1;es.set(g,v),o.set(g,b),v||(Nd.has(g)||g.removeAttribute(n),Nd.delete(g)),b||g.removeAttribute(r)}),lg--,lg||(es=new WeakMap,es=new WeakMap,Nd=new WeakMap,Ed={})}},_T=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=CT(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),OT(n,i,r,"aria-hidden")):function(){return null}},hh="Dialog",[h5]=aI(hh),[MT,wn]=h5(hh),m5=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:u=!0}=e,c=y.useRef(null),f=y.useRef(null),[h,m]=cI({prop:n,defaultProp:i??!1,onChange:o,caller:hh});return l.jsx(MT,{scope:t,triggerRef:c,contentRef:f,contentId:fi(),titleId:fi(),descriptionId:fi(),open:h,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(g=>!g),[m]),modal:u,children:r})};m5.displayName=hh;var p5="DialogTrigger",IT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(p5,r),o=wo(t,i.triggerRef);return l.jsx(Xt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":C0(i.open),...n,ref:o,onClick:ha(e.onClick,i.onOpenToggle)})});IT.displayName=p5;var A0="DialogPortal",[TT,g5]=h5(A0,{forceMount:void 0}),v5=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=wn(A0,t);return l.jsx(TT,{scope:t,forceMount:r,children:y.Children.map(n,u=>l.jsx(dh,{present:r||o.open,children:l.jsx(n5,{asChild:!0,container:i,children:u})}))})};v5.displayName=A0;var sf="DialogOverlay",y5=y.forwardRef((e,t)=>{const r=g5(sf,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=wn(sf,e.__scopeDialog);return o.modal?l.jsx(dh,{present:n||o.open,children:l.jsx(RT,{...i,ref:t})}):null});y5.displayName=sf;var DT=ZN("DialogOverlay.RemoveScroll"),RT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(sf,r),o=OI(),u=wo(t,o);return l.jsx(d5,{as:DT,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Xt.div,{"data-state":C0(i.open),...n,ref:u,style:{pointerEvents:"auto",...n.style}})})}),Ls="DialogContent",x5=y.forwardRef((e,t)=>{const r=g5(Ls,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=wn(Ls,e.__scopeDialog);return l.jsx(dh,{present:n||o.open,children:o.modal?l.jsx(LT,{...i,ref:t}):l.jsx($T,{...i,ref:t})})});x5.displayName=Ls;var LT=y.forwardRef((e,t)=>{const r=wn(Ls,e.__scopeDialog),n=y.useRef(null),i=wo(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return _T(o)},[]),l.jsx(b5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ha(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ha(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&o.preventDefault()}),onFocusOutside:ha(e.onFocusOutside,o=>o.preventDefault())})}),$T=y.forwardRef((e,t)=>{const r=wn(Ls,e.__scopeDialog),n=y.useRef(!1),i=y.useRef(!1);return l.jsx(b5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(n.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),b5=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...u}=e,c=wn(Ls,r);return KI(),l.jsx(l.Fragment,{children:l.jsx(t5,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:l.jsx(JN,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":C0(c.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),w5="DialogTitle",zT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(w5,r);return l.jsx(Xt.h2,{id:i.titleId,...n,ref:t})});zT.displayName=w5;var k5="DialogDescription",FT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(k5,r);return l.jsx(Xt.p,{id:i.descriptionId,...n,ref:t})});FT.displayName=k5;var j5="DialogClose",BT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=wn(j5,r);return l.jsx(Xt.button,{type:"button",...n,ref:t,onClick:ha(e.onClick,()=>i.onOpenChange(!1))})});BT.displayName=j5;function C0(e){return e?"open":"closed"}var Vl='[cmdk-group=""]',ug='[cmdk-group-items=""]',UT='[cmdk-group-heading=""]',S5='[cmdk-item=""]',Uw=`${S5}:not([aria-disabled="true"])`,mv="cmdk-item-select",us="data-value",HT=(e,t,r)=>iI(e,t,r),N5=y.createContext(void 0),Gu=()=>y.useContext(N5),E5=y.createContext(void 0),P0=()=>y.useContext(E5),A5=y.createContext(void 0),C5=y.forwardRef((e,t)=>{let r=cs(()=>{var M,H;return{search:"",value:(H=(M=e.value)!=null?M:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=cs(()=>new Set),i=cs(()=>new Map),o=cs(()=>new Map),u=cs(()=>new Set),c=P5(e),{label:f,children:h,value:m,onValueChange:g,filter:v,shouldFilter:b,loop:j,disablePointerSelection:k=!1,vimBindings:S=!0,...N}=e,E=fi(),A=fi(),P=fi(),_=y.useRef(null),O=eD();fo(()=>{if(m!==void 0){let M=m.trim();r.current.value=M,T.emit()}},[m]),fo(()=>{O(6,ve)},[]);let T=y.useMemo(()=>({subscribe:M=>(u.current.add(M),()=>u.current.delete(M)),snapshot:()=>r.current,setState:(M,H,ie)=>{var J,Z,ae,me;if(!Object.is(r.current[M],H)){if(r.current[M]=H,M==="search")U(),z(),O(1,Q);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(P);re?re.focus():(J=document.getElementById(E))==null||J.focus()}if(O(7,()=>{var re;r.current.selectedItemId=(re=ue())==null?void 0:re.id,T.emit()}),ie||O(5,ve),((Z=c.current)==null?void 0:Z.value)!==void 0){let re=H??"";(me=(ae=c.current).onValueChange)==null||me.call(ae,re);return}}T.emit()}},emit:()=>{u.current.forEach(M=>M())}}),[]),B=y.useMemo(()=>({value:(M,H,ie)=>{var J;H!==((J=o.current.get(M))==null?void 0:J.value)&&(o.current.set(M,{value:H,keywords:ie}),r.current.filtered.items.set(M,$(H,ie)),O(2,()=>{z(),T.emit()}))},item:(M,H)=>(n.current.add(M),H&&(i.current.has(H)?i.current.get(H).add(M):i.current.set(H,new Set([M]))),O(3,()=>{U(),z(),r.current.value||Q(),T.emit()}),()=>{o.current.delete(M),n.current.delete(M),r.current.filtered.items.delete(M);let ie=ue();O(4,()=>{U(),(ie==null?void 0:ie.getAttribute("id"))===M&&Q(),T.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>c.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:E,inputId:P,labelId:A,listInnerRef:_}),[]);function $(M,H){var ie,J;let Z=(J=(ie=c.current)==null?void 0:ie.filter)!=null?J:HT;return M?Z(M,r.current.search,H):0}function z(){if(!r.current.search||c.current.shouldFilter===!1)return;let M=r.current.filtered.items,H=[];r.current.filtered.groups.forEach(J=>{let Z=i.current.get(J),ae=0;Z.forEach(me=>{let re=M.get(me);ae=Math.max(re,ae)}),H.push([J,ae])});let ie=_.current;pe().sort((J,Z)=>{var ae,me;let re=J.getAttribute("id"),ye=Z.getAttribute("id");return((ae=M.get(ye))!=null?ae:0)-((me=M.get(re))!=null?me:0)}).forEach(J=>{let Z=J.closest(ug);Z?Z.appendChild(J.parentElement===Z?J:J.closest(`${ug} > *`)):ie.appendChild(J.parentElement===ie?J:J.closest(`${ug} > *`))}),H.sort((J,Z)=>Z[1]-J[1]).forEach(J=>{var Z;let ae=(Z=_.current)==null?void 0:Z.querySelector(`${Vl}[${us}="${encodeURIComponent(J[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function Q(){let M=pe().find(ie=>ie.getAttribute("aria-disabled")!=="true"),H=M==null?void 0:M.getAttribute(us);T.setState("value",H||void 0)}function U(){var M,H,ie,J;if(!r.current.search||c.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let Z=0;for(let ae of n.current){let me=(H=(M=o.current.get(ae))==null?void 0:M.value)!=null?H:"",re=(J=(ie=o.current.get(ae))==null?void 0:ie.keywords)!=null?J:[],ye=$(me,re);r.current.filtered.items.set(ae,ye),ye>0&&Z++}for(let[ae,me]of i.current)for(let re of me)if(r.current.filtered.items.get(re)>0){r.current.filtered.groups.add(ae);break}r.current.filtered.count=Z}function ve(){var M,H,ie;let J=ue();J&&(((M=J.parentElement)==null?void 0:M.firstChild)===J&&((ie=(H=J.closest(Vl))==null?void 0:H.querySelector(UT))==null||ie.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function ue(){var M;return(M=_.current)==null?void 0:M.querySelector(`${S5}[aria-selected="true"]`)}function pe(){var M;return Array.from(((M=_.current)==null?void 0:M.querySelectorAll(Uw))||[])}function oe(M){let H=pe()[M];H&&T.setState("value",H.getAttribute(us))}function se(M){var H;let ie=ue(),J=pe(),Z=J.findIndex(me=>me===ie),ae=J[Z+M];(H=c.current)!=null&&H.loop&&(ae=Z+M<0?J[J.length-1]:Z+M===J.length?J[0]:J[Z+M]),ae&&T.setState("value",ae.getAttribute(us))}function X(M){let H=ue(),ie=H==null?void 0:H.closest(Vl),J;for(;ie&&!J;)ie=M>0?ZT(ie,Vl):JT(ie,Vl),J=ie==null?void 0:ie.querySelector(Uw);J?T.setState("value",J.getAttribute(us)):se(M)}let ne=()=>oe(pe().length-1),te=M=>{M.preventDefault(),M.metaKey?ne():M.altKey?X(1):se(1)},I=M=>{M.preventDefault(),M.metaKey?oe(0):M.altKey?X(-1):se(-1)};return y.createElement(Xt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:M=>{var H;(H=N.onKeyDown)==null||H.call(N,M);let ie=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||ie))switch(M.key){case"n":case"j":{S&&M.ctrlKey&&te(M);break}case"ArrowDown":{te(M);break}case"p":case"k":{S&&M.ctrlKey&&I(M);break}case"ArrowUp":{I(M);break}case"Home":{M.preventDefault(),oe(0);break}case"End":{M.preventDefault(),ne();break}case"Enter":{M.preventDefault();let J=ue();if(J){let Z=new Event(mv);J.dispatchEvent(Z)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:rD},f),mh(e,M=>y.createElement(E5.Provider,{value:T},y.createElement(N5.Provider,{value:B},M))))}),WT=y.forwardRef((e,t)=>{var r,n;let i=fi(),o=y.useRef(null),u=y.useContext(A5),c=Gu(),f=P5(e),h=(n=(r=f.current)==null?void 0:r.forceMount)!=null?n:u==null?void 0:u.forceMount;fo(()=>{if(!h)return c.item(i,u==null?void 0:u.id)},[h]);let m=O5(i,o,[e.value,e.children,o],e.keywords),g=P0(),v=va(O=>O.value&&O.value===m.current),b=va(O=>h||c.filter()===!1?!0:O.search?O.filtered.items.get(i)>0:!0);y.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(mv,j),()=>O.removeEventListener(mv,j)},[b,e.onSelect,e.disabled]);function j(){var O,T;k(),(T=(O=f.current).onSelect)==null||T.call(O,m.current)}function k(){g.setState("value",m.current,!0)}if(!b)return null;let{disabled:S,value:N,onSelect:E,forceMount:A,keywords:P,..._}=e;return y.createElement(Xt.div,{ref:Rs(o,t),..._,id:i,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!v,"data-disabled":!!S,"data-selected":!!v,onPointerMove:S||c.getDisablePointerSelection()?void 0:k,onClick:S?void 0:j},e.children)}),KT=y.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...o}=e,u=fi(),c=y.useRef(null),f=y.useRef(null),h=fi(),m=Gu(),g=va(b=>i||m.filter()===!1?!0:b.search?b.filtered.groups.has(u):!0);fo(()=>m.group(u),[]),O5(u,c,[e.value,e.heading,f]);let v=y.useMemo(()=>({id:u,forceMount:i}),[i]);return y.createElement(Xt.div,{ref:Rs(c,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&y.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),mh(e,b=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},y.createElement(A5.Provider,{value:v},b))))}),GT=y.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=y.useRef(null),o=va(u=>!u.search);return!r&&!o?null:y.createElement(Xt.div,{ref:Rs(i,t),...n,"cmdk-separator":"",role:"separator"})}),VT=y.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,o=P0(),u=va(h=>h.search),c=va(h=>h.selectedItemId),f=Gu();return y.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),y.createElement(Xt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:i?e.value:u,onChange:h=>{i||o.setState("search",h.target.value),r==null||r(h.target.value)}})}),qT=y.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,o=y.useRef(null),u=y.useRef(null),c=va(h=>h.selectedItemId),f=Gu();return y.useEffect(()=>{if(u.current&&o.current){let h=u.current,m=o.current,g,v=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let b=h.offsetHeight;m.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(g),v.unobserve(h)}}},[]),y.createElement(Xt.div,{ref:Rs(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:f.listId},mh(e,h=>y.createElement("div",{ref:Rs(u,f.listInnerRef),"cmdk-list-sizer":""},h)))}),QT=y.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:o,container:u,...c}=e;return y.createElement(m5,{open:r,onOpenChange:n},y.createElement(v5,{container:u},y.createElement(y5,{"cmdk-overlay":"",className:i}),y.createElement(x5,{"aria-label":e.label,"cmdk-dialog":"",className:o},y.createElement(C5,{ref:t,...c}))))}),YT=y.forwardRef((e,t)=>va(r=>r.filtered.count===0)?y.createElement(Xt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),XT=y.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...o}=e;return y.createElement(Xt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},mh(e,u=>y.createElement("div",{"aria-hidden":!0},u)))}),ts=Object.assign(C5,{List:qT,Item:WT,Input:VT,Group:KT,Separator:GT,Dialog:QT,Empty:YT,Loading:XT});function ZT(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function JT(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function P5(e){let t=y.useRef(e);return fo(()=>{t.current=e}),t}var fo=typeof window>"u"?y.useEffect:y.useLayoutEffect;function cs(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function va(e){let t=P0(),r=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,r,r)}function O5(e,t,r,n=[]){let i=y.useRef(),o=Gu();return fo(()=>{var u;let c=(()=>{var h;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():i.current}})(),f=n.map(h=>h.trim());o.value(e,c,f),(u=t.current)==null||u.setAttribute(us,c),i.current=c}),i}var eD=()=>{let[e,t]=y.useState(),r=cs(()=>new Map);return fo(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function tD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function mh({asChild:e,children:t},r){return e&&y.isValidElement(t)?y.cloneElement(tD(t),{ref:t.ref},r(t.props.children)):r(t)}var rD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function nD({onNavigate:e}){const[t,r]=y.useState(!1);return y.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&(i.preventDefault(),r(o=>!o))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),l.jsx(ts.Dialog,{open:t,onOpenChange:r,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh] overscroll-contain",onClick:()=>r(!1),children:l.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:n=>n.stopPropagation(),children:[l.jsx(ts.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),l.jsxs(ts.List,{className:"max-h-80 overflow-y-auto p-2",children:[l.jsx(ts.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),l.jsx(ts.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:lu.map(n=>l.jsxs(ts.Item,{value:`${n.label} ${n.hint}`,onSelect:()=>{e(n.id),r(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[l.jsx(n.icon,{className:"h-4 w-4 text-primary"}),l.jsx("span",{children:n.label}),l.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:n.hint})]},n.id))})]})]})})}const _5="mc_expert_mode",pv="mc-expert-mode-change",iD=()=>{try{return localStorage.getItem(_5)==="true"}catch{return!1}};function aD(e){return window.addEventListener(pv,e),window.addEventListener("storage",e),()=>{window.removeEventListener(pv,e),window.removeEventListener("storage",e)}}function Hw(e){localStorage.setItem(_5,String(e)),window.dispatchEvent(new Event(pv))}function O0(){return y.useSyncExternalStore(aD,iD,()=>!1)}function M5(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=lD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{const c=u.split(_0);return c[0]===""&&c.length!==1&&c.shift(),I5(c,t)||sD(u)},getConflictingClassGroupIds:(u,c)=>{const f=r[u]||[];return c&&n[u]?[...f,...n[u]]:f}}},I5=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?I5(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(_0);return(u=t.validators.find(({validator:c})=>c(o)))==null?void 0:u.classGroupId},Ww=/^\[(.+)\]$/,sD=e=>{if(Ww.test(e)){const t=Ww.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},lD=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return cD(Object.entries(e.classGroups),r).forEach(([o,u])=>{gv(u,n,o,t)}),n},gv=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Kw(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(uD(i)){gv(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,u])=>{gv(u,Kw(t,o),r,n)})})},Kw=(e,t)=>{let r=e;return t.split(_0).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},uD=e=>e.isThemeGetter,cD=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([u,c])=>[t+u,c])):o);return[r,i]}):e,dD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,u)=>{r.set(o,u),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let u=r.get(o);if(u!==void 0)return u;if((u=n.get(o))!==void 0)return i(o,u),u},set(o,u){r.has(o)?r.set(o,u):i(o,u)}}},T5="!",fD=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,u=c=>{const f=[];let h=0,m=0,g;for(let S=0;Sm?g-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:k}};return r?c=>r({className:c,parseClassName:u}):u},hD=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},mD=e=>({cache:dD(e.cacheSize),parseClassName:fD(e),...oD(e)}),pD=/\s+/,gD=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],u=e.trim().split(pD);let c="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{modifiers:m,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:b}=r(h);let j=!!b,k=n(j?v.substring(0,b):v);if(!k){if(!j){c=h+(c.length>0?" "+c:c);continue}if(k=n(v),!k){c=h+(c.length>0?" "+c:c);continue}j=!1}const S=hD(m).join(":"),N=g?S+T5:S,E=N+k;if(o.includes(E))continue;o.push(E);const A=i(k,j);for(let P=0;P0?" "+c:c)}return c};function vD(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;ng(m),e());return r=mD(h),n=r.cache.get,i=r.cache.set,o=c,c(f)}function c(f){const h=n(f);if(h)return h;const m=gD(f,r);return i(f,m),m}return function(){return o(vD.apply(null,arguments))}}const ot=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},R5=/^\[(?:([a-z-]+):)?(.+)\]$/i,xD=/^\d+\/\d+$/,bD=new Set(["px","full","screen"]),wD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ND=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ri=e=>vs(e)||bD.has(e)||xD.test(e),qi=e=>Qs(e,"length",ID),vs=e=>!!e&&!Number.isNaN(Number(e)),cg=e=>Qs(e,"number",vs),ql=e=>!!e&&Number.isInteger(Number(e)),ED=e=>e.endsWith("%")&&vs(e.slice(0,-1)),$e=e=>R5.test(e),Qi=e=>wD.test(e),AD=new Set(["length","size","percentage"]),CD=e=>Qs(e,AD,L5),PD=e=>Qs(e,"position",L5),OD=new Set(["image","url"]),_D=e=>Qs(e,OD,DD),MD=e=>Qs(e,"",TD),Ql=()=>!0,Qs=(e,t,r)=>{const n=R5.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},ID=e=>kD.test(e)&&!jD.test(e),L5=()=>!1,TD=e=>SD.test(e),DD=e=>ND.test(e),RD=()=>{const e=ot("colors"),t=ot("spacing"),r=ot("blur"),n=ot("brightness"),i=ot("borderColor"),o=ot("borderRadius"),u=ot("borderSpacing"),c=ot("borderWidth"),f=ot("contrast"),h=ot("grayscale"),m=ot("hueRotate"),g=ot("invert"),v=ot("gap"),b=ot("gradientColorStops"),j=ot("gradientColorStopPositions"),k=ot("inset"),S=ot("margin"),N=ot("opacity"),E=ot("padding"),A=ot("saturate"),P=ot("scale"),_=ot("sepia"),O=ot("skew"),T=ot("space"),B=ot("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",$e,t],U=()=>[$e,t],ve=()=>["",ri,qi],ue=()=>["auto",vs,$e],pe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",$e],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[vs,$e];return{cacheSize:500,separator:":",theme:{colors:[Ql],spacing:[ri,qi],blur:["none","",Qi,$e],brightness:I(),borderColor:[e],borderRadius:["none","","full",Qi,$e],borderSpacing:U(),borderWidth:ve(),contrast:I(),grayscale:ne(),hueRotate:I(),invert:ne(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[ED,qi],inset:Q(),margin:Q(),opacity:I(),padding:U(),saturate:I(),scale:I(),sepia:ne(),skew:I(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Qi]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...pe(),$e]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ql,$e]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",ql,$e]}],"grid-cols":[{"grid-cols":[Ql]}],"col-start-end":[{col:["auto",{span:["full",ql,$e]},$e]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[Ql]}],"row-start-end":[{row:["auto",{span:[ql,$e]},$e]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Qi]},Qi]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qi,qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cg]}],"font-family":[{font:[Ql]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",vs,cg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ri,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ri,qi]}],"underline-offset":[{"underline-offset":["auto",ri,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...pe(),PD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",CD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_D]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:oe()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[ri,$e]}],"outline-w":[{outline:[ri,qi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[ri,qi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qi,MD]}],"shadow-color":[{shadow:[Ql]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Qi,$e]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[g]}],saturate:[{saturate:[A]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[ql,$e]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ri,qi,cg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},LD=yD(RD);function ee(...e){return LD(rt(e))}function lf(e){return e?e.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function $5(){const e=O0();return l.jsxs("div",{className:"flex items-center rounded-md border border-border/40 bg-background/40 p-0.5",role:"group","aria-label":"Ansichtsmodus",title:"Einfach zeigt nur das Wichtigste. Experte zeigt alle technischen Details.",children:[l.jsxs("button",{onClick:()=>Hw(!1),"aria-pressed":!e,className:ee("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary/15 text-primary shadow-sm"),children:[l.jsx(fs,{className:"h-3.5 w-3.5"})," Einfach"]}),l.jsxs("button",{onClick:()=>Hw(!0),"aria-pressed":e,className:ee("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.jsx(KM,{className:"h-3.5 w-3.5"})," Experte"]})]})}async function we(e,t){var f;const r={"Content-Type":"application/json",...t==null?void 0:t.headers},n=localStorage.getItem("mc_sudo_password"),i=localStorage.getItem("mc_hf_token");n&&(r["X-Sudo-Password"]=n);let o=t==null?void 0:t.body;if((((f=t==null?void 0:t.method)==null?void 0:f.toUpperCase())||"GET")==="POST"){if(typeof o=="string")try{const h=JSON.parse(o);let m=!1;n&&!("sudo_password"in h)&&(h.sudo_password=n,m=!0),i&&!("hf_token"in h)&&(h.hf_token=i,m=!0),m&&(o=JSON.stringify(h))}catch{}else if(!o){const h={};n&&(h.sudo_password=n),i&&(h.hf_token=i),Object.keys(h).length>0&&(o=JSON.stringify(h))}}const c=await fetch(e,{...t,headers:r,body:o});if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.json()}const z5=(e,t,r=!1,n=!0)=>we("/api/groups",{method:"PUT",body:JSON.stringify({group:e,members:t,swap:r,persist:n})}),$D=e=>we("/api/routing/policy",{method:"PUT",body:JSON.stringify(e)}),Be={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],groups:["groups"],routing:["routing"],routingPolicy:["routing-policy"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:e=>["drafts",e??""],connect:e=>["connect",e??""],connectHealth:["connect-health"],memory:(e,t)=>["memory",e??"",t??""],memoryGraph:["memory-graph"],voiceTrace:["voice-trace"]},zD=(e=!0)=>Yt({queryKey:Be.memoryGraph,queryFn:()=>we("/api/memory/graph"),enabled:e}),M0=()=>Yt({queryKey:Be.health,queryFn:()=>we("/api/health"),refetchInterval:1e4}),ko=(e=5e3)=>Yt({queryKey:Be.systemStatus,queryFn:()=>we("/api/system/status"),refetchInterval:e}),F5=(e=3e3)=>Yt({queryKey:Be.services,queryFn:()=>we("/api/system/services"),refetchInterval:e}),wi=(e=4e3)=>Yt({queryKey:Be.models,queryFn:()=>we("/api/models"),refetchInterval:e}),I0=(e=8e3)=>Yt({queryKey:Be.groups,queryFn:()=>we("/api/groups"),refetchInterval:e}),FD=()=>Yt({queryKey:Be.routingPolicy,queryFn:()=>we("/api/routing/policy")}),BD=(e=2e3)=>Yt({queryKey:Be.jobs,queryFn:()=>we("/api/jobs"),refetchInterval:e,select:t=>t.jobs??[]}),B5=(e=3e3)=>Yt({queryKey:Be.tokenStats,queryFn:()=>we("/api/system/token-stats"),refetchInterval:e}),ph=(e=5e3)=>Yt({queryKey:Be.agentStatus,queryFn:()=>we("/api/agent/status"),refetchInterval:e}),U5=(e=6e4)=>Yt({queryKey:Be.hermesBrain,queryFn:()=>we("/api/agent/brain"),refetchInterval:e}),gh=e=>Yt({queryKey:Be.updates,queryFn:()=>we("/api/maintenance/updates"),refetchInterval:e}),UD=()=>Yt({queryKey:Be.discover,queryFn:()=>we("/api/discover")}),HD=e=>Yt({queryKey:Be.drafts(e),queryFn:()=>we(`/api/models/drafts?target=${encodeURIComponent(e??"")}`),enabled:!!e}),WD=e=>Yt({queryKey:Be.connect(e),queryFn:()=>we(e?`/api/connect?${e}`:"/api/connect")}),H5=()=>Yt({queryKey:Be.connectHealth,queryFn:()=>we("/api/connect/health"),refetchInterval:15e3}),vv=e=>Yt({queryKey:Be.memory(e==null?void 0:e.q,e==null?void 0:e.category),queryFn:()=>{const t=new URLSearchParams;return e!=null&&e.q&&t.set("q",e.q),e!=null&&e.category&&t.set("category",e.category),we(`/api/memory?${t}`)},select:t=>e!=null&&e.limit?t.slice(0,e.limit):t});function W5({type:e,title:t,message:r,defaultValue:n,autoValue:i,autoLabel:o,onConfirm:u,onCancel:c}){const f=y.useRef(null);return l.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":t,children:l.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:t}),l.jsx("button",{onClick:c||(()=>u()),"aria-label":"Schließen",className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r}),e==="prompt"&&l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{ref:f,type:"text",defaultValue:n,"aria-label":t,className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var m;h.key==="Enter"&&u((m=f.current)==null?void 0:m.value)}}),i!==void 0&&l.jsx("button",{type:"button",onClick:()=>{f.current&&(f.current.value=i)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:o||"Auto"})]}),l.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(e==="confirm"||e==="prompt")&&l.jsx("button",{onClick:c,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),l.jsx("button",{onClick:()=>{var m;const h=e==="prompt"?(m=f.current)==null?void 0:m.value:void 0;u(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:e==="confirm"?"Ja, fortfahren":e==="prompt"?"Übernehmen":"OK"})]})]})})}function ba(){const[e,t]=y.useState(null),r=y.useCallback(()=>t(null),[]),n=y.useCallback((c,f,h)=>{t({type:"alert",title:c,message:f,onConfirm:()=>{t(null),h==null||h()}})},[]),i=y.useCallback((c,f,h,m)=>{t({type:"confirm",title:c,message:f,onConfirm:()=>{t(null),h()},onCancel:()=>{t(null),m==null||m()}})},[]),o=y.useCallback((c,f,h,m,g,v)=>{t({type:"prompt",title:c,message:f,defaultValue:h,autoValue:v==null?void 0:v.autoValue,autoLabel:v==null?void 0:v.autoLabel,onConfirm:b=>{t(null),m(b)},onCancel:()=>{t(null),g==null||g()}})},[]),u=e?l.jsx(W5,{...e}):null;return{showAlert:n,showConfirm:i,showPrompt:o,close:r,dialogElement:u}}function Qr(e){return(e/1024**3).toFixed(1)}function yv(e){return e?e>1024**3?`${(e/1024**3).toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`:""}function or(e){if(!e)return"—";const t=e/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`}function KD(e){if(!e)return"";const t=Math.floor(e/60);return t>0?`${t} min`:`${e} s`}function xv(e){return e?`${Math.round(e/1024)}k`:"—"}function GD(){const e=Kn(),{data:t=[]}=BD(2e3),{showAlert:r,dialogElement:n}=ba();async function i(c){try{await we(`/api/jobs/${c}/cancel`,{method:"POST"}),e.invalidateQueries({queryKey:Be.jobs})}catch(f){r("Fehler",f.message)}}const o=t.filter(c=>c.state==="running"||c.state==="queued"),u=t.filter(c=>c.state!=="running"&&c.state!=="queued").slice(-3);return o.length===0&&u.length===0?null:l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[l.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),o.map(c=>l.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:c.label}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-muted-foreground font-mono",children:[c.progress??0,"% • ",yv(c.done_bytes),"/",yv(c.total_bytes),c.eta_s?` • ETA ${KD(c.eta_s)}`:""]}),l.jsx("button",{onClick:()=>i(c.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),l.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${c.progress??0}%`}})})]},c.id)),u.map(c=>l.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[l.jsx("span",{className:"truncate",children:c.label}),l.jsx("span",{className:ee("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",c.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:c.state})]},c.id)),n]})}function Ra({children:e,tone:t="muted"}){const r={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return l.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${r[t]}`,children:e})}function bv({caps:e}){return e?l.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[e.coder&&l.jsx(Ra,{children:"💻 Code"}),e.vision&&l.jsx(Ra,{children:"👁 Bild"}),e.reasoning&&l.jsx(Ra,{children:"🧠 Reason"}),e.moe&&l.jsxs(Ra,{tone:"primary",children:["🧩 MoE",e.active_b?`·${e.active_b}b`:""]}),e.tools==="yes"&&l.jsx(Ra,{tone:"primary",children:"🛠 Tools"}),e.tools==="likely"&&l.jsx(Ra,{tone:"warn",children:"🛠 Tools?"}),e.embedding&&l.jsx(Ra,{children:"🔢 Embed"})]}):null}const T0=[{role:"hermes",label:"Lucys Hirn",short:"Hirn",icon:xa,desc:"Lucys Alltags-Verstand — denkt und redet mit dir. Immer bereit.",tone:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25",protected:!0},{role:"embed",label:"Lucys Gedächtnis",short:"Gedächtnis",icon:LN,desc:"Merkt sich Wichtiges und findet es später wieder.",tone:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",protected:!0},{role:"vision",label:"Lucys Augen",short:"Augen",icon:yu,desc:"Sieht Bilder und Screenshots und beschreibt, was drauf ist.",tone:"bg-pink-500/15 text-pink-400 border-pink-500/25"},{role:"heavy",label:"Großes Hirn",short:"Groß",icon:cM,desc:"Das schwere Geschütz — wird für besonders knifflige Fragen dazugeholt.",tone:"bg-amber-500/15 text-amber-400 border-amber-500/25"},{role:"coder-lite",label:"Programmierer (schnell)",short:"Code schnell",icon:Ts,desc:"Schnelles Programmieren im Alltag.",tone:"bg-violet-500/15 text-violet-400 border-violet-500/25"},{role:"coder",label:"Programmierer (gründlich)",short:"Code gründlich",icon:Ts,desc:"Schreibt und prüft Code besonders sorgfältig — für schwere Coding-Aufgaben.",tone:"bg-fuchsia-500/15 text-fuchsia-400 border-fuchsia-500/25"},{role:"scout",label:"Späher",short:"Späher",icon:qM,desc:"Schneller erster Blick und grobe Einschätzung.",tone:"bg-teal-500/15 text-teal-400 border-teal-500/25"}],VD=T0.map(e=>e.role),Gw=Object.fromEntries(T0.map(e=>[e.role,e])),Vw=e=>({role:e||"?",label:e||"unbekannt",short:e||"?",icon:xa,desc:"Rolle ohne hinterlegten Klartext-Namen.",tone:"bg-slate-500/15 text-slate-300 border-slate-500/25"}),qD={fast:"hermes",coder_lite:"coder-lite"};function ct(e){return e&&(Gw[e]||Gw[qD[e]])||Vw(e)}function so({role:e,dense:t=!1,className:r}){const n=ct(e),i=n.icon;return l.jsxs("span",{className:ee("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-semibold border tracking-wide",n.tone,r),title:`${n.desc} (${n.role})`,children:[l.jsx(i,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),t?n.short:n.label]})}function QD({fit:e}){const t={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[e.level];return l.jsxs("span",{className:ee("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",t),children:[e.text," • ",e.req_gb," GB RAM"]})}function uf(e){const t=e.toLowerCase();return t.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:t.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:t.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:t.includes("mistral")||t.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:t.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:t.includes("hermes")||t.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:t.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function K5({model:e,onClose:t,onChanged:r}){var k,S;const{data:n,isLoading:i}=HD(e.gguf_path),[o,u]=y.useState(null),[c,f]=y.useState(""),h=n==null?void 0:n.target_vocab,m=(n==null?void 0:n.drafts)??[],g=m.filter(N=>N.compatible===!0),v=e.spec_draft_model;async function b(N){u(N??"__clear__"),f("");try{await we(`/api/models/${encodeURIComponent(e.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:N})}),r(),t()}catch(E){f(String((E==null?void 0:E.message)||E)),u(null)}}const j=N=>{var E;return N?`${N.pre??"?"} · ${((E=N.n_vocab)==null?void 0:E.toLocaleString())??"?"} Tokens`:"—"};return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[l.jsx(ga,{className:"h-4 w-4"})," Speculative Draft"]}),l.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',l.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),l.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:(k=e.name.split("/").pop())==null?void 0:k.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-foreground",children:["Vocab: ",j(h)]})]}),e.spec_active&&v&&l.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[l.jsx(qt,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",v]}),l.jsx("button",{onClick:()=>b(null),disabled:o!==null,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(n!=null&&n.target_exists)&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[l.jsx(Er,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),l.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:i?l.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):m.length===0?l.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",l.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):m.map(N=>{var P,_;const E=N.filename===v,A=N.compatible===!0;return l.jsxs("div",{className:ee("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",A?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",E&&"border-primary/40 bg-primary/10"),children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate flex items-center gap-1.5",children:[N.filename,N.mtp&&l.jsx("span",{className:"shrink-0 rounded bg-indigo-500/15 px-1.5 py-0.5 text-[8px] font-bold uppercase tracking-wider text-indigo-400 border border-indigo-500/25",title:"MTP-Kopf (Multi-Token-Prediction) — by-construction vocab-identisch, höchste Akzeptanzrate",children:"MTP"})]}),l.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[or(N.size_bytes)," · Vocab: ",j(N.vocab)]})]}),A?E?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[l.jsx(qt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("button",{onClick:()=>b(N.path),disabled:o!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):l.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:N.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(P=N.vocab)==null?void 0:P.pre}/${(_=N.vocab)==null?void 0:_.n_vocab} ≠ Modell ${h==null?void 0:h.pre}/${h==null?void 0:h.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[l.jsx(Er,{className:"h-3.5 w-3.5"})," ",N.compatible===!1?"Vocab ≠":"n/a"]})]},N.path)})}),!i&&(n==null?void 0:n.target_exists)&&m.length>0&&g.length===0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",l.jsx("span",{className:"font-mono",children:h==null?void 0:h.pre}),", n_vocab=",l.jsx("span",{className:"font-mono",children:(S=h==null?void 0:h.n_vocab)==null?void 0:S.toLocaleString()}),")."]}),c&&l.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:c})]})})}const qw={hermes:{bar:"bg-indigo-500",dot:"bg-indigo-500",text:"text-indigo-400"},embed:{bar:"bg-emerald-500",dot:"bg-emerald-500",text:"text-emerald-400"},vision:{bar:"bg-pink-500",dot:"bg-pink-500",text:"text-pink-400"},heavy:{bar:"bg-amber-500",dot:"bg-amber-500",text:"text-amber-400"},"coder-lite":{bar:"bg-violet-500",dot:"bg-violet-500",text:"text-violet-400"},coder:{bar:"bg-fuchsia-500",dot:"bg-fuchsia-500",text:"text-fuchsia-400"},scout:{bar:"bg-teal-500",dot:"bg-teal-500",text:"text-teal-400"}},YD={fast:"hermes",coder_lite:"coder-lite"},Qw={bar:"bg-slate-400",dot:"bg-slate-400",text:"text-slate-300"};function cf(e){return e&&(qw[e]||qw[YD[e]])||Qw}const Yw=1024**3,Xw=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function XD({running:e,capacityBytes:t,realUsedBytes:r,selected:n,onSelect:i}){const o=t>2*Yw?t:124*Yw,u=e.reduce((h,m)=>h+(m.size_bytes||0),0),c=Math.max(0,o-u),f=c/o*100;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-end justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fa,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Arbeitsspeicher"}),l.jsxs("div",{className:"font-space text-xl font-bold tracking-tight text-foreground",children:[Qr(o)," GB ",l.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"gesamt"})]})]})]}),l.jsxs("div",{className:"text-right text-[11px] font-mono text-muted-foreground",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"font-bold text-foreground",children:[Qr(u)," GB"]})," Modelle geladen"]}),r>0&&l.jsxs("div",{children:[Qr(r)," GB real belegt (inkl. KV-Cache)"]}),l.jsxs("div",{className:"text-emerald-400",children:[Qr(c)," GB frei"]})]})]}),l.jsx("div",{className:"flex h-12 w-full overflow-hidden rounded-xl border border-border/40 bg-background/50 p-1",children:e.length===0?l.jsx("div",{className:"flex w-full items-center justify-center text-[11px] italic text-muted-foreground/60",children:"Kein Modell geladen — Auto-Swap holt bei Anfrage automatisch das passende."}):l.jsxs(l.Fragment,{children:[e.map(h=>{const m=(h.size_bytes||0)/o*100,g=cf(h.role),v=n===h.name;return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),style:{width:`${m}%`},title:`${ct(h.role).label} · ${Xw(h.name)} · ${or(h.size_bytes)}`,className:ee("group flex h-full min-w-[2.5rem] shrink-0 flex-col justify-center gap-0.5 rounded-lg px-2 text-left text-white transition-all",g.bar,v?"ring-2 ring-white/70":"opacity-90 hover:opacity-100"),children:[l.jsx("span",{className:"truncate font-space text-[10px] font-bold leading-tight tracking-wide",children:ct(h.role).short}),l.jsx("span",{className:"truncate font-mono text-[9px] leading-tight opacity-85",children:or(h.size_bytes)})]},h.name)}),f>1.5&&l.jsx("div",{style:{width:`${f}%`},className:"flex h-full min-w-[2rem] items-center justify-center rounded-lg text-[9px] font-mono text-muted-foreground/50",title:`${Qr(c)} GB frei`,children:"frei"})]})}),e.length>0&&l.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5",children:[e.map(h=>{const m=cf(h.role);return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[l.jsx("span",{className:ee("h-2.5 w-2.5 rounded-sm",m.dot)}),l.jsx("span",{className:ee("font-semibold",m.text),children:ct(h.role).short}),l.jsx("span",{className:"font-mono text-muted-foreground/70",children:Xw(h.name)})]},h.name)}),l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60",children:[l.jsx("span",{className:"h-2.5 w-2.5 rounded-sm border border-border/50 bg-background/50"})," frei · ",Qr(c)," GB"]})]})]})}const Zw=1024**3,Ua=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function ZD(){var M,H,ie,J;const e=Kn(),{data:t,isLoading:r,error:n}=wi(4e3),{data:i}=ko(),{data:o}=I0(),{showAlert:u,showConfirm:c,showPrompt:f,dialogElement:h}=ba(),m=O0(),g=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=Z=>!!ct(Z).protected,j=(M=o==null?void 0:o.groups)==null?void 0:M.brains,k=(j==null?void 0:j.members)??[],S=Z=>k.includes(Z),[N,E]=y.useState(null),[A,P]=y.useState(""),[_,O]=y.useState("all"),[T,B]=y.useState(null),$=()=>{e.invalidateQueries({queryKey:Be.models}),e.invalidateQueries({queryKey:Be.routing}),e.invalidateQueries({queryKey:Be.groups})},z=g.filter(Z=>v.includes(Z.name)),Q=((H=i==null?void 0:i.gpu)==null?void 0:H.gtt_total)||((ie=i==null?void 0:i.gpu)==null?void 0:ie.vram_total)||0,U=((J=i==null?void 0:i.gpu)==null?void 0:J.gtt_used)||0,ve=Q>2*Zw?Q:124*Zw,ue=y.useMemo(()=>{const Z=A.trim().toLowerCase();return g.filter(ae=>_==="in_use"?!!ae.role||v.includes(ae.name):!0).filter(ae=>Z?ae.name.toLowerCase().includes(Z):!0).sort((ae,me)=>{const re=v.includes(ae.name)?0:1,ye=v.includes(me.name)?0:1;return re!==ye?re-ye:Ua(ae.name).localeCompare(Ua(me.name))})},[g,v,_,A]),pe=g.find(Z=>Z.name===N)??null;async function oe(Z){try{await we(`/api/models/${encodeURIComponent(Z)}/load`,{method:"POST"}),$()}catch(ae){u("Fehler",`Laden fehlgeschlagen: ${ae.message||ae}`)}}async function se(Z){const ae=k.some(me=>v.includes(me));if(j&&ae&&!S(Z)){const me=k.filter(re=>v.includes(re)).map(Ua).join(", ");c("Verdrängt das Hirn?",`„${Ua(Z)}" ist nicht ko-resident. Beim Laden wirft es das warme Hirn (${me}) raus — Lucy verliert Hirn bzw. Augen. -Trotzdem exklusiv laden?`,()=>oe(Z));return}oe(Z)}async function X(Z){const ae=g.find(me=>me.name===Z);if(ae&&b(ae.role)){u("Geschützt",`„${ct(ae.role).label}" ist lebenswichtig und bleibt geladen.`);return}try{await we(`/api/models/${encodeURIComponent(Z)}/unload`,{method:"POST"}),$()}catch(me){u("Fehler",`Entladen fehlgeschlagen: ${me.message||me}`)}}async function ne(Z,ae){try{const me=await we(`/api/models/${encodeURIComponent(ae)}/role`,{method:"POST",body:JSON.stringify({role:Z||null})});$(),me!=null&&me.warning&&u("Rolle gesetzt — Hinweis",me.warning)}catch(me){u("Fehler",`Rolle zuweisen fehlgeschlagen: ${me.message||me}`)}}async function te(Z,ae){let me=null;try{me=await we(`/api/models/${encodeURIComponent(Z)}/ctx/auto`)}catch{}const re=me?`Optimal für dein Setup: ${(me.ctx/1024).toFixed(0)}k (${me.ctx}). »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";f("Kontextlänge anpassen",re,String(ae||32768),async ye=>{if(ye)try{await we(`/api/models/${encodeURIComponent(Z)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ye,10)})}),$()}catch(Oe){u("Fehler",`Kontext setzen fehlgeschlagen: ${Oe.message||Oe}`)}},void 0,me?{autoValue:String(me.ctx),autoLabel:`Auto (${(me.ctx/1024).toFixed(0)}k)`}:void 0)}async function I(Z){const ae=g.find(me=>me.name===Z);if(ae&&b(ae.role)){u("Geschützt",`„${ct(ae.role).label}" kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}c("Modell löschen?",`„${Ua(Z)}" und alle GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await we(`/api/models/${encodeURIComponent(Z)}`,{method:"DELETE"}),N===Z&&E(null),$()}catch(me){u("Fehler",`Löschen fehlgeschlagen: ${me.message||me}`)}})}return r?l.jsx("div",{className:"py-16 text-center text-xs text-muted-foreground",children:"Werkbank wird geladen …"}):n?l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",String(n),")."]}):l.jsxs("div",{className:"space-y-5",children:[l.jsx(YD,{running:z,capacityBytes:ve,realUsedBytes:U,selected:N,onSelect:E}),l.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(lh,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60"}),l.jsx("input",{value:A,onChange:Z=>P(Z.target.value),placeholder:"Modell suchen …",className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"})]}),l.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:["all","in_use"].map(Z=>l.jsx("button",{onClick:()=>O(Z),className:ee("rounded-md px-2 py-1 text-[9px] font-bold uppercase transition-all cursor-pointer",_===Z?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:Z==="all"?"Alle":"In Benutzung"},Z))})]}),l.jsx("div",{className:"max-h-[60vh] space-y-1.5 overflow-y-auto scrollbar-thin pr-1",children:ue.length===0?l.jsx("div",{className:"rounded-xl border border-dashed border-border/50 p-8 text-center text-xs text-muted-foreground",children:"Keine Modelle."}):ue.map(Z=>{const ae=v.includes(Z.name),me=N===Z.name,re=uf(Z.name),ye=cf(Z.role);return l.jsxs("button",{onClick:()=>E(Z.name),className:ee("flex w-full items-center gap-2.5 rounded-xl border p-2.5 text-left transition-all cursor-pointer",me?"border-primary/60 bg-primary/10":"border-border/40 bg-background/20 hover:border-primary/30 hover:bg-background/40"),children:[l.jsx("span",{className:ee("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border text-[10px] font-bold",re.color),children:re.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate font-mono text-xs font-semibold text-foreground",children:Ua(Z.name)}),l.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[Z.role&&l.jsx("span",{className:ee("h-2 w-2 rounded-sm",ye.dot)}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:Z.role?ct(Z.role).short:"keine Rolle"}),l.jsxs("span",{className:"text-[10px] text-muted-foreground/50",children:["· ",or(Z.size_bytes)]})]})]}),ae?l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[9px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]}):Z.incomplete?l.jsx("span",{className:"shrink-0 text-[9px] font-bold uppercase text-amber-400",children:"⚠ fehlt"}):l.jsx("span",{className:"shrink-0 text-[9px] font-semibold uppercase text-muted-foreground/50",children:"bereit"})]},Z.name)})})]}),l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:pe?l.jsx(ZD,{m:pe,warm:v.includes(pe.name),expert:m,protectedRole:b(pe.role),coresident:S(pe.name),onLoad:()=>se(pe.name),onUnload:()=>X(pe.name),onRole:Z=>ne(Z,pe.name),onCtx:()=>te(pe.name,pe.ctx),onSpec:()=>B(pe),onDelete:()=>I(pe.name)}):l.jsxs("div",{className:"flex h-full min-h-[16rem] flex-col items-center justify-center gap-2 text-center text-muted-foreground",children:[l.jsx(pi,{className:"h-8 w-8 opacity-40"}),l.jsx("p",{className:"text-sm font-semibold",children:"Links ein Modell wählen"}),l.jsx("p",{className:"text-xs",children:"Dann verwaltest du es hier — laden, Rolle, Kontext, löschen."})]})})]}),T&&l.jsx(K5,{model:T,onClose:()=>B(null),onChanged:$}),h]})}function ZD({m:e,warm:t,expert:r,protectedRole:n,coresident:i,onLoad:o,onUnload:u,onRole:c,onCtx:f,onSpec:h,onDelete:m}){const g=uf(e.name),v=t&&n;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:ee("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border text-sm font-bold",g.color),children:g.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"break-all font-mono text-sm font-bold text-foreground",children:Ua(e.name)}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.role?l.jsx(so,{role:e.role}):l.jsx("span",{className:"rounded border border-dashed border-border/50 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:"keine Rolle"}),n&&l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 text-[10px] text-muted-foreground",title:"Lebenswichtig — geschützt",children:[l.jsx(WN,{className:"mr-0.5 inline h-3 w-3"}),"geschützt"]}),i&&l.jsxs("span",{className:"rounded border border-fuchsia-500/30 bg-fuchsia-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase text-fuchsia-300",children:[l.jsx(xa,{className:"mr-0.5 inline h-3 w-3"}),"Ko-resident"]}),t&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]})]})]})]}),l.jsxs("button",{onClick:t?u:o,disabled:e.incomplete&&!t||v,className:ee("flex h-11 w-full items-center justify-center gap-2 rounded-xl border text-sm font-bold transition-all cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",t?"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),title:v?`„${ct(e.role).label}" bleibt geladen (geschützt).`:void 0,children:[t?l.jsx(RM,{className:"h-4 w-4"}):l.jsx(GN,{className:"h-4 w-4"}),v?"🔒 bleibt geladen":t?"Entladen":"Ins Warm-Set laden"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsx("div",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Rolle"}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.jsx(Jw,{active:!e.role,onClick:()=>c(""),dot:"bg-slate-400",label:"keine"}),T0.map(b=>l.jsx(Jw,{active:e.role===b.role,onClick:()=>c(b.role),dot:cf(b.role).dot,label:b.short},b.role))]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[l.jsx(JD,{icon:fa,label:"Größe",value:or(e.size_bytes)}),l.jsxs("button",{onClick:f,className:"group flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5 text-left transition-colors hover:border-primary/40 cursor-pointer",children:[l.jsx(KN,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Kontext · ändern"}),l.jsx("div",{className:"font-semibold text-foreground",children:xv(e.ctx)})]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Beschleuniger"}),r&&l.jsxs("button",{onClick:h,className:ee("flex h-6 items-center gap-1 rounded-lg border px-2 text-[9px] font-bold uppercase transition-colors cursor-pointer",e.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":e.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),children:[l.jsx(ga,{className:"h-3 w-3"})," Spec"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.spec_active&&l.jsx(Cd,{tone:"emerald",label:"Spec-Decoding aktiv"}),!e.spec_active&&e.spec_draft_model&&l.jsx(Cd,{tone:"amber",label:"Spec inaktiv"}),e.prompt_cache&&l.jsx(Cd,{tone:"cyan",label:"Prompt-Cache"}),e.parallel_slots>1&&l.jsx(Cd,{tone:"violet",label:`${e.parallel_slots} Slots`}),!e.spec_active&&!e.spec_draft_model&&!e.prompt_cache&&e.parallel_slots<=1&&l.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"keine aktiv"})]})]}),l.jsx("div",{className:"flex flex-wrap gap-1",children:l.jsx(bv,{caps:e.capabilities})}),l.jsxs("button",{onClick:m,disabled:n,className:ee("mt-auto flex h-9 items-center justify-center gap-1.5 rounded-lg border text-xs font-semibold transition-colors",n?"cursor-not-allowed border-border/30 text-muted-foreground/40":"border-red-500/30 text-red-400 hover:bg-red-500/10 cursor-pointer"),children:[l.jsx(of,{className:"h-3.5 w-3.5"})," ",n?"geschützt — nicht löschbar":"Modell löschen"]})]})}function Jw({active:e,onClick:t,dot:r,label:n}){return l.jsxs("button",{onClick:t,className:ee("flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-semibold transition-all cursor-pointer",e?"border-primary/60 bg-primary/15 text-foreground":"border-border/40 bg-background/20 text-muted-foreground hover:border-primary/30"),children:[l.jsx("span",{className:ee("h-2 w-2 rounded-sm",r)}),n,e&&l.jsx(qt,{className:"h-3 w-3 text-primary"})]})}function JD({icon:e,label:t,value:r}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5",children:[l.jsx(e,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:t}),l.jsx("div",{className:"font-semibold text-foreground",children:r})]})]})}function Cd({tone:e,label:t}){const r={emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",amber:"bg-amber-500/10 text-amber-400 border-amber-500/20",cyan:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",violet:"bg-violet-500/10 text-violet-400 border-violet-500/20"}[e];return l.jsx("span",{className:ee("rounded border px-1.5 py-0.5 text-[10px] font-semibold",r),children:t})}const eR=[{key:"popular",label:"Beliebt",q:""},{key:"coder",label:"Coder",q:"coder"},{key:"vision",label:"Vision",q:"vision"},{key:"reasoning",label:"Reasoning",q:"reasoning"},{key:"small",label:"Klein (≤4B)",q:"3B"}],tR=["fast","heavy","coder","vision","hermes","scout"],rR=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function ek(e){return rR.format(e)}function nR(){const{data:e}=wi(),t=(e==null?void 0:e.models)??[],[r,n]=y.useState(""),[i,o]=y.useState([]),[u,c]=y.useState(!1),[f,h]=y.useState(""),[m,g]=y.useState("popular"),[v,b]=y.useState(""),[j,k]=y.useState(null),[S,N]=y.useState([]),[E,A]=y.useState("Q4_K_M"),[P,_]=y.useState(""),[O,T]=y.useState(null),[B,$]=y.useState(!1),[z,Q]=y.useState({});async function U(M){c(!0),h("");try{const H=await we(`/api/hf/search?q=${encodeURIComponent(M)}`);o(H.results),H.results.length||h("Keine Ergebnisse.")}catch(H){h(`Suche fehlgeschlagen: ${H}`)}finally{c(!1)}}y.useEffect(()=>{U("")},[]);function ve(M){g(M.key),n(""),U(M.q)}function ue(){g(""),U(r)}async function pe(M,H,ie){$(!1);try{const J=await we(`/api/fit?params_b=0&quant=${encodeURIComponent(H)}&ctx=8192&name=${encodeURIComponent(M)}&role=${encodeURIComponent(ie)}`);T(J)}catch{T(null)}}async function oe(M){if(j===M){k(null);return}k(M),N([]),T(null),_(""),$(!1),h("Analysiere Repository…");try{const H=await we(`/api/hf/quants?repo=${encodeURIComponent(M)}`);N(H.quants);const ie=H.quants.includes("Q4_K_M")?"Q4_K_M":H.quants[0]||"Q4_K_M";A(ie),h(H.quants.length?"":"Keine GGUF-Dateien in diesem Repo gefunden."),H.quants.length&&pe(H.repo,ie,"")}catch(H){h(`Fehler: ${H}`)}}function se(){const M=v.trim();M&&(o(H=>H.some(ie=>ie.repo===M)?H:[{repo:M,downloads:0,likes:0},...H]),b(""),oe(M))}const X=P?t.find(M=>(M.role||"").toLowerCase()===P):void 0;async function ne(M){if((O==null?void 0:O.fit.level)==="too_tight"&&!B){$(!0);return}Q(H=>({...H,[M]:"Starte…"}));try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:M,quant:E,role:P||void 0,jinja:!0})}),Q(H=>({...H,[M]:"Download läuft"})),$(!1)}catch{Q(ie=>({...ie,[M]:"Fehler"}))}}const te=M=>{var ie;const H=((ie=M.split("/").pop())==null?void 0:ie.toLowerCase().replace(/-gguf$/i,""))||"";return H.length>3&&t.some(J=>J.name.toLowerCase().includes(H))},I=M=>M==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":M==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(lh,{className:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx("input",{value:r,onChange:M=>n(M.target.value),onKeyDown:M=>M.key==="Enter"&&ue(),"aria-label":"HuggingFace durchsuchen",type:"search",spellCheck:!1,placeholder:"HuggingFace durchsuchen (z.B. Qwen Coder, Llama-3.1, gemma)…",className:"w-full h-10 pl-9 pr-3 rounded-xl border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),l.jsx("button",{onClick:ue,className:"h-10 px-5 rounded-xl bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer",children:"Suchen"})]}),l.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:eR.map(M=>l.jsxs("button",{onClick:()=>ve(M),className:ee("flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-semibold transition-all cursor-pointer border",m===M.key?"bg-primary/15 text-primary border-primary/30":"border-border/50 text-muted-foreground hover:text-foreground hover:border-border"),children:[M.key==="popular"&&l.jsx(bM,{className:"h-3 w-3"}),M.label]},M.key))}),u?l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:"Lade GGUF-Modelle von HuggingFace…"}):l.jsxs("div",{className:"space-y-2",children:[i.map(M=>{const H=j===M.repo,ie=te(M.repo),J=M.repo.includes("/")?M.repo.split("/")[0]:"—",Z=M.repo.split("/").pop();return l.jsxs("div",{className:ee("rounded-xl border bg-card/45 backdrop-blur-md transition-all",H?"border-primary/40 shadow-lg shadow-primary/5":"border-border/50 hover:border-primary/30"),children:[l.jsxs("button",{onClick:()=>oe(M.repo),className:"w-full flex items-center gap-3 p-3.5 text-left cursor-pointer",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs font-bold font-mono text-foreground truncate max-w-[280px]",title:M.repo,children:Z}),ie&&l.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-1.5 py-0.5 rounded",children:[l.jsx(qt,{className:"h-2.5 w-2.5"})," installiert"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-3 mt-0.5 font-mono",children:[l.jsx("span",{children:J}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Ds,{className:"h-3 w-3"})," ",ek(M.downloads)]}),M.likes>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(NM,{className:"h-3 w-3"})," ",ek(M.likes)]})]})]}),H?l.jsx(zN,{className:"h-4 w-4 text-muted-foreground shrink-0"}):l.jsx($N,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),H&&l.jsx("div",{className:"border-t border-border/30 p-3.5 space-y-3",children:S.length===0?l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono",children:f||"Lade Quants…"}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Quant"}),l.jsx("select",{value:E,onChange:ae=>{A(ae.target.value),pe(M.repo,ae.target.value,P)},"aria-label":"Quantisierung",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:S.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))}),l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground ml-1",children:"Rolle"}),l.jsxs("select",{value:P,onChange:ae=>{_(ae.target.value),pe(M.repo,E,ae.target.value)},"aria-label":"Rolle",title:"Optional — bestimmt Auto-Konfiguration + setup-bewussten Kontext",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:[l.jsx("option",{value:"",className:"bg-popover text-foreground",children:"keine"}),tR.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))]}),l.jsx("button",{onClick:()=>ne(M.repo),disabled:!!z[M.repo]&&z[M.repo]==="Download läuft",className:ee("h-8 px-3.5 ml-auto rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5",B?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"),children:z[M.repo]?z[M.repo]:B?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"h-3.5 w-3.5"})," OOM — trotzdem laden"]}):l.jsxs(l.Fragment,{children:[l.jsx(Ds,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]}),O&&l.jsxs("div",{className:ee("flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium",I(O.fit.level)),children:[l.jsx("span",{className:"font-bold uppercase tracking-wide",children:O.fit.text}),l.jsxs("span",{className:"font-mono opacity-90",children:["~",O.params_b,"B · ~",O.fit.req_gb," GB / ",O.sys_ram_gb," GB · ~",O.fit.tps," t/s"]}),O.fit.level!=="too_tight"?l.jsxs("span",{className:"font-mono opacity-80",children:["ctx → ",(O.assigned_ctx/1024).toFixed(0),"k"]}):l.jsx("span",{className:"opacity-90",children:"— passt nicht, würde beim Laden abstürzen (OOM)."})]}),X&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-400",children:[l.jsx(Er,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),l.jsxs("span",{children:["Rolle ",l.jsxs("strong",{children:["„",P,'"']})," hält aktuell ",l.jsx("strong",{children:X.name.split("/").pop()})," — wird beim Download übernommen."]})]})]})})]},M.repo)}),!i.length&&!u&&l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:f||"Keine Ergebnisse."})]}),l.jsxs("div",{className:"border-t border-border/30 pt-4 flex flex-col sm:flex-row gap-2 items-stretch sm:items-center",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground shrink-0",children:"Direkt:"}),l.jsx("input",{value:v,onChange:M=>b(M.target.value),onKeyDown:M=>M.key==="Enter"&&se(),"aria-label":"Repository oder URL direkt eingeben",spellCheck:!1,placeholder:"org/repo oder HF-URL (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground font-mono"}),l.jsx("button",{onClick:se,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Laden"})]})]})}const iR={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ga},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:xa},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Ts},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:xu},hermes:{title:"Lucys Hirn (Agent)",desc:"Lucys dauer-warmes Agent-Hirn mit Tool-Calling — bleibt ko-resident, lädt nie kalt nach.",icon:lM},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:lv}};function aR(){const{data:e,isLoading:t,error:r}=BD(),{data:n}=wi(),{data:i}=gh(),o=(n==null?void 0:n.models)??[],u=r?String(r):"",[c,f]=y.useState({}),[h,m]=y.useState({}),[g,v]=y.useState("recommended");async function b(j,k,S,N){f(E=>({...E,[j]:"Starte..."}));try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:k,quant:S,jinja:N})}),f(E=>({...E,[j]:"Download läuft"}))}catch{f(A=>({...A,[j]:"Fehler"}))}}return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 w-fit",children:[["recommended","Empfohlen"],["browse","Stöbern & Suchen"]].map(([j,k])=>l.jsx("button",{onClick:()=>v(j),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide transition-all cursor-pointer",g===j?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:k},j))}),g==="browse"?l.jsx(nR,{}):t?l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):u||!e?l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",u,")."]}):l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[l.jsxs("div",{children:["Modell-Registry geladen für ",l.jsxs("span",{className:"text-foreground font-bold",children:[e.sys_ram_gb," GB"]})," System-RAM."]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(GM,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),l.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),l.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:e.categories.map(j=>{const k=iR[j.role]||{title:j.title||j.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:HN},S=k.icon,N=o.find(T=>T.role===j.role||(T.aliases||[]).includes(j.role)),E=i==null?void 0:i.model_list.find(T=>T.role===j.role),A=j.models.find(T=>T.repo===j.recommended)||j.models[0];if(!A)return null;const P=c[A.repo],_=j.models.filter(T=>T.repo!==j.recommended),O=!!h[j.role];return l.jsxs("div",{className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",N?"border-border/60":"border-primary/20 shadow-primary/5"),children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:l.jsx(S,{className:"h-5.5 w-5.5"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:k.title}),l.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",j.role]})]})]}),N?l.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):l.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:k.desc}),l.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:N?l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:N.name,children:N.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[l.jsxs("span",{children:["Größe: ",yv(N.size_bytes||0)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",N.quant||"GGUF"]})]})]}):l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[l.jsxs("span",{children:["Ersteller: ",A.author]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",A.quant]})]}),l.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:l.jsx(qD,{fit:A.fit})})]})}),l.jsx("div",{className:"pt-1",children:N?E?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),l.jsxs("span",{children:["Bessere Version in der Registry: ",E.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>b(E.repo,j.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!c[E.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[l.jsx(Ds,{className:"h-3.5 w-3.5"}),c[E.repo]||"Auf neue Version aktualisieren"]})]}):l.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[l.jsx(qt,{className:"h-4 w-4"})," Auf neuestem Stand"]}):l.jsxs("button",{onClick:()=>b(A.repo,j.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!P,className:ee("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",P?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[l.jsx(Ds,{className:"h-3.5 w-3.5"}),P||"Optimales Modell einsetzen"]})})]}),_.length>0&&l.jsxs("div",{className:"border-t border-border/20 pt-3",children:[l.jsxs("button",{onClick:()=>m(T=>({...T,[j.role]:!O})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[O?l.jsx(zN,{className:"h-3 w-3"}):l.jsx($N,{className:"h-3 w-3"}),l.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",_.length,")"]})]}),O&&l.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:_.map(T=>l.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:T.name,children:T.name}),l.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[l.jsxs("span",{children:["Quant: ",T.quant]}),l.jsx("span",{children:"•"}),l.jsx("span",{children:T.fit.text})]})]}),l.jsx("button",{onClick:()=>b(T.repo,j.role,T.quant||"Q4_K_M",T.caps.tools!=="no"),disabled:!!c[T.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:c[T.repo]||"Installieren"})]},T.repo))})]})]},j.role)})})]})]})}function oR(){const[e,t]=y.useState("cockpit");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),l.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(r=>l.jsx("button",{onClick:()=>t(r),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:r==="cockpit"?"Werkbank":"Modelle finden"},r))})]}),l.jsx(KD,{}),l.jsx("div",{className:"transition-all duration-300",children:e==="cockpit"?l.jsx(XD,{}):l.jsx(aR,{})})]})}const sR={zed:"Zed: settings.json",kilo:"Kilo: Einstellungen → API Provider",claude_code:"env / Übersetzer"};function tk({line:e,loading:t}){return t||!e?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-muted-foreground",children:[l.jsx(qs,{className:"h-3 w-3 animate-spin"})," prüfe…"]}):e.ok?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-emerald-400",children:[l.jsx(FN,{className:"h-3 w-3"})," ",e.detail]}):l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-red-400",children:[l.jsx(mM,{className:"h-3 w-3"})," ",e.detail]})}function rk({tool:e,fileName:t,accent:r,copied:n,onCopy:i}){return l.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[l.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),l.jsx("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:l.jsx("span",{children:t})}),l.jsxs("button",{onClick:i,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[n?l.jsx(qt,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(uv,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:n?"Kopiert":"Kopieren"})]})]}),l.jsx("pre",{className:ee("p-5 overflow-x-auto text-xs font-mono whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",r==="teal"?"text-cyan-200/90":"text-violet-200/90"),children:l.jsx("code",{children:e.snippet})})]})}function G5(){const[e,t]=y.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[r,n]=y.useState(localStorage.getItem("mc_mcp_path")||""),[i,o]=y.useState("zed"),[u,c]=y.useState(null),f=new URLSearchParams({host:e});r&&f.set("mcp_path",r);const{data:h,error:m}=HD(f.toString()),{data:g,isLoading:v}=H5(),b=m?String(m):"";function j(E){t(E),E&&localStorage.setItem("mc_host",E)}function k(E){n(E),localStorage.setItem("mc_mcp_path",E)}const S=h==null?void 0:h.tools[i];async function N(E,A){A&&(await navigator.clipboard.writeText(A),c(E),setTimeout(()=>c(null),1500))}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Binde deinen lokalen Agenten an die Box an — über ",l.jsx("span",{className:"text-foreground",children:"zwei getrennte Leitungen"}),": das Modell (Gateway) und das geteilte Gedächtnis (MCP)."]})]}),l.jsxs("div",{className:"p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-[170px_1fr] items-center",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background/40 p-4 text-center",children:[l.jsx(AM,{className:"h-7 w-7 mx-auto text-muted-foreground"}),l.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:"Dein lokaler Agent"}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Cline · Cursor · Zed …"})]}),l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(nf,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-primary/25 bg-primary/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-primary",children:[l.jsx(pi,{className:"h-3.5 w-3.5"})," Leitung 1 — Modell"]}),l.jsx(tk,{line:g==null?void 0:g.gateway,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-primary/80",children:"Gateway · :9001/v1 · Lanes chat / coding"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(nf,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-violet-500/25 bg-violet-500/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-violet-300",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Leitung 2 — Gedächtnis"]}),l.jsx(tk,{line:g==null?void 0:g.memory,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-violet-300/80",children:"MCP · mcp_memory.py · separat"})]})]})]})]}),l.jsxs("p",{className:"mt-3.5 text-[11px] text-muted-foreground leading-relaxed",children:["Der Gateway liefert ",l.jsx("span",{className:"text-foreground",children:"nur das LLM"}),". Das geteilte Gedächtnis läuft über einen",l.jsx("span",{className:"text-foreground",children:" eigenen MCP-Server"})," — beide werden unabhängig eingerichtet."]})]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(SM,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),l.jsx("input",{value:e,onChange:E=>j(E.target.value),"aria-label":"Box LAN IP-Adresse",spellCheck:!1,placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(wM,{className:"h-3.5 w-3.5 text-violet-400"})," Lokaler MCP-Scriptpfad",l.jsx("span",{className:"text-violet-400/70 normal-case font-semibold tracking-normal",children:"(nur Leitung 2)"})]}),l.jsx("input",{value:r,onChange:E=>k(E.target.value),"aria-label":"Lokaler MCP-Scriptpfad",spellCheck:!1,placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-violet-500/50 text-foreground"})]})]}),b&&l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",b]}),h&&l.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-primary/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-primary/15 text-primary text-[11px]",children:"1"}),"Modell anbinden"]}),l.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Wähle dein Tool — das Snippet zeigt auf den Gateway."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(h.tools).map(([E,A])=>l.jsx("button",{onClick:()=>o(E),className:ee("rounded-lg px-3 py-1.5 text-[11px] font-semibold tracking-wide transition-all cursor-pointer",i===E?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"border border-border/50 text-muted-foreground hover:text-foreground"),children:A.label},E))}),S&&l.jsxs(l.Fragment,{children:[S.note&&l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(kw,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:S.note})]}),l.jsx(rk,{tool:S,fileName:sR[i]||"config.json",accent:"teal",copied:u==="model",onCopy:()=>N("model",S.snippet)})]})]}),l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-violet-500/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-violet-500/15 text-violet-300 text-[11px]",children:"2"}),"Gedächtnis anbinden",l.jsx("span",{className:"text-[10px] font-medium text-muted-foreground normal-case",children:"optional"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Ein MCP-Block — gilt zusätzlich für ",l.jsx("em",{children:"jedes"})," Tool aus Schritt 1."]})]}),l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-violet-500/5 border border-violet-500/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(kw,{className:"h-4 w-4 text-violet-400 shrink-0 mt-0.5"}),l.jsx("span",{children:h.memory.note})]}),l.jsx(rk,{tool:h.memory,fileName:"mcp.json",accent:"violet",copied:u==="memory",onCopy:()=>N("memory",h.memory.snippet)})]})]})]})}const lR="modulepreload",uR=function(e){return"/"+e},nk={},cR=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=u(r.map(h=>{if(h=uR(h),h in nk)return;nk[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":lR,m||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((b,j)=>{v.addEventListener("load",b),v.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return i.then(u=>{for(const c of u||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};class dR extends y.Component{constructor(){super(...arguments);Xo(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?l.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[l.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),l.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const fR=y.lazy(()=>cR(()=>import("./GraphView--jt2Kx1K.js"),[]).then(e=>({default:e.GraphView}))),Pd=["identity","knowledge","rules","events"],ik=new Set(["auto","agent","hermes"]),dg={identity:{label:"Identität",icon:qM,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:Qs,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:FM,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:BN,bg:"bg-amber-500/10",text:"text-amber-400"}},ak={label:"Gedächtnis",icon:sv,text:"text-muted-foreground"},hR={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},ok=`Hi Hermes! Lass uns ein kurzes Onboarding machen, damit du dich künftig an mich erinnerst. Stell mir nacheinander ein paar kurze Fragen zu: +Trotzdem exklusiv laden?`,()=>oe(Z));return}oe(Z)}async function X(Z){const ae=g.find(me=>me.name===Z);if(ae&&b(ae.role)){u("Geschützt",`„${ct(ae.role).label}" ist lebenswichtig und bleibt geladen.`);return}try{await we(`/api/models/${encodeURIComponent(Z)}/unload`,{method:"POST"}),$()}catch(me){u("Fehler",`Entladen fehlgeschlagen: ${me.message||me}`)}}async function ne(Z,ae){try{const me=await we(`/api/models/${encodeURIComponent(ae)}/role`,{method:"POST",body:JSON.stringify({role:Z||null})});$(),me!=null&&me.warning&&u("Rolle gesetzt — Hinweis",me.warning)}catch(me){u("Fehler",`Rolle zuweisen fehlgeschlagen: ${me.message||me}`)}}async function te(Z,ae){let me=null;try{me=await we(`/api/models/${encodeURIComponent(Z)}/ctx/auto`)}catch{}const re=me?`Optimal für dein Setup: ${(me.ctx/1024).toFixed(0)}k (${me.ctx}). »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";f("Kontextlänge anpassen",re,String(ae||32768),async ye=>{if(ye)try{await we(`/api/models/${encodeURIComponent(Z)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ye,10)})}),$()}catch(Oe){u("Fehler",`Kontext setzen fehlgeschlagen: ${Oe.message||Oe}`)}},void 0,me?{autoValue:String(me.ctx),autoLabel:`Auto (${(me.ctx/1024).toFixed(0)}k)`}:void 0)}async function I(Z){const ae=g.find(me=>me.name===Z);if(ae&&b(ae.role)){u("Geschützt",`„${ct(ae.role).label}" kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}c("Modell löschen?",`„${Ua(Z)}" und alle GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await we(`/api/models/${encodeURIComponent(Z)}`,{method:"DELETE"}),N===Z&&E(null),$()}catch(me){u("Fehler",`Löschen fehlgeschlagen: ${me.message||me}`)}})}return r?l.jsx("div",{className:"py-16 text-center text-xs text-muted-foreground",children:"Werkbank wird geladen …"}):n?l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",String(n),")."]}):l.jsxs("div",{className:"space-y-5",children:[l.jsx(XD,{running:z,capacityBytes:ve,realUsedBytes:U,selected:N,onSelect:E}),l.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(lh,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60"}),l.jsx("input",{value:A,onChange:Z=>P(Z.target.value),placeholder:"Modell suchen …",className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"})]}),l.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:["all","in_use"].map(Z=>l.jsx("button",{onClick:()=>O(Z),className:ee("rounded-md px-2 py-1 text-[9px] font-bold uppercase transition-all cursor-pointer",_===Z?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:Z==="all"?"Alle":"In Benutzung"},Z))})]}),l.jsx("div",{className:"max-h-[60vh] space-y-1.5 overflow-y-auto scrollbar-thin pr-1",children:ue.length===0?l.jsx("div",{className:"rounded-xl border border-dashed border-border/50 p-8 text-center text-xs text-muted-foreground",children:"Keine Modelle."}):ue.map(Z=>{const ae=v.includes(Z.name),me=N===Z.name,re=uf(Z.name),ye=cf(Z.role);return l.jsxs("button",{onClick:()=>E(Z.name),className:ee("flex w-full items-center gap-2.5 rounded-xl border p-2.5 text-left transition-all cursor-pointer",me?"border-primary/60 bg-primary/10":"border-border/40 bg-background/20 hover:border-primary/30 hover:bg-background/40"),children:[l.jsx("span",{className:ee("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border text-[10px] font-bold",re.color),children:re.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate font-mono text-xs font-semibold text-foreground",children:Ua(Z.name)}),l.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[Z.role&&l.jsx("span",{className:ee("h-2 w-2 rounded-sm",ye.dot)}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:Z.role?ct(Z.role).short:"keine Rolle"}),l.jsxs("span",{className:"text-[10px] text-muted-foreground/50",children:["· ",or(Z.size_bytes)]})]})]}),ae?l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[9px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]}):Z.incomplete?l.jsx("span",{className:"shrink-0 text-[9px] font-bold uppercase text-amber-400",children:"⚠ fehlt"}):l.jsx("span",{className:"shrink-0 text-[9px] font-semibold uppercase text-muted-foreground/50",children:"bereit"})]},Z.name)})})]}),l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:pe?l.jsx(JD,{m:pe,warm:v.includes(pe.name),expert:m,protectedRole:b(pe.role),coresident:S(pe.name),onLoad:()=>se(pe.name),onUnload:()=>X(pe.name),onRole:Z=>ne(Z,pe.name),onCtx:()=>te(pe.name,pe.ctx),onSpec:()=>B(pe),onDelete:()=>I(pe.name)}):l.jsxs("div",{className:"flex h-full min-h-[16rem] flex-col items-center justify-center gap-2 text-center text-muted-foreground",children:[l.jsx(pi,{className:"h-8 w-8 opacity-40"}),l.jsx("p",{className:"text-sm font-semibold",children:"Links ein Modell wählen"}),l.jsx("p",{className:"text-xs",children:"Dann verwaltest du es hier — laden, Rolle, Kontext, löschen."})]})})]}),T&&l.jsx(K5,{model:T,onClose:()=>B(null),onChanged:$}),h]})}function JD({m:e,warm:t,expert:r,protectedRole:n,coresident:i,onLoad:o,onUnload:u,onRole:c,onCtx:f,onSpec:h,onDelete:m}){const g=uf(e.name),v=t&&n;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:ee("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border text-sm font-bold",g.color),children:g.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"break-all font-mono text-sm font-bold text-foreground",children:Ua(e.name)}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.role?l.jsx(so,{role:e.role}):l.jsx("span",{className:"rounded border border-dashed border-border/50 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:"keine Rolle"}),n&&l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 text-[10px] text-muted-foreground",title:"Lebenswichtig — geschützt",children:[l.jsx(WN,{className:"mr-0.5 inline h-3 w-3"}),"geschützt"]}),i&&l.jsxs("span",{className:"rounded border border-fuchsia-500/30 bg-fuchsia-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase text-fuchsia-300",children:[l.jsx(xa,{className:"mr-0.5 inline h-3 w-3"}),"Ko-resident"]}),t&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]})]})]})]}),l.jsxs("button",{onClick:t?u:o,disabled:e.incomplete&&!t||v,className:ee("flex h-11 w-full items-center justify-center gap-2 rounded-xl border text-sm font-bold transition-all cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",t?"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),title:v?`„${ct(e.role).label}" bleibt geladen (geschützt).`:void 0,children:[t?l.jsx(LM,{className:"h-4 w-4"}):l.jsx(GN,{className:"h-4 w-4"}),v?"🔒 bleibt geladen":t?"Entladen":"Ins Warm-Set laden"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsx("div",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Rolle"}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.jsx(Jw,{active:!e.role,onClick:()=>c(""),dot:"bg-slate-400",label:"keine"}),T0.map(b=>l.jsx(Jw,{active:e.role===b.role,onClick:()=>c(b.role),dot:cf(b.role).dot,label:b.short},b.role))]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[l.jsx(eR,{icon:fa,label:"Größe",value:or(e.size_bytes)}),l.jsxs("button",{onClick:f,className:"group flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5 text-left transition-colors hover:border-primary/40 cursor-pointer",children:[l.jsx(KN,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Kontext · ändern"}),l.jsx("div",{className:"font-semibold text-foreground",children:xv(e.ctx)})]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Beschleuniger"}),r&&l.jsxs("button",{onClick:h,className:ee("flex h-6 items-center gap-1 rounded-lg border px-2 text-[9px] font-bold uppercase transition-colors cursor-pointer",e.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":e.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),children:[l.jsx(ga,{className:"h-3 w-3"})," Spec"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.spec_active&&l.jsx(Ad,{tone:"emerald",label:"Spec-Decoding aktiv"}),!e.spec_active&&e.spec_draft_model&&l.jsx(Ad,{tone:"amber",label:"Spec inaktiv"}),e.prompt_cache&&l.jsx(Ad,{tone:"cyan",label:"Prompt-Cache"}),e.parallel_slots>1&&l.jsx(Ad,{tone:"violet",label:`${e.parallel_slots} Slots`}),!e.spec_active&&!e.spec_draft_model&&!e.prompt_cache&&e.parallel_slots<=1&&l.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"keine aktiv"})]})]}),l.jsx("div",{className:"flex flex-wrap gap-1",children:l.jsx(bv,{caps:e.capabilities})}),l.jsxs("button",{onClick:m,disabled:n,className:ee("mt-auto flex h-9 items-center justify-center gap-1.5 rounded-lg border text-xs font-semibold transition-colors",n?"cursor-not-allowed border-border/30 text-muted-foreground/40":"border-red-500/30 text-red-400 hover:bg-red-500/10 cursor-pointer"),children:[l.jsx(of,{className:"h-3.5 w-3.5"})," ",n?"geschützt — nicht löschbar":"Modell löschen"]})]})}function Jw({active:e,onClick:t,dot:r,label:n}){return l.jsxs("button",{onClick:t,className:ee("flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-semibold transition-all cursor-pointer",e?"border-primary/60 bg-primary/15 text-foreground":"border-border/40 bg-background/20 text-muted-foreground hover:border-primary/30"),children:[l.jsx("span",{className:ee("h-2 w-2 rounded-sm",r)}),n,e&&l.jsx(qt,{className:"h-3 w-3 text-primary"})]})}function eR({icon:e,label:t,value:r}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5",children:[l.jsx(e,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:t}),l.jsx("div",{className:"font-semibold text-foreground",children:r})]})]})}function Ad({tone:e,label:t}){const r={emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",amber:"bg-amber-500/10 text-amber-400 border-amber-500/20",cyan:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",violet:"bg-violet-500/10 text-violet-400 border-violet-500/20"}[e];return l.jsx("span",{className:ee("rounded border px-1.5 py-0.5 text-[10px] font-semibold",r),children:t})}const tR=[{key:"popular",label:"Beliebt",q:""},{key:"coder",label:"Coder",q:"coder"},{key:"vision",label:"Vision",q:"vision"},{key:"reasoning",label:"Reasoning",q:"reasoning"},{key:"small",label:"Klein (≤4B)",q:"3B"}],rR=["fast","heavy","coder","vision","hermes","scout"],nR=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function ek(e){return nR.format(e)}function iR(){const{data:e}=wi(),t=(e==null?void 0:e.models)??[],[r,n]=y.useState(""),[i,o]=y.useState([]),[u,c]=y.useState(!1),[f,h]=y.useState(""),[m,g]=y.useState("popular"),[v,b]=y.useState(""),[j,k]=y.useState(null),[S,N]=y.useState([]),[E,A]=y.useState("Q4_K_M"),[P,_]=y.useState(""),[O,T]=y.useState(null),[B,$]=y.useState(!1),[z,Q]=y.useState({});async function U(M){c(!0),h("");try{const H=await we(`/api/hf/search?q=${encodeURIComponent(M)}`);o(H.results),H.results.length||h("Keine Ergebnisse.")}catch(H){h(`Suche fehlgeschlagen: ${H}`)}finally{c(!1)}}y.useEffect(()=>{U("")},[]);function ve(M){g(M.key),n(""),U(M.q)}function ue(){g(""),U(r)}async function pe(M,H,ie){$(!1);try{const J=await we(`/api/fit?params_b=0&quant=${encodeURIComponent(H)}&ctx=8192&name=${encodeURIComponent(M)}&role=${encodeURIComponent(ie)}`);T(J)}catch{T(null)}}async function oe(M){if(j===M){k(null);return}k(M),N([]),T(null),_(""),$(!1),h("Analysiere Repository…");try{const H=await we(`/api/hf/quants?repo=${encodeURIComponent(M)}`);N(H.quants);const ie=H.quants.includes("Q4_K_M")?"Q4_K_M":H.quants[0]||"Q4_K_M";A(ie),h(H.quants.length?"":"Keine GGUF-Dateien in diesem Repo gefunden."),H.quants.length&&pe(H.repo,ie,"")}catch(H){h(`Fehler: ${H}`)}}function se(){const M=v.trim();M&&(o(H=>H.some(ie=>ie.repo===M)?H:[{repo:M,downloads:0,likes:0},...H]),b(""),oe(M))}const X=P?t.find(M=>(M.role||"").toLowerCase()===P):void 0;async function ne(M){if((O==null?void 0:O.fit.level)==="too_tight"&&!B){$(!0);return}Q(H=>({...H,[M]:"Starte…"}));try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:M,quant:E,role:P||void 0,jinja:!0})}),Q(H=>({...H,[M]:"Download läuft"})),$(!1)}catch{Q(ie=>({...ie,[M]:"Fehler"}))}}const te=M=>{var ie;const H=((ie=M.split("/").pop())==null?void 0:ie.toLowerCase().replace(/-gguf$/i,""))||"";return H.length>3&&t.some(J=>J.name.toLowerCase().includes(H))},I=M=>M==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":M==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(lh,{className:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx("input",{value:r,onChange:M=>n(M.target.value),onKeyDown:M=>M.key==="Enter"&&ue(),"aria-label":"HuggingFace durchsuchen",type:"search",spellCheck:!1,placeholder:"HuggingFace durchsuchen (z.B. Qwen Coder, Llama-3.1, gemma)…",className:"w-full h-10 pl-9 pr-3 rounded-xl border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),l.jsx("button",{onClick:ue,className:"h-10 px-5 rounded-xl bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer",children:"Suchen"})]}),l.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:tR.map(M=>l.jsxs("button",{onClick:()=>ve(M),className:ee("flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-semibold transition-all cursor-pointer border",m===M.key?"bg-primary/15 text-primary border-primary/30":"border-border/50 text-muted-foreground hover:text-foreground hover:border-border"),children:[M.key==="popular"&&l.jsx(wM,{className:"h-3 w-3"}),M.label]},M.key))}),u?l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:"Lade GGUF-Modelle von HuggingFace…"}):l.jsxs("div",{className:"space-y-2",children:[i.map(M=>{const H=j===M.repo,ie=te(M.repo),J=M.repo.includes("/")?M.repo.split("/")[0]:"—",Z=M.repo.split("/").pop();return l.jsxs("div",{className:ee("rounded-xl border bg-card/45 backdrop-blur-md transition-all",H?"border-primary/40 shadow-lg shadow-primary/5":"border-border/50 hover:border-primary/30"),children:[l.jsxs("button",{onClick:()=>oe(M.repo),className:"w-full flex items-center gap-3 p-3.5 text-left cursor-pointer",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs font-bold font-mono text-foreground truncate max-w-[280px]",title:M.repo,children:Z}),ie&&l.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-1.5 py-0.5 rounded",children:[l.jsx(qt,{className:"h-2.5 w-2.5"})," installiert"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-3 mt-0.5 font-mono",children:[l.jsx("span",{children:J}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Ds,{className:"h-3 w-3"})," ",ek(M.downloads)]}),M.likes>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(EM,{className:"h-3 w-3"})," ",ek(M.likes)]})]})]}),H?l.jsx(zN,{className:"h-4 w-4 text-muted-foreground shrink-0"}):l.jsx($N,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),H&&l.jsx("div",{className:"border-t border-border/30 p-3.5 space-y-3",children:S.length===0?l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono",children:f||"Lade Quants…"}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Quant"}),l.jsx("select",{value:E,onChange:ae=>{A(ae.target.value),pe(M.repo,ae.target.value,P)},"aria-label":"Quantisierung",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:S.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))}),l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground ml-1",children:"Rolle"}),l.jsxs("select",{value:P,onChange:ae=>{_(ae.target.value),pe(M.repo,E,ae.target.value)},"aria-label":"Rolle",title:"Optional — bestimmt Auto-Konfiguration + setup-bewussten Kontext",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:[l.jsx("option",{value:"",className:"bg-popover text-foreground",children:"keine"}),rR.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))]}),l.jsx("button",{onClick:()=>ne(M.repo),disabled:!!z[M.repo]&&z[M.repo]==="Download läuft",className:ee("h-8 px-3.5 ml-auto rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5",B?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"),children:z[M.repo]?z[M.repo]:B?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"h-3.5 w-3.5"})," OOM — trotzdem laden"]}):l.jsxs(l.Fragment,{children:[l.jsx(Ds,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]}),O&&l.jsxs("div",{className:ee("flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium",I(O.fit.level)),children:[l.jsx("span",{className:"font-bold uppercase tracking-wide",children:O.fit.text}),l.jsxs("span",{className:"font-mono opacity-90",children:["~",O.params_b,"B · ~",O.fit.req_gb," GB / ",O.sys_ram_gb," GB · ~",O.fit.tps," t/s"]}),O.fit.level!=="too_tight"?l.jsxs("span",{className:"font-mono opacity-80",children:["ctx → ",(O.assigned_ctx/1024).toFixed(0),"k"]}):l.jsx("span",{className:"opacity-90",children:"— passt nicht, würde beim Laden abstürzen (OOM)."})]}),X&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-400",children:[l.jsx(Er,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),l.jsxs("span",{children:["Rolle ",l.jsxs("strong",{children:["„",P,'"']})," hält aktuell ",l.jsx("strong",{children:X.name.split("/").pop()})," — wird beim Download übernommen."]})]})]})})]},M.repo)}),!i.length&&!u&&l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:f||"Keine Ergebnisse."})]}),l.jsxs("div",{className:"border-t border-border/30 pt-4 flex flex-col sm:flex-row gap-2 items-stretch sm:items-center",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground shrink-0",children:"Direkt:"}),l.jsx("input",{value:v,onChange:M=>b(M.target.value),onKeyDown:M=>M.key==="Enter"&&se(),"aria-label":"Repository oder URL direkt eingeben",spellCheck:!1,placeholder:"org/repo oder HF-URL (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground font-mono"}),l.jsx("button",{onClick:se,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Laden"})]})]})}const aR={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ga},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:xa},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Ts},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:yu},hermes:{title:"Lucys Hirn (Agent)",desc:"Lucys dauer-warmes Agent-Hirn mit Tool-Calling — bleibt ko-resident, lädt nie kalt nach.",icon:uM},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:lv}};function oR(){const{data:e,isLoading:t,error:r}=UD(),{data:n}=wi(),{data:i}=gh(),o=(n==null?void 0:n.models)??[],u=r?String(r):"",[c,f]=y.useState({}),[h,m]=y.useState({}),[g,v]=y.useState("recommended");async function b(j,k,S,N){f(E=>({...E,[j]:"Starte..."}));try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:k,quant:S,jinja:N})}),f(E=>({...E,[j]:"Download läuft"}))}catch{f(A=>({...A,[j]:"Fehler"}))}}return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 w-fit",children:[["recommended","Empfohlen"],["browse","Stöbern & Suchen"]].map(([j,k])=>l.jsx("button",{onClick:()=>v(j),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide transition-all cursor-pointer",g===j?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:k},j))}),g==="browse"?l.jsx(iR,{}):t?l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):u||!e?l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",u,")."]}):l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[l.jsxs("div",{children:["Modell-Registry geladen für ",l.jsxs("span",{className:"text-foreground font-bold",children:[e.sys_ram_gb," GB"]})," System-RAM."]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(VM,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),l.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),l.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:e.categories.map(j=>{const k=aR[j.role]||{title:j.title||j.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:HN},S=k.icon,N=o.find(T=>T.role===j.role||(T.aliases||[]).includes(j.role)),E=i==null?void 0:i.model_list.find(T=>T.role===j.role),A=j.models.find(T=>T.repo===j.recommended)||j.models[0];if(!A)return null;const P=c[A.repo],_=j.models.filter(T=>T.repo!==j.recommended),O=!!h[j.role];return l.jsxs("div",{className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",N?"border-border/60":"border-primary/20 shadow-primary/5"),children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:l.jsx(S,{className:"h-5.5 w-5.5"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:k.title}),l.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",j.role]})]})]}),N?l.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):l.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:k.desc}),l.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:N?l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:N.name,children:N.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[l.jsxs("span",{children:["Größe: ",yv(N.size_bytes||0)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",N.quant||"GGUF"]})]})]}):l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[l.jsxs("span",{children:["Ersteller: ",A.author]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",A.quant]})]}),l.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:l.jsx(QD,{fit:A.fit})})]})}),l.jsx("div",{className:"pt-1",children:N?E?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),l.jsxs("span",{children:["Bessere Version in der Registry: ",E.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>b(E.repo,j.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!c[E.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[l.jsx(Ds,{className:"h-3.5 w-3.5"}),c[E.repo]||"Auf neue Version aktualisieren"]})]}):l.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[l.jsx(qt,{className:"h-4 w-4"})," Auf neuestem Stand"]}):l.jsxs("button",{onClick:()=>b(A.repo,j.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!P,className:ee("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",P?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[l.jsx(Ds,{className:"h-3.5 w-3.5"}),P||"Optimales Modell einsetzen"]})})]}),_.length>0&&l.jsxs("div",{className:"border-t border-border/20 pt-3",children:[l.jsxs("button",{onClick:()=>m(T=>({...T,[j.role]:!O})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[O?l.jsx(zN,{className:"h-3 w-3"}):l.jsx($N,{className:"h-3 w-3"}),l.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",_.length,")"]})]}),O&&l.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:_.map(T=>l.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:T.name,children:T.name}),l.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[l.jsxs("span",{children:["Quant: ",T.quant]}),l.jsx("span",{children:"•"}),l.jsx("span",{children:T.fit.text})]})]}),l.jsx("button",{onClick:()=>b(T.repo,j.role,T.quant||"Q4_K_M",T.caps.tools!=="no"),disabled:!!c[T.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:c[T.repo]||"Installieren"})]},T.repo))})]})]},j.role)})})]})]})}function sR(){const[e,t]=y.useState("cockpit");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),l.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(r=>l.jsx("button",{onClick:()=>t(r),className:ee("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:r==="cockpit"?"Werkbank":"Modelle finden"},r))})]}),l.jsx(GD,{}),l.jsx("div",{className:"transition-all duration-300",children:e==="cockpit"?l.jsx(ZD,{}):l.jsx(oR,{})})]})}const lR={zed:"Zed: settings.json",kilo:"Kilo: Einstellungen → API Provider",claude_code:"env / Übersetzer"};function tk({line:e,loading:t}){return t||!e?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-muted-foreground",children:[l.jsx(Vs,{className:"h-3 w-3 animate-spin"})," prüfe…"]}):e.ok?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-emerald-400",children:[l.jsx(FN,{className:"h-3 w-3"})," ",e.detail]}):l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-red-400",children:[l.jsx(pM,{className:"h-3 w-3"})," ",e.detail]})}function rk({tool:e,fileName:t,accent:r,copied:n,onCopy:i}){return l.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[l.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),l.jsx("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:l.jsx("span",{children:t})}),l.jsxs("button",{onClick:i,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[n?l.jsx(qt,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(uv,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:n?"Kopiert":"Kopieren"})]})]}),l.jsx("pre",{className:ee("p-5 overflow-x-auto text-xs font-mono whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",r==="teal"?"text-cyan-200/90":"text-violet-200/90"),children:l.jsx("code",{children:e.snippet})})]})}function G5(){const[e,t]=y.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[r,n]=y.useState(localStorage.getItem("mc_mcp_path")||""),[i,o]=y.useState("zed"),[u,c]=y.useState(null),f=new URLSearchParams({host:e});r&&f.set("mcp_path",r);const{data:h,error:m}=WD(f.toString()),{data:g,isLoading:v}=H5(),b=m?String(m):"";function j(E){t(E),E&&localStorage.setItem("mc_host",E)}function k(E){n(E),localStorage.setItem("mc_mcp_path",E)}const S=h==null?void 0:h.tools[i];async function N(E,A){A&&(await navigator.clipboard.writeText(A),c(E),setTimeout(()=>c(null),1500))}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Binde deinen lokalen Agenten an die Box an — über ",l.jsx("span",{className:"text-foreground",children:"zwei getrennte Leitungen"}),": das Modell (Gateway) und das geteilte Gedächtnis (MCP)."]})]}),l.jsxs("div",{className:"p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-[170px_1fr] items-center",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background/40 p-4 text-center",children:[l.jsx(CM,{className:"h-7 w-7 mx-auto text-muted-foreground"}),l.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:"Dein lokaler Agent"}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Cline · Cursor · Zed …"})]}),l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(rf,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-primary/25 bg-primary/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-primary",children:[l.jsx(pi,{className:"h-3.5 w-3.5"})," Leitung 1 — Modell"]}),l.jsx(tk,{line:g==null?void 0:g.gateway,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-primary/80",children:"Gateway · :9001/v1 · Lanes chat / coding"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(rf,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-violet-500/25 bg-violet-500/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-violet-300",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Leitung 2 — Gedächtnis"]}),l.jsx(tk,{line:g==null?void 0:g.memory,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-violet-300/80",children:"MCP · mcp_memory.py · separat"})]})]})]})]}),l.jsxs("p",{className:"mt-3.5 text-[11px] text-muted-foreground leading-relaxed",children:["Der Gateway liefert ",l.jsx("span",{className:"text-foreground",children:"nur das LLM"}),". Das geteilte Gedächtnis läuft über einen",l.jsx("span",{className:"text-foreground",children:" eigenen MCP-Server"})," — beide werden unabhängig eingerichtet."]})]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(NM,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),l.jsx("input",{value:e,onChange:E=>j(E.target.value),"aria-label":"Box LAN IP-Adresse",spellCheck:!1,placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(kM,{className:"h-3.5 w-3.5 text-violet-400"})," Lokaler MCP-Scriptpfad",l.jsx("span",{className:"text-violet-400/70 normal-case font-semibold tracking-normal",children:"(nur Leitung 2)"})]}),l.jsx("input",{value:r,onChange:E=>k(E.target.value),"aria-label":"Lokaler MCP-Scriptpfad",spellCheck:!1,placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-violet-500/50 text-foreground"})]})]}),b&&l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",b]}),h&&l.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-primary/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-primary/15 text-primary text-[11px]",children:"1"}),"Modell anbinden"]}),l.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Wähle dein Tool — das Snippet zeigt auf den Gateway."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(h.tools).map(([E,A])=>l.jsx("button",{onClick:()=>o(E),className:ee("rounded-lg px-3 py-1.5 text-[11px] font-semibold tracking-wide transition-all cursor-pointer",i===E?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"border border-border/50 text-muted-foreground hover:text-foreground"),children:A.label},E))}),S&&l.jsxs(l.Fragment,{children:[S.note&&l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(kw,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:S.note})]}),l.jsx(rk,{tool:S,fileName:lR[i]||"config.json",accent:"teal",copied:u==="model",onCopy:()=>N("model",S.snippet)})]})]}),l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-violet-500/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-violet-500/15 text-violet-300 text-[11px]",children:"2"}),"Gedächtnis anbinden",l.jsx("span",{className:"text-[10px] font-medium text-muted-foreground normal-case",children:"optional"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Ein MCP-Block — gilt zusätzlich für ",l.jsx("em",{children:"jedes"})," Tool aus Schritt 1."]})]}),l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-violet-500/5 border border-violet-500/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(kw,{className:"h-4 w-4 text-violet-400 shrink-0 mt-0.5"}),l.jsx("span",{children:h.memory.note})]}),l.jsx(rk,{tool:h.memory,fileName:"mcp.json",accent:"violet",copied:u==="memory",onCopy:()=>N("memory",h.memory.snippet)})]})]})]})}const uR="modulepreload",cR=function(e){return"/"+e},nk={},dR=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=u(r.map(h=>{if(h=cR(h),h in nk)return;nk[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":uR,m||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((b,j)=>{v.addEventListener("load",b),v.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return i.then(u=>{for(const c of u||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};class fR extends y.Component{constructor(){super(...arguments);Xo(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?l.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[l.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),l.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const hR=y.lazy(()=>dR(()=>import("./GraphView-yMisqyGY.js"),[]).then(e=>({default:e.GraphView}))),Cd=["identity","knowledge","rules","events"],ik=new Set(["auto","agent","hermes"]),dg={identity:{label:"Identität",icon:QM,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:qs,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:BM,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:BN,bg:"bg-amber-500/10",text:"text-amber-400"}},ak={label:"Gedächtnis",icon:sv,text:"text-muted-foreground"},mR={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},ok=`Hi Hermes! Lass uns ein kurzes Onboarding machen, damit du dich künftig an mich erinnerst. Stell mir nacheinander ein paar kurze Fragen zu: 1) wer ich bin und woran ich gerade arbeite, 2) wie ich angesprochen werden möchte, 3) meine bevorzugten Tools, Sprachen und Arbeitsweise, 4) wichtige Regeln/Konventionen, die du beachten sollst, 5) meine Infrastruktur (Server, Dienste – ohne Geheimnisse). -Frag immer nur eine Sache auf einmal und fass am Ende zusammen, was du dir gemerkt hast.`;function V5(){const[e,t]=y.useState(""),[r,n]=y.useState(""),[i,o]=y.useState(""),[u,c]=y.useState("knowledge"),[f,h]=y.useState(!1),[m,g]=y.useState(!1),[v,b]=y.useState("liste"),[j,k]=y.useState(!1),S=Kn(),{showAlert:N,showConfirm:E,dialogElement:A}=ba(),{data:P=[]}=vv({}),{data:_=[],error:O}=vv({q:r,category:e}),{data:T}=$D(v==="graph"),B=O?String(O):"",$=()=>{S.invalidateQueries({queryKey:["memory"]}),S.invalidateQueries({queryKey:["memory-graph"]})},z=y.useMemo(()=>{const I=P.length,M=P.filter(H=>ik.has(H.source)).length;return{total:I,auto:M,manual:I-M,cats:new Set(P.map(H=>H.category)).size}},[P]),Q=P.length===0,U=y.useMemo(()=>{const I=T??{nodes:[],edges:[]};if(!r.trim())return I;const M=r.toLowerCase(),H=I.nodes.filter(J=>J.content.toLowerCase().includes(M)),ie=new Set(H.map(J=>J.id));return{nodes:H,edges:I.edges.filter(J=>ie.has(J.source)&&ie.has(J.target))}},[T,r]),ve=y.useMemo(()=>{const I={};return _.forEach(M=>{var H;(I[H=M.category]??(I[H]=[])).push(M)}),I},[_]),ue=y.useMemo(()=>_.filter(I=>!Pd.includes(I.category)),[_]);async function pe(){i.trim()&&(await we("/api/memory",{method:"POST",body:JSON.stringify({content:i,category:u,source:"ui"})}),o(""),k(!1),$())}function oe(I){E("Eintrag löschen?","Diesen Gedächtnis-Eintrag dauerhaft entfernen?",async()=>{try{await we(`/api/memory/${I}`,{method:"DELETE"}),$()}catch(M){N("Fehler",`Löschen fehlgeschlagen: ${M.message||M}`)}})}async function se(){try{await navigator.clipboard.writeText(ok),g(!0),setTimeout(()=>g(!1),1800)}catch{N("Kopieren fehlgeschlagen","Markiere den Prompt und kopiere ihn manuell (Strg+C).")}}function X(){se(),window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"terminal"}}))}async function ne(){h(!0);try{const I=await we("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(I.duplicate_count===0){N("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}E("Deduplizierung bestätigen",`${I.duplicate_count} Dublette(n) in ${I.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await we("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),$()}catch(M){N("Fehler",`Fehler beim Löschen: ${M.message}`)}})}catch(I){N("Fehler",`Fehler bei der Deduplizierung: ${I.message}`)}finally{h(!1)}}const te=({value:I,label:M,accent:H})=>l.jsxs("span",{className:ee("flex items-center gap-1.5 text-[11px] rounded-lg px-2.5 py-1 border",H==="auto"?"text-emerald-400 bg-emerald-500/[0.07] border-emerald-500/20":"text-muted-foreground bg-card/40 border-border/50"),children:[H==="auto"&&l.jsx(fs,{className:"h-3 w-3"}),l.jsx("b",{className:ee("font-semibold",H==="auto"?"":"text-foreground"),children:I})," ",M]});return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geteilte Konstitution — Hermes, IDEs & Gateway lesen und lernen hier per MCP."})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{value:r,onChange:I=>n(I.target.value),"aria-label":"Gedächtnis durchsuchen",type:"search",placeholder:"Semantisch suchen…",className:"w-52 h-9 pl-8 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),l.jsx(lh,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.jsxs("button",{onClick:()=>k(I=>!I),className:"h-9 px-3 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[l.jsx(cv,{className:"h-4 w-4"})," Eintrag"]}),l.jsx("div",{className:"flex items-center gap-1 p-1 bg-card/30 border border-border/40 rounded-lg",children:[["liste",_M,"Liste"],["graph",UM,"Graph"]].map(([I,M,H])=>l.jsxs("button",{onClick:()=>b(I),className:ee("flex h-7 px-2.5 items-center gap-1.5 text-[11px] font-semibold rounded-md transition-all cursor-pointer",v===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(M,{className:"h-3.5 w-3.5"})," ",H]},I))}),l.jsx("button",{onClick:ne,disabled:f,className:"flex h-9 w-9 items-center justify-center rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50","aria-label":"Duplikate bereinigen",title:"Deduplizieren",children:l.jsx(fs,{className:"h-4 w-4 text-primary","aria-hidden":"true"})})]})]}),!Q&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(te,{value:z.total,label:"Fakten"}),l.jsx(te,{value:z.auto,label:"auto gelernt",accent:"auto"}),l.jsx(te,{value:z.manual,label:"manuell"}),l.jsx(te,{value:z.cats,label:"Kategorien"}),l.jsxs("span",{className:"ml-auto text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(fs,{className:"h-3 w-3 text-emerald-400"})," lernt automatisch aus Hermes-Gesprächen"]})]}),j&&l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),l.jsx("button",{onClick:()=>k(!1),"aria-label":"Schließen",className:"text-muted-foreground hover:text-foreground",children:l.jsx(gi,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("textarea",{value:i,onChange:I=>o(I.target.value),rows:2,"aria-label":"Eintragstext",placeholder:"Eine Regel, Vorliebe oder einen stabilen Fakt über dich oder das Projekt…",className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground leading-relaxed"}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsx("select",{value:u,onChange:I=>c(I.target.value),"aria-label":"Kategorie",className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Pd.map(I=>{var M;return l.jsx("option",{value:I,className:"bg-popover text-foreground",children:((M=dg[I])==null?void 0:M.label)||I},I)})}),l.jsxs("button",{onClick:pe,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer",children:[l.jsx(cv,{className:"h-4 w-4"})," Speichern"]})]})]}),B&&l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler: ",B]}),Q?l.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 sm:p-10 flex flex-col items-center text-center gap-5",children:[l.jsx("div",{className:"h-14 w-14 rounded-2xl bg-primary/10 flex items-center justify-center",children:l.jsx(IM,{className:"h-7 w-7 text-primary"})}),l.jsxs("div",{className:"space-y-1.5 max-w-lg",children:[l.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Lass Hermes dich kennenlernen"}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Statt Fakten einzutippen: führ ein kurzes Onboarding-Gespräch mit Hermes. Was ihr besprecht, merkt sich das Gedächtnis automatisch — du musst nichts manuell pflegen."})]}),l.jsxs("div",{className:"w-full max-w-lg text-left",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Sende das an Hermes"}),l.jsx("button",{onClick:se,className:"flex items-center gap-1 text-[10px] font-semibold text-muted-foreground hover:text-foreground transition-colors",children:m?l.jsxs(l.Fragment,{children:[l.jsx(qt,{className:"h-3 w-3 text-emerald-400"})," Kopiert"]}):l.jsxs(l.Fragment,{children:[l.jsx(uv,{className:"h-3 w-3"})," Kopieren"]})})]}),l.jsx("pre",{className:"w-full rounded-xl border border-border/60 bg-background/40 p-3.5 text-[11px] leading-relaxed text-foreground/90 whitespace-pre-wrap font-mono",children:ok})]}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[l.jsxs("button",{onClick:X,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer",children:[l.jsx(YN,{className:"h-4 w-4"})," Im Terminal starten"]}),l.jsxs("button",{onClick:se,className:"h-9 px-4 rounded-lg border border-border/60 bg-card text-xs font-semibold hover:border-primary/50 transition-all flex items-center gap-1.5 cursor-pointer",children:[m?l.jsx(qt,{className:"h-4 w-4 text-emerald-400"}):l.jsx(uv,{className:"h-4 w-4"})," Prompt kopieren"]})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(BM,{className:"h-3 w-3"})," Funktioniert genauso über Telegram —"," ",l.jsx("button",{onClick:()=>k(!0),className:"underline hover:text-foreground",children:"oder lieber manuell anlegen"}),"."]})]}):v==="graph"?l.jsx(dR,{children:l.jsx(y.Suspense,{fallback:l.jsx("div",{className:"h-[480px] rounded-2xl border border-border/60 bg-card/30 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:l.jsx(fR,{data:U,onDelete:oe})})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl w-fit",children:[l.jsx("button",{onClick:()=>t(""),className:ee("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Pd.map(I=>{const M=dg[I]||ak,H=M.icon;return l.jsxs("button",{onClick:()=>t(I),className:ee("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1",e===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(H,{className:"h-3 w-3"})," ",M.label]},I)})]}),_.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):l.jsx("div",{className:"space-y-5",children:[...Pd,"__other"].map(I=>{const M=I==="__other"?ue:ve[I]||[];if(!M.length)return null;const H=dg[I]||ak,ie=H.icon;return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[l.jsx(ie,{className:ee("h-3.5 w-3.5",H.text)}),l.jsx("span",{className:ee("text-[11px] font-bold uppercase tracking-wider",H.text),children:H.label}),l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 bg-card/50 rounded px-1.5 py-0.5",children:M.length}),l.jsx("div",{className:"ml-1 h-px flex-1 bg-border/30"})]}),l.jsx("div",{className:"space-y-2",children:M.map(J=>{const Z=ik.has(J.source);return l.jsxs("div",{className:ee("flex items-start justify-between gap-4 p-3.5 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 hover:border-primary/20 transition-all group",hR[J.category]||"border-l-muted"),children:[l.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1 min-w-0",children:J.content}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[typeof J.score=="number"&&l.jsxs("span",{className:"text-[9px] font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded",title:"Relevanz der semantischen Suche",children:[Math.round(J.score*100),"%"]}),l.jsxs("span",{className:ee("flex items-center gap-1 text-[9px] font-mono px-1.5 py-0.5 rounded",Z?"text-emerald-400 bg-emerald-500/10":"text-muted-foreground/60 bg-background/20"),title:Z?"Automatisch gelernt":"Manuell angelegt",children:[Z&&l.jsx(fs,{className:"h-2.5 w-2.5"}),J.source]}),l.jsx("button",{onClick:()=>oe(J.id),"aria-label":"Eintrag löschen",title:"Eintrag löschen",className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",children:l.jsx(of,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]},J.id)})})]},I)})})]}),A]})}const mR=["chat","coding","fast","heavy"];function q5(){const{data:e,error:t}=ph(5e3),{data:r}=wi(),{showAlert:n,dialogElement:i}=ba(),o=Kn(),u=t?String(t):"",[c,f]=y.useState(!1),h=(r==null?void 0:r.models)??[];async function m(v){try{await we("/api/agent/brain",{method:"POST",body:JSON.stringify({model:v})}),n("Erledigt",`Hermes-Hirn zeigt jetzt auf das Alias '${v}'. Der Gateway-Dienst wurde neu gestartet.`),o.invalidateQueries({queryKey:Be.agentStatus}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}async function g(v){try{await we("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:v})}),n("Erledigt","Agent-Hirn gewechselt (warm gehalten). Gateway wurde neugestartet."),o.invalidateQueries({queryKey:Be.agentStatus}),o.invalidateQueries({queryKey:Be.models}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Hermes Agenten-Cockpit"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",l.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(e==null?void 0:e.terminal_url)&&l.jsxs("a",{href:lf(e.terminal_url),target:"_blank",rel:"noopener",className:ee("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",e.terminal_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[l.jsx(sh,{className:"h-4 w-4"}),l.jsx("span",{children:"Terminal öffnen"})]})]}),u&&l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",u,")."]}),e&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(yn,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Fluss"})]}),l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-stretch gap-3",children:[l.jsxs("button",{onClick:()=>e.terminal_reachable&&window.open(lf(e.terminal_url),"_blank"),title:e.terminal_reachable?"Hermes-Terminal öffnen":"Terminal offline",className:"lg:w-40 shrink-0 rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/40 transition-all cursor-pointer flex flex-col justify-center",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(oh,{className:ee("h-3.5 w-3.5",e.terminal_reachable?"text-emerald-400":"text-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Terminal"}),l.jsx("span",{className:ee("ml-auto h-1.5 w-1.5 rounded-full animate-pulse",e.terminal_reachable?"bg-emerald-500":"bg-amber-500")})]}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono mt-0.5",children:"hermes chat · Clients"})]}),l.jsx("div",{className:"hidden lg:flex items-center text-muted-foreground text-lg select-none",children:"→"}),l.jsxs("div",{className:"flex-1 flex flex-col gap-2.5",children:[l.jsxs("div",{className:"rounded-xl border border-primary/40 bg-primary/5 px-3.5 py-2.5 flex items-center gap-2",children:[l.jsx(yn,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold text-primary",children:"Agent Gateway"}),l.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:":8642"}),l.jsxs("span",{className:ee("ml-auto inline-flex items-center gap-1.5 text-[10px] font-bold uppercase font-mono px-2 py-0.5 rounded-full border",e.gateway_reachable?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-red-500/10 text-red-400 border-red-500/20"),children:[l.jsx("span",{className:ee("h-1.5 w-1.5 rounded-full",e.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-red-500")}),e.gateway_reachable?"online":"offline"]})]}),l.jsxs("div",{className:"grid gap-2.5 sm:grid-cols-3",children:[l.jsxs("button",{onClick:()=>f(!0),className:"rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/45 transition-all cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(pi,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Hirn"}),l.jsx("span",{className:"ml-auto text-[9px] text-primary/70 font-bold uppercase",children:"wechseln →"})]}),l.jsx("div",{className:"text-[11px] font-mono font-medium text-foreground truncate mt-1",title:e.brain_model,children:e.brain_model||"chat"})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(Gu,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),l.jsxs("div",{className:"text-[10px] font-mono mt-1 flex flex-wrap gap-x-2 text-muted-foreground",children:[l.jsxs("span",{children:["Config: ",e.has_config?"✓":"—"]}),l.jsxs("span",{children:["Skills: ",e.has_skills?"✓":"—"]}),l.jsxs("span",{children:["Memory: ",e.has_memories?"✓":"—"]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(jw,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"PC"}),l.jsx("span",{className:ee("ml-auto h-1.5 w-1.5 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")})]}),l.jsxs("div",{className:ee("text-[11px] font-mono mt-1",e.pc_executor_reachable?"text-emerald-400":"text-muted-foreground"),children:[":7777 ",e.pc_executor_reachable?"verbunden":"offline"]})]})]})]})]})]}),l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jw,{className:"h-5 w-5 text-primary"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{children:["Der ",l.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),l.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),l.jsx("div",{className:"space-y-3",children:e.pc_executor_reachable?l.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[l.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),l.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",l.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",l.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",l.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),l.jsxs("p",{children:["Starte ",l.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",l.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),l.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!e.gateway_reachable&&l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Qs,{className:"h-5 w-5 text-amber-500"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[l.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),l.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",l.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),l.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[l.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-terminal"})]}),l.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",l.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),e&&c&&l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":"Hermes-Hirn konfigurieren",children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(pi,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes-Hirn konfigurieren"})]}),l.jsx("button",{onClick:()=>f(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Lane / Gateway-Alias"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:mR.map(v=>{const b=e.brain_model===v;return l.jsxs("button",{onClick:()=>m(v),className:ee("px-3 py-1.5 rounded-lg text-xs font-mono font-semibold border transition-all cursor-pointer flex items-center gap-1.5",b?"border-primary/40 bg-primary/10 text-primary":"border-border/30 bg-background/20 text-foreground hover:bg-accent"),children:[v,b&&l.jsx(qt,{className:"h-3.5 w-3.5"})]},v)})}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70",children:["Schlank & flexibel: das Hirn folgt dem Lane-Routing (z.B. ",l.jsx("code",{className:"text-primary",children:"chat"})," = fast↔heavy)."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Installiertes Modell (warm gehalten)"}),l.jsx("div",{className:"space-y-1.5 max-h-56 overflow-y-auto pr-1",children:h.map(v=>{var j;const b=v.role==="hermes";return l.jsxs("button",{onClick:()=>!b&&g(v.name),disabled:b||v.incomplete,className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",b?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":v.incomplete?"border-border/20 bg-background/10 text-muted-foreground/50 cursor-not-allowed":"border-border/30 bg-background/20 text-foreground hover:bg-accent cursor-pointer"),children:[l.jsxs("div",{className:"flex flex-col min-w-0",children:[l.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(j=v.name.split("/").pop())==null?void 0:j.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[v.capabilities.params_b?`${v.capabilities.params_b}B`:"?"," · ",v.capabilities.tools!=="no"?"Tools ✓":"ohne Tools",v.role&&` · Rolle: ${v.role}`]})]}),b?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[l.jsx(qt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Warm setzen →"})]},v.name)})})]}),l.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[l.jsx("span",{children:"💡"}),l.jsxs("span",{children:["Für einen ",l.jsx("strong",{children:"Agenten"}),' sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl. Neues Modell? Erst über „Modell-Manager → Modelle finden" laden.']})]})]})}),i]})}function pR(){const{data:e}=ph(5e3),t=e!=null&&e.terminal_url?lf(e.terminal_url):void 0,r=e==null?void 0:e.terminal_reachable;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Hermes Terminal"}),l.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Interaktiver Agent (",l.jsx("code",{className:"rounded bg-background/40 px-1 font-mono text-[11px] text-primary",children:"hermes chat"}),') mit Tools & PC-Steuerung — „mehr als Chatten".']})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[l.jsx("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500 animate-pulse":"bg-amber-500"}`}),r?"online":"offline"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[l.jsx(sh,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?l.jsxs("div",{className:"relative min-h-[68vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&l.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[l.jsx(Er,{className:"h-8 w-8 text-amber-400"}),l.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Terminal nicht erreichbar"}),l.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",l.jsx("code",{className:"font-mono text-primary",children:"hermes-terminal"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",l.jsx("code",{className:"font-mono",children:"systemctl --user restart hermes-terminal"}),"."]})]}),l.jsx("iframe",{src:t,title:"Hermes Terminal",className:"h-full w-full border-0",style:{minHeight:"68vh"}})]}):l.jsxs("div",{className:"flex min-h-[68vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[l.jsx(Rs,{className:"mr-2 h-4 w-4"})," Lade Terminal…"]})]})}function gR(){const{data:e}=ph(5e3),t=e!=null&&e.box_console_url?lf(e.box_console_url):void 0,r=e==null?void 0:e.box_console_reachable;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Konsole"}),l.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Direkte Shell auf der Box — wie ein SSH-Fenster, mitten im Browser."})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full",r?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r?"online":"offline"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[l.jsx(sh,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?l.jsxs("div",{className:"relative min-h-[58vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&l.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[l.jsx(Er,{className:"h-8 w-8 text-amber-400"}),l.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),l.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",l.jsx("code",{className:"font-mono text-primary",children:"box-console"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",l.jsx("code",{className:"font-mono",children:"systemctl --user restart box-console"}),"."]})]}),l.jsx("iframe",{src:t,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):l.jsxs("div",{className:"flex min-h-[58vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[l.jsx(Rs,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}const sk=[{id:"grundlagen",label:"Grundlagen"},{id:"moe",label:"MoE & Quant"},{id:"lokal",label:"Lokal betreiben"},{id:"modelle",label:"Modell-Landschaft"},{id:"gateway",label:"Gateway-Trick"},{id:"mcp",label:"MCP"},{id:"skills",label:"Skills"},{id:"memory",label:"Gedächtnis & RAG"},{id:"agents",label:"Agenten"},{id:"ide",label:"IDE anbinden"},{id:"tricks",label:"Tricks & Kniffe"},{id:"wartung",label:"Sicherheit & Wartung"},{id:"ressourcen",label:"Ressourcen"},{id:"troubleshooting",label:"Troubleshooting"}];function vR(e){var t;(t=document.getElementById(e))==null||t.scrollIntoView({behavior:"smooth",block:"start"})}function Ir({id:e,icon:t,color:r,title:n,kicker:i,children:o,wide:u}){return l.jsxs("section",{id:e,className:ee("scroll-mt-20 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-3",u&&"md:col-span-2"),children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(t,{className:ee("h-5 w-5 shrink-0",r)}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:n}),i&&l.jsx("span",{className:ee("text-[9px] font-mono",r),children:i})]})]}),l.jsx("div",{className:"text-xs text-muted-foreground space-y-2.5 leading-relaxed",children:o})]})}function La({children:e}){return l.jsxs("div",{className:"mt-1 rounded-xl border border-primary/25 bg-primary/[0.06] p-3 text-[11px] leading-relaxed",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-primary mb-1",children:[l.jsx(fs,{className:"h-3 w-3"})," Bei dir konkret"]}),l.jsx("div",{className:"text-muted-foreground space-y-1",children:e})]})}function ze({children:e}){return l.jsx("code",{className:"rounded bg-background/40 border border-border/30 px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e})}function kt({href:e,name:t,note:r}){return l.jsxs("li",{className:"leading-relaxed",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold inline-flex items-center gap-0.5",children:[t,l.jsx(aM,{className:"h-3 w-3 opacity-60"})]}),l.jsxs("span",{className:"text-muted-foreground",children:[" — ",r]})]})}function yR(){const[e,t]=y.useState(!1);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 flex items-start gap-4",children:[l.jsx("div",{className:"h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center shrink-0",children:l.jsx(sv,{className:"h-6 w-6 text-primary"})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Die AI-Bibel"}),l.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl",children:["Allgemeines Nachschlagewerk für lokale & agentische AI — Konzepte, Tricks, Kniffe und kuratierte Quellen. ",l.jsx("span",{className:"font-semibold text-foreground",children:"Stand Juni 2026."})," ","Das meiste gilt überall; ",l.jsx("span",{className:"text-primary font-semibold",children:'„Bei dir konkret"'}),"-Kästen zeigen, was dein Stack daraus macht."]})]})]}),l.jsx("div",{className:"sticky top-0 z-10 -mx-1 px-1",children:l.jsx("div",{className:"rounded-xl border border-border/50 bg-card/70 backdrop-blur-xl p-2 shadow-lg shadow-black/20",children:l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(lv,{className:"h-3.5 w-3.5 text-primary ml-1 mr-0.5 shrink-0"}),(e?sk:sk.slice(0,9)).map(r=>l.jsx("button",{onClick:()=>vR(r.id),className:"rounded-lg px-2.5 py-1 text-[11px] font-semibold text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:r.label},r.id)),l.jsx("button",{onClick:()=>t(r=>!r),className:"rounded-lg px-2 py-1 text-[11px] font-semibold text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:e?"weniger":"+ mehr"})]})})}),l.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[l.jsxs(Ir,{id:"grundlagen",icon:pi,color:"text-cyan-400",title:"1. Wie LLMs ticken",kicker:"Grundlagen",children:[l.jsxs("p",{children:["Ein LLM ist im Kern ein ",l.jsx("strong",{children:"Wahrscheinlichkeits-Rechner für das nächste Token"}),' (Wortteil). Es „weiß" nichts — es setzt fort, was statistisch am plausibelsten ist. Daraus folgt fast alles andere.']}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Tokens"})," sind die Einheit — ~¾ Wort. Ein- und Ausgabe werden in Tokens gezählt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontextfenster"}),' = wie viele Tokens das Modell gleichzeitig „sehen" kann (Prompt + Antwort). Voll = Anfang fällt raus.']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Parameter"})," = die trainierten Gewichte. Training ist einmalig, ",l.jsx("strong",{children:"Inferenz"})," ist jede Antwort."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Temperatur / Sampling"})," steuert Zufall: niedrig = deterministisch/präzise (Code), hoch = kreativ."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Halluzination"})," ist kein Bug, sondern die Kehrseite des Ratens. Gegenmittel: Grounding via Tools/RAG, Verifikation."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Reasoning-/Thinking-Modelle"}),' „denken" in unsichtbaren Tokens vor der Antwort — besser bei Logik, langsamer/teurer.']})]})]}),l.jsxs(Ir,{id:"moe",icon:HN,color:"text-violet-400",title:"2. MoE & Quantisierung",kicker:"Mehr Modell, weniger Last",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Mixture of Experts (MoE):"})," Statt für jedes Token das ganze Netz zu aktivieren, wählt ein",l.jsx("em",{children:" Router"})," nur ein paar spezialisierte ",l.jsx("em",{children:"Experts"}),' aus. So läuft ein 100B-Modell mit der aktiven Rechenlast eines viel kleineren (z.B. „122B total / 10B aktiv").']}),l.jsxs("p",{children:[l.jsx("strong",{children:"Quantisierung:"})," Gewichte von FP16 auf weniger Bits eindampfen — kleiner & schneller bei minimalem Qualitätsverlust. Faustregel:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx(ze,{children:"Q8"})," nahezu verlustfrei, größter Footprint"]}),l.jsxs("li",{children:[l.jsx(ze,{children:"Q6_K"})," sehr gut, guter Mittelweg"]}),l.jsxs("li",{children:[l.jsx(ze,{children:"Q4_K_M"})," der Sweet-Spot für lokal — viel Modell pro GB"]})]}),l.jsxs(La,{children:["VRAM/RAM ist die harte Grenze — ",l.jsx("strong",{children:"darum"})," ist beides hier zentral: MoE lässt 100B+ überhaupt laufen, Quant entscheidet, was reinpasst. Dein Line-up fährt durchweg ",l.jsx(ze,{children:"Q4_K_M"}),"/",l.jsx(ze,{children:"Q6_K"}),"."]})]}),l.jsxs(Ir,{id:"lokal",icon:uh,color:"text-emerald-400",title:"3. Lokal betreiben: Engines & Backends",kicker:"llama.cpp, vLLM & Co.",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Inference-Engines"})," — was die Modelle ausführt:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"llama.cpp / GGUF"})," — der De-facto-Standard für lokal, CPU+GPU, läuft überall."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Ollama / LM Studio"})," — bequeme Wrapper mit One-Click-Downloads (LM Studio mit GUI)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"vLLM / TGI"})," — Server-Engines für maximalen Durchsatz auf dicken GPUs."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"llama-swap"})," — Proxy, der ",l.jsx("em",{children:"mehrere"})," Modelle hinter ",l.jsx("em",{children:"einem"})," Port hält und je nach Anfrage automatisch ein-/aussattelt."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"GPU-Backends"})," — wie gerechnet wird:"]}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx(ze,{children:"CUDA"})," NVIDIA · ",l.jsx(ze,{children:"ROCm"})," AMD · ",l.jsx(ze,{children:"Vulkan"})," herstellerübergreifend · ",l.jsx(ze,{children:"Metal"})," Apple"]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Begriffe, die immer wiederkommen:"})," Kontext (",l.jsx(ze,{children:"-c"}),"), Slots/Parallel, KV-Cache, Modell-TTL/Swap, ",l.jsx("strong",{children:"Speculative Decoding"})," (kleines Draft-Modell rät voraus → schneller)."]})]})]}),l.jsxs(La,{children:["Deine Box hat eine AMD-APU (gfx1151). ",l.jsx("strong",{children:"Einschränkung & Trick:"})," dort schlägt ",l.jsx(ze,{children:"Vulkan/RADV"})," das offizielle ",l.jsx(ze,{children:"ROCm"})," bei Token-Generierung um ~12–22 % — darum läuft die Engine auf Vulkan.",l.jsx(ze,{children:"llama-swap"})," hält die Alltags-Hirne dauerwarm; ",l.jsx(ze,{children:"coder"})," nutzt Spec-Decoding."]})]}),l.jsxs(Ir,{id:"modelle",icon:af,color:"text-sky-400",title:"4. Modell-Landschaft",kicker:"Stand Juni 2026",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Open-Weight (lokal nutzbar):"})}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Qwen"})," (Alibaba) — starke Allrounder + Coder + Vision, viele Größen/MoE."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Llama"})," (Meta), ",l.jsx("strong",{children:"Gemma"})," (Google), ",l.jsx("strong",{children:"Phi"})," (Microsoft) — solide Open-Familien."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"DeepSeek"}),", ",l.jsx("strong",{children:"Mistral/Mixtral"})," — kräftige MoE-/Reasoning-Modelle."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Frontier (Cloud-API):"})}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx("strong",{children:"Claude"})," (Anthropic), ",l.jsx("strong",{children:"GPT"})," (OpenAI), ",l.jsx("strong",{children:"Gemini"})," (Google) — die stärksten Allrounder, aber nicht lokal."]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Modellwahl nach Aufgabe:"})," schnelles Alltags-Hirn · großes Logik-Hirn für harte Tasks · dediziertes Code-Modell · multimodal für Bilder · Embedding-Modell fürs Gedächtnis."]})]})]}),l.jsx("p",{className:"text-[11px] italic",children:'Leaderboards (HF, LMArena) sind grobe Orientierung — der einzige Benchmark, der zählt, ist deine eigene Aufgabe. Vorsicht vor „Benchmaxxing".'}),l.jsxs(La,{children:["Dein Line-up via llama-swap: ",l.jsx(ze,{children:"fast"})," (Alltag/Vision/MoE) · ",l.jsx(ze,{children:"heavy"})," (schwere Logik) ·",l.jsx(ze,{children:"coder"})," · ",l.jsx(ze,{children:"scout"})," · ",l.jsx(ze,{children:"vision"})," · ",l.jsx(ze,{children:"embed"})," (fürs Gedächtnis) ·",l.jsx(ze,{children:"hermes"})," (Agent-Hirn). Verwalten/tauschen im ",l.jsx("strong",{children:"Modell-Manager"}),"-Tab."]})]}),l.jsxs(Ir,{id:"gateway",icon:DM,color:"text-amber-400",title:"5. Der Gateway-Trick",kicker:"OpenAI-kompatibel = überall andocken",children:[l.jsxs("p",{children:["Fast jedes AI-Tool spricht heute das ",l.jsx("strong",{children:"OpenAI-Format"})," (",l.jsx(ze,{children:"/v1/chat/completions"}),"). Ein",l.jsx("strong",{children:" Gateway"})," davor gibt dir ",l.jsx("em",{children:"einen"})," Endpunkt für alles: zentrales Key-Management, Logging und transparentes ",l.jsx("strong",{children:"Routing"})," — der Client merkt nicht, welches Modell tatsächlich antwortet."]}),l.jsxs("p",{children:["Die ",l.jsx(ze,{children:"model:auto"}),'-Idee: du sagst „auto", das Gateway wählt das passende Modell je nach Anfrage und lädt es bei Bedarf.']}),l.jsxs(La,{children:["Dein Gateway: ",l.jsx(ze,{children:"http://192.168.178.151:9001/v1"}),", Model ",l.jsx(ze,{children:"auto"}),", API-Key beliebig. Fertige Configs erzeugt dir der ",l.jsx("strong",{children:"Verbinden"}),"-Tab live — eine Wahrheit, kein Abtippen."]})]}),l.jsxs(Ir,{id:"mcp",icon:bu,color:"text-violet-400",title:"6. MCP — Werkzeuge für Agenten",kicker:"USB-C für AI-Tools",children:[l.jsxs("p",{children:["Das ",l.jsx("strong",{children:"Model Context Protocol"})," (offen, von Anthropic initiiert) standardisiert, wie ein AI-Client mit externen Tools & Datenquellen spricht. Ein ",l.jsx("strong",{children:"MCP-Server"})," bringt Fähigkeiten: Dateien, Web-Fetch, Git, Datenbanken, eigene APIs."]}),l.jsx("p",{children:"Statt für jeden Editor eigene Tools zu schreiben, bindet jeder MCP-fähige Agent denselben Server an."}),l.jsxs("div",{className:"flex items-start gap-1.5 rounded-xl border border-amber-500/25 bg-amber-500/[0.06] p-2.5 text-[11px]",children:[l.jsx(WN,{className:"h-3.5 w-3.5 text-amber-400 shrink-0 mt-0.5"}),l.jsxs("span",{children:[l.jsx("strong",{children:"Sicherheit:"})," ein MCP-Server hat echten Zugriff (Dateien, Shell). Nur vertrauenswürdige Server laufen lassen, Rechte minimal halten, Quelle prüfen."]})]})]}),l.jsxs(Ir,{id:"skills",icon:LM,color:"text-emerald-400",title:"7. Agent Skills",kicker:"Wiederverwendbare Fähigkeiten",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Skill"})," ist ein Ordner mit einer ",l.jsx(ze,{children:"SKILL.md"})," (YAML-Kopf + Anleitung, optional Skripte/Beispiele), den der Agent für eine bestimmte Aufgabe lädt — z.B. TDD, Code-Vereinfachung, API-Design."]}),l.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`--- +Frag immer nur eine Sache auf einmal und fass am Ende zusammen, was du dir gemerkt hast.`;function V5(){const[e,t]=y.useState(""),[r,n]=y.useState(""),[i,o]=y.useState(""),[u,c]=y.useState("knowledge"),[f,h]=y.useState(!1),[m,g]=y.useState(!1),[v,b]=y.useState("liste"),[j,k]=y.useState(!1),S=Kn(),{showAlert:N,showConfirm:E,dialogElement:A}=ba(),{data:P=[]}=vv({}),{data:_=[],error:O}=vv({q:r,category:e}),{data:T}=zD(v==="graph"),B=O?String(O):"",$=()=>{S.invalidateQueries({queryKey:["memory"]}),S.invalidateQueries({queryKey:["memory-graph"]})},z=y.useMemo(()=>{const I=P.length,M=P.filter(H=>ik.has(H.source)).length;return{total:I,auto:M,manual:I-M,cats:new Set(P.map(H=>H.category)).size}},[P]),Q=P.length===0,U=y.useMemo(()=>{const I=T??{nodes:[],edges:[]};if(!r.trim())return I;const M=r.toLowerCase(),H=I.nodes.filter(J=>J.content.toLowerCase().includes(M)),ie=new Set(H.map(J=>J.id));return{nodes:H,edges:I.edges.filter(J=>ie.has(J.source)&&ie.has(J.target))}},[T,r]),ve=y.useMemo(()=>{const I={};return _.forEach(M=>{var H;(I[H=M.category]??(I[H]=[])).push(M)}),I},[_]),ue=y.useMemo(()=>_.filter(I=>!Cd.includes(I.category)),[_]);async function pe(){i.trim()&&(await we("/api/memory",{method:"POST",body:JSON.stringify({content:i,category:u,source:"ui"})}),o(""),k(!1),$())}function oe(I){E("Eintrag löschen?","Diesen Gedächtnis-Eintrag dauerhaft entfernen?",async()=>{try{await we(`/api/memory/${I}`,{method:"DELETE"}),$()}catch(M){N("Fehler",`Löschen fehlgeschlagen: ${M.message||M}`)}})}async function se(){try{await navigator.clipboard.writeText(ok),g(!0),setTimeout(()=>g(!1),1800)}catch{N("Kopieren fehlgeschlagen","Markiere den Prompt und kopiere ihn manuell (Strg+C).")}}function X(){se(),window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"terminal"}}))}async function ne(){h(!0);try{const I=await we("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(I.duplicate_count===0){N("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}E("Deduplizierung bestätigen",`${I.duplicate_count} Dublette(n) in ${I.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await we("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),$()}catch(M){N("Fehler",`Fehler beim Löschen: ${M.message}`)}})}catch(I){N("Fehler",`Fehler bei der Deduplizierung: ${I.message}`)}finally{h(!1)}}const te=({value:I,label:M,accent:H})=>l.jsxs("span",{className:ee("flex items-center gap-1.5 text-[11px] rounded-lg px-2.5 py-1 border",H==="auto"?"text-emerald-400 bg-emerald-500/[0.07] border-emerald-500/20":"text-muted-foreground bg-card/40 border-border/50"),children:[H==="auto"&&l.jsx(fs,{className:"h-3 w-3"}),l.jsx("b",{className:ee("font-semibold",H==="auto"?"":"text-foreground"),children:I})," ",M]});return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geteilte Konstitution — Hermes, IDEs & Gateway lesen und lernen hier per MCP."})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{value:r,onChange:I=>n(I.target.value),"aria-label":"Gedächtnis durchsuchen",type:"search",placeholder:"Semantisch suchen…",className:"w-52 h-9 pl-8 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),l.jsx(lh,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.jsxs("button",{onClick:()=>k(I=>!I),className:"h-9 px-3 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[l.jsx(cv,{className:"h-4 w-4"})," Eintrag"]}),l.jsx("div",{className:"flex items-center gap-1 p-1 bg-card/30 border border-border/40 rounded-lg",children:[["liste",MM,"Liste"],["graph",HM,"Graph"]].map(([I,M,H])=>l.jsxs("button",{onClick:()=>b(I),className:ee("flex h-7 px-2.5 items-center gap-1.5 text-[11px] font-semibold rounded-md transition-all cursor-pointer",v===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(M,{className:"h-3.5 w-3.5"})," ",H]},I))}),l.jsx("button",{onClick:ne,disabled:f,className:"flex h-9 w-9 items-center justify-center rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50","aria-label":"Duplikate bereinigen",title:"Deduplizieren",children:l.jsx(fs,{className:"h-4 w-4 text-primary","aria-hidden":"true"})})]})]}),!Q&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(te,{value:z.total,label:"Fakten"}),l.jsx(te,{value:z.auto,label:"auto gelernt",accent:"auto"}),l.jsx(te,{value:z.manual,label:"manuell"}),l.jsx(te,{value:z.cats,label:"Kategorien"}),l.jsxs("span",{className:"ml-auto text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(fs,{className:"h-3 w-3 text-emerald-400"})," lernt automatisch aus Hermes-Gesprächen"]})]}),j&&l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),l.jsx("button",{onClick:()=>k(!1),"aria-label":"Schließen",className:"text-muted-foreground hover:text-foreground",children:l.jsx(gi,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("textarea",{value:i,onChange:I=>o(I.target.value),rows:2,"aria-label":"Eintragstext",placeholder:"Eine Regel, Vorliebe oder einen stabilen Fakt über dich oder das Projekt…",className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground leading-relaxed"}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsx("select",{value:u,onChange:I=>c(I.target.value),"aria-label":"Kategorie",className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Cd.map(I=>{var M;return l.jsx("option",{value:I,className:"bg-popover text-foreground",children:((M=dg[I])==null?void 0:M.label)||I},I)})}),l.jsxs("button",{onClick:pe,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer",children:[l.jsx(cv,{className:"h-4 w-4"})," Speichern"]})]})]}),B&&l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler: ",B]}),Q?l.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 sm:p-10 flex flex-col items-center text-center gap-5",children:[l.jsx("div",{className:"h-14 w-14 rounded-2xl bg-primary/10 flex items-center justify-center",children:l.jsx(TM,{className:"h-7 w-7 text-primary"})}),l.jsxs("div",{className:"space-y-1.5 max-w-lg",children:[l.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Lass Hermes dich kennenlernen"}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Statt Fakten einzutippen: führ ein kurzes Onboarding-Gespräch mit Hermes. Was ihr besprecht, merkt sich das Gedächtnis automatisch — du musst nichts manuell pflegen."})]}),l.jsxs("div",{className:"w-full max-w-lg text-left",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Sende das an Hermes"}),l.jsx("button",{onClick:se,className:"flex items-center gap-1 text-[10px] font-semibold text-muted-foreground hover:text-foreground transition-colors",children:m?l.jsxs(l.Fragment,{children:[l.jsx(qt,{className:"h-3 w-3 text-emerald-400"})," Kopiert"]}):l.jsxs(l.Fragment,{children:[l.jsx(uv,{className:"h-3 w-3"})," Kopieren"]})})]}),l.jsx("pre",{className:"w-full rounded-xl border border-border/60 bg-background/40 p-3.5 text-[11px] leading-relaxed text-foreground/90 whitespace-pre-wrap font-mono",children:ok})]}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[l.jsxs("button",{onClick:X,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer",children:[l.jsx(YN,{className:"h-4 w-4"})," Im Terminal starten"]}),l.jsxs("button",{onClick:se,className:"h-9 px-4 rounded-lg border border-border/60 bg-card text-xs font-semibold hover:border-primary/50 transition-all flex items-center gap-1.5 cursor-pointer",children:[m?l.jsx(qt,{className:"h-4 w-4 text-emerald-400"}):l.jsx(uv,{className:"h-4 w-4"})," Prompt kopieren"]})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(UM,{className:"h-3 w-3"})," Funktioniert genauso über Telegram —"," ",l.jsx("button",{onClick:()=>k(!0),className:"underline hover:text-foreground",children:"oder lieber manuell anlegen"}),"."]})]}):v==="graph"?l.jsx(fR,{children:l.jsx(y.Suspense,{fallback:l.jsx("div",{className:"h-[480px] rounded-2xl border border-border/60 bg-card/30 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:l.jsx(hR,{data:U,onDelete:oe})})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl w-fit",children:[l.jsx("button",{onClick:()=>t(""),className:ee("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Cd.map(I=>{const M=dg[I]||ak,H=M.icon;return l.jsxs("button",{onClick:()=>t(I),className:ee("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1",e===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(H,{className:"h-3 w-3"})," ",M.label]},I)})]}),_.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):l.jsx("div",{className:"space-y-5",children:[...Cd,"__other"].map(I=>{const M=I==="__other"?ue:ve[I]||[];if(!M.length)return null;const H=dg[I]||ak,ie=H.icon;return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[l.jsx(ie,{className:ee("h-3.5 w-3.5",H.text)}),l.jsx("span",{className:ee("text-[11px] font-bold uppercase tracking-wider",H.text),children:H.label}),l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 bg-card/50 rounded px-1.5 py-0.5",children:M.length}),l.jsx("div",{className:"ml-1 h-px flex-1 bg-border/30"})]}),l.jsx("div",{className:"space-y-2",children:M.map(J=>{const Z=ik.has(J.source);return l.jsxs("div",{className:ee("flex items-start justify-between gap-4 p-3.5 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 hover:border-primary/20 transition-all group",mR[J.category]||"border-l-muted"),children:[l.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1 min-w-0",children:J.content}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[typeof J.score=="number"&&l.jsxs("span",{className:"text-[9px] font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded",title:"Relevanz der semantischen Suche",children:[Math.round(J.score*100),"%"]}),l.jsxs("span",{className:ee("flex items-center gap-1 text-[9px] font-mono px-1.5 py-0.5 rounded",Z?"text-emerald-400 bg-emerald-500/10":"text-muted-foreground/60 bg-background/20"),title:Z?"Automatisch gelernt":"Manuell angelegt",children:[Z&&l.jsx(fs,{className:"h-2.5 w-2.5"}),J.source]}),l.jsx("button",{onClick:()=>oe(J.id),"aria-label":"Eintrag löschen",title:"Eintrag löschen",className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",children:l.jsx(of,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]},J.id)})})]},I)})})]}),A]})}const pR=["chat","coding","fast","heavy"];function q5(){const{data:e,error:t}=ph(5e3),{data:r}=wi(),{showAlert:n,dialogElement:i}=ba(),o=Kn(),u=t?String(t):"",[c,f]=y.useState(!1),h=(r==null?void 0:r.models)??[];async function m(v){try{await we("/api/agent/brain",{method:"POST",body:JSON.stringify({model:v})}),n("Erledigt",`Hermes-Hirn zeigt jetzt auf das Alias '${v}'. Der Gateway-Dienst wurde neu gestartet.`),o.invalidateQueries({queryKey:Be.agentStatus}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}async function g(v){try{await we("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:v})}),n("Erledigt","Agent-Hirn gewechselt (warm gehalten). Gateway wurde neugestartet."),o.invalidateQueries({queryKey:Be.agentStatus}),o.invalidateQueries({queryKey:Be.models}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Hermes Agenten-Cockpit"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",l.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(e==null?void 0:e.terminal_url)&&l.jsxs("a",{href:lf(e.terminal_url),target:"_blank",rel:"noopener",className:ee("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",e.terminal_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[l.jsx(sh,{className:"h-4 w-4"}),l.jsx("span",{children:"Terminal öffnen"})]})]}),u&&l.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",u,")."]}),e&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(Jr,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Fluss"})]}),l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-stretch gap-3",children:[l.jsxs("button",{onClick:()=>e.terminal_reachable&&window.open(lf(e.terminal_url),"_blank"),title:e.terminal_reachable?"Hermes-Terminal öffnen":"Terminal offline",className:"lg:w-40 shrink-0 rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/40 transition-all cursor-pointer flex flex-col justify-center",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(oh,{className:ee("h-3.5 w-3.5",e.terminal_reachable?"text-emerald-400":"text-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Terminal"}),l.jsx("span",{className:ee("ml-auto h-1.5 w-1.5 rounded-full animate-pulse",e.terminal_reachable?"bg-emerald-500":"bg-amber-500")})]}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono mt-0.5",children:"hermes chat · Clients"})]}),l.jsx("div",{className:"hidden lg:flex items-center text-muted-foreground text-lg select-none",children:"→"}),l.jsxs("div",{className:"flex-1 flex flex-col gap-2.5",children:[l.jsxs("div",{className:"rounded-xl border border-primary/40 bg-primary/5 px-3.5 py-2.5 flex items-center gap-2",children:[l.jsx(Jr,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold text-primary",children:"Agent Gateway"}),l.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:":8642"}),l.jsxs("span",{className:ee("ml-auto inline-flex items-center gap-1.5 text-[10px] font-bold uppercase font-mono px-2 py-0.5 rounded-full border",e.gateway_reachable?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-red-500/10 text-red-400 border-red-500/20"),children:[l.jsx("span",{className:ee("h-1.5 w-1.5 rounded-full",e.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-red-500")}),e.gateway_reachable?"online":"offline"]})]}),l.jsxs("div",{className:"grid gap-2.5 sm:grid-cols-3",children:[l.jsxs("button",{onClick:()=>f(!0),className:"rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/45 transition-all cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(pi,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Hirn"}),l.jsx("span",{className:"ml-auto text-[9px] text-primary/70 font-bold uppercase",children:"wechseln →"})]}),l.jsx("div",{className:"text-[11px] font-mono font-medium text-foreground truncate mt-1",title:e.brain_model,children:e.brain_model||"chat"})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(Ku,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),l.jsxs("div",{className:"text-[10px] font-mono mt-1 flex flex-wrap gap-x-2 text-muted-foreground",children:[l.jsxs("span",{children:["Config: ",e.has_config?"✓":"—"]}),l.jsxs("span",{children:["Skills: ",e.has_skills?"✓":"—"]}),l.jsxs("span",{children:["Memory: ",e.has_memories?"✓":"—"]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(jw,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"PC"}),l.jsx("span",{className:ee("ml-auto h-1.5 w-1.5 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")})]}),l.jsxs("div",{className:ee("text-[11px] font-mono mt-1",e.pc_executor_reachable?"text-emerald-400":"text-muted-foreground"),children:[":7777 ",e.pc_executor_reachable?"verbunden":"offline"]})]})]})]})]})]}),l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jw,{className:"h-5 w-5 text-primary"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{children:["Der ",l.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),l.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),l.jsx("div",{className:"space-y-3",children:e.pc_executor_reachable?l.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[l.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),l.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",l.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",l.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",l.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),l.jsxs("p",{children:["Starte ",l.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",l.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),l.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!e.gateway_reachable&&l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qs,{className:"h-5 w-5 text-amber-500"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[l.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),l.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",l.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),l.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[l.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-terminal"})]}),l.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",l.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),e&&c&&l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":"Hermes-Hirn konfigurieren",children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(pi,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes-Hirn konfigurieren"})]}),l.jsx("button",{onClick:()=>f(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Lane / Gateway-Alias"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:pR.map(v=>{const b=e.brain_model===v;return l.jsxs("button",{onClick:()=>m(v),className:ee("px-3 py-1.5 rounded-lg text-xs font-mono font-semibold border transition-all cursor-pointer flex items-center gap-1.5",b?"border-primary/40 bg-primary/10 text-primary":"border-border/30 bg-background/20 text-foreground hover:bg-accent"),children:[v,b&&l.jsx(qt,{className:"h-3.5 w-3.5"})]},v)})}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70",children:["Schlank & flexibel: das Hirn folgt dem Lane-Routing (z.B. ",l.jsx("code",{className:"text-primary",children:"chat"})," = fast↔heavy)."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Installiertes Modell (warm gehalten)"}),l.jsx("div",{className:"space-y-1.5 max-h-56 overflow-y-auto pr-1",children:h.map(v=>{var j;const b=v.role==="hermes";return l.jsxs("button",{onClick:()=>!b&&g(v.name),disabled:b||v.incomplete,className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",b?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":v.incomplete?"border-border/20 bg-background/10 text-muted-foreground/50 cursor-not-allowed":"border-border/30 bg-background/20 text-foreground hover:bg-accent cursor-pointer"),children:[l.jsxs("div",{className:"flex flex-col min-w-0",children:[l.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(j=v.name.split("/").pop())==null?void 0:j.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[v.capabilities.params_b?`${v.capabilities.params_b}B`:"?"," · ",v.capabilities.tools!=="no"?"Tools ✓":"ohne Tools",v.role&&` · Rolle: ${v.role}`]})]}),b?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[l.jsx(qt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Warm setzen →"})]},v.name)})})]}),l.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[l.jsx("span",{children:"💡"}),l.jsxs("span",{children:["Für einen ",l.jsx("strong",{children:"Agenten"}),' sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl. Neues Modell? Erst über „Modell-Manager → Modelle finden" laden.']})]})]})}),i]})}function gR(){const{data:e}=ph(5e3),t=e!=null&&e.hermes_ui_url?lf(e.hermes_ui_url):void 0,r=e==null?void 0:e.hermes_ui_reachable;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Hermes GUI"}),l.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Die eingebaute Hermes-Weboberfläche — Threads, sichtbare Tool-Calls & Chat, direkt im Cockpit statt im Terminal."})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[l.jsx("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500 animate-pulse":"bg-amber-500"}`}),r?"online":"offline"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[l.jsx(sh,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?l.jsxs("div",{className:"relative min-h-[68vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&l.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[l.jsx(Er,{className:"h-8 w-8 text-amber-400"}),l.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Hermes-GUI nicht erreichbar"}),l.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",l.jsx("code",{className:"font-mono text-primary",children:"hermes-builtin-ui"}),"-Dienst (",l.jsx("code",{className:"font-mono",children:"hermes serve"}),") läuft nicht. Auf der Box: ",l.jsx("code",{className:"font-mono",children:"systemctl --user restart hermes-builtin-ui"}),"."]})]}),l.jsx("iframe",{src:t,title:"Hermes GUI",className:"h-full w-full border-0",style:{minHeight:"68vh"}})]}):l.jsxs("div",{className:"flex min-h-[68vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[l.jsx(Jr,{className:"mr-2 h-4 w-4"})," Lade Hermes-GUI…"]})]})}function vR(){const{data:e}=ph(5e3),t=e!=null&&e.box_console_url?lf(e.box_console_url):void 0,r=e==null?void 0:e.box_console_reachable;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Konsole"}),l.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Direkte Shell auf der Box — wie ein SSH-Fenster, mitten im Browser."})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full",r?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r?"online":"offline"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[l.jsx(sh,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?l.jsxs("div",{className:"relative min-h-[58vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&l.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[l.jsx(Er,{className:"h-8 w-8 text-amber-400"}),l.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),l.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",l.jsx("code",{className:"font-mono text-primary",children:"box-console"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",l.jsx("code",{className:"font-mono",children:"systemctl --user restart box-console"}),"."]})]}),l.jsx("iframe",{src:t,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):l.jsxs("div",{className:"flex min-h-[58vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[l.jsx(af,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}const sk=[{id:"grundlagen",label:"Grundlagen"},{id:"moe",label:"MoE & Quant"},{id:"lokal",label:"Lokal betreiben"},{id:"modelle",label:"Modell-Landschaft"},{id:"gateway",label:"Gateway-Trick"},{id:"mcp",label:"MCP"},{id:"skills",label:"Skills"},{id:"memory",label:"Gedächtnis & RAG"},{id:"agents",label:"Agenten"},{id:"ide",label:"IDE anbinden"},{id:"tricks",label:"Tricks & Kniffe"},{id:"wartung",label:"Sicherheit & Wartung"},{id:"ressourcen",label:"Ressourcen"},{id:"troubleshooting",label:"Troubleshooting"}];function yR(e){var t;(t=document.getElementById(e))==null||t.scrollIntoView({behavior:"smooth",block:"start"})}function Ir({id:e,icon:t,color:r,title:n,kicker:i,children:o,wide:u}){return l.jsxs("section",{id:e,className:ee("scroll-mt-20 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-3",u&&"md:col-span-2"),children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(t,{className:ee("h-5 w-5 shrink-0",r)}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:n}),i&&l.jsx("span",{className:ee("text-[9px] font-mono",r),children:i})]})]}),l.jsx("div",{className:"text-xs text-muted-foreground space-y-2.5 leading-relaxed",children:o})]})}function La({children:e}){return l.jsxs("div",{className:"mt-1 rounded-xl border border-primary/25 bg-primary/[0.06] p-3 text-[11px] leading-relaxed",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-primary mb-1",children:[l.jsx(fs,{className:"h-3 w-3"})," Bei dir konkret"]}),l.jsx("div",{className:"text-muted-foreground space-y-1",children:e})]})}function ze({children:e}){return l.jsx("code",{className:"rounded bg-background/40 border border-border/30 px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e})}function kt({href:e,name:t,note:r}){return l.jsxs("li",{className:"leading-relaxed",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold inline-flex items-center gap-0.5",children:[t,l.jsx(oM,{className:"h-3 w-3 opacity-60"})]}),l.jsxs("span",{className:"text-muted-foreground",children:[" — ",r]})]})}function xR(){const[e,t]=y.useState(!1);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 flex items-start gap-4",children:[l.jsx("div",{className:"h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center shrink-0",children:l.jsx(sv,{className:"h-6 w-6 text-primary"})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Die AI-Bibel"}),l.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl",children:["Allgemeines Nachschlagewerk für lokale & agentische AI — Konzepte, Tricks, Kniffe und kuratierte Quellen. ",l.jsx("span",{className:"font-semibold text-foreground",children:"Stand Juni 2026."})," ","Das meiste gilt überall; ",l.jsx("span",{className:"text-primary font-semibold",children:'„Bei dir konkret"'}),"-Kästen zeigen, was dein Stack daraus macht."]})]})]}),l.jsx("div",{className:"sticky top-0 z-10 -mx-1 px-1",children:l.jsx("div",{className:"rounded-xl border border-border/50 bg-card/70 backdrop-blur-xl p-2 shadow-lg shadow-black/20",children:l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(lv,{className:"h-3.5 w-3.5 text-primary ml-1 mr-0.5 shrink-0"}),(e?sk:sk.slice(0,9)).map(r=>l.jsx("button",{onClick:()=>yR(r.id),className:"rounded-lg px-2.5 py-1 text-[11px] font-semibold text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:r.label},r.id)),l.jsx("button",{onClick:()=>t(r=>!r),className:"rounded-lg px-2 py-1 text-[11px] font-semibold text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:e?"weniger":"+ mehr"})]})})}),l.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[l.jsxs(Ir,{id:"grundlagen",icon:pi,color:"text-cyan-400",title:"1. Wie LLMs ticken",kicker:"Grundlagen",children:[l.jsxs("p",{children:["Ein LLM ist im Kern ein ",l.jsx("strong",{children:"Wahrscheinlichkeits-Rechner für das nächste Token"}),' (Wortteil). Es „weiß" nichts — es setzt fort, was statistisch am plausibelsten ist. Daraus folgt fast alles andere.']}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Tokens"})," sind die Einheit — ~¾ Wort. Ein- und Ausgabe werden in Tokens gezählt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontextfenster"}),' = wie viele Tokens das Modell gleichzeitig „sehen" kann (Prompt + Antwort). Voll = Anfang fällt raus.']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Parameter"})," = die trainierten Gewichte. Training ist einmalig, ",l.jsx("strong",{children:"Inferenz"})," ist jede Antwort."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Temperatur / Sampling"})," steuert Zufall: niedrig = deterministisch/präzise (Code), hoch = kreativ."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Halluzination"})," ist kein Bug, sondern die Kehrseite des Ratens. Gegenmittel: Grounding via Tools/RAG, Verifikation."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Reasoning-/Thinking-Modelle"}),' „denken" in unsichtbaren Tokens vor der Antwort — besser bei Logik, langsamer/teurer.']})]})]}),l.jsxs(Ir,{id:"moe",icon:HN,color:"text-violet-400",title:"2. MoE & Quantisierung",kicker:"Mehr Modell, weniger Last",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Mixture of Experts (MoE):"})," Statt für jedes Token das ganze Netz zu aktivieren, wählt ein",l.jsx("em",{children:" Router"})," nur ein paar spezialisierte ",l.jsx("em",{children:"Experts"}),' aus. So läuft ein 100B-Modell mit der aktiven Rechenlast eines viel kleineren (z.B. „122B total / 10B aktiv").']}),l.jsxs("p",{children:[l.jsx("strong",{children:"Quantisierung:"})," Gewichte von FP16 auf weniger Bits eindampfen — kleiner & schneller bei minimalem Qualitätsverlust. Faustregel:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx(ze,{children:"Q8"})," nahezu verlustfrei, größter Footprint"]}),l.jsxs("li",{children:[l.jsx(ze,{children:"Q6_K"})," sehr gut, guter Mittelweg"]}),l.jsxs("li",{children:[l.jsx(ze,{children:"Q4_K_M"})," der Sweet-Spot für lokal — viel Modell pro GB"]})]}),l.jsxs(La,{children:["VRAM/RAM ist die harte Grenze — ",l.jsx("strong",{children:"darum"})," ist beides hier zentral: MoE lässt 100B+ überhaupt laufen, Quant entscheidet, was reinpasst. Dein Line-up fährt durchweg ",l.jsx(ze,{children:"Q4_K_M"}),"/",l.jsx(ze,{children:"Q6_K"}),"."]})]}),l.jsxs(Ir,{id:"lokal",icon:uh,color:"text-emerald-400",title:"3. Lokal betreiben: Engines & Backends",kicker:"llama.cpp, vLLM & Co.",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Inference-Engines"})," — was die Modelle ausführt:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"llama.cpp / GGUF"})," — der De-facto-Standard für lokal, CPU+GPU, läuft überall."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Ollama / LM Studio"})," — bequeme Wrapper mit One-Click-Downloads (LM Studio mit GUI)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"vLLM / TGI"})," — Server-Engines für maximalen Durchsatz auf dicken GPUs."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"llama-swap"})," — Proxy, der ",l.jsx("em",{children:"mehrere"})," Modelle hinter ",l.jsx("em",{children:"einem"})," Port hält und je nach Anfrage automatisch ein-/aussattelt."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"GPU-Backends"})," — wie gerechnet wird:"]}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx(ze,{children:"CUDA"})," NVIDIA · ",l.jsx(ze,{children:"ROCm"})," AMD · ",l.jsx(ze,{children:"Vulkan"})," herstellerübergreifend · ",l.jsx(ze,{children:"Metal"})," Apple"]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Begriffe, die immer wiederkommen:"})," Kontext (",l.jsx(ze,{children:"-c"}),"), Slots/Parallel, KV-Cache, Modell-TTL/Swap, ",l.jsx("strong",{children:"Speculative Decoding"})," (kleines Draft-Modell rät voraus → schneller)."]})]})]}),l.jsxs(La,{children:["Deine Box hat eine AMD-APU (gfx1151). ",l.jsx("strong",{children:"Einschränkung & Trick:"})," dort schlägt ",l.jsx(ze,{children:"Vulkan/RADV"})," das offizielle ",l.jsx(ze,{children:"ROCm"})," bei Token-Generierung um ~12–22 % — darum läuft die Engine auf Vulkan.",l.jsx(ze,{children:"llama-swap"})," hält die Alltags-Hirne dauerwarm; ",l.jsx(ze,{children:"coder"})," nutzt Spec-Decoding."]})]}),l.jsxs(Ir,{id:"modelle",icon:nf,color:"text-sky-400",title:"4. Modell-Landschaft",kicker:"Stand Juni 2026",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Open-Weight (lokal nutzbar):"})}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Qwen"})," (Alibaba) — starke Allrounder + Coder + Vision, viele Größen/MoE."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Llama"})," (Meta), ",l.jsx("strong",{children:"Gemma"})," (Google), ",l.jsx("strong",{children:"Phi"})," (Microsoft) — solide Open-Familien."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"DeepSeek"}),", ",l.jsx("strong",{children:"Mistral/Mixtral"})," — kräftige MoE-/Reasoning-Modelle."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Frontier (Cloud-API):"})}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx("strong",{children:"Claude"})," (Anthropic), ",l.jsx("strong",{children:"GPT"})," (OpenAI), ",l.jsx("strong",{children:"Gemini"})," (Google) — die stärksten Allrounder, aber nicht lokal."]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Modellwahl nach Aufgabe:"})," schnelles Alltags-Hirn · großes Logik-Hirn für harte Tasks · dediziertes Code-Modell · multimodal für Bilder · Embedding-Modell fürs Gedächtnis."]})]})]}),l.jsx("p",{className:"text-[11px] italic",children:'Leaderboards (HF, LMArena) sind grobe Orientierung — der einzige Benchmark, der zählt, ist deine eigene Aufgabe. Vorsicht vor „Benchmaxxing".'}),l.jsxs(La,{children:["Dein Line-up via llama-swap: ",l.jsx(ze,{children:"fast"})," (Alltag/Vision/MoE) · ",l.jsx(ze,{children:"heavy"})," (schwere Logik) ·",l.jsx(ze,{children:"coder"})," · ",l.jsx(ze,{children:"scout"})," · ",l.jsx(ze,{children:"vision"})," · ",l.jsx(ze,{children:"embed"})," (fürs Gedächtnis) ·",l.jsx(ze,{children:"hermes"})," (Agent-Hirn). Verwalten/tauschen im ",l.jsx("strong",{children:"Modell-Manager"}),"-Tab."]})]}),l.jsxs(Ir,{id:"gateway",icon:RM,color:"text-amber-400",title:"5. Der Gateway-Trick",kicker:"OpenAI-kompatibel = überall andocken",children:[l.jsxs("p",{children:["Fast jedes AI-Tool spricht heute das ",l.jsx("strong",{children:"OpenAI-Format"})," (",l.jsx(ze,{children:"/v1/chat/completions"}),"). Ein",l.jsx("strong",{children:" Gateway"})," davor gibt dir ",l.jsx("em",{children:"einen"})," Endpunkt für alles: zentrales Key-Management, Logging und transparentes ",l.jsx("strong",{children:"Routing"})," — der Client merkt nicht, welches Modell tatsächlich antwortet."]}),l.jsxs("p",{children:["Die ",l.jsx(ze,{children:"model:auto"}),'-Idee: du sagst „auto", das Gateway wählt das passende Modell je nach Anfrage und lädt es bei Bedarf.']}),l.jsxs(La,{children:["Dein Gateway: ",l.jsx(ze,{children:"http://192.168.178.151:9001/v1"}),", Model ",l.jsx(ze,{children:"auto"}),", API-Key beliebig. Fertige Configs erzeugt dir der ",l.jsx("strong",{children:"Verbinden"}),"-Tab live — eine Wahrheit, kein Abtippen."]})]}),l.jsxs(Ir,{id:"mcp",icon:xu,color:"text-violet-400",title:"6. MCP — Werkzeuge für Agenten",kicker:"USB-C für AI-Tools",children:[l.jsxs("p",{children:["Das ",l.jsx("strong",{children:"Model Context Protocol"})," (offen, von Anthropic initiiert) standardisiert, wie ein AI-Client mit externen Tools & Datenquellen spricht. Ein ",l.jsx("strong",{children:"MCP-Server"})," bringt Fähigkeiten: Dateien, Web-Fetch, Git, Datenbanken, eigene APIs."]}),l.jsx("p",{children:"Statt für jeden Editor eigene Tools zu schreiben, bindet jeder MCP-fähige Agent denselben Server an."}),l.jsxs("div",{className:"flex items-start gap-1.5 rounded-xl border border-amber-500/25 bg-amber-500/[0.06] p-2.5 text-[11px]",children:[l.jsx(WN,{className:"h-3.5 w-3.5 text-amber-400 shrink-0 mt-0.5"}),l.jsxs("span",{children:[l.jsx("strong",{children:"Sicherheit:"})," ein MCP-Server hat echten Zugriff (Dateien, Shell). Nur vertrauenswürdige Server laufen lassen, Rechte minimal halten, Quelle prüfen."]})]})]}),l.jsxs(Ir,{id:"skills",icon:$M,color:"text-emerald-400",title:"7. Agent Skills",kicker:"Wiederverwendbare Fähigkeiten",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Skill"})," ist ein Ordner mit einer ",l.jsx(ze,{children:"SKILL.md"})," (YAML-Kopf + Anleitung, optional Skripte/Beispiele), den der Agent für eine bestimmte Aufgabe lädt — z.B. TDD, Code-Vereinfachung, API-Design."]}),l.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`--- name: tdd-pro description: Treibt Entwicklung mit strikter TDD-Praxis --- # Instructions -...`}),l.jsxs("p",{children:["Suchen & installieren über die ",l.jsx("strong",{children:"skills.sh"}),"-Registry: ",l.jsx(ze,{children:"npx skills find"})," /",l.jsx(ze,{children:"npx skills add owner/repo"}),". Skills liegen projektweit (vom Agent beim Start gelesen) oder global."]})]}),l.jsxs(Ir,{id:"memory",icon:yM,color:"text-indigo-400",title:"8. Gedächtnis & RAG",kicker:"Modelle vergessen — du nicht",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["LLMs sind ",l.jsx("strong",{children:"zustandslos"}),": ohne Hilfe weiß das Modell beim nächsten Turn nichts mehr. Gedächtnis lebt extern."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Embeddings"})," wandeln Text in Vektoren; ein ",l.jsx("strong",{children:"Vektor-Store"})," (Chroma, …) findet semantisch Ähnliches."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"RAG"})," = relevante Fakten vor dem Turn heraussuchen und einblenden statt alles im Prompt zu halten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Long-Context vs. RAG:"}),' riesige Fenster sind bequem, aber teuer & „lost in the middle" — gezieltes Abrufen skaliert besser.']})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Auto-lernendes Gedächtnis"})," ist die nächste Stufe:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:["extrahiert Fakten ",l.jsx("em",{children:"selbst"})," aus Gesprächen, statt nur abzuspeichern"]}),l.jsx("li",{children:"dedupliziert semantisch (kein 10× derselbe Fakt)"}),l.jsxs("li",{children:[l.jsx("strong",{children:"Graph-Sicht"})," = Fakten ",l.jsx("em",{children:"plus"})," ihre Beziehungen, nicht nur eine flache Liste"]})]})]})]}),l.jsxs(La,{children:["Dein Gedächtnis (Tab ",l.jsx("strong",{children:"Gedächtnis"}),") ist ",l.jsx("strong",{children:"Mem0"}),"-basiert: auto-lernend & semantisch, ",l.jsx("strong",{children:"graph-first"})," dargestellt, mit 4-Typen-Taxonomie (",l.jsx(ze,{children:"Identität"})," · ",l.jsx(ze,{children:"Wissen"})," · ",l.jsx(ze,{children:"Regeln"})," · ",l.jsx(ze,{children:"Ereignisse"}),"). Einstieg über ein kurzes ",l.jsx("strong",{children:"Hermes-Onboarding-Gespräch"})," im Terminal — der Agent lernt im Hintergrund nach jedem Turn.",l.jsx("br",{}),l.jsx("strong",{children:"Gotcha:"})," ein gelöschter Fakt kann wieder auftauchen, solange die Original-Nachricht noch im Verlauf steht (additive Extraktion)."]})]}),l.jsxs(Ir,{id:"agents",icon:yn,color:"text-rose-400",title:"9. Autonome Agenten betreiben",kicker:"LLM in der Schleife",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Agent"})," ist ein LLM in einer Schleife mit Tools:",l.jsx("em",{children:" denken → Tool aufrufen → Ergebnis beobachten → weiter"}),", bis das Ziel erreicht ist."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Guardrails"})," (Hard-Stop, Tool-Limits) verhindern Endlos-Loops, wenn ein Tool fehlt oder hängt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontext-Hygiene"})," ist die wichtigste Disziplin: frische Sessions starten — vollgemüllte Historien werden langsam, driften und halluzinieren."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kanäle:"})," CLI/Terminal, Chat-UI, Messaging (z.B. Telegram), reine API."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Least Privilege:"})," gib einem Agenten nur die Tools, die er wirklich braucht. Kritische Aktionen (Shell auf dem Host, Löschen, Geld/Deploys) hinter menschliche Freigabe."]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Was sich vollautomatisch lohnt:"})," Modell-Routing, Hintergrund-Gedächtnis, Recherche. ",l.jsx("strong",{children:"Was Freigabe braucht:"})," Systembefehle, Updates/Reboots, permanentes Löschen."]})]})]}),l.jsxs(La,{children:[l.jsx("strong",{children:"Hermes"})," ist dein Box-Agent (Hirn = ",l.jsx(ze,{children:"fast"}),"). Reden tust du mit ihm im",l.jsx("strong",{children:" Terminal"}),"-Tab (Web-Terminal via ttyd) oder per ",l.jsx("strong",{children:"Telegram"}),". Er hat MCP-Server für Gedächtnis, Stack-Steuerung, Web-Fetch und ",l.jsx("strong",{children:"PC-Steuerung"})," (Executor auf deinem Windows-PC). Status & Verdrahtung im ",l.jsx("strong",{children:"Hermes"}),"-Tab."]})]}),l.jsxs(Ir,{id:"ide",icon:Ts,color:"text-cyan-400",title:"10. IDE / Editor anbinden",kicker:"Vibe-Coding lokal",children:[l.jsxs("p",{children:["Jede ",l.jsx("strong",{children:"OpenAI-kompatible"})," IDE oder Extension lässt sich auf einen lokalen Server umbiegen — Base-URL + Model eintragen, fertig:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Cline"})," & ",l.jsx("strong",{children:"Roo Code"})," (VS-Code-Extensions, voller Agent + MCP)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cursor"})," (VS-Code-Fork mit Top-Autocomplete)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Continue"}),", ",l.jsx("strong",{children:"aider"})," (CLI), ",l.jsx("strong",{children:"OpenCode"})," (Desktop)"]})]}),l.jsxs(La,{children:["Tipp den Kram nicht ab: der ",l.jsx("strong",{children:"Verbinden"}),"-Tab generiert die fertige Config (inkl. MCP-Gedächtnis) pro Tool zum Kopieren. Essenz: Base ",l.jsx(ze,{children:"…:9001/v1"}),", Model ",l.jsx(ze,{children:"auto"}),", Key beliebig."]})]}),l.jsx(Ir,{id:"tricks",icon:OM,color:"text-amber-400",title:"11. Tricks & Kniffe",kicker:"Was im Alltag wirklich spart",wide:!0,children:l.jsx("div",{className:"grid md:grid-cols-3 gap-3",children:[["Kontext sauber halten","Neue Session statt Mega-Historie. Drift, Tempo und Halluzination hängen direkt am Kontext-Müll."],["Plan-then-Act","Erst Plan/Vorgehen bestätigen lassen, dann ausführen. Spart teure Holzwege."],["Gezielte Edits","Nie ganze Dateien überschreiben für eine Zeile — Such-/Ersetz-Tools nutzen. Weniger Tokens, weniger Fehler."],["Non-interaktive Befehle","Keine interaktiven Prompts im Agent-Terminal; lange Tasks als Background-Job. Sonst hängt der Loop."],["DevTools koppeln","Browser-/Konsolen-Zugriff geben — der Agent liest echte Fehler statt blind zu raten."],["Richtige Modellwahl","Schnelles Hirn für Alltag, großes für harte Logik, Coder fürs Coden. Nicht alles mit der Kanone."],["Akzeptanzkriterien","Sag konkret, woran „fertig“ erkennbar ist. Vage Prompts → vage Ergebnisse."],["Verifizieren statt vertrauen","Tests/Live-Check fordern. „Sollte funktionieren“ ist kein Beweis."],["Regeln ins Gedächtnis","Wiederkehrende Vorlieben/Konventionen einmal ablegen — der Agent zieht sie selbst."]].map(([r,n])=>l.jsxs("div",{className:"space-y-1 p-3 bg-background/10 rounded-xl border border-border/30",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-foreground text-[11px]",children:[l.jsx(ga,{className:"h-3 w-3 text-amber-400"})," ",r]}),l.jsx("p",{className:"text-[11px]",children:n})]},r))})}),l.jsx(Ir,{id:"wartung",icon:Qs,color:"text-emerald-400",title:"12. Sicherheit & Wartung",kicker:"Damit's auch morgen noch läuft",wide:!0,children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(kM,{className:"h-3.5 w-3.5 text-emerald-400"})," Goldene Regeln"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Ein ungetesteter Restore ist kein Backup."})," Wiederherstellung mindestens einmal echt durchspielen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates können Dinge still zerschießen"})," — gerade bei AI-Stacks (Embeddings, Provider-Interna). Versionen pinnen, Smoke-Test, Post-Check."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Least Privilege"})," für Agenten, MCP-Server und PC-Zugriff. Kritisches hinter Freigabe."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(Gu,{className:"h-3.5 w-3.5 text-emerald-400"})," Bei dir im SystemDrawer"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Backup:"})," tägliches Voll-Zustands-Backup, getesteter ",l.jsx(ze,{children:"restore.sh"})," (Doku in ",l.jsx(ze,{children:"docs/BACKUP.md"}),")."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates:"})," git-basierter Update-Check; ",l.jsx("strong",{children:"Hermes-Update-Button"})," mit anschließendem ",l.jsx("strong",{children:"Gehirn-Check"})," (rot, falls das Update das Gedächtnis zerschießt) + Engine-Update."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Dienste & Gefahrenzone:"})," Restart/Logs pro Dienst, kritische Eingriffe getrennt."]})]}),l.jsx("p",{className:"text-[10px] italic",children:'Erreichbar über das System-Icon → Tab „Wartung".'})]})]})}),l.jsxs("section",{id:"ressourcen",className:"scroll-mt-20 md:col-span-2 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(lv,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"13. Kuratierte Ressourcen & Links"}),l.jsx("span",{className:"text-[9px] font-mono text-primary",children:"Sauber geordnet — die guten Quellen"})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-5 text-xs",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(af,{className:"h-3.5 w-3.5 text-sky-400"})," Modelle & Engines"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://huggingface.co/models",name:"Hugging Face",note:"das Repository für offene Modelle (GGUF, Embeddings, Datasets)."}),l.jsx(kt,{href:"https://github.com/ggml-org/llama.cpp",name:"llama.cpp",note:"die Referenz-Engine für lokale Inferenz."}),l.jsx(kt,{href:"https://github.com/mostlygeek/llama-swap",name:"llama-swap",note:"mehrere Modelle hinter einem Port, Auto-Swap."}),l.jsx(kt,{href:"https://ollama.com",name:"Ollama",note:"einfachster Einstieg, One-Command-Modelle."}),l.jsx(kt,{href:"https://lmstudio.ai",name:"LM Studio",note:"lokale GUI zum Stöbern, Laden & Chatten."}),l.jsx(kt,{href:"https://github.com/vllm-project/vllm",name:"vLLM",note:"Hochdurchsatz-Serving auf dicken GPUs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(bu,{className:"h-3.5 w-3.5 text-violet-400"})," MCP & Skills"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://modelcontextprotocol.io",name:"MCP — offizielle Doku",note:"Spezifikation & Einstieg."}),l.jsx(kt,{href:"https://github.com/modelcontextprotocol/servers",name:"Offizielle MCP-Server",note:"filesystem, git, postgres, fetch & mehr."}),l.jsx(kt,{href:"https://smithery.ai",name:"Smithery",note:"Registry zum Suchen & Auto-Installieren von MCP-Servern."}),l.jsx(kt,{href:"https://glama.ai/mcp/servers",name:"Glama MCP Registry",note:"kuratierte Community-Datenbank."}),l.jsx(kt,{href:"https://skills.sh",name:"skills.sh",note:"Registry & CLI für Agent-Skills."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(yn,{className:"h-3.5 w-3.5 text-rose-400"})," Agenten & Frameworks"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://github.com/NousResearch/hermes-agent",name:"Hermes Agent (Nous)",note:"der Agent, der auf deiner Box läuft."}),l.jsx(kt,{href:"https://docs.claude.com",name:"Anthropic / Claude Docs",note:"API, Tool-Use, Agent SDK, MCP."}),l.jsx(kt,{href:"https://github.com/cline/cline",name:"Cline",note:"autonomer Coding-Agent für VS Code."}),l.jsx(kt,{href:"https://aider.chat",name:"aider",note:"AI-Pair-Programming im Terminal, git-nativ."}),l.jsx(kt,{href:"https://continue.dev",name:"Continue",note:"Open-Source-Autopilot für IDEs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(sv,{className:"h-3.5 w-3.5 text-amber-400"})," Lernen & Community"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview",name:"Prompt-Engineering (Anthropic)",note:"die beste praktische Anleitung."}),l.jsx(kt,{href:"https://github.com/anthropics/anthropic-cookbook",name:"Anthropic Cookbook",note:"lauffähige Rezepte für Tools, RAG, Agenten."}),l.jsx(kt,{href:"https://www.promptingguide.ai",name:"Prompt Engineering Guide",note:"herstellerneutrales Nachschlagewerk."}),l.jsx(kt,{href:"https://github.com/mem0ai/mem0",name:"Mem0",note:"die auto-lernende Memory-Schicht hinter deinem Gedächtnis."}),l.jsx(kt,{href:"https://www.reddit.com/r/LocalLLaMA/",name:"r/LocalLLaMA",note:"der Puls der lokalen-LLM-Szene."})]})]})]})]}),l.jsx(Ir,{id:"troubleshooting",icon:PM,color:"text-rose-400",title:"14. Troubleshooting",kicker:"Wenn's hakt",wide:!0,children:l.jsxs("ul",{className:"space-y-2 list-disc pl-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Keine Verbindung?"})," Selbes LAN wie die Box? IP/Port stimmen (",l.jsx(ze,{children:":9001"}),")? Backend-Status in der ",l.jsx("strong",{children:"Zentrale"})," prüfen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Modell antwortet nicht / langsam?"})," In der ",l.jsx("strong",{children:"Zentrale → Dienste"})," schauen, ob ",l.jsx(ze,{children:"llama-swap"})," grün ist; sonst Restart. Erstes Token nach Swap dauert (Modell lädt)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Agent dreht durch / halluziniert?"})," Frische Session im ",l.jsx("strong",{children:"Terminal"})," starten — meist ist es vollgemüllter Kontext."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Gedächtnis findet nichts?"})," Embedding-Dienst online? Semantisch suchen (Sinn statt exaktem Wort). Leeres Gedächtnis → Hermes-Onboarding starten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Update hat etwas zerschossen?"})," Genau dafür gibt es Backup & ",l.jsx(ze,{children:"restore.sh"})," — den getesteten Restore fahren, dann Ursache suchen."]})]})})]}),l.jsx("p",{className:"text-center text-[10px] text-muted-foreground/50 pt-2",children:"Mission Control 2 · AI-Bibel · Stand Juni 2026 — lebendes Dokument, wächst mit dem Stack."})]})}function xR({title:e,hint:t}){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:e}),l.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[l.jsx(vM,{className:"h-8 w-8 text-muted-foreground"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const lk=[{id:"mission-control-2",label:"Mission Control",type:"user",reach:"gateway (integr"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user",reach:"hermes-gateway"},{id:"mem0-service",label:"Mem0 (Gedächtnis)",type:"user",reach:"mem0"},{id:"voice-service",label:"Voice (Sprache)",type:"user",reach:"voice"},{id:"hermes-terminal",label:"Hermes Terminal",type:"user",reach:"hermes-terminal"},{id:"llama-swap",label:"Llama Swap",type:"system",reach:"llama-swap"}];function Xl({icon:e,iconClass:t,name:r,status:n,available:i,busy:o,actionLabel:u,onAction:c}){return l.jsxs("div",{className:ee("flex items-center gap-3 rounded-lg border px-3 py-2",i?"border-amber-500/30 bg-amber-500/5":"border-border/50 bg-background/20"),children:[l.jsx(e,{className:ee("h-4 w-4 shrink-0",t)}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:r}),l.jsx("div",{className:ee("text-[10px] truncate",i?"text-amber-400/90":"text-muted-foreground"),children:n})]}),l.jsx("button",{onClick:c,disabled:!i||o,className:ee("text-[11px] font-semibold rounded-lg px-2.5 py-1 transition-colors shrink-0",i?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer":"border border-border/50 text-muted-foreground/40 cursor-default"),children:o?"…":u})]})}function bR({label:e,ok:t,system:r,busy:n,onRestart:i,onLogs:o}){return l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border/50 bg-background/20 px-3 py-2",children:[l.jsx("span",{className:ee("w-1.5 h-1.5 rounded-full shrink-0",t===!0?"bg-emerald-500":t===!1?"bg-red-500":"bg-muted-foreground/40")}),l.jsxs("span",{className:"flex-1 text-xs text-foreground truncate",children:[e,r&&l.jsx("span",{className:"text-[9px] text-muted-foreground",children:" (root)"})]}),l.jsx("button",{onClick:i,disabled:n,title:"Neu starten",className:"text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",children:l.jsx(ps,{className:ee("h-3.5 w-3.5",n&&"animate-spin")})}),l.jsx("button",{onClick:o,title:"Logs ansehen",className:"text-muted-foreground hover:text-primary transition-colors",children:l.jsx(xM,{className:"h-3.5 w-3.5"})})]})}function fg(e){return e==null?"":e>1024**3?`${(e/1024**3).toFixed(2)} GB`:`${(e/1024**2).toFixed(1)} MB`}const wR=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,kR=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function jR(e){return wR.test(e)?"error":kR.test(e)?"warn":"info"}const SR={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function NR({service:e,text:t,loading:r,logStatus:n,onRefresh:i,onOpenSettings:o}){const[u,c]=y.useState(!1),[f,h]=y.useState(""),m=y.useRef(null),g=y.useMemo(()=>t?t.split(` -`).map(S=>({t:S,level:jR(S)})):[],[t]),v=y.useMemo(()=>g.filter(S=>S.level!=="info").length,[g]),b=f.trim().toLowerCase(),j=g.filter(S=>(!u||S.level!=="info")&&(!b||S.t.toLowerCase().includes(b))),k=n==="password_required"||n==="incorrect_password";return l.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[l.jsxs("div",{className:"flex h-10 items-center justify-between gap-2 px-3 border-b border-border/40 bg-black/30 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground shrink-0",children:[l.jsx(YN,{className:"h-3 w-3 text-primary"}),l.jsx("span",{className:"hidden sm:inline",children:"stdout/stderr —"})," ",e]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs("div",{className:"relative",children:[l.jsx(lh,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{value:f,onChange:S=>h(S.target.value),placeholder:"filtern…",className:"h-7 w-24 sm:w-36 rounded-md border border-border/50 bg-background/40 pl-6 pr-2 text-[10px] text-foreground outline-none focus:border-primary/50"})]}),l.jsxs("button",{onClick:()=>c(S=>!S),title:"Nur Fehler und Warnungen zeigen",className:ee("flex h-7 items-center gap-1 rounded-md border px-2 text-[10px] font-semibold transition-colors",u?"border-amber-500/50 bg-amber-500/15 text-amber-300":"border-border/50 bg-background/20 text-muted-foreground hover:text-foreground"),children:[l.jsx(Er,{className:"h-3 w-3"}),"Nur Probleme",v>0?` (${v})`:""]}),l.jsx("button",{onClick:i,disabled:r,title:"Neu laden",className:"flex h-7 w-7 items-center justify-center rounded-md border border-border/50 bg-background/20 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:l.jsx(ps,{className:ee("h-3 w-3",r&&"animate-spin")})})]})]}),l.jsx("div",{ref:m,className:"flex-1 overflow-y-auto p-3 text-[10px] font-mono leading-relaxed scrollbar-thin select-text",children:k?l.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[l.jsx(Er,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),l.jsx("div",{className:"text-xs font-semibold text-amber-300",children:n==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),l.jsxs("p",{className:"max-w-xs text-[10px] leading-normal text-muted-foreground",children:["Für das Auslesen der systemd-Logs von ",e," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),l.jsx("button",{onClick:o,className:"mt-2 rounded-md bg-primary px-3 py-1.5 text-[10px] font-semibold text-primary-foreground transition-colors hover:bg-primary/95",children:"Sudo-Passwort eintragen"})]}):r&&!t?l.jsx("span",{className:"text-muted-foreground",children:"Lade Logs…"}):g.length===0?l.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."}):j.length===0?l.jsx("span",{className:"text-muted-foreground",children:u?"Keine Fehler oder Warnungen — der Dienst läuft sauber. ✓":"Kein Treffer für den Filter."}):j.map((S,N)=>l.jsx("div",{className:ee("whitespace-pre-wrap",SR[S.level]),children:S.t||" "},N))})]})}function ER({open:e,showAlert:t}){const[r,n]=y.useState(""),[i,o]=y.useState(""),[u,c]=y.useState(!1),[f,h]=y.useState(!1);return y.useEffect(()=>{e&&(n(localStorage.getItem("mc_sudo_password")||""),o(localStorage.getItem("mc_hf_token")||""))},[e]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(Qs,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:u?"text":"password",value:r,onChange:m=>n(m.target.value),"aria-label":"Host Sudo-Passwort",name:"sudo-password",autoComplete:"off",spellCheck:!1,placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>c(!u),"aria-label":u?"Passwort verbergen":"Passwort anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:u?l.jsx(ww,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(xu,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(EM,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:f?"text":"password",value:i,onChange:m=>o(m.target.value),"aria-label":"HuggingFace API Token",name:"hf-token",autoComplete:"off",spellCheck:!1,placeholder:"hf_…",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>h(!f),"aria-label":f?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:f?l.jsx(ww,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(xu,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",r),localStorage.setItem("mc_hf_token",i),t("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),l.jsx("button",{onClick:()=>{n(""),o(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),t("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})}function AR({detail:e,maintenanceJob:t,onClose:r,onApply:n}){var f,h;const i=e.data,o={os:{icon:Qs,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:uh,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:QN,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:yn,cls:"text-amber-400",title:"Hermes-Agent"}}[e.kind],u=o.icon,c=i?e.kind==="os"?(i.count??0)===0:e.kind==="hermes"?(i.behind??0)===0:i.installed_build!=null&&i.latest_build!=null&&i.latest_build<=i.installed_build:!0;return l.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:r}),l.jsxs("div",{className:"relative w-full max-w-lg max-h-[80vh] flex flex-col rounded-2xl border border-border/60 bg-card shadow-2xl font-sans text-foreground",children:[l.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(u,{className:ee("h-4.5 w-4.5",o.cls)}),l.jsx("h3",{className:"text-sm font-semibold",children:o.title})]}),l.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-xs space-y-3 scrollbar-thin",children:e.loading?l.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 text-muted-foreground",children:[l.jsx(ps,{className:"h-4 w-4 animate-spin"})," Details werden geladen…"]}):i!=null&&i.error?l.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-red-400",children:i.error}):l.jsxs(l.Fragment,{children:[(i==null?void 0:i.action_needed)!=null&&l.jsxs("div",{className:ee("flex items-start gap-2 rounded-lg border p-3",i.action_needed?"border-amber-500/40 bg-amber-500/10":"border-emerald-500/40 bg-emerald-500/10"),children:[i.action_needed?l.jsx(Er,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):l.jsx(FN,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:ee("text-xs font-semibold",i.action_needed?"text-amber-300":"text-emerald-300"),children:["Musst du etwas tun? ",i.action_needed?"Ja":"Nein — die Box regelt das (Fangnetz)"]}),i.action_needed&&i.action_text&&l.jsx("div",{className:"mt-0.5 text-[11px] text-foreground/90",children:i.action_text})]})]}),(i==null?void 0:i.summary)&&l.jsxs("div",{className:"rounded-lg border border-primary/25 bg-primary/5 p-3 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary",children:"Was dieses Update bedeutet (Zusammenfassung der Box)"}),l.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-relaxed text-foreground/90 font-sans",children:i.summary})]}),e.kind==="os"?l.jsxs(l.Fragment,{children:[((i==null?void 0:i.count)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine Pakete zu aktualisieren — System ist aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.count," Paket(e) werden aktualisiert:"]}),l.jsx("div",{className:"space-y-1",children:i.packages.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(Sw,{className:"h-3 w-3 text-cyan-400 shrink-0"}),m.name]}),l.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground shrink-0",children:[l.jsx("span",{children:m.current}),l.jsx(nf,{className:"h-3 w-3"}),l.jsx("span",{className:"text-emerald-400",children:m.candidate})]})]},m.name))})]}),(((f=i==null?void 0:i.held_back)==null?void 0:f.length)??0)>0&&l.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/40 bg-background/20 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground",children:[l.jsx(BN,{className:"h-3.5 w-3.5"})," Vom Hersteller zurückgestellt — kein Handeln nötig"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Pakete gäbe es bereits, Ubuntu spielt sie aber gestaffelt aus (Phasen-Rollout) bzw. hält sie kurz zurück. Sie kommen bei einem der nächsten automatischen Läufe von selbst — das ist kein Fehler und nichts hängt fest."}),l.jsx("div",{className:"space-y-1",children:i.held_back.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/30 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(Sw,{className:"h-3 w-3 text-muted-foreground shrink-0"}),m.name]}),l.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:m.reason==="phasing"?"Phasen-Rollout":"vorerst zurückgehalten"})]},m.name))})]})]}):e.kind==="engine"||e.kind==="swap"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[l.jsxs("span",{className:"rounded-md border border-border/40 bg-background/30 px-2 py-1",children:["Build ",(i==null?void 0:i.installed_build)??"?"]}),l.jsx(nf,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsxs("span",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/5 px-2 py-1 text-emerald-400",children:["Build ",(i==null?void 0:i.latest_build)??"?"]})]}),((i==null?void 0:i.name)||(i==null?void 0:i.latest_tag))&&l.jsxs("div",{className:"text-muted-foreground",children:["Release: ",l.jsx("span",{className:"text-foreground",children:i==null?void 0:i.name}),i!=null&&i.latest_tag?` (${i.latest_tag})`:""]}),(i==null?void 0:i.url)&&l.jsxs("a",{href:i.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Original-Release-Notes auf GitHub ",l.jsx(sh,{className:"h-3 w-3"})]}),(i==null?void 0:i.body)&&l.jsxs("details",{className:"group",children:[l.jsx("summary",{className:"cursor-pointer text-[10px] text-muted-foreground hover:text-foreground",children:"Original-Notizen (englisch) anzeigen"}),l.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap rounded-lg border border-border/40 bg-background/30 p-3 text-[10px] leading-relaxed text-muted-foreground max-h-60 overflow-y-auto scrollbar-thin",children:i.body})]})]}):(((h=i==null?void 0:i.commits)==null?void 0:h.length)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine neuen Commits — Hermes-Agent ist bereits aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.behind," neue Commit(s) auf ",l.jsxs("span",{className:"font-mono text-foreground",children:["origin/",i.branch]}),":"]}),l.jsx("div",{className:"space-y-1",children:i.commits.map(m=>l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsx(jM,{className:"h-3.5 w-3.5 text-primary shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[11px] truncate",children:m.subject}),l.jsxs("div",{className:"font-mono text-[9px] text-muted-foreground",children:[m.hash," · ",m.when]})]})]},m.hash))})]}),e.kind!=="os"&&!c&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background/20 p-2.5",children:[l.jsx(qN,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Vor dem Update sichert die Box automatisch den alten Stand. Danach prüft sie den ganzen Stack per echter Anfrage — läuft etwas nicht, rollt sie von selbst zurück",e.kind==="hermes"?" und startet den Gateway neu":"","."]})]})]})}),l.jsxs("div",{className:"flex gap-3 border-t border-border/40 p-4 shrink-0",children:[l.jsx("button",{onClick:r,className:"h-9 flex-1 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold text-muted-foreground hover:bg-accent transition-colors cursor-pointer",children:"Schließen"}),l.jsx("button",{onClick:n,disabled:e.loading||c||!!t,title:t?`Update läuft bereits: ${t.label}`:void 0,className:"h-9 flex-1 rounded-lg bg-primary text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-40 disabled:cursor-default",children:t?"Update läuft…":"Jetzt aktualisieren"})]})]})]})}function Q5({open:e,onClose:t,defaultTab:r="maintenance"}){var nt;const[n,i]=y.useState(null),[o,u]=y.useState([]),[c,f]=y.useState("llama-swap"),[h,m]=y.useState(""),[g,v]=y.useState(!1),[b,j]=y.useState(null),[k,S]=y.useState({}),[N,E]=y.useState("maintenance"),[A,P]=y.useState(!1),[_,O]=y.useState(""),[T,B]=y.useState(!1),[$,z]=y.useState(null),[Q,U]=y.useState([]),[ve,ue]=y.useState(!1),[pe,oe]=y.useState(null),[se,X]=y.useState(null);function ne(K,Le,Cr){X({type:"alert",title:K,message:Le,onConfirm:()=>{X(null),Cr&&Cr()}})}function te(K,Le,Cr){X({type:"confirm",title:K,message:Le,onConfirm:()=>{X(null),Cr()},onCancel:()=>X(null)})}function I(K){return K?new Date(K*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}y.useEffect(()=>{e&&r&&E(r)},[e,r]);function M(){we("/api/maintenance/updates").then(i).catch(K=>console.error("Error loading updates",K))}function H(){we("/api/jobs").then(K=>u(K.jobs||[])).catch(K=>console.error("Error loading jobs",K))}function ie(){we("/api/system/services").then(z).catch(()=>{})}function J(){we("/api/system/backups").then(K=>U(K.backups||[])).catch(()=>{})}function Z(K){v(!0),j(null),we(`/api/maintenance/logs?service=${K}&lines=150`).then(Le=>{Le.ok?m(Le.text):(m(`Fehler beim Laden der Logs: ${Le.err||"Unbekannter Fehler"}`),(Le.status==="incorrect_password"||Le.status==="password_required")&&j(Le.status))}).catch(Le=>m(`Fehler: ${Le.message}`)).finally(()=>v(!1))}y.useEffect(()=>{if(!e)return;M(),H(),ie(),J();const K=setInterval(()=>{H(),M(),ie()},3e3);return()=>clearInterval(K)},[e]),y.useEffect(()=>{!e||N!=="logs"||Z(c)},[e,N,c]);function ae(K){return(K==null?void 0:K.status)==="busy"?(ne("Update läuft bereits",`Es läuft gerade „${K.running}". Bitte warte, bis es fertig ist.`),H(),!0):!1}function me(K){return(K==null?void 0:K.status)==="password_required"||(K==null?void 0:K.status)==="incorrect_password"?(ne("Box-Passwort nötig",(K.status==="incorrect_password"?"Das gespeicherte Box-Passwort stimmt nicht. ":"Für dieses Update braucht die Box dein Passwort. ")+"Bitte oben im Reiter „Einstellungen“ setzen bzw. korrigieren."),!0):K&&K.ok===!1?(ne("Update fehlgeschlagen",K.err||"Unbekannter Fehler."),!0):!1}async function re(){try{const K=await we("/api/maintenance/os-update",{method:"POST"});if(ae(K)||me(K))return;H(),E("maintenance")}catch(K){ne("Fehler",`Fehler beim Starten des OS-Updates: ${K.message}`)}}async function ye(){try{const K=await we("/api/maintenance/engine-update",{method:"POST"});if(ae(K)||me(K))return;H(),E("maintenance")}catch(K){ne("Fehler",`Fehler beim Engine-Update: ${K.message}`)}}async function Oe(){try{const K=await we("/api/maintenance/swap-update",{method:"POST"});if(ae(K)||me(K))return;H(),E("maintenance")}catch(K){ne("Fehler",`Fehler beim Router-Update: ${K.message}`)}}async function de(){ue(!0);try{const K=await we("/api/maintenance/hermes-update",{method:"POST"});if(ae(K))return;H()}catch(K){ne("Fehler",`Hermes-Update fehlgeschlagen: ${K.message}`)}finally{ue(!1)}}async function Ze(K){oe({kind:K,loading:!0,data:null});try{const Le=await we(`/api/maintenance/update-details?kind=${K}`);oe({kind:K,loading:!1,data:Le})}catch(Le){oe({kind:K,loading:!1,data:{kind:K,error:Le.message}})}}function Ue(){const K=pe==null?void 0:pe.kind;oe(null),K==="os"?re():K==="engine"?ye():K==="swap"?Oe():K==="hermes"&&de()}async function _e(){P(!0);try{await we("/api/maintenance/check-updates",{method:"POST"}),H(),E("maintenance")}catch(K){ne("Fehler",`Fehler bei der Update-Suche: ${K.message}`)}finally{P(!1)}}async function xt(K,Le){try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:K,role:Le})}),ne("Gestartet",`Modell-Upgrade für '${Le}' (${K}) gestartet.`),H(),E("maintenance")}catch(Cr){ne("Fehler",`Fehler beim Starten des Modell-Upgrades: ${Cr.message}`)}}async function Jt(){te("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await we("/api/maintenance/reboot",{method:"POST"}),ne("Reboot","Reboot ausgelöst. System startet neu...",()=>{t()})}catch(K){ne("Fehler",`Fehler beim Reboot: ${K.message}`)}})}async function G(){B(!0),O("Snapshot wird erzeugt...");try{const K=await we("/api/system/backup",{method:"POST"});O(K.ok?`Snapshot erzeugt: ${K.snapshot} (${K.files.length} Komponenten)`:"Backup fehlgeschlagen."),J()}catch(K){O(`Fehler: ${K.message}`)}finally{B(!1)}}async function Ne(K){S(Le=>({...Le,[K]:!0}));try{const Le=await we("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:K})});Le.ok?ne("Dienst neu gestartet",`Dienst ${K} wurde erfolgreich neu gestartet.`,()=>{N==="logs"&&c===K&&Z(K)}):ne("Fehler",`Fehler beim Neustart: ${Le.err||"Unbekannter Fehler"}`)}catch(Le){ne("Fehler",`Fehler beim Neustart: ${Le.message}`)}finally{S(Le=>({...Le,[K]:!1}))}}async function Pe(K){try{await we(`/api/jobs/${K}/cancel`,{method:"POST"}),H()}catch(Le){ne("Fehler",`Fehler beim Abbrechen: ${Le.message}`)}}const Ve=o.find(K=>(K.state==="running"||K.state==="queued")&&K.group==="maintenance");return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:ee("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:t}),l.jsxs("div",{className:ee("fixed inset-y-0 right-0 w-full sm:w-[640px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",e?"translate-x-0":"translate-x-full"),children:[l.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),l.jsx("button",{onClick:t,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[l.jsx("button",{onClick:()=>E("maintenance"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),l.jsx("button",{onClick:()=>E("logs"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),l.jsx("button",{onClick:()=>E("settings"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[N==="maintenance"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Updates"}),l.jsxs("button",{onClick:_e,disabled:A||!!Ve,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[l.jsx(ps,{className:ee("h-3 w-3",A&&"animate-spin")})," Nach Updates suchen"]})]}),(n==null?void 0:n.last_check)&&l.jsxs("div",{className:"text-[9px] text-muted-foreground -mt-1",children:["Zuletzt gesucht: ",I(n.last_check)]}),Ve&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-300",children:[l.jsx(ps,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),l.jsxs("span",{children:["Update läuft: ",l.jsx("span",{className:"font-semibold",children:Ve.label})," — bitte warten. Weitere Updates sind solange gesperrt."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Xl,{icon:Qs,iconClass:"text-cyan-400",name:"OS-Pakete (apt)",available:!!(n!=null&&n.os),status:n!=null&&n.os?`${n.os} verfügbar`:"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("os")}),l.jsx(Xl,{icon:uh,iconClass:"text-violet-400",name:"Inferenz-Engine (llama.cpp)",available:!!(n!=null&&n.engine),status:n!=null&&n.engine?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("engine")}),l.jsx(Xl,{icon:QN,iconClass:"text-fuchsia-400",name:"Router (llama-swap)",available:!!(n!=null&&n.swap),status:n!=null&&n.swap?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("swap")}),(()=>{var Le;const K=(Le=n==null?void 0:n.components)==null?void 0:Le.find(Cr=>Cr.key==="hermes_agent");return l.jsx(Xl,{icon:yn,iconClass:"text-amber-400",name:"Hermes-Agent",available:(K==null?void 0:K.update)===!0,busy:ve,status:(K==null?void 0:K.update)===!0?`Update: ${K.latest}`:(K==null?void 0:K.reachable)===!1?"offline":"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("hermes")})})(),(nt=n==null?void 0:n.model_list)==null?void 0:nt.map(K=>l.jsx(Xl,{icon:sM,iconClass:"text-emerald-400",name:`Modell · ${K.role}`,available:!0,status:K.title,actionLabel:"Upgrade",onAction:()=>xt(K.repo,K.role)},K.role))]})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dienste"}),l.jsx("div",{className:"space-y-1.5",children:lk.map(K=>{var Le;return l.jsx(bR,{label:K.label,system:K.type==="system",ok:(Le=$==null?void 0:$.services.find(Cr=>Cr.name.toLowerCase().includes(K.reach)))==null?void 0:Le.ok,busy:k[K.id],onRestart:()=>Ne(K.id),onLogs:()=>{f(K.id),E("logs")}},K.id)})})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Backup"}),l.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/20 px-3 py-2.5 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:Q[0]?`Letztes: ${Q[0].snapshot}`:"Noch kein Backup"}),l.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[Q.length," Snapshots · Restore per CLI (restore.sh)"]})]}),l.jsxs("button",{onClick:G,disabled:T,className:"flex items-center gap-1.5 text-[11px] font-semibold rounded-lg px-2.5 py-1 bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shrink-0",children:[l.jsx(cM,{className:ee("h-3.5 w-3.5",T&&"animate-pulse")})," Snapshot"]})]}),_&&l.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:_})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-red-400/80",children:"Gefahrenzone"}),l.jsxs("button",{onClick:Jt,className:"flex w-full items-center gap-3 p-3 rounded-lg border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[l.jsx(GN,{className:"h-4.5 w-4.5"}),l.jsxs("div",{children:[l.jsx("div",{children:"Host-System neu starten"}),l.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet die ganze Box neu"})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),l.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[o.filter(K=>K.state==="running"||K.state==="queued").length," Aktiv"]})]}),l.jsx("div",{className:"space-y-3",children:o.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):o.map(K=>{const Le=K.state==="running"||K.state==="queued";return l.jsxs("div",{className:ee("p-3 rounded-xl border transition-all duration-300",Le?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[Le&&l.jsxs("span",{className:"flex h-2 w-2 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),K.label]}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[l.jsxs("span",{children:["ID: ",K.id]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:ee(K.state==="done"&&"text-emerald-400",K.state==="failed"&&"text-red-400",K.state==="running"&&"text-primary",K.state==="queued"&&"text-amber-400",K.state==="canceled"&&"text-muted-foreground"),children:K.state})]})]}),Le&&l.jsx("button",{onClick:()=>Pe(K.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),K.state==="running"&&l.jsxs("div",{className:"mt-3 space-y-1",children:[l.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${K.progress??0}%`}})}),l.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[l.jsxs("span",{children:[K.progress??0,"%"]}),K.done_bytes!=null&&K.total_bytes!=null&&l.jsxs("span",{children:[fg(K.done_bytes)," / ",fg(K.total_bytes),K.rate_bps!=null&&` (${fg(K.rate_bps)}/s)`]}),K.eta_s!=null&&l.jsxs("span",{children:["ETA: ",K.eta_s,"s"]})]})]})]},K.id)})})]})]}),N==="logs"&&l.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("select",{value:c,onChange:K=>f(K.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:lk.map(K=>l.jsxs("option",{value:K.id,children:[K.label," (",K.type==="system"?"systemd-root":"user",")"]},K.id))}),l.jsxs("button",{onClick:()=>Ne(c),disabled:k[c],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[l.jsx(ps,{className:ee("h-3.5 w-3.5",k[c]&&"animate-spin")}),"Restart"]})]}),l.jsx(NR,{service:c,text:h,loading:g,logStatus:b,onRefresh:()=>Z(c),onOpenSettings:()=>E("settings")})]}),N==="settings"&&l.jsx(ER,{open:e,showAlert:ne})]})]}),pe&&l.jsx(AR,{detail:pe,maintenanceJob:Ve,onClose:()=>oe(null),onApply:Ue}),se&&l.jsx(W5,{type:se.type,title:se.title,message:se.message,onConfirm:se.onConfirm,onCancel:se.onCancel})]})}let wv=[],kv=[];const jv=new Set,Y5=()=>jv.forEach(e=>e());function X5(e){return jv.add(e),()=>{jv.delete(e)}}function CR(e){wv=[...wv,e].slice(-40),Y5()}function PR(e){kv=[...kv,e].slice(-40),Y5()}const OR=()=>y.useSyncExternalStore(X5,()=>wv),_R=()=>y.useSyncExternalStore(X5,()=>kv);function MR(){const{data:e,dataUpdatedAt:t}=ko(3e3),{data:r,dataUpdatedAt:n}=B5(3e3),i=y.useRef(null);y.useEffect(()=>{var o,u,c,f;e&&CR({t:Date.now(),cpu:((o=e.cpu)==null?void 0:o.percent)??0,ram:((u=e.ram)==null?void 0:u.percent)??0,gpu:((c=e.gpu)==null?void 0:c.busy_percent)??null,disk:((f=e.disk)==null?void 0:f.percent)??null})},[t]),y.useEffect(()=>{if(!r)return;const o=Date.now(),u=r.prompt_tokens,c=r.completion_tokens;if(i.current){const f=Math.max((o-i.current.t)/1e3,.001);PR({t:o,prompt:Math.max(0,(u-i.current.p)/f),completion:Math.max(0,(c-i.current.c)/f)})}i.current={p:u,c,t:o}},[n])}function Z5(){var P,_,O,T,B,$;const{data:e}=M0(),{data:t}=F5(),{data:r}=wi(),{data:n}=ko(),i=!!e&&!!t,o=z=>{var Q;return(Q=t==null?void 0:t.services.find(U=>U.name.toLowerCase().includes(z)))==null?void 0:Q.ok},u=e==null?void 0:e.engine_reachable,c=(P=e==null?void 0:e.brain)==null?void 0:P.ready,f=((_=e==null?void 0:e.brain)==null?void 0:_.model)||((O=r==null?void 0:r.models.find(z=>z.role==="hermes"))==null?void 0:O.name)||"",h=[];h.push((()=>{const z={id:"brain",label:"Lucys Hirn",icon:xa,critical:!0};return i?u===!1?{...z,status:"down",detail:"Die Motor-Maschine (Engine) läuft nicht — Lucy kann gerade gar nicht denken.",repair:{kind:"restart",service:"llama-swap",label:"Motor neu starten",needsSudo:!0}}:c===!1?{...z,status:"down",detail:"Lucys Hirn ist gerade eingeschlafen — einmal aufwecken.",repair:f?{kind:"loadModel",model:f,label:"Hirn aufwecken"}:void 0}:{...z,status:"ok",detail:"Wach und ansprechbar."}:{...z,status:"loading",detail:"Wird geprüft …"}})()),h.push((()=>{const z={id:"vision",label:"Lucys Augen",icon:xu,critical:!1};if(!i||!r)return{...z,status:"loading",detail:"Wird geprüft …"};const Q=r.models.find(ve=>ve.role==="vision");return Q?(r.running??[]).includes(Q.name)?{...z,status:"ok",detail:"Sieht Bildschirm und Bilder."}:{...z,status:"warn",detail:"Lucys Augen sind eingeschlafen — das erste Bild-Ansehen dauert dann kurz.",repair:{kind:"loadModel",model:Q.name,label:"Augen aufwecken"}}:{...z,status:"warn",detail:"Kein Augen-Modell eingerichtet — Lucy kann keine Bilder ansehen."}})()),h.push((()=>{const z={id:"memory",label:"Lucys Gedächtnis",icon:LN,critical:!0},Q=o("mem0");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Merkt sich Neues und findet Altes wieder."}:{...z,status:"down",detail:"Lucy kann sich gerade nichts merken — das Gedächtnis antwortet nicht.",repair:{kind:"restart",service:"mem0-service",label:"Gedächtnis neu starten"}}})()),h.push((()=>{const z={id:"gateway",label:"Verbindung (Gateway)",icon:bu,critical:!0},Q=e?e.gateway_reachable:o("integriert");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Apps und IDEs können Lucy erreichen."}:{...z,status:"down",detail:"Die Verbindungs-Zentrale antwortet nicht — Apps erreichen Lucy nicht.",repair:{kind:"restart",service:"mission-control-2",label:"Zentrale neu starten"}}})()),h.push((()=>{const z={id:"agent",label:"Lucys Agent (Hermes)",icon:yn,critical:!0},Q=o("hermes-gateway");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Lucy ist bereit zu reden und zu handeln."}:{...z,status:"down",detail:"Lucys Agent ist offline — sie reagiert gerade nicht.",repair:{kind:"restart",service:"hermes-gateway",label:"Agent neu starten"}}})()),h.push((()=>{const z={id:"voice",label:"Lucys Stimme",icon:TM,critical:!1},Q=o("voice");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Lucy kann hören und sprechen."}:{...z,status:"warn",detail:"Sprechen ist gerade aus — Tippen geht weiter normal.",repair:{kind:"restart",service:"voice-service",label:"Stimme neu starten"}}})());const m=((T=n==null?void 0:n.gpu)==null?void 0:T.gtt_total)||((B=n==null?void 0:n.gpu)==null?void 0:B.vram_total)||0,g=(($=n==null?void 0:n.gpu)==null?void 0:$.gtt_used)||0,v=m>0?Math.min(100,g/m*100):0,b=1024**3,j=m?v>=90?{status:"full",usedGb:g/b,totalGb:m/b,pct:v,text:"Speicher fast voll — Lucy könnte langsamer werden."}:v>=72?{status:"warn",usedGb:g/b,totalGb:m/b,pct:v,text:"Speicher gut gefüllt — noch okay."}:{status:"ok",usedGb:g/b,totalGb:m/b,pct:v,text:"Genug Speicher frei."}:{status:"unknown",usedGb:0,totalGb:0,pct:0,text:"Speicher-Auslastung unbekannt."},k=h.some(z=>z.status==="loading"),S=h.filter(z=>z.critical&&z.status==="down"),N=h.filter(z=>z.status==="warn"||!z.critical&&z.status==="down"),E=j.status==="full";return{verdict:k&&!S.length?"loading":S.length?"problem":N.length||E?"warn":"gut",checks:h,memory:j,problems:S}}const IR={ok:"bg-emerald-500",warn:"bg-amber-500",down:"bg-red-500",loading:"bg-muted-foreground/40"};function TR({frame:e="lucy"}={}){const{verdict:t,checks:r,memory:n,problems:i}=Z5(),{showAlert:o,dialogElement:u}=ba(),c=Kn(),[f,h]=y.useState({});async function m(S,N){h(E=>({...E,[S]:!0}));try{if(N.kind==="loadModel")await we(`/api/models/${encodeURIComponent(N.model)}/load`,{method:"POST"});else{const E=await we("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:N.service})});E.ok||o("Reparatur nicht ganz geklappt",(E.err||"Unbekannter Fehler")+(N.needsSudo?` +...`}),l.jsxs("p",{children:["Suchen & installieren über die ",l.jsx("strong",{children:"skills.sh"}),"-Registry: ",l.jsx(ze,{children:"npx skills find"})," /",l.jsx(ze,{children:"npx skills add owner/repo"}),". Skills liegen projektweit (vom Agent beim Start gelesen) oder global."]})]}),l.jsxs(Ir,{id:"memory",icon:xM,color:"text-indigo-400",title:"8. Gedächtnis & RAG",kicker:"Modelle vergessen — du nicht",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["LLMs sind ",l.jsx("strong",{children:"zustandslos"}),": ohne Hilfe weiß das Modell beim nächsten Turn nichts mehr. Gedächtnis lebt extern."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Embeddings"})," wandeln Text in Vektoren; ein ",l.jsx("strong",{children:"Vektor-Store"})," (Chroma, …) findet semantisch Ähnliches."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"RAG"})," = relevante Fakten vor dem Turn heraussuchen und einblenden statt alles im Prompt zu halten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Long-Context vs. RAG:"}),' riesige Fenster sind bequem, aber teuer & „lost in the middle" — gezieltes Abrufen skaliert besser.']})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Auto-lernendes Gedächtnis"})," ist die nächste Stufe:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:["extrahiert Fakten ",l.jsx("em",{children:"selbst"})," aus Gesprächen, statt nur abzuspeichern"]}),l.jsx("li",{children:"dedupliziert semantisch (kein 10× derselbe Fakt)"}),l.jsxs("li",{children:[l.jsx("strong",{children:"Graph-Sicht"})," = Fakten ",l.jsx("em",{children:"plus"})," ihre Beziehungen, nicht nur eine flache Liste"]})]})]})]}),l.jsxs(La,{children:["Dein Gedächtnis (Tab ",l.jsx("strong",{children:"Gedächtnis"}),") ist ",l.jsx("strong",{children:"Mem0"}),"-basiert: auto-lernend & semantisch, ",l.jsx("strong",{children:"graph-first"})," dargestellt, mit 4-Typen-Taxonomie (",l.jsx(ze,{children:"Identität"})," · ",l.jsx(ze,{children:"Wissen"})," · ",l.jsx(ze,{children:"Regeln"})," · ",l.jsx(ze,{children:"Ereignisse"}),"). Einstieg über ein kurzes ",l.jsx("strong",{children:"Hermes-Onboarding-Gespräch"})," im Terminal — der Agent lernt im Hintergrund nach jedem Turn.",l.jsx("br",{}),l.jsx("strong",{children:"Gotcha:"})," ein gelöschter Fakt kann wieder auftauchen, solange die Original-Nachricht noch im Verlauf steht (additive Extraktion)."]})]}),l.jsxs(Ir,{id:"agents",icon:Jr,color:"text-rose-400",title:"9. Autonome Agenten betreiben",kicker:"LLM in der Schleife",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Agent"})," ist ein LLM in einer Schleife mit Tools:",l.jsx("em",{children:" denken → Tool aufrufen → Ergebnis beobachten → weiter"}),", bis das Ziel erreicht ist."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Guardrails"})," (Hard-Stop, Tool-Limits) verhindern Endlos-Loops, wenn ein Tool fehlt oder hängt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontext-Hygiene"})," ist die wichtigste Disziplin: frische Sessions starten — vollgemüllte Historien werden langsam, driften und halluzinieren."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kanäle:"})," CLI/Terminal, Chat-UI, Messaging (z.B. Telegram), reine API."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Least Privilege:"})," gib einem Agenten nur die Tools, die er wirklich braucht. Kritische Aktionen (Shell auf dem Host, Löschen, Geld/Deploys) hinter menschliche Freigabe."]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Was sich vollautomatisch lohnt:"})," Modell-Routing, Hintergrund-Gedächtnis, Recherche. ",l.jsx("strong",{children:"Was Freigabe braucht:"})," Systembefehle, Updates/Reboots, permanentes Löschen."]})]})]}),l.jsxs(La,{children:[l.jsx("strong",{children:"Hermes"})," ist dein Box-Agent (Hirn = ",l.jsx(ze,{children:"fast"}),"). Reden tust du mit ihm im",l.jsx("strong",{children:" Terminal"}),"-Tab (Web-Terminal via ttyd) oder per ",l.jsx("strong",{children:"Telegram"}),". Er hat MCP-Server für Gedächtnis, Stack-Steuerung, Web-Fetch und ",l.jsx("strong",{children:"PC-Steuerung"})," (Executor auf deinem Windows-PC). Status & Verdrahtung im ",l.jsx("strong",{children:"Hermes"}),"-Tab."]})]}),l.jsxs(Ir,{id:"ide",icon:Ts,color:"text-cyan-400",title:"10. IDE / Editor anbinden",kicker:"Vibe-Coding lokal",children:[l.jsxs("p",{children:["Jede ",l.jsx("strong",{children:"OpenAI-kompatible"})," IDE oder Extension lässt sich auf einen lokalen Server umbiegen — Base-URL + Model eintragen, fertig:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Cline"})," & ",l.jsx("strong",{children:"Roo Code"})," (VS-Code-Extensions, voller Agent + MCP)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cursor"})," (VS-Code-Fork mit Top-Autocomplete)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Continue"}),", ",l.jsx("strong",{children:"aider"})," (CLI), ",l.jsx("strong",{children:"OpenCode"})," (Desktop)"]})]}),l.jsxs(La,{children:["Tipp den Kram nicht ab: der ",l.jsx("strong",{children:"Verbinden"}),"-Tab generiert die fertige Config (inkl. MCP-Gedächtnis) pro Tool zum Kopieren. Essenz: Base ",l.jsx(ze,{children:"…:9001/v1"}),", Model ",l.jsx(ze,{children:"auto"}),", Key beliebig."]})]}),l.jsx(Ir,{id:"tricks",icon:_M,color:"text-amber-400",title:"11. Tricks & Kniffe",kicker:"Was im Alltag wirklich spart",wide:!0,children:l.jsx("div",{className:"grid md:grid-cols-3 gap-3",children:[["Kontext sauber halten","Neue Session statt Mega-Historie. Drift, Tempo und Halluzination hängen direkt am Kontext-Müll."],["Plan-then-Act","Erst Plan/Vorgehen bestätigen lassen, dann ausführen. Spart teure Holzwege."],["Gezielte Edits","Nie ganze Dateien überschreiben für eine Zeile — Such-/Ersetz-Tools nutzen. Weniger Tokens, weniger Fehler."],["Non-interaktive Befehle","Keine interaktiven Prompts im Agent-Terminal; lange Tasks als Background-Job. Sonst hängt der Loop."],["DevTools koppeln","Browser-/Konsolen-Zugriff geben — der Agent liest echte Fehler statt blind zu raten."],["Richtige Modellwahl","Schnelles Hirn für Alltag, großes für harte Logik, Coder fürs Coden. Nicht alles mit der Kanone."],["Akzeptanzkriterien","Sag konkret, woran „fertig“ erkennbar ist. Vage Prompts → vage Ergebnisse."],["Verifizieren statt vertrauen","Tests/Live-Check fordern. „Sollte funktionieren“ ist kein Beweis."],["Regeln ins Gedächtnis","Wiederkehrende Vorlieben/Konventionen einmal ablegen — der Agent zieht sie selbst."]].map(([r,n])=>l.jsxs("div",{className:"space-y-1 p-3 bg-background/10 rounded-xl border border-border/30",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-foreground text-[11px]",children:[l.jsx(ga,{className:"h-3 w-3 text-amber-400"})," ",r]}),l.jsx("p",{className:"text-[11px]",children:n})]},r))})}),l.jsx(Ir,{id:"wartung",icon:qs,color:"text-emerald-400",title:"12. Sicherheit & Wartung",kicker:"Damit's auch morgen noch läuft",wide:!0,children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(jM,{className:"h-3.5 w-3.5 text-emerald-400"})," Goldene Regeln"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Ein ungetesteter Restore ist kein Backup."})," Wiederherstellung mindestens einmal echt durchspielen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates können Dinge still zerschießen"})," — gerade bei AI-Stacks (Embeddings, Provider-Interna). Versionen pinnen, Smoke-Test, Post-Check."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Least Privilege"})," für Agenten, MCP-Server und PC-Zugriff. Kritisches hinter Freigabe."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(Ku,{className:"h-3.5 w-3.5 text-emerald-400"})," Bei dir im SystemDrawer"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Backup:"})," tägliches Voll-Zustands-Backup, getesteter ",l.jsx(ze,{children:"restore.sh"})," (Doku in ",l.jsx(ze,{children:"docs/BACKUP.md"}),")."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates:"})," git-basierter Update-Check; ",l.jsx("strong",{children:"Hermes-Update-Button"})," mit anschließendem ",l.jsx("strong",{children:"Gehirn-Check"})," (rot, falls das Update das Gedächtnis zerschießt) + Engine-Update."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Dienste & Gefahrenzone:"})," Restart/Logs pro Dienst, kritische Eingriffe getrennt."]})]}),l.jsx("p",{className:"text-[10px] italic",children:'Erreichbar über das System-Icon → Tab „Wartung".'})]})]})}),l.jsxs("section",{id:"ressourcen",className:"scroll-mt-20 md:col-span-2 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(lv,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"13. Kuratierte Ressourcen & Links"}),l.jsx("span",{className:"text-[9px] font-mono text-primary",children:"Sauber geordnet — die guten Quellen"})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-5 text-xs",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(nf,{className:"h-3.5 w-3.5 text-sky-400"})," Modelle & Engines"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://huggingface.co/models",name:"Hugging Face",note:"das Repository für offene Modelle (GGUF, Embeddings, Datasets)."}),l.jsx(kt,{href:"https://github.com/ggml-org/llama.cpp",name:"llama.cpp",note:"die Referenz-Engine für lokale Inferenz."}),l.jsx(kt,{href:"https://github.com/mostlygeek/llama-swap",name:"llama-swap",note:"mehrere Modelle hinter einem Port, Auto-Swap."}),l.jsx(kt,{href:"https://ollama.com",name:"Ollama",note:"einfachster Einstieg, One-Command-Modelle."}),l.jsx(kt,{href:"https://lmstudio.ai",name:"LM Studio",note:"lokale GUI zum Stöbern, Laden & Chatten."}),l.jsx(kt,{href:"https://github.com/vllm-project/vllm",name:"vLLM",note:"Hochdurchsatz-Serving auf dicken GPUs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(xu,{className:"h-3.5 w-3.5 text-violet-400"})," MCP & Skills"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://modelcontextprotocol.io",name:"MCP — offizielle Doku",note:"Spezifikation & Einstieg."}),l.jsx(kt,{href:"https://github.com/modelcontextprotocol/servers",name:"Offizielle MCP-Server",note:"filesystem, git, postgres, fetch & mehr."}),l.jsx(kt,{href:"https://smithery.ai",name:"Smithery",note:"Registry zum Suchen & Auto-Installieren von MCP-Servern."}),l.jsx(kt,{href:"https://glama.ai/mcp/servers",name:"Glama MCP Registry",note:"kuratierte Community-Datenbank."}),l.jsx(kt,{href:"https://skills.sh",name:"skills.sh",note:"Registry & CLI für Agent-Skills."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(Jr,{className:"h-3.5 w-3.5 text-rose-400"})," Agenten & Frameworks"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://github.com/NousResearch/hermes-agent",name:"Hermes Agent (Nous)",note:"der Agent, der auf deiner Box läuft."}),l.jsx(kt,{href:"https://docs.claude.com",name:"Anthropic / Claude Docs",note:"API, Tool-Use, Agent SDK, MCP."}),l.jsx(kt,{href:"https://github.com/cline/cline",name:"Cline",note:"autonomer Coding-Agent für VS Code."}),l.jsx(kt,{href:"https://aider.chat",name:"aider",note:"AI-Pair-Programming im Terminal, git-nativ."}),l.jsx(kt,{href:"https://continue.dev",name:"Continue",note:"Open-Source-Autopilot für IDEs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(sv,{className:"h-3.5 w-3.5 text-amber-400"})," Lernen & Community"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(kt,{href:"https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview",name:"Prompt-Engineering (Anthropic)",note:"die beste praktische Anleitung."}),l.jsx(kt,{href:"https://github.com/anthropics/anthropic-cookbook",name:"Anthropic Cookbook",note:"lauffähige Rezepte für Tools, RAG, Agenten."}),l.jsx(kt,{href:"https://www.promptingguide.ai",name:"Prompt Engineering Guide",note:"herstellerneutrales Nachschlagewerk."}),l.jsx(kt,{href:"https://github.com/mem0ai/mem0",name:"Mem0",note:"die auto-lernende Memory-Schicht hinter deinem Gedächtnis."}),l.jsx(kt,{href:"https://www.reddit.com/r/LocalLLaMA/",name:"r/LocalLLaMA",note:"der Puls der lokalen-LLM-Szene."})]})]})]})]}),l.jsx(Ir,{id:"troubleshooting",icon:OM,color:"text-rose-400",title:"14. Troubleshooting",kicker:"Wenn's hakt",wide:!0,children:l.jsxs("ul",{className:"space-y-2 list-disc pl-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Keine Verbindung?"})," Selbes LAN wie die Box? IP/Port stimmen (",l.jsx(ze,{children:":9001"}),")? Backend-Status in der ",l.jsx("strong",{children:"Zentrale"})," prüfen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Modell antwortet nicht / langsam?"})," In der ",l.jsx("strong",{children:"Zentrale → Dienste"})," schauen, ob ",l.jsx(ze,{children:"llama-swap"})," grün ist; sonst Restart. Erstes Token nach Swap dauert (Modell lädt)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Agent dreht durch / halluziniert?"})," Frische Session im ",l.jsx("strong",{children:"Terminal"})," starten — meist ist es vollgemüllter Kontext."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Gedächtnis findet nichts?"})," Embedding-Dienst online? Semantisch suchen (Sinn statt exaktem Wort). Leeres Gedächtnis → Hermes-Onboarding starten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Update hat etwas zerschossen?"})," Genau dafür gibt es Backup & ",l.jsx(ze,{children:"restore.sh"})," — den getesteten Restore fahren, dann Ursache suchen."]})]})})]}),l.jsx("p",{className:"text-center text-[10px] text-muted-foreground/50 pt-2",children:"Mission Control 2 · AI-Bibel · Stand Juni 2026 — lebendes Dokument, wächst mit dem Stack."})]})}function bR({title:e,hint:t}){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:e}),l.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[l.jsx(yM,{className:"h-8 w-8 text-muted-foreground"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const lk=[{id:"mission-control-2",label:"Mission Control",type:"user",reach:"gateway (integr"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user",reach:"hermes-gateway"},{id:"mem0-service",label:"Mem0 (Gedächtnis)",type:"user",reach:"mem0"},{id:"voice-service",label:"Voice (Sprache)",type:"user",reach:"voice"},{id:"hermes-terminal",label:"Hermes Terminal",type:"user",reach:"hermes-terminal"},{id:"llama-swap",label:"Llama Swap",type:"system",reach:"llama-swap"}];function Yl({icon:e,iconClass:t,name:r,status:n,available:i,busy:o,actionLabel:u,onAction:c}){return l.jsxs("div",{className:ee("flex items-center gap-3 rounded-lg border px-3 py-2",i?"border-amber-500/30 bg-amber-500/5":"border-border/50 bg-background/20"),children:[l.jsx(e,{className:ee("h-4 w-4 shrink-0",t)}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:r}),l.jsx("div",{className:ee("text-[10px] truncate",i?"text-amber-400/90":"text-muted-foreground"),children:n})]}),l.jsx("button",{onClick:c,disabled:!i||o,className:ee("text-[11px] font-semibold rounded-lg px-2.5 py-1 transition-colors shrink-0",i?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer":"border border-border/50 text-muted-foreground/40 cursor-default"),children:o?"…":u})]})}function wR({label:e,ok:t,system:r,busy:n,onRestart:i,onLogs:o}){return l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border/50 bg-background/20 px-3 py-2",children:[l.jsx("span",{className:ee("w-1.5 h-1.5 rounded-full shrink-0",t===!0?"bg-emerald-500":t===!1?"bg-red-500":"bg-muted-foreground/40")}),l.jsxs("span",{className:"flex-1 text-xs text-foreground truncate",children:[e,r&&l.jsx("span",{className:"text-[9px] text-muted-foreground",children:" (root)"})]}),l.jsx("button",{onClick:i,disabled:n,title:"Neu starten",className:"text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",children:l.jsx(ps,{className:ee("h-3.5 w-3.5",n&&"animate-spin")})}),l.jsx("button",{onClick:o,title:"Logs ansehen",className:"text-muted-foreground hover:text-primary transition-colors",children:l.jsx(bM,{className:"h-3.5 w-3.5"})})]})}function fg(e){return e==null?"":e>1024**3?`${(e/1024**3).toFixed(2)} GB`:`${(e/1024**2).toFixed(1)} MB`}const kR=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,jR=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function SR(e){return kR.test(e)?"error":jR.test(e)?"warn":"info"}const NR={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function ER({service:e,text:t,loading:r,logStatus:n,onRefresh:i,onOpenSettings:o}){const[u,c]=y.useState(!1),[f,h]=y.useState(""),m=y.useRef(null),g=y.useMemo(()=>t?t.split(` +`).map(S=>({t:S,level:SR(S)})):[],[t]),v=y.useMemo(()=>g.filter(S=>S.level!=="info").length,[g]),b=f.trim().toLowerCase(),j=g.filter(S=>(!u||S.level!=="info")&&(!b||S.t.toLowerCase().includes(b))),k=n==="password_required"||n==="incorrect_password";return l.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[l.jsxs("div",{className:"flex h-10 items-center justify-between gap-2 px-3 border-b border-border/40 bg-black/30 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground shrink-0",children:[l.jsx(YN,{className:"h-3 w-3 text-primary"}),l.jsx("span",{className:"hidden sm:inline",children:"stdout/stderr —"})," ",e]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs("div",{className:"relative",children:[l.jsx(lh,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{value:f,onChange:S=>h(S.target.value),placeholder:"filtern…",className:"h-7 w-24 sm:w-36 rounded-md border border-border/50 bg-background/40 pl-6 pr-2 text-[10px] text-foreground outline-none focus:border-primary/50"})]}),l.jsxs("button",{onClick:()=>c(S=>!S),title:"Nur Fehler und Warnungen zeigen",className:ee("flex h-7 items-center gap-1 rounded-md border px-2 text-[10px] font-semibold transition-colors",u?"border-amber-500/50 bg-amber-500/15 text-amber-300":"border-border/50 bg-background/20 text-muted-foreground hover:text-foreground"),children:[l.jsx(Er,{className:"h-3 w-3"}),"Nur Probleme",v>0?` (${v})`:""]}),l.jsx("button",{onClick:i,disabled:r,title:"Neu laden",className:"flex h-7 w-7 items-center justify-center rounded-md border border-border/50 bg-background/20 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:l.jsx(ps,{className:ee("h-3 w-3",r&&"animate-spin")})})]})]}),l.jsx("div",{ref:m,className:"flex-1 overflow-y-auto p-3 text-[10px] font-mono leading-relaxed scrollbar-thin select-text",children:k?l.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[l.jsx(Er,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),l.jsx("div",{className:"text-xs font-semibold text-amber-300",children:n==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),l.jsxs("p",{className:"max-w-xs text-[10px] leading-normal text-muted-foreground",children:["Für das Auslesen der systemd-Logs von ",e," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),l.jsx("button",{onClick:o,className:"mt-2 rounded-md bg-primary px-3 py-1.5 text-[10px] font-semibold text-primary-foreground transition-colors hover:bg-primary/95",children:"Sudo-Passwort eintragen"})]}):r&&!t?l.jsx("span",{className:"text-muted-foreground",children:"Lade Logs…"}):g.length===0?l.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."}):j.length===0?l.jsx("span",{className:"text-muted-foreground",children:u?"Keine Fehler oder Warnungen — der Dienst läuft sauber. ✓":"Kein Treffer für den Filter."}):j.map((S,N)=>l.jsx("div",{className:ee("whitespace-pre-wrap",NR[S.level]),children:S.t||" "},N))})]})}function AR({open:e,showAlert:t}){const[r,n]=y.useState(""),[i,o]=y.useState(""),[u,c]=y.useState(!1),[f,h]=y.useState(!1);return y.useEffect(()=>{e&&(n(localStorage.getItem("mc_sudo_password")||""),o(localStorage.getItem("mc_hf_token")||""))},[e]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(qs,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:u?"text":"password",value:r,onChange:m=>n(m.target.value),"aria-label":"Host Sudo-Passwort",name:"sudo-password",autoComplete:"off",spellCheck:!1,placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>c(!u),"aria-label":u?"Passwort verbergen":"Passwort anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:u?l.jsx(ww,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(yu,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(AM,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:f?"text":"password",value:i,onChange:m=>o(m.target.value),"aria-label":"HuggingFace API Token",name:"hf-token",autoComplete:"off",spellCheck:!1,placeholder:"hf_…",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>h(!f),"aria-label":f?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:f?l.jsx(ww,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(yu,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",r),localStorage.setItem("mc_hf_token",i),t("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),l.jsx("button",{onClick:()=>{n(""),o(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),t("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})}function CR({detail:e,maintenanceJob:t,onClose:r,onApply:n}){var f,h;const i=e.data,o={os:{icon:qs,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:uh,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:QN,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:Jr,cls:"text-amber-400",title:"Hermes-Agent"}}[e.kind],u=o.icon,c=i?e.kind==="os"?(i.count??0)===0:e.kind==="hermes"?(i.behind??0)===0:i.installed_build!=null&&i.latest_build!=null&&i.latest_build<=i.installed_build:!0;return l.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:r}),l.jsxs("div",{className:"relative w-full max-w-lg max-h-[80vh] flex flex-col rounded-2xl border border-border/60 bg-card shadow-2xl font-sans text-foreground",children:[l.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(u,{className:ee("h-4.5 w-4.5",o.cls)}),l.jsx("h3",{className:"text-sm font-semibold",children:o.title})]}),l.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-xs space-y-3 scrollbar-thin",children:e.loading?l.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 text-muted-foreground",children:[l.jsx(ps,{className:"h-4 w-4 animate-spin"})," Details werden geladen…"]}):i!=null&&i.error?l.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-red-400",children:i.error}):l.jsxs(l.Fragment,{children:[(i==null?void 0:i.action_needed)!=null&&l.jsxs("div",{className:ee("flex items-start gap-2 rounded-lg border p-3",i.action_needed?"border-amber-500/40 bg-amber-500/10":"border-emerald-500/40 bg-emerald-500/10"),children:[i.action_needed?l.jsx(Er,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):l.jsx(FN,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:ee("text-xs font-semibold",i.action_needed?"text-amber-300":"text-emerald-300"),children:["Musst du etwas tun? ",i.action_needed?"Ja":"Nein — die Box regelt das (Fangnetz)"]}),i.action_needed&&i.action_text&&l.jsx("div",{className:"mt-0.5 text-[11px] text-foreground/90",children:i.action_text})]})]}),(i==null?void 0:i.summary)&&l.jsxs("div",{className:"rounded-lg border border-primary/25 bg-primary/5 p-3 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary",children:"Was dieses Update bedeutet (Zusammenfassung der Box)"}),l.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-relaxed text-foreground/90 font-sans",children:i.summary})]}),e.kind==="os"?l.jsxs(l.Fragment,{children:[((i==null?void 0:i.count)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine Pakete zu aktualisieren — System ist aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.count," Paket(e) werden aktualisiert:"]}),l.jsx("div",{className:"space-y-1",children:i.packages.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(Sw,{className:"h-3 w-3 text-cyan-400 shrink-0"}),m.name]}),l.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground shrink-0",children:[l.jsx("span",{children:m.current}),l.jsx(rf,{className:"h-3 w-3"}),l.jsx("span",{className:"text-emerald-400",children:m.candidate})]})]},m.name))})]}),(((f=i==null?void 0:i.held_back)==null?void 0:f.length)??0)>0&&l.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/40 bg-background/20 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground",children:[l.jsx(BN,{className:"h-3.5 w-3.5"})," Vom Hersteller zurückgestellt — kein Handeln nötig"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Pakete gäbe es bereits, Ubuntu spielt sie aber gestaffelt aus (Phasen-Rollout) bzw. hält sie kurz zurück. Sie kommen bei einem der nächsten automatischen Läufe von selbst — das ist kein Fehler und nichts hängt fest."}),l.jsx("div",{className:"space-y-1",children:i.held_back.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/30 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(Sw,{className:"h-3 w-3 text-muted-foreground shrink-0"}),m.name]}),l.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:m.reason==="phasing"?"Phasen-Rollout":"vorerst zurückgehalten"})]},m.name))})]})]}):e.kind==="engine"||e.kind==="swap"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[l.jsxs("span",{className:"rounded-md border border-border/40 bg-background/30 px-2 py-1",children:["Build ",(i==null?void 0:i.installed_build)??"?"]}),l.jsx(rf,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsxs("span",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/5 px-2 py-1 text-emerald-400",children:["Build ",(i==null?void 0:i.latest_build)??"?"]})]}),((i==null?void 0:i.name)||(i==null?void 0:i.latest_tag))&&l.jsxs("div",{className:"text-muted-foreground",children:["Release: ",l.jsx("span",{className:"text-foreground",children:i==null?void 0:i.name}),i!=null&&i.latest_tag?` (${i.latest_tag})`:""]}),(i==null?void 0:i.url)&&l.jsxs("a",{href:i.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Original-Release-Notes auf GitHub ",l.jsx(sh,{className:"h-3 w-3"})]}),(i==null?void 0:i.body)&&l.jsxs("details",{className:"group",children:[l.jsx("summary",{className:"cursor-pointer text-[10px] text-muted-foreground hover:text-foreground",children:"Original-Notizen (englisch) anzeigen"}),l.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap rounded-lg border border-border/40 bg-background/30 p-3 text-[10px] leading-relaxed text-muted-foreground max-h-60 overflow-y-auto scrollbar-thin",children:i.body})]})]}):(((h=i==null?void 0:i.commits)==null?void 0:h.length)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine neuen Commits — Hermes-Agent ist bereits aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.behind," neue Commit(s) auf ",l.jsxs("span",{className:"font-mono text-foreground",children:["origin/",i.branch]}),":"]}),l.jsx("div",{className:"space-y-1",children:i.commits.map(m=>l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsx(SM,{className:"h-3.5 w-3.5 text-primary shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[11px] truncate",children:m.subject}),l.jsxs("div",{className:"font-mono text-[9px] text-muted-foreground",children:[m.hash," · ",m.when]})]})]},m.hash))})]}),e.kind!=="os"&&!c&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background/20 p-2.5",children:[l.jsx(qN,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Vor dem Update sichert die Box automatisch den alten Stand. Danach prüft sie den ganzen Stack per echter Anfrage — läuft etwas nicht, rollt sie von selbst zurück",e.kind==="hermes"?" und startet den Gateway neu":"","."]})]})]})}),l.jsxs("div",{className:"flex gap-3 border-t border-border/40 p-4 shrink-0",children:[l.jsx("button",{onClick:r,className:"h-9 flex-1 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold text-muted-foreground hover:bg-accent transition-colors cursor-pointer",children:"Schließen"}),l.jsx("button",{onClick:n,disabled:e.loading||c||!!t,title:t?`Update läuft bereits: ${t.label}`:void 0,className:"h-9 flex-1 rounded-lg bg-primary text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-40 disabled:cursor-default",children:t?"Update läuft…":"Jetzt aktualisieren"})]})]})]})}function Q5({open:e,onClose:t,defaultTab:r="maintenance"}){var nt;const[n,i]=y.useState(null),[o,u]=y.useState([]),[c,f]=y.useState("llama-swap"),[h,m]=y.useState(""),[g,v]=y.useState(!1),[b,j]=y.useState(null),[k,S]=y.useState({}),[N,E]=y.useState("maintenance"),[A,P]=y.useState(!1),[_,O]=y.useState(""),[T,B]=y.useState(!1),[$,z]=y.useState(null),[Q,U]=y.useState([]),[ve,ue]=y.useState(!1),[pe,oe]=y.useState(null),[se,X]=y.useState(null);function ne(K,Le,Cr){X({type:"alert",title:K,message:Le,onConfirm:()=>{X(null),Cr&&Cr()}})}function te(K,Le,Cr){X({type:"confirm",title:K,message:Le,onConfirm:()=>{X(null),Cr()},onCancel:()=>X(null)})}function I(K){return K?new Date(K*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}y.useEffect(()=>{e&&r&&E(r)},[e,r]);function M(){we("/api/maintenance/updates").then(i).catch(K=>console.error("Error loading updates",K))}function H(){we("/api/jobs").then(K=>u(K.jobs||[])).catch(K=>console.error("Error loading jobs",K))}function ie(){we("/api/system/services").then(z).catch(()=>{})}function J(){we("/api/system/backups").then(K=>U(K.backups||[])).catch(()=>{})}function Z(K){v(!0),j(null),we(`/api/maintenance/logs?service=${K}&lines=150`).then(Le=>{Le.ok?m(Le.text):(m(`Fehler beim Laden der Logs: ${Le.err||"Unbekannter Fehler"}`),(Le.status==="incorrect_password"||Le.status==="password_required")&&j(Le.status))}).catch(Le=>m(`Fehler: ${Le.message}`)).finally(()=>v(!1))}y.useEffect(()=>{if(!e)return;M(),H(),ie(),J();const K=setInterval(()=>{H(),M(),ie()},3e3);return()=>clearInterval(K)},[e]),y.useEffect(()=>{!e||N!=="logs"||Z(c)},[e,N,c]);function ae(K){return(K==null?void 0:K.status)==="busy"?(ne("Update läuft bereits",`Es läuft gerade „${K.running}". Bitte warte, bis es fertig ist.`),H(),!0):!1}function me(K){return(K==null?void 0:K.status)==="password_required"||(K==null?void 0:K.status)==="incorrect_password"?(ne("Box-Passwort nötig",(K.status==="incorrect_password"?"Das gespeicherte Box-Passwort stimmt nicht. ":"Für dieses Update braucht die Box dein Passwort. ")+"Bitte oben im Reiter „Einstellungen“ setzen bzw. korrigieren."),!0):K&&K.ok===!1?(ne("Update fehlgeschlagen",K.err||"Unbekannter Fehler."),!0):!1}async function re(){try{const K=await we("/api/maintenance/os-update",{method:"POST"});if(ae(K)||me(K))return;H(),E("maintenance")}catch(K){ne("Fehler",`Fehler beim Starten des OS-Updates: ${K.message}`)}}async function ye(){try{const K=await we("/api/maintenance/engine-update",{method:"POST"});if(ae(K)||me(K))return;H(),E("maintenance")}catch(K){ne("Fehler",`Fehler beim Engine-Update: ${K.message}`)}}async function Oe(){try{const K=await we("/api/maintenance/swap-update",{method:"POST"});if(ae(K)||me(K))return;H(),E("maintenance")}catch(K){ne("Fehler",`Fehler beim Router-Update: ${K.message}`)}}async function de(){ue(!0);try{const K=await we("/api/maintenance/hermes-update",{method:"POST"});if(ae(K))return;H()}catch(K){ne("Fehler",`Hermes-Update fehlgeschlagen: ${K.message}`)}finally{ue(!1)}}async function Ze(K){oe({kind:K,loading:!0,data:null});try{const Le=await we(`/api/maintenance/update-details?kind=${K}`);oe({kind:K,loading:!1,data:Le})}catch(Le){oe({kind:K,loading:!1,data:{kind:K,error:Le.message}})}}function Ue(){const K=pe==null?void 0:pe.kind;oe(null),K==="os"?re():K==="engine"?ye():K==="swap"?Oe():K==="hermes"&&de()}async function _e(){P(!0);try{await we("/api/maintenance/check-updates",{method:"POST"}),H(),E("maintenance")}catch(K){ne("Fehler",`Fehler bei der Update-Suche: ${K.message}`)}finally{P(!1)}}async function xt(K,Le){try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:K,role:Le})}),ne("Gestartet",`Modell-Upgrade für '${Le}' (${K}) gestartet.`),H(),E("maintenance")}catch(Cr){ne("Fehler",`Fehler beim Starten des Modell-Upgrades: ${Cr.message}`)}}async function Jt(){te("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await we("/api/maintenance/reboot",{method:"POST"}),ne("Reboot","Reboot ausgelöst. System startet neu...",()=>{t()})}catch(K){ne("Fehler",`Fehler beim Reboot: ${K.message}`)}})}async function G(){B(!0),O("Snapshot wird erzeugt...");try{const K=await we("/api/system/backup",{method:"POST"});O(K.ok?`Snapshot erzeugt: ${K.snapshot} (${K.files.length} Komponenten)`:"Backup fehlgeschlagen."),J()}catch(K){O(`Fehler: ${K.message}`)}finally{B(!1)}}async function Ne(K){S(Le=>({...Le,[K]:!0}));try{const Le=await we("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:K})});Le.ok?ne("Dienst neu gestartet",`Dienst ${K} wurde erfolgreich neu gestartet.`,()=>{N==="logs"&&c===K&&Z(K)}):ne("Fehler",`Fehler beim Neustart: ${Le.err||"Unbekannter Fehler"}`)}catch(Le){ne("Fehler",`Fehler beim Neustart: ${Le.message}`)}finally{S(Le=>({...Le,[K]:!1}))}}async function Pe(K){try{await we(`/api/jobs/${K}/cancel`,{method:"POST"}),H()}catch(Le){ne("Fehler",`Fehler beim Abbrechen: ${Le.message}`)}}const Ve=o.find(K=>(K.state==="running"||K.state==="queued")&&K.group==="maintenance");return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:ee("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:t}),l.jsxs("div",{className:ee("fixed inset-y-0 right-0 w-full sm:w-[640px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",e?"translate-x-0":"translate-x-full"),children:[l.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),l.jsx("button",{onClick:t,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[l.jsx("button",{onClick:()=>E("maintenance"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),l.jsx("button",{onClick:()=>E("logs"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),l.jsx("button",{onClick:()=>E("settings"),className:ee("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[N==="maintenance"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Updates"}),l.jsxs("button",{onClick:_e,disabled:A||!!Ve,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[l.jsx(ps,{className:ee("h-3 w-3",A&&"animate-spin")})," Nach Updates suchen"]})]}),(n==null?void 0:n.last_check)&&l.jsxs("div",{className:"text-[9px] text-muted-foreground -mt-1",children:["Zuletzt gesucht: ",I(n.last_check)]}),Ve&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-300",children:[l.jsx(ps,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),l.jsxs("span",{children:["Update läuft: ",l.jsx("span",{className:"font-semibold",children:Ve.label})," — bitte warten. Weitere Updates sind solange gesperrt."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(Yl,{icon:qs,iconClass:"text-cyan-400",name:"OS-Pakete (apt)",available:!!(n!=null&&n.os),status:n!=null&&n.os?`${n.os} verfügbar`:"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("os")}),l.jsx(Yl,{icon:uh,iconClass:"text-violet-400",name:"Inferenz-Engine (llama.cpp)",available:!!(n!=null&&n.engine),status:n!=null&&n.engine?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("engine")}),l.jsx(Yl,{icon:QN,iconClass:"text-fuchsia-400",name:"Router (llama-swap)",available:!!(n!=null&&n.swap),status:n!=null&&n.swap?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("swap")}),(()=>{var Le;const K=(Le=n==null?void 0:n.components)==null?void 0:Le.find(Cr=>Cr.key==="hermes_agent");return l.jsx(Yl,{icon:Jr,iconClass:"text-amber-400",name:"Hermes-Agent",available:(K==null?void 0:K.update)===!0,busy:ve,status:(K==null?void 0:K.update)===!0?`Update: ${K.latest}`:(K==null?void 0:K.reachable)===!1?"offline":"aktuell",actionLabel:"Anzeigen",onAction:()=>Ze("hermes")})})(),(nt=n==null?void 0:n.model_list)==null?void 0:nt.map(K=>l.jsx(Yl,{icon:lM,iconClass:"text-emerald-400",name:`Modell · ${K.role}`,available:!0,status:K.title,actionLabel:"Upgrade",onAction:()=>xt(K.repo,K.role)},K.role))]})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dienste"}),l.jsx("div",{className:"space-y-1.5",children:lk.map(K=>{var Le;return l.jsx(wR,{label:K.label,system:K.type==="system",ok:(Le=$==null?void 0:$.services.find(Cr=>Cr.name.toLowerCase().includes(K.reach)))==null?void 0:Le.ok,busy:k[K.id],onRestart:()=>Ne(K.id),onLogs:()=>{f(K.id),E("logs")}},K.id)})})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Backup"}),l.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/20 px-3 py-2.5 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:Q[0]?`Letztes: ${Q[0].snapshot}`:"Noch kein Backup"}),l.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[Q.length," Snapshots · Restore per CLI (restore.sh)"]})]}),l.jsxs("button",{onClick:G,disabled:T,className:"flex items-center gap-1.5 text-[11px] font-semibold rounded-lg px-2.5 py-1 bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shrink-0",children:[l.jsx(dM,{className:ee("h-3.5 w-3.5",T&&"animate-pulse")})," Snapshot"]})]}),_&&l.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:_})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-red-400/80",children:"Gefahrenzone"}),l.jsxs("button",{onClick:Jt,className:"flex w-full items-center gap-3 p-3 rounded-lg border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[l.jsx(GN,{className:"h-4.5 w-4.5"}),l.jsxs("div",{children:[l.jsx("div",{children:"Host-System neu starten"}),l.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet die ganze Box neu"})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),l.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[o.filter(K=>K.state==="running"||K.state==="queued").length," Aktiv"]})]}),l.jsx("div",{className:"space-y-3",children:o.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):o.map(K=>{const Le=K.state==="running"||K.state==="queued";return l.jsxs("div",{className:ee("p-3 rounded-xl border transition-all duration-300",Le?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[Le&&l.jsxs("span",{className:"flex h-2 w-2 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),K.label]}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[l.jsxs("span",{children:["ID: ",K.id]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:ee(K.state==="done"&&"text-emerald-400",K.state==="failed"&&"text-red-400",K.state==="running"&&"text-primary",K.state==="queued"&&"text-amber-400",K.state==="canceled"&&"text-muted-foreground"),children:K.state})]})]}),Le&&l.jsx("button",{onClick:()=>Pe(K.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),K.state==="running"&&l.jsxs("div",{className:"mt-3 space-y-1",children:[l.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${K.progress??0}%`}})}),l.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[l.jsxs("span",{children:[K.progress??0,"%"]}),K.done_bytes!=null&&K.total_bytes!=null&&l.jsxs("span",{children:[fg(K.done_bytes)," / ",fg(K.total_bytes),K.rate_bps!=null&&` (${fg(K.rate_bps)}/s)`]}),K.eta_s!=null&&l.jsxs("span",{children:["ETA: ",K.eta_s,"s"]})]})]})]},K.id)})})]})]}),N==="logs"&&l.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("select",{value:c,onChange:K=>f(K.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:lk.map(K=>l.jsxs("option",{value:K.id,children:[K.label," (",K.type==="system"?"systemd-root":"user",")"]},K.id))}),l.jsxs("button",{onClick:()=>Ne(c),disabled:k[c],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[l.jsx(ps,{className:ee("h-3.5 w-3.5",k[c]&&"animate-spin")}),"Restart"]})]}),l.jsx(ER,{service:c,text:h,loading:g,logStatus:b,onRefresh:()=>Z(c),onOpenSettings:()=>E("settings")})]}),N==="settings"&&l.jsx(AR,{open:e,showAlert:ne})]})]}),pe&&l.jsx(CR,{detail:pe,maintenanceJob:Ve,onClose:()=>oe(null),onApply:Ue}),se&&l.jsx(W5,{type:se.type,title:se.title,message:se.message,onConfirm:se.onConfirm,onCancel:se.onCancel})]})}let wv=[],kv=[];const jv=new Set,Y5=()=>jv.forEach(e=>e());function X5(e){return jv.add(e),()=>{jv.delete(e)}}function PR(e){wv=[...wv,e].slice(-40),Y5()}function OR(e){kv=[...kv,e].slice(-40),Y5()}const _R=()=>y.useSyncExternalStore(X5,()=>wv),MR=()=>y.useSyncExternalStore(X5,()=>kv);function IR(){const{data:e,dataUpdatedAt:t}=ko(3e3),{data:r,dataUpdatedAt:n}=B5(3e3),i=y.useRef(null);y.useEffect(()=>{var o,u,c,f;e&&PR({t:Date.now(),cpu:((o=e.cpu)==null?void 0:o.percent)??0,ram:((u=e.ram)==null?void 0:u.percent)??0,gpu:((c=e.gpu)==null?void 0:c.busy_percent)??null,disk:((f=e.disk)==null?void 0:f.percent)??null})},[t]),y.useEffect(()=>{if(!r)return;const o=Date.now(),u=r.prompt_tokens,c=r.completion_tokens;if(i.current){const f=Math.max((o-i.current.t)/1e3,.001);OR({t:o,prompt:Math.max(0,(u-i.current.p)/f),completion:Math.max(0,(c-i.current.c)/f)})}i.current={p:u,c,t:o}},[n])}function Z5(){var P,_,O,T,B,$;const{data:e}=M0(),{data:t}=F5(),{data:r}=wi(),{data:n}=ko(),i=!!e&&!!t,o=z=>{var Q;return(Q=t==null?void 0:t.services.find(U=>U.name.toLowerCase().includes(z)))==null?void 0:Q.ok},u=e==null?void 0:e.engine_reachable,c=(P=e==null?void 0:e.brain)==null?void 0:P.ready,f=((_=e==null?void 0:e.brain)==null?void 0:_.model)||((O=r==null?void 0:r.models.find(z=>z.role==="hermes"))==null?void 0:O.name)||"",h=[];h.push((()=>{const z={id:"brain",label:"Lucys Hirn",icon:xa,critical:!0};return i?u===!1?{...z,status:"down",detail:"Die Motor-Maschine (Engine) läuft nicht — Lucy kann gerade gar nicht denken.",repair:{kind:"restart",service:"llama-swap",label:"Motor neu starten",needsSudo:!0}}:c===!1?{...z,status:"down",detail:"Lucys Hirn ist gerade eingeschlafen — einmal aufwecken.",repair:f?{kind:"loadModel",model:f,label:"Hirn aufwecken"}:void 0}:{...z,status:"ok",detail:"Wach und ansprechbar."}:{...z,status:"loading",detail:"Wird geprüft …"}})()),h.push((()=>{const z={id:"vision",label:"Lucys Augen",icon:yu,critical:!1};if(!i||!r)return{...z,status:"loading",detail:"Wird geprüft …"};const Q=r.models.find(ve=>ve.role==="vision");return Q?(r.running??[]).includes(Q.name)?{...z,status:"ok",detail:"Sieht Bildschirm und Bilder."}:{...z,status:"warn",detail:"Lucys Augen sind eingeschlafen — das erste Bild-Ansehen dauert dann kurz.",repair:{kind:"loadModel",model:Q.name,label:"Augen aufwecken"}}:{...z,status:"warn",detail:"Kein Augen-Modell eingerichtet — Lucy kann keine Bilder ansehen."}})()),h.push((()=>{const z={id:"memory",label:"Lucys Gedächtnis",icon:LN,critical:!0},Q=o("mem0");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Merkt sich Neues und findet Altes wieder."}:{...z,status:"down",detail:"Lucy kann sich gerade nichts merken — das Gedächtnis antwortet nicht.",repair:{kind:"restart",service:"mem0-service",label:"Gedächtnis neu starten"}}})()),h.push((()=>{const z={id:"gateway",label:"Verbindung (Gateway)",icon:xu,critical:!0},Q=e?e.gateway_reachable:o("integriert");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Apps und IDEs können Lucy erreichen."}:{...z,status:"down",detail:"Die Verbindungs-Zentrale antwortet nicht — Apps erreichen Lucy nicht.",repair:{kind:"restart",service:"mission-control-2",label:"Zentrale neu starten"}}})()),h.push((()=>{const z={id:"agent",label:"Lucys Agent (Hermes)",icon:Jr,critical:!0},Q=o("hermes-gateway");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Lucy ist bereit zu reden und zu handeln."}:{...z,status:"down",detail:"Lucys Agent ist offline — sie reagiert gerade nicht.",repair:{kind:"restart",service:"hermes-gateway",label:"Agent neu starten"}}})()),h.push((()=>{const z={id:"voice",label:"Lucys Stimme",icon:DM,critical:!1},Q=o("voice");return!i||Q===void 0?{...z,status:"loading",detail:"Wird geprüft …"}:Q?{...z,status:"ok",detail:"Lucy kann hören und sprechen."}:{...z,status:"warn",detail:"Sprechen ist gerade aus — Tippen geht weiter normal.",repair:{kind:"restart",service:"voice-service",label:"Stimme neu starten"}}})());const m=((T=n==null?void 0:n.gpu)==null?void 0:T.gtt_total)||((B=n==null?void 0:n.gpu)==null?void 0:B.vram_total)||0,g=(($=n==null?void 0:n.gpu)==null?void 0:$.gtt_used)||0,v=m>0?Math.min(100,g/m*100):0,b=1024**3,j=m?v>=90?{status:"full",usedGb:g/b,totalGb:m/b,pct:v,text:"Speicher fast voll — Lucy könnte langsamer werden."}:v>=72?{status:"warn",usedGb:g/b,totalGb:m/b,pct:v,text:"Speicher gut gefüllt — noch okay."}:{status:"ok",usedGb:g/b,totalGb:m/b,pct:v,text:"Genug Speicher frei."}:{status:"unknown",usedGb:0,totalGb:0,pct:0,text:"Speicher-Auslastung unbekannt."},k=h.some(z=>z.status==="loading"),S=h.filter(z=>z.critical&&z.status==="down"),N=h.filter(z=>z.status==="warn"||!z.critical&&z.status==="down"),E=j.status==="full";return{verdict:k&&!S.length?"loading":S.length?"problem":N.length||E?"warn":"gut",checks:h,memory:j,problems:S}}const TR={ok:"bg-emerald-500",warn:"bg-amber-500",down:"bg-red-500",loading:"bg-muted-foreground/40"};function DR({frame:e="lucy"}={}){const{verdict:t,checks:r,memory:n,problems:i}=Z5(),{showAlert:o,dialogElement:u}=ba(),c=Kn(),[f,h]=y.useState({});async function m(S,N){h(E=>({...E,[S]:!0}));try{if(N.kind==="loadModel")await we(`/api/models/${encodeURIComponent(N.model)}/load`,{method:"POST"});else{const E=await we("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:N.service})});E.ok||o("Reparatur nicht ganz geklappt",(E.err||"Unbekannter Fehler")+(N.needsSudo?` -Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}c.invalidateQueries({queryKey:Be.health}),c.invalidateQueries({queryKey:Be.services}),c.invalidateQueries({queryKey:Be.models})}catch(E){o("Reparatur fehlgeschlagen",String((E==null?void 0:E.message)||E))}finally{h(E=>({...E,[S]:!1}))}}const g=e==="box"?{loading:"Box wird geprüft …",gut:"Alles okay",warn:"Kleinigkeit an der Box",problem:"Box braucht Hilfe"}:{loading:"Lucy wird geprüft …",gut:"Lucy geht's gut 💚",warn:"Kleinigkeit bei Lucy",problem:"Lucy braucht Hilfe"},v={loading:{ring:"border-border/60 bg-card/45",icon:qs,iconCls:"text-muted-foreground animate-spin",title:g.loading,sub:"Einen Moment, ich schaue nach dem Rechten."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:UN,iconCls:"text-emerald-400",title:g.gut,sub:"Alle wichtigen Fähigkeiten laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Er,iconCls:"text-amber-400",title:g.warn,sub:"Nichts Schlimmes — nur ein Hinweis."},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Er,iconCls:"text-red-400",title:g.problem,sub:`${i.length} wichtige${i.length===1?"s":""} Problem${i.length===1?"":"e"} gefunden.`}}[t],b=v.icon,j={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[n.status],k={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[n.status];return l.jsxs("div",{className:ee("rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors",v.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(b,{className:ee("h-6 w-6",v.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:v.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:v.sub})]})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(fa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:ee("font-mono font-bold",k),children:n.status==="unknown"?"—":`${n.usedGb.toFixed(0)} / ${n.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:ee("h-full rounded-full transition-all duration-500",j),style:{width:`${n.pct}%`}})}),l.jsx("p",{className:ee("mt-1.5 text-[11px]",k),children:n.text})]}),l.jsx("div",{className:"mt-4 space-y-1.5",children:r.map(S=>l.jsx(DR,{c:S,busy:!!f[S.id],onRepair:()=>S.repair&&m(S.id,S.repair)},S.id))}),u]})}function DR({c:e,busy:t,onRepair:r}){const n=e.icon,i=e.status==="down"||e.status==="warn";return l.jsxs("div",{className:ee("flex items-center justify-between gap-3 rounded-xl border p-2.5 transition-colors",e.status==="down"?"border-red-500/25 bg-red-500/5":e.status==="warn"?"border-amber-500/20 bg-amber-500/5":"border-border/30 bg-background/15"),children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsxs("span",{className:"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/40 bg-background/30 text-foreground/80",children:[l.jsx(n,{className:"h-4 w-4"}),l.jsx("span",{className:ee("absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-black/40",IR[e.status],e.status==="down"&&"animate-pulse")})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-foreground",children:[e.label,e.status==="ok"&&l.jsx(qt,{className:"h-3 w-3 text-emerald-400"}),!e.critical&&l.jsx("span",{className:"rounded bg-background/40 px-1 py-0.5 text-[8px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"optional"})]}),l.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:e.detail})]})]}),i&&e.repair&&l.jsxs("button",{onClick:r,disabled:t,className:ee("flex h-8 shrink-0 items-center gap-1.5 rounded-lg border px-2.5 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-60",e.status==="down"?"border-red-500/40 bg-red-500/10 text-red-300 hover:bg-red-500/20":"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20"),title:e.repair.label,children:[t?l.jsx(qs,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Gu,{className:"h-3.5 w-3.5"}),e.repair.label]}),i&&!e.repair&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-semibold text-muted-foreground",title:"Keine Auto-Reparatur bekannt",children:[l.jsx(HM,{className:"h-3.5 w-3.5"})," manuell"]})]})}function RR(){const{data:e,error:t}=ko(3e3),r=OR();return{sys:e,hist:r,error:t}}var LR=["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"];function D0(e){if(typeof e!="string")return!1;var t=LR;return t.includes(e)}var $R=["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"],zR=new Set($R);function J5(e){return typeof e!="string"?!1:zR.has(e)}function eE(e){return typeof e=="string"&&e.startsWith("data-")}function xn(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(J5(r)||eE(r))&&(t[r]=e[r]);return t}function vh(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return xn(t)}return typeof e=="object"&&!Array.isArray(e)?xn(e):null}function Jr(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(J5(r)||eE(r)||D0(r))&&(t[r]=e[r]);return t}function FR(e){return e==null?null:y.isValidElement(e)?Jr(e.props):typeof e=="object"&&!Array.isArray(e)?Jr(e):null}var BR=["children","width","height","viewBox","className","style","title","desc"];function Sv(){return Sv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,o=e.viewBox,u=e.className,c=e.style,f=e.title,h=e.desc,m=UR(e,BR),g=o||{width:n,height:i,x:0,y:0},v=rt("recharts-surface",u);return y.createElement("svg",Sv({},Jr(m),{className:v,width:n,height:i,style:c,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),y.createElement("title",null,f),y.createElement("desc",null,h),r)}),WR=["children","className"];function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=KR(e,WR),o=rt("recharts-layer",n);return y.createElement("g",Nv({className:o},Jr(i),{ref:t}),r)}),VR=y.createContext(null);function vt(e){return function(){return e}}const Ev=Math.PI,Av=2*Ev,Ha=1e-6,qR=Av-Ha;function rE(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rE;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iHa)if(!(Math.abs(g*f-h*m)>Ha)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let b=n-u,j=i-c,k=f*f+h*h,S=b*b+j*j,N=Math.sqrt(k),E=Math.sqrt(v),A=o*Math.tan((Ev-Math.acos((k+v-S)/(2*N*E)))/2),P=A/E,_=A/N;Math.abs(P-1)>Ha&&this._append`L${t+P*m},${r+P*g}`,this._append`A${o},${o},0,0,${+(g*b>m*j)},${this._x1=t+_*f},${this._y1=r+_*h}`}}arc(t,r,n,i,o,u){if(t=+t,r=+r,n=+n,u=!!u,n<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(i),f=n*Math.sin(i),h=t+c,m=r+f,g=1^u,v=u?i-o:o-i;this._x1===null?this._append`M${h},${m}`:(Math.abs(this._x1-h)>Ha||Math.abs(this._y1-m)>Ha)&&this._append`L${h},${m}`,n&&(v<0&&(v=v%Av+Av),v>qR?this._append`A${n},${n},0,1,${g},${t-c},${r-f}A${n},${n},0,1,${g},${this._x1=h},${this._y1=m}`:v>Ha&&this._append`A${n},${n},0,${+(v>=Ev)},${g},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function nE(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new YR(t)}function R0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iE(e){this._context=e}iE.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 yh(e){return new iE(e)}function aE(e){return e[0]}function oE(e){return e[1]}function sE(e,t){var r=vt(!0),n=null,i=yh,o=null,u=nE(c);e=typeof e=="function"?e:e===void 0?aE:vt(e),t=typeof t=="function"?t:t===void 0?oE:vt(t);function c(f){var h,m=(f=R0(f)).length,g,v=!1,b;for(n==null&&(o=i(b=u())),h=0;h<=m;++h)!(h=b;--j)c.point(A[j],P[j]);c.lineEnd(),c.areaEnd()}N&&(A[v]=+e(S,v,g),P[v]=+t(S,v,g),c.point(n?+n(S,v,g):A[v],r?+r(S,v,g):P[v]))}if(E)return c=null,E+""||null}function m(){return sE().defined(i).curve(u).context(o)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:vt(+g),n=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:vt(+g),h):e},h.x1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:vt(+g),h):n},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:vt(+g),r=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:vt(+g),h):t},h.y1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:vt(+g),h):r},h.lineX0=h.lineY0=function(){return m().x(e).y(t)},h.lineY1=function(){return m().x(e).y(r)},h.lineX1=function(){return m().x(n).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:vt(!!g),h):i},h.curve=function(g){return arguments.length?(u=g,o!=null&&(c=u(o)),h):u},h.context=function(g){return arguments.length?(g==null?o=c=null:c=u(o=g),h):o},h}class lE{constructor(t,r){this._context=t,this._x=r}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(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function XR(e){return new lE(e,!0)}function ZR(e){return new lE(e,!1)}function df(){}function ff(e,t,r){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+r)/6)}function uE(e){this._context=e}uE.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:ff(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:ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JR(e){return new uE(e)}function cE(e){this._context=e}cE.prototype={areaStart:df,areaEnd:df,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:ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eL(e){return new cE(e)}function dE(e){this._context=e}dE.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tL(e){return new dE(e)}function fE(e){this._context=e}fE.prototype={areaStart:df,areaEnd:df,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 rL(e){return new fE(e)}function uk(e){return e<0?-1:1}function ck(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),u=(r-e._y1)/(i||n<0&&-0),c=(o*i+u*n)/(n+i);return(uk(o)+uk(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(c))||0}function dk(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function hg(e,t,r){var n=e._x0,i=e._y0,o=e._x1,u=e._y1,c=(o-n)/3;e._context.bezierCurveTo(n+c,i+c*t,o-c,u-c*r,o,u)}function hf(e){this._context=e}hf.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:hg(this,this._t0,dk(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 r=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,hg(this,dk(this,r=ck(this,e,t)),r);break;default:hg(this,this._t0,r=ck(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function hE(e){this._context=new mE(e)}(hE.prototype=Object.create(hf.prototype)).point=function(e,t){hf.prototype.point.call(this,t,e)};function mE(e){this._context=e}mE.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,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function nL(e){return new hf(e)}function iL(e){return new hE(e)}function pE(e){this._context=e}pE.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=fk(e),i=fk(t),o=0,u=1;u=0;--t)i[t]=(u[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function oL(e){return new xh(e,.5)}function sL(e){return new xh(e,0)}function lL(e){return new xh(e,1)}function ho(e,t){if((u=e.length)>1)for(var r=1,n,i,o=e[t[0]],u,c=o.length;r=0;)r[t]=t;return r}function uL(e,t){return e[t]}function cL(e){const t=[];return t.key=e,t}function dL(){var e=vt([]),t=Cv,r=ho,n=uL;function i(o){var u=Array.from(e.apply(this,arguments),cL),c,f=u.length,h=-1,m;for(const g of o)for(c=0,++h;c0){for(var r,n,i=0,o=e[0].length,u;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,u;n1&&arguments[1]!==void 0?arguments[1]:gL,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Wt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var c=r[u-1];return typeof c=="string"?i+c+o:c!==void 0?i+ca(c)+o:i+o},"")}var Yr=e=>e===0?0:e>0?1:-1,Fn=e=>typeof e=="number"&&e!=+e,mo=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ae=e=>(typeof e=="number"||e instanceof Number)&&!Fn(e),Bn=e=>Ae(e)||typeof e=="string",vL=0,ju=e=>{var t=++vL;return"".concat(e||"").concat(t)},ya=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(t)&&typeof t!="string")return n;var o;if(mo(t)){if(r==null)return n;var u=t.indexOf("%");o=r*parseFloat(t.slice(0,u))/100}else o=+t;return Fn(o)&&(o=n),i&&r!=null&&o>r&&(o=r),o},yE=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):jo(n,t))===r)}var Qt=e=>e===null||typeof e>"u",z0=e=>Qt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Sr(e){return e!=null}function Xs(){}var bE=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,F0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(y.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{D0(i)&&typeof r[i]=="function"&&(n[i]=(o=>r[i](r,o)))}),n},yL=(e,t,r)=>n=>(e(t,r,n),null),xL=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var o=e[i];D0(i)&&typeof o=="function"&&(n||(n={}),n[i]=yL(o,t,r))}),n};function hk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bL(e){for(var t=1;t(u[c]===void 0&&n[c]!==void 0&&(u[c]=n[c]),u),r);return o}function SL(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function B0(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const PL="[object RegExp]",kE="[object String]",jE="[object Number]",SE="[object Boolean]",NE="[object Arguments]",OL="[object Symbol]",_L="[object Date]",ML="[object Map]",IL="[object Set]",TL="[object Array]",DL="[object ArrayBuffer]",RL="[object Object]",LL="[object DataView]",$L="[object Uint8Array]",zL="[object Uint8ClampedArray]",FL="[object Uint16Array]",BL="[object Uint32Array]",UL="[object Int8Array]",HL="[object Int16Array]",WL="[object Int32Array]",KL="[object Float32Array]",GL="[object Float64Array]",mk=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function VL(e){return typeof mk.Buffer<"u"&&mk.Buffer.isBuffer(e)}function qL(e,t){return Va(e,void 0,e,new Map,t)}function Va(e,t,r,n=new Map,i=void 0){const o=i==null?void 0:i(e,t,r,n);if(o!==void 0)return o;if(Ov(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const u=new Array(e.length);n.set(e,u);for(let c=0;c{}):_v(e,t,function n(i,o,u,c,f,h){const m=r(i,o,u,c,f,h);return m!==void 0?!!m:_v(i,o,n,h,!1)},new Map,!0)}function _v(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return XL(e,t,r,n);case"function":return Object.keys(t).length>0?_v(e,{...t},r,n,i):qd(e,t);default:return EE(e)&&i?typeof t=="string"?t==="":!0:qd(e,t)}}function XL(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return CE(e,t,r,n);if(t instanceof Map)return ZL(e,t,r,n);if(t instanceof Set)return JL(e,t,r,n);const i=Object.keys(t);if(e==null||Ov(e))return i.length===0;if(i.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o{})}function e$(e){return e=YL(e),t=>PE(t,e)}function t$(e,t){return qL(e,(r,n,i,o)=>{if(typeof e=="object"){if(B0(e)==="[object Object]"&&typeof e.constructor!="function"){const u={};return o.set(e,u),hn(u,e,i,o),u}switch(Object.prototype.toString.call(e)){case jE:case kE:case SE:{const u=new e.constructor(e==null?void 0:e.valueOf());return hn(u,e),u}case NE:{const u={};return hn(u,e),u.length=e.length,u[Symbol.iterator]=e[Symbol.iterator],u}default:return}}})}function r$(e){return t$(e)}const n$=/^(?:0|[1-9]\d*)$/;function OE(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function _E(e){return e!=null&&typeof e!="function"&&l$(e.length)}function u$(e){return typeof e=="object"&&e!==null}function c$(e){return u$(e)&&_E(e)}function pk(e,t=wE){return c$(e)?SL(Array.from(e),NL(s$(t),1)):[]}function d$(e,t,r){return t===!0?pk(e,r):typeof t=="function"?pk(e,t):e}var mg={exports:{}},pg={},gg={exports:{}},vg={};/** +Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}c.invalidateQueries({queryKey:Be.health}),c.invalidateQueries({queryKey:Be.services}),c.invalidateQueries({queryKey:Be.models})}catch(E){o("Reparatur fehlgeschlagen",String((E==null?void 0:E.message)||E))}finally{h(E=>({...E,[S]:!1}))}}const g=e==="box"?{loading:"Box wird geprüft …",gut:"Alles okay",warn:"Kleinigkeit an der Box",problem:"Box braucht Hilfe"}:{loading:"Lucy wird geprüft …",gut:"Lucy geht's gut 💚",warn:"Kleinigkeit bei Lucy",problem:"Lucy braucht Hilfe"},v={loading:{ring:"border-border/60 bg-card/45",icon:Vs,iconCls:"text-muted-foreground animate-spin",title:g.loading,sub:"Einen Moment, ich schaue nach dem Rechten."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:UN,iconCls:"text-emerald-400",title:g.gut,sub:"Alle wichtigen Fähigkeiten laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Er,iconCls:"text-amber-400",title:g.warn,sub:"Nichts Schlimmes — nur ein Hinweis."},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Er,iconCls:"text-red-400",title:g.problem,sub:`${i.length} wichtige${i.length===1?"s":""} Problem${i.length===1?"":"e"} gefunden.`}}[t],b=v.icon,j={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[n.status],k={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[n.status];return l.jsxs("div",{className:ee("rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors",v.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(b,{className:ee("h-6 w-6",v.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:v.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:v.sub})]})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(fa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:ee("font-mono font-bold",k),children:n.status==="unknown"?"—":`${n.usedGb.toFixed(0)} / ${n.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:ee("h-full rounded-full transition-all duration-500",j),style:{width:`${n.pct}%`}})}),l.jsx("p",{className:ee("mt-1.5 text-[11px]",k),children:n.text})]}),l.jsx("div",{className:"mt-4 space-y-1.5",children:r.map(S=>l.jsx(RR,{c:S,busy:!!f[S.id],onRepair:()=>S.repair&&m(S.id,S.repair)},S.id))}),u]})}function RR({c:e,busy:t,onRepair:r}){const n=e.icon,i=e.status==="down"||e.status==="warn";return l.jsxs("div",{className:ee("flex items-center justify-between gap-3 rounded-xl border p-2.5 transition-colors",e.status==="down"?"border-red-500/25 bg-red-500/5":e.status==="warn"?"border-amber-500/20 bg-amber-500/5":"border-border/30 bg-background/15"),children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsxs("span",{className:"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/40 bg-background/30 text-foreground/80",children:[l.jsx(n,{className:"h-4 w-4"}),l.jsx("span",{className:ee("absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-black/40",TR[e.status],e.status==="down"&&"animate-pulse")})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-foreground",children:[e.label,e.status==="ok"&&l.jsx(qt,{className:"h-3 w-3 text-emerald-400"}),!e.critical&&l.jsx("span",{className:"rounded bg-background/40 px-1 py-0.5 text-[8px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"optional"})]}),l.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:e.detail})]})]}),i&&e.repair&&l.jsxs("button",{onClick:r,disabled:t,className:ee("flex h-8 shrink-0 items-center gap-1.5 rounded-lg border px-2.5 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-60",e.status==="down"?"border-red-500/40 bg-red-500/10 text-red-300 hover:bg-red-500/20":"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20"),title:e.repair.label,children:[t?l.jsx(Vs,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Ku,{className:"h-3.5 w-3.5"}),e.repair.label]}),i&&!e.repair&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-semibold text-muted-foreground",title:"Keine Auto-Reparatur bekannt",children:[l.jsx(WM,{className:"h-3.5 w-3.5"})," manuell"]})]})}function LR(){const{data:e,error:t}=ko(3e3),r=_R();return{sys:e,hist:r,error:t}}var $R=["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"];function D0(e){if(typeof e!="string")return!1;var t=$R;return t.includes(e)}var zR=["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"],FR=new Set(zR);function J5(e){return typeof e!="string"?!1:FR.has(e)}function eE(e){return typeof e=="string"&&e.startsWith("data-")}function xn(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(J5(r)||eE(r))&&(t[r]=e[r]);return t}function vh(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return xn(t)}return typeof e=="object"&&!Array.isArray(e)?xn(e):null}function en(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(J5(r)||eE(r)||D0(r))&&(t[r]=e[r]);return t}function BR(e){return e==null?null:y.isValidElement(e)?en(e.props):typeof e=="object"&&!Array.isArray(e)?en(e):null}var UR=["children","width","height","viewBox","className","style","title","desc"];function Sv(){return Sv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,o=e.viewBox,u=e.className,c=e.style,f=e.title,h=e.desc,m=HR(e,UR),g=o||{width:n,height:i,x:0,y:0},v=rt("recharts-surface",u);return y.createElement("svg",Sv({},en(m),{className:v,width:n,height:i,style:c,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),y.createElement("title",null,f),y.createElement("desc",null,h),r)}),KR=["children","className"];function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=GR(e,KR),o=rt("recharts-layer",n);return y.createElement("g",Nv({className:o},en(i),{ref:t}),r)}),qR=y.createContext(null);function vt(e){return function(){return e}}const Ev=Math.PI,Av=2*Ev,Ha=1e-6,QR=Av-Ha;function rE(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rE;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iHa)if(!(Math.abs(g*f-h*m)>Ha)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let b=n-u,j=i-c,k=f*f+h*h,S=b*b+j*j,N=Math.sqrt(k),E=Math.sqrt(v),A=o*Math.tan((Ev-Math.acos((k+v-S)/(2*N*E)))/2),P=A/E,_=A/N;Math.abs(P-1)>Ha&&this._append`L${t+P*m},${r+P*g}`,this._append`A${o},${o},0,0,${+(g*b>m*j)},${this._x1=t+_*f},${this._y1=r+_*h}`}}arc(t,r,n,i,o,u){if(t=+t,r=+r,n=+n,u=!!u,n<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(i),f=n*Math.sin(i),h=t+c,m=r+f,g=1^u,v=u?i-o:o-i;this._x1===null?this._append`M${h},${m}`:(Math.abs(this._x1-h)>Ha||Math.abs(this._y1-m)>Ha)&&this._append`L${h},${m}`,n&&(v<0&&(v=v%Av+Av),v>QR?this._append`A${n},${n},0,1,${g},${t-c},${r-f}A${n},${n},0,1,${g},${this._x1=h},${this._y1=m}`:v>Ha&&this._append`A${n},${n},0,${+(v>=Ev)},${g},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function nE(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new XR(t)}function R0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iE(e){this._context=e}iE.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 yh(e){return new iE(e)}function aE(e){return e[0]}function oE(e){return e[1]}function sE(e,t){var r=vt(!0),n=null,i=yh,o=null,u=nE(c);e=typeof e=="function"?e:e===void 0?aE:vt(e),t=typeof t=="function"?t:t===void 0?oE:vt(t);function c(f){var h,m=(f=R0(f)).length,g,v=!1,b;for(n==null&&(o=i(b=u())),h=0;h<=m;++h)!(h=b;--j)c.point(A[j],P[j]);c.lineEnd(),c.areaEnd()}N&&(A[v]=+e(S,v,g),P[v]=+t(S,v,g),c.point(n?+n(S,v,g):A[v],r?+r(S,v,g):P[v]))}if(E)return c=null,E+""||null}function m(){return sE().defined(i).curve(u).context(o)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:vt(+g),n=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:vt(+g),h):e},h.x1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:vt(+g),h):n},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:vt(+g),r=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:vt(+g),h):t},h.y1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:vt(+g),h):r},h.lineX0=h.lineY0=function(){return m().x(e).y(t)},h.lineY1=function(){return m().x(e).y(r)},h.lineX1=function(){return m().x(n).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:vt(!!g),h):i},h.curve=function(g){return arguments.length?(u=g,o!=null&&(c=u(o)),h):u},h.context=function(g){return arguments.length?(g==null?o=c=null:c=u(o=g),h):o},h}class lE{constructor(t,r){this._context=t,this._x=r}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(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function ZR(e){return new lE(e,!0)}function JR(e){return new lE(e,!1)}function df(){}function ff(e,t,r){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+r)/6)}function uE(e){this._context=e}uE.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:ff(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:ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eL(e){return new uE(e)}function cE(e){this._context=e}cE.prototype={areaStart:df,areaEnd:df,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:ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tL(e){return new cE(e)}function dE(e){this._context=e}dE.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ff(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rL(e){return new dE(e)}function fE(e){this._context=e}fE.prototype={areaStart:df,areaEnd:df,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 nL(e){return new fE(e)}function uk(e){return e<0?-1:1}function ck(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),u=(r-e._y1)/(i||n<0&&-0),c=(o*i+u*n)/(n+i);return(uk(o)+uk(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(c))||0}function dk(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function hg(e,t,r){var n=e._x0,i=e._y0,o=e._x1,u=e._y1,c=(o-n)/3;e._context.bezierCurveTo(n+c,i+c*t,o-c,u-c*r,o,u)}function hf(e){this._context=e}hf.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:hg(this,this._t0,dk(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 r=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,hg(this,dk(this,r=ck(this,e,t)),r);break;default:hg(this,this._t0,r=ck(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function hE(e){this._context=new mE(e)}(hE.prototype=Object.create(hf.prototype)).point=function(e,t){hf.prototype.point.call(this,t,e)};function mE(e){this._context=e}mE.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,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function iL(e){return new hf(e)}function aL(e){return new hE(e)}function pE(e){this._context=e}pE.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=fk(e),i=fk(t),o=0,u=1;u=0;--t)i[t]=(u[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function sL(e){return new xh(e,.5)}function lL(e){return new xh(e,0)}function uL(e){return new xh(e,1)}function ho(e,t){if((u=e.length)>1)for(var r=1,n,i,o=e[t[0]],u,c=o.length;r=0;)r[t]=t;return r}function cL(e,t){return e[t]}function dL(e){const t=[];return t.key=e,t}function fL(){var e=vt([]),t=Cv,r=ho,n=cL;function i(o){var u=Array.from(e.apply(this,arguments),dL),c,f=u.length,h=-1,m;for(const g of o)for(c=0,++h;c0){for(var r,n,i=0,o=e[0].length,u;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,u;n1&&arguments[1]!==void 0?arguments[1]:vL,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Wt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var c=r[u-1];return typeof c=="string"?i+c+o:c!==void 0?i+ca(c)+o:i+o},"")}var Yr=e=>e===0?0:e>0?1:-1,Fn=e=>typeof e=="number"&&e!=+e,mo=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ae=e=>(typeof e=="number"||e instanceof Number)&&!Fn(e),Bn=e=>Ae(e)||typeof e=="string",yL=0,ku=e=>{var t=++yL;return"".concat(e||"").concat(t)},ya=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(t)&&typeof t!="string")return n;var o;if(mo(t)){if(r==null)return n;var u=t.indexOf("%");o=r*parseFloat(t.slice(0,u))/100}else o=+t;return Fn(o)&&(o=n),i&&r!=null&&o>r&&(o=r),o},yE=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):jo(n,t))===r)}var Qt=e=>e===null||typeof e>"u",z0=e=>Qt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Sr(e){return e!=null}function Ys(){}var bE=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,F0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(y.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{D0(i)&&typeof r[i]=="function"&&(n[i]=(o=>r[i](r,o)))}),n},xL=(e,t,r)=>n=>(e(t,r,n),null),bL=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var o=e[i];D0(i)&&typeof o=="function"&&(n||(n={}),n[i]=xL(o,t,r))}),n};function hk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wL(e){for(var t=1;t(u[c]===void 0&&n[c]!==void 0&&(u[c]=n[c]),u),r);return o}function NL(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function B0(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const OL="[object RegExp]",kE="[object String]",jE="[object Number]",SE="[object Boolean]",NE="[object Arguments]",_L="[object Symbol]",ML="[object Date]",IL="[object Map]",TL="[object Set]",DL="[object Array]",RL="[object ArrayBuffer]",LL="[object Object]",$L="[object DataView]",zL="[object Uint8Array]",FL="[object Uint8ClampedArray]",BL="[object Uint16Array]",UL="[object Uint32Array]",HL="[object Int8Array]",WL="[object Int16Array]",KL="[object Int32Array]",GL="[object Float32Array]",VL="[object Float64Array]",mk=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function qL(e){return typeof mk.Buffer<"u"&&mk.Buffer.isBuffer(e)}function QL(e,t){return Va(e,void 0,e,new Map,t)}function Va(e,t,r,n=new Map,i=void 0){const o=i==null?void 0:i(e,t,r,n);if(o!==void 0)return o;if(Ov(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const u=new Array(e.length);n.set(e,u);for(let c=0;c{}):_v(e,t,function n(i,o,u,c,f,h){const m=r(i,o,u,c,f,h);return m!==void 0?!!m:_v(i,o,n,h,!1)},new Map,!0)}function _v(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return ZL(e,t,r,n);case"function":return Object.keys(t).length>0?_v(e,{...t},r,n,i):Vd(e,t);default:return EE(e)&&i?typeof t=="string"?t==="":!0:Vd(e,t)}}function ZL(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return CE(e,t,r,n);if(t instanceof Map)return JL(e,t,r,n);if(t instanceof Set)return e$(e,t,r,n);const i=Object.keys(t);if(e==null||Ov(e))return i.length===0;if(i.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o{})}function t$(e){return e=XL(e),t=>PE(t,e)}function r$(e,t){return QL(e,(r,n,i,o)=>{if(typeof e=="object"){if(B0(e)==="[object Object]"&&typeof e.constructor!="function"){const u={};return o.set(e,u),mn(u,e,i,o),u}switch(Object.prototype.toString.call(e)){case jE:case kE:case SE:{const u=new e.constructor(e==null?void 0:e.valueOf());return mn(u,e),u}case NE:{const u={};return mn(u,e),u.length=e.length,u[Symbol.iterator]=e[Symbol.iterator],u}default:return}}})}function n$(e){return r$(e)}const i$=/^(?:0|[1-9]\d*)$/;function OE(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function _E(e){return e!=null&&typeof e!="function"&&u$(e.length)}function c$(e){return typeof e=="object"&&e!==null}function d$(e){return c$(e)&&_E(e)}function pk(e,t=wE){return d$(e)?NL(Array.from(e),EL(l$(t),1)):[]}function f$(e,t,r){return t===!0?pk(e,r):typeof t=="function"?pk(e,t):e}var mg={exports:{}},pg={},gg={exports:{}},vg={};/** * @license React * use-sync-external-store-shim.production.js * @@ -586,7 +591,7 @@ Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:" * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var gk;function f$(){if(gk)return vg;gk=1;var e=Vs();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function c(g,v){var b=v(),j=n({inst:{value:b,getSnapshot:v}}),k=j[0].inst,S=j[1];return o(function(){k.value=b,k.getSnapshot=v,f(k)&&S({inst:k})},[g,b,v]),i(function(){return f(k)&&S({inst:k}),g(function(){f(k)&&S({inst:k})})},[g]),u(b),b}function f(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!r(g,b)}catch{return!0}}function h(g,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return vg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,vg}var vk;function h$(){return vk||(vk=1,gg.exports=f$()),gg.exports}/** + */var gk;function h$(){if(gk)return vg;gk=1;var e=Gs();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function c(g,v){var b=v(),j=n({inst:{value:b,getSnapshot:v}}),k=j[0].inst,S=j[1];return o(function(){k.value=b,k.getSnapshot=v,f(k)&&S({inst:k})},[g,b,v]),i(function(){return f(k)&&S({inst:k}),g(function(){f(k)&&S({inst:k})})},[g]),u(b),b}function f(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!r(g,b)}catch{return!0}}function h(g,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return vg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,vg}var vk;function m$(){return vk||(vk=1,gg.exports=h$()),gg.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -594,12 +599,12 @@ Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:" * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yk;function m$(){if(yk)return pg;yk=1;var e=Vs(),t=h$();function r(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,o=e.useRef,u=e.useEffect,c=e.useMemo,f=e.useDebugValue;return pg.useSyncExternalStoreWithSelector=function(h,m,g,v,b){var j=o(null);if(j.current===null){var k={hasValue:!1,value:null};j.current=k}else k=j.current;j=c(function(){function N(O){if(!E){if(E=!0,A=O,O=v(O),b!==void 0&&k.hasValue){var T=k.value;if(b(T,O))return P=T}return P=O}if(T=P,n(A,O))return T;var B=v(O);return b!==void 0&&b(T,B)?(A=O,T):(A=O,P=B)}var E=!1,A,P,_=g===void 0?null:g;return[function(){return N(m())},_===null?void 0:function(){return N(_())}]},[m,g,v,b]);var S=i(h,j[0],j[1]);return u(function(){k.hasValue=!0,k.value=S},[S]),f(S),S},pg}var xk;function p$(){return xk||(xk=1,mg.exports=m$()),mg.exports}var g$=p$(),U0=y.createContext(null),v$=e=>e,Nt=()=>{var e=y.useContext(U0);return e?e.store.dispatch:v$},Qd=()=>{},y$=()=>Qd,x$=(e,t)=>e===t;function Me(e){var t=y.useContext(U0),r=y.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Qd,[t,e]);return g$.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:y$,t?t.store.getState:Qd,t?t.store.getState:Qd,r,x$)}function b$(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function w$(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var bk=e=>Array.isArray(e)?e:[e];function k$(e){const t=Array.isArray(e[0])?e[0]:e;return w$(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function j$(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?S$:WeakRef,ME=N$(),E$=0,wk=1;function _d(){return{s:E$,v:void 0,o:null,p:null}}function A$(e){return e instanceof ME?e.deref():e}function IE(e,t={}){let r=_d();const{resultEqualityCheck:n}=t;let i,o=0;function u(){let c=r;const{length:f}=arguments;for(let g=0,v=f;g{r=_d(),u.resetResultsCount()},u.resultsCount=()=>o,u.resetResultsCount=()=>{o=0},u}function C$(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,u=0,c,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),b$(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const m={...r,...f},{memoize:g,memoizeOptions:v=[],argsMemoize:b=IE,argsMemoizeOptions:j=[]}=m,k=bk(v),S=bk(j),N=k$(i),E=g(function(){return o++,h.apply(null,arguments)},...k),A=b(function(){u++;const _=j$(N,arguments);return c=E.apply(null,_),c},...S);return Object.assign(A,{resultFunc:h,memoizedResultFunc:E,dependencies:N,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:g,argsMemoize:b})};return Object.assign(n,{withTypes:()=>n}),n}var q=C$(IE);function P$(e,t=1){const r=[],n=Math.floor(t),i=(o,u)=>{for(let c=0;c{if(e!==t){const n=kk(e),i=kk(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function TE(e){return typeof e=="symbol"||e instanceof Symbol}const _$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M$=/^\w*$/;function I$(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||TE(e)?!0:typeof e=="string"&&(M$.test(e)||!_$.test(e))||t!=null}function T$(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(c=>String(c));const i=(c,f)=>{let h=c;for(let m=0;mf==null||c==null?f:typeof c=="object"&&"key"in c?Object.hasOwn(f,c.key)?f[c.key]:i(f,c.path):typeof c=="function"?c(f):Array.isArray(c)?i(f,c):typeof f=="object"?f[c]:f,u=t.map(c=>(Array.isArray(c)&&c.length===1&&(c=c[0]),c==null||typeof c=="function"||Array.isArray(c)||I$(c)?c:{key:c,path:$0(c)}));return e.map(c=>({original:c,criteria:u.map(f=>o(f,c))})).slice().sort((c,f)=>{for(let h=0;hc.original)}function bh(e,...t){const r=t.length;return r>1&&Mv(e,t[0],t[1])?t=[]:r>2&&Mv(t[0],t[1],t[2])&&(t=[t[0]]),T$(e,P$(t),["asc"])}var DE=e=>e.legend.settings,D$=e=>e.legend.size,R$=e=>e.legend.payload;q([R$,DE],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?bh(n,r):n});function L$(e,t){return B$(e)||F$(e,t)||z$(e,t)||$$()}function $$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z$(e,t){if(e){if(typeof e=="string")return jk(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jk(e,t):void 0}}function jk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rMd||Math.abs(e.left-t.left)>Md||Math.abs(e.top-t.top)>Md||Math.abs(e.width-t.width)>Md}function Nk(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function U$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=y.useState({height:0,left:0,top:0,width:0}),r=L$(t,2),n=r[0],i=r[1],o=y.useRef(null),u=y.useRef(n);u.current=n;var c=y.useCallback(f=>{if(o.current!=null&&(o.current.disconnect(),o.current=null),f!=null){var h=Nk(f);if(Sk(h,u.current)&&i(h),typeof ResizeObserver<"u"){var m=new ResizeObserver(()=>{var g=Nk(f);Sk(g,u.current)&&i(g)});m.observe(f),o.current=m}}},[...e]);return y.useEffect(()=>()=>{var f;(f=o.current)===null||f===void 0||f.disconnect()},[]),[n,c]}function Ht(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 H$=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ek=H$,yg=()=>Math.random().toString(36).substring(7).split("").join("."),W$={INIT:`@@redux/INIT${yg()}`,REPLACE:`@@redux/REPLACE${yg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yg()}`},mf=W$;function H0(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function RE(e,t,r){if(typeof e!="function")throw new Error(Ht(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ht(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ht(1));return r(RE)(e,t)}let n=e,i=t,o=new Map,u=o,c=0,f=!1;function h(){u===o&&(u=new Map,o.forEach((S,N)=>{u.set(N,S)}))}function m(){if(f)throw new Error(Ht(3));return i}function g(S){if(typeof S!="function")throw new Error(Ht(4));if(f)throw new Error(Ht(5));let N=!0;h();const E=c++;return u.set(E,S),function(){if(N){if(f)throw new Error(Ht(6));N=!1,h(),u.delete(E),o=null}}}function v(S){if(!H0(S))throw new Error(Ht(7));if(typeof S.type>"u")throw new Error(Ht(8));if(typeof S.type!="string")throw new Error(Ht(17));if(f)throw new Error(Ht(9));try{f=!0,i=n(i,S)}finally{f=!1}return(o=u).forEach(E=>{E()}),S}function b(S){if(typeof S!="function")throw new Error(Ht(10));n=S,v({type:mf.REPLACE})}function j(){const S=g;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Ht(11));function E(){const P=N;P.next&&P.next(m())}return E(),{unsubscribe:S(E)}},[Ek](){return this}}}return v({type:mf.INIT}),{dispatch:v,subscribe:g,getState:m,replaceReducer:b,[Ek]:j}}function K$(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:mf.INIT})>"u")throw new Error(Ht(12));if(typeof r(void 0,{type:mf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ht(13))})}function LE(e){const t=Object.keys(e),r={};for(let o=0;o"u")throw c&&c.type,new Error(Ht(14));h[g]=j,f=f||j!==b}return f=f||n.length!==Object.keys(u).length,f?h:u}}function pf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function G$(...e){return t=>(r,n)=>{const i=t(r,n);let o=()=>{throw new Error(Ht(15))};const u={getState:i.getState,dispatch:(f,...h)=>o(f,...h)},c=e.map(f=>f(u));return o=pf(...c)(i.dispatch),{...i,dispatch:o}}}function $E(e){return H0(e)&&"type"in e&&typeof e.type=="string"}var zE=Symbol.for("immer-nothing"),Ak=Symbol.for("immer-draftable"),mr=Symbol.for("immer-state");function pn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lr=Object,zs=Lr.getPrototypeOf,gf="constructor",wh="prototype",Iv="configurable",vf="enumerable",Yd="writable",Su="value",vi=e=>!!e&&!!e[mr];function bn(e){var t;return e?FE(e)||jh(e)||!!e[Ak]||!!((t=e[gf])!=null&&t[Ak])||Sh(e)||Nh(e):!1}var V$=Lr[wh][gf].toString(),Ck=new WeakMap;function FE(e){if(!e||!W0(e))return!1;const t=zs(e);if(t===null||t===Lr[wh])return!0;const r=Lr.hasOwnProperty.call(t,gf)&&t[gf];if(r===Object)return!0;if(!ds(r))return!1;let n=Ck.get(r);return n===void 0&&(n=Function.toString.call(r),Ck.set(r,n)),n===V$}function kh(e,t,r=!0){qu(e)===0?(r?Reflect.ownKeys(e):Lr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function qu(e){const t=e[mr];return t?t.type_:jh(e)?1:Sh(e)?2:Nh(e)?3:0}var Pk=(e,t,r=qu(e))=>r===2?e.has(t):Lr[wh].hasOwnProperty.call(e,t),Tv=(e,t,r=qu(e))=>r===2?e.get(t):e[t],yf=(e,t,r,n=qu(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function q$(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var jh=Array.isArray,Sh=e=>e instanceof Map,Nh=e=>e instanceof Set,W0=e=>typeof e=="object",ds=e=>typeof e=="function",xg=e=>typeof e=="boolean";function Q$(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ai=e=>e.copy_||e.base_,K0=e=>e.modified_?e.copy_:e.base_;function Dv(e,t){if(Sh(e))return new Map(e);if(Nh(e))return new Set(e);if(jh(e))return Array[wh].slice.call(e);const r=FE(e);if(t===!0||t==="class_only"&&!r){const n=Lr.getOwnPropertyDescriptors(e);delete n[mr];let i=Reflect.ownKeys(n);for(let o=0;o1&&Lr.defineProperties(e,{set:Id,add:Id,clear:Id,delete:Id}),Lr.freeze(e),t&&kh(e,(r,n)=>{G0(n,!0)},!1)),e}function Y$(){pn(2)}var Id={[Su]:Y$};function Eh(e){return e===null||!W0(e)?!0:Lr.isFrozen(e)}var xf="MapSet",Rv="Patches",Ok="ArrayMethods",BE={};function po(e){const t=BE[e];return t||pn(0,e),t}var _k=e=>!!BE[e],Nu,UE=()=>Nu,X$=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_k(xf)?po(xf):void 0,arrayMethodsPlugin_:_k(Ok)?po(Ok):void 0});function Mk(e,t){t&&(e.patchPlugin_=po(Rv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Lv(e){$v(e),e.drafts_.forEach(Z$),e.drafts_=null}function $v(e){e===Nu&&(Nu=e.parent_)}var Ik=e=>Nu=X$(Nu,e);function Z$(e){const t=e[mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Tk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[mr].modified_&&(Lv(t),pn(4)),bn(e)&&(e=Dk(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[mr].base_,e,t)}else e=Dk(t,r);return J$(t,e,!0),Lv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zE?e:void 0}function Dk(e,t){if(Eh(t))return t;const r=t[mr];if(!r)return bf(t,e.handledSet_,e);if(!Ah(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);KE(r,e)}return r.copy_}function J$(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&G0(t,r)}function HE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ah=(e,t)=>e.scope_===t,ez=[];function WE(e,t,r,n){const i=ai(e),o=e.type_;if(n!==void 0&&Tv(i,n,o)===t){yf(i,n,r,o);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;kh(i,(f,h)=>{if(vi(h)){const m=c.get(h)||[];m.push(f),c.set(h,m)}})}const u=e.draftLocations_.get(t)??ez;for(const c of u)yf(i,c,r,o)}function tz(e,t,r){e.callbacks_.push(function(i){var c;const o=t;if(!o||!Ah(o,i))return;(c=i.mapSetPlugin_)==null||c.fixSetContents(o);const u=K0(o);WE(e,o.draft_??o,u,r),KE(o,i)})}function KE(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}HE(e)}}function rz(e,t,r){const{scope_:n}=e;if(vi(r)){const i=r[mr];Ah(i,n)&&i.callbacks_.push(function(){Xd(e);const u=K0(i);WE(e,r,u,t)})}else bn(r)&&e.callbacks_.push(function(){const o=ai(e);e.type_===3?o.has(r)&&bf(r,n.handledSet_,n):Tv(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&bf(Tv(e.copy_,t,e.type_),n.handledSet_,n)})}function bf(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||vi(e)||t.has(e)||!bn(e)||Eh(e)||(t.add(e),kh(e,(n,i)=>{if(vi(i)){const o=i[mr];if(Ah(o,r)){const u=K0(o);yf(e,n,u,e.type_),HE(o)}}else bn(i)&&bf(i,t,r)})),e}function nz(e,t){const r=jh(e),n={type_:r?1:0,scope_:t?t.scope_:UE(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,o=wf;r&&(i=[n],o=Eu);const{revoke:u,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=u,[c,n]}var wf={get(e,t){if(t===mr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ai(e);if(!Pk(i,t,e.type_))return iz(e,i,t);const o=i[t];if(e.finalized_||!bn(o)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&Q$(t))return o;if(o===bg(e.base_,t)){Xd(e);const u=e.type_===1?+t:t,c=Fv(e.scope_,o,e,u);return e.copy_[u]=c}return o},has(e,t){return t in ai(e)},ownKeys(e){return Reflect.ownKeys(ai(e))},set(e,t,r){const n=GE(ai(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=bg(ai(e),t),o=i==null?void 0:i[mr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(q$(r,i)&&(r!==void 0||Pk(e.base_,t,e.type_)))return!0;Xd(e),zv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),rz(e,t,r)),!0},deleteProperty(e,t){return Xd(e),bg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),zv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ai(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Yd]:!0,[Iv]:e.type_!==1||t!=="length",[vf]:n[vf],[Su]:r[t]}},defineProperty(){pn(11)},getPrototypeOf(e){return zs(e.base_)},setPrototypeOf(){pn(12)}},Eu={};for(let e in wf){let t=wf[e];Eu[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Eu.deleteProperty=function(e,t){return Eu.set.call(this,e,t,void 0)};Eu.set=function(e,t,r){return wf.set.call(this,e[0],t,r,e[0])};function bg(e,t){const r=e[mr];return(r?ai(r):e)[t]}function iz(e,t,r){var i;const n=GE(t,r);return n?Su in n?n[Su]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function GE(e,t){if(!(t in e))return;let r=zs(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=zs(r)}}function zv(e){e.modified_||(e.modified_=!0,e.parent_&&zv(e.parent_))}function Xd(e){e.copy_||(e.assigned_=new Map,e.copy_=Dv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var az=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(ds(r)&&!ds(n)){const u=n;n=r;const c=this;return function(h=u,...m){return c.produce(h,g=>n.call(this,g,...m))}}ds(n)||pn(6),i!==void 0&&!ds(i)&&pn(7);let o;if(bn(r)){const u=Ik(this),c=Fv(u,r,void 0);let f=!0;try{o=n(c),f=!1}finally{f?Lv(u):$v(u)}return Mk(u,i),Tk(o,u)}else if(!r||!W0(r)){if(o=n(r),o===void 0&&(o=r),o===zE&&(o=void 0),this.autoFreeze_&&G0(o,!0),i){const u=[],c=[];po(Rv).generateReplacementPatches_(r,o,{patches_:u,inversePatches_:c}),i(u,c)}return o}else pn(1,r)},this.produceWithPatches=(r,n)=>{if(ds(r))return(c,...f)=>this.produceWithPatches(c,h=>r(h,...f));let i,o;return[this.produce(r,n,(c,f)=>{i=c,o=f}),i,o]},xg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),xg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),xg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){bn(t)||pn(8),vi(t)&&(t=Xr(t));const r=Ik(this),n=Fv(r,t,void 0);return n[mr].isManual_=!0,$v(r),n}finishDraft(t,r){const n=t&&t[mr];(!n||!n.isManual_)&&pn(9);const{scope_:i}=n;return Mk(i,r),Tk(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const i=po(Rv).applyPatches_;return vi(t)?i(t,r):this.produce(t,o=>i(o,r))}};function Fv(e,t,r,n){const[i,o]=Sh(t)?po(xf).proxyMap_(t,r):Nh(t)?po(xf).proxySet_(t,r):nz(t,r);return((r==null?void 0:r.scope_)??UE()).drafts_.push(i),o.callbacks_=(r==null?void 0:r.callbacks_)??[],o.key_=n,r&&n!==void 0?tz(r,o,n):o.callbacks_.push(function(f){var m;(m=f.mapSetPlugin_)==null||m.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),i}function Xr(e){return vi(e)||pn(10,e),VE(e)}function VE(e){if(!bn(e)||Eh(e))return e;const t=e[mr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Dv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Dv(e,!0);return kh(r,(i,o)=>{yf(r,i,VE(o))},n),t&&(t.finalized_=!1),r}var oz=new az,qE=oz.produce;function QE(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var sz=QE(),lz=QE,uz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pf:pf.apply(null,arguments)};function zr(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error($r(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>$E(n)&&n.type===e,r}var YE=class cu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,cu.prototype)}static get[Symbol.species](){return cu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new cu(...t[0].concat(this)):new cu(...t.concat(this))}};function Rk(e){return bn(e)?qE(e,()=>{}):e}function Td(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function cz(e){return typeof e=="boolean"}var dz=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let u=new YE;return r&&(cz(r)?u.push(sz):u.push(lz(r.extraArgument))),u},XE="RTK_autoBatch",st=()=>e=>({payload:e,meta:{[XE]:!0}}),Lk=e=>t=>{setTimeout(t,e)},fz=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(u),r())},o=e(i),u=setTimeout(i,t)},ZE=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,o=!1,u=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?fz(window.requestAnimationFrame,100):Lk(10):e.type==="callback"?e.queueNotification:Lk(e.timeout),h=()=>{u=!1,o&&(o=!1,c.forEach(m=>m()))};return Object.assign({},n,{subscribe(m){const g=()=>i&&m(),v=n.subscribe(g);return c.add(m),()=>{v(),c.delete(m)}},dispatch(m){var g;try{return i=!((g=m==null?void 0:m.meta)!=null&&g[XE]),o=!i,o&&(u||(u=!0,f(h))),n.dispatch(m)}finally{i=!0}}})},hz=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new YE(e);return n&&i.push(ZE(typeof n=="object"?n:void 0)),i};function mz(e){const t=dz(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:u=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(H0(r))c=LE(r);else throw new Error($r(1));let f;typeof n=="function"?f=n(t):f=t();let h=pf;i&&(h=uz({trace:!1,...typeof i=="object"&&i}));const m=G$(...f),g=hz(m);let v=typeof u=="function"?u(g):g();const b=h(...v);return RE(c,o,b)}function JE(e){const t={},r=[];let n;const i={addCase(o,u){const c=typeof o=="string"?o:o.type;if(!c)throw new Error($r(28));if(c in t)throw new Error($r(29));return t[c]=u,i},addAsyncThunk(o,u){return u.pending&&(t[o.pending.type]=u.pending),u.rejected&&(t[o.rejected.type]=u.rejected),u.fulfilled&&(t[o.fulfilled.type]=u.fulfilled),u.settled&&r.push({matcher:o.settled,reducer:u.settled}),i},addMatcher(o,u){return r.push({matcher:o,reducer:u}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function pz(e){return typeof e=="function"}function gz(e,t){let[r,n,i]=JE(t),o;if(pz(e))o=()=>Rk(e());else{const c=Rk(e);o=()=>c}function u(c=o(),f){let h=[r[f.type],...n.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[i]),h.reduce((m,g)=>{if(g)if(vi(m)){const b=g(m,f);return b===void 0?m:b}else{if(bn(m))return qE(m,v=>g(v,f));{const v=g(m,f);if(v===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return m},c)}return u.getInitialState=o,u}var vz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",yz=(e=21)=>{let t="",r=e;for(;r--;)t+=vz[Math.random()*64|0];return t},xz=Symbol.for("rtk-slice-createasyncthunk");function bz(e,t){return`${e}/${t}`}function wz({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[xz];return function(i){const{name:o,reducerPath:u=o}=i;if(!o)throw new Error($r(11));const c=(typeof i.reducers=="function"?i.reducers(jz()):i.reducers)||{},f=Object.keys(c),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(P,_){const O=typeof P=="string"?P:P.type;if(!O)throw new Error($r(12));if(O in h.sliceCaseReducersByType)throw new Error($r(13));return h.sliceCaseReducersByType[O]=_,m},addMatcher(P,_){return h.sliceMatchers.push({matcher:P,reducer:_}),m},exposeAction(P,_){return h.actionCreators[P]=_,m},exposeCaseReducer(P,_){return h.sliceCaseReducersByName[P]=_,m}};f.forEach(P=>{const _=c[P],O={reducerName:P,type:bz(o,P),createNotation:typeof i.reducers=="function"};Nz(_)?Az(O,_,m,t):Sz(O,_,m)});function g(){const[P={},_=[],O=void 0]=typeof i.extraReducers=="function"?JE(i.extraReducers):[i.extraReducers],T={...P,...h.sliceCaseReducersByType};return gz(i.initialState,B=>{for(let $ in T)B.addCase($,T[$]);for(let $ of h.sliceMatchers)B.addMatcher($.matcher,$.reducer);for(let $ of _)B.addMatcher($.matcher,$.reducer);O&&B.addDefaultCase(O)})}const v=P=>P,b=new Map,j=new WeakMap;let k;function S(P,_){return k||(k=g()),k(P,_)}function N(){return k||(k=g()),k.getInitialState()}function E(P,_=!1){function O(B){let $=B[P];return typeof $>"u"&&_&&($=Td(j,O,N)),$}function T(B=v){const $=Td(b,_,()=>new WeakMap);return Td($,B,()=>{const z={};for(const[Q,U]of Object.entries(i.selectors??{}))z[Q]=kz(U,B,()=>Td(j,B,N),_);return z})}return{reducerPath:P,getSelectors:T,get selectors(){return T(O)},selectSlice:O}}const A={name:o,reducer:S,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:N,...E(u),injectInto(P,{reducerPath:_,...O}={}){const T=_??u;return P.inject({reducerPath:T,reducer:S},O),{...A,...E(T,!0)}}};return A}}function kz(e,t,r,n){function i(o,...u){let c=t(o);return typeof c>"u"&&n&&(c=r()),e(c,...u)}return i.unwrapped=e,i}var lr=wz();function jz(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Sz({type:e,reducerName:t,createNotation:r},n,i){let o,u;if("reducer"in n){if(r&&!Ez(n))throw new Error($r(17));o=n.reducer,u=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,u?zr(e,u):zr(e))}function Nz(e){return e._reducerDefinitionType==="asyncThunk"}function Ez(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Az({type:e,reducerName:t},r,n,i){if(!i)throw new Error($r(18));const{payloadCreator:o,fulfilled:u,pending:c,rejected:f,settled:h,options:m}=r,g=i(e,o,m);n.exposeAction(t,g),u&&n.addCase(g.fulfilled,u),c&&n.addCase(g.pending,c),f&&n.addCase(g.rejected,f),h&&n.addMatcher(g.settled,h),n.exposeCaseReducer(t,{fulfilled:u||Dd,pending:c||Dd,rejected:f||Dd,settled:h||Dd})}function Dd(){}var Cz="task",eA="listener",tA="completed",V0="cancelled",Pz=`task-${V0}`,Oz=`task-${tA}`,Bv=`${eA}-${V0}`,_z=`${eA}-${tA}`,Ch=class{constructor(e){Xo(this,"code");Xo(this,"name","TaskAbortError");Xo(this,"message");this.code=e,this.message=`${Cz} ${V0} (reason: ${e})`}},q0=(e,t)=>{if(typeof e!="function")throw new TypeError($r(32))},kf=()=>{},rA=(e,t=kf)=>(e.catch(t),e),nA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),lo=e=>{if(e.aborted)throw new Ch(e.reason)};function iA(e,t){let r=kf;return new Promise((n,i)=>{const o=()=>i(new Ch(e.reason));if(e.aborted){o();return}r=nA(e,o),t.finally(()=>r()).then(n,i)}).finally(()=>{r=kf})}var Mz=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Ch?"cancelled":"rejected",error:r}}finally{t==null||t()}},jf=e=>t=>rA(iA(e,t).then(r=>(lo(e),r))),aA=e=>{const t=jf(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ys}=Object,$k={},Ph="listenerMiddleware",Iz=(e,t)=>{const r=n=>nA(e,()=>n.abort(e.reason));return(n,i)=>{q0(n);const o=new AbortController;r(o);const u=Mz(async()=>{lo(e),lo(o.signal);const c=await n({pause:jf(o.signal),delay:aA(o.signal),signal:o.signal});return lo(o.signal),c},()=>o.abort(Oz));return i!=null&&i.autoJoin&&t.push(u.catch(kf)),{result:jf(e)(u),cancel(){o.abort(Pz)}}}},Tz=(e,t)=>{const r=async(n,i)=>{lo(t);let o=()=>{};const c=[new Promise((f,h)=>{let m=e({predicate:n,effect:(g,v)=>{v.unsubscribe(),f([g,v.getState(),v.getOriginalState()])}});o=()=>{m(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await iA(t,Promise.race(c));return lo(t),f}finally{o()}};return((n,i)=>rA(r(n,i)))},oA=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:o}=e;if(t)i=zr(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error($r(21));return q0(o),{predicate:i,type:t,effect:o}},sA=ys(e=>{const{type:t,predicate:r,effect:n}=oA(e);return{id:yz(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error($r(22))}}},{withTypes:()=>sA}),zk=(e,t)=>{const{type:r,effect:n,predicate:i}=oA(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===i)&&o.effect===n)},Uv=e=>{e.pending.forEach(t=>{t.abort(Bv)})},Dz=(e,t)=>()=>{for(const r of t.keys())Uv(r);e.clear()},Fk=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},lA=ys(zr(`${Ph}/add`),{withTypes:()=>lA}),Rz=zr(`${Ph}/removeAll`),uA=ys(zr(`${Ph}/remove`),{withTypes:()=>uA}),Lz=(...e)=>{console.error(`${Ph}/error`,...e)},Qu=(e={})=>{const t=new Map,r=new Map,n=b=>{const j=r.get(b)??0;r.set(b,j+1)},i=b=>{const j=r.get(b)??1;j===1?r.delete(b):r.set(b,j-1)},{extra:o,onError:u=Lz}=e;q0(u);const c=b=>(b.unsubscribe=()=>t.delete(b.id),t.set(b.id,b),j=>{b.unsubscribe(),j!=null&&j.cancelActive&&Uv(b)}),f=(b=>{const j=zk(t,b)??sA(b);return c(j)});ys(f,{withTypes:()=>f});const h=b=>{const j=zk(t,b);return j&&(j.unsubscribe(),b.cancelActive&&Uv(j)),!!j};ys(h,{withTypes:()=>h});const m=async(b,j,k,S)=>{const N=new AbortController,E=Tz(f,N.signal),A=[];try{b.pending.add(N),n(b),await Promise.resolve(b.effect(j,ys({},k,{getOriginalState:S,condition:(P,_)=>E(P,_).then(Boolean),take:E,delay:aA(N.signal),pause:jf(N.signal),extra:o,signal:N.signal,fork:Iz(N.signal,A),unsubscribe:b.unsubscribe,subscribe:()=>{t.set(b.id,b)},cancelActiveListeners:()=>{b.pending.forEach((P,_,O)=>{P!==N&&(P.abort(Bv),O.delete(P))})},cancel:()=>{N.abort(Bv),b.pending.delete(N)},throwIfCancelled:()=>{lo(N.signal)}})))}catch(P){P instanceof Ch||Fk(u,P,{raisedBy:"effect"})}finally{await Promise.all(A),N.abort(_z),i(b),b.pending.delete(N)}},g=Dz(t,r);return{middleware:b=>j=>k=>{if(!$E(k))return j(k);if(lA.match(k))return f(k.payload);if(Rz.match(k)){g();return}if(uA.match(k))return h(k.payload);let S=b.getState();const N=()=>{if(S===$k)throw new Error($r(23));return S};let E;try{if(E=j(k),t.size>0){const A=b.getState(),P=Array.from(t.values());for(const _ of P){let O=!1;try{O=_.predicate(k,A,S)}catch(T){O=!1,Fk(u,T,{raisedBy:"predicate"})}O&&m(_,k,b,N)}}}finally{S=$k}return E},startListening:f,stopListening:h,clearListeners:g}};function $r(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 $z={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},cA=lr({name:"chartLayout",initialState:$z,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,o;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),Oh=cA.actions,zz=Oh.setMargin,Fz=Oh.setLayout,Bz=Oh.setChartSize,Uz=Oh.setScale,Hz=cA.reducer;function dA(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function We(e){return Number.isFinite(e)}function Un(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Bk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hs(e){for(var t=1;t{if(t&&r){var n=r.width,i=r.height,o=t.align,u=t.verticalAlign,c=t.layout;if((c==="vertical"||c==="horizontal"&&u==="middle")&&o!=="center"&&Ae(e[o]))return hs(hs({},e),{},{[o]:e[o]+(n||0)});if((c==="horizontal"||c==="vertical"&&o==="center")&&u!=="middle"&&Ae(e[u]))return hs(hs({},e),{},{[u]:e[u]+(i||0)})}return e},Gn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",fA=(e,t,r,n)=>{if(n)return e.map(c=>c.coordinate);var i,o,u=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===r&&(o=!0),c.coordinate));return i||u.push(t),o||u.push(r),u},hA=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,i=e.type,o=e.range,u=e.scale,c=e.realScaleType,f=e.isCategorical,h=e.categoricalDomain,m=e.tickCount,g=e.ticks,v=e.niceTicks,b=e.axisType;if(!u)return null;var j=c==="scaleBand"&&u.bandwidth?u.bandwidth()/2:2,k=i==="category"&&u.bandwidth?u.bandwidth()/j:0;if(k=b==="angleAxis"&&o&&o.length>=2?Yr(o[0]-o[1])*2*k:k,g||v){var S=(g||v||[]).map((N,E)=>{var A=n?n.indexOf(N):N,P=u.map(A);return We(P)?{coordinate:P+k,value:N,offset:k,index:E}:null}).filter(Sr);return S}return f&&h?h.map((N,E)=>{var A=u.map(N);return We(A)?{coordinate:A+k,value:N,index:E,offset:k}:null}).filter(Sr):u.ticks&&m!=null?u.ticks(m).map((N,E)=>{var A=u.map(N);return We(A)?{coordinate:A+k,value:N,index:E,offset:k}:null}).filter(Sr):u.domain().map((N,E)=>{var A=u.map(N);return We(A)?{coordinate:A+k,value:n?n[N]:N,index:E,offset:k}:null}).filter(Sr)},qz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(h[0]=o,o+=v,h[1]=o):(h[0]=u,u+=v,h[1]=u)}}}},Qz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},Yz={sign:qz,expand:fL,none:ho,silhouette:hL,wiggle:mL,positive:Qz},Xz=(e,t,r)=>{var n,i=(n=Yz[r])!==null&&n!==void 0?n:ho,o=dL().keys(t).value((c,f)=>Number(Lt(c,f,0))).order(Cv).offset(i),u=o(e);return u.forEach((c,f)=>{c.forEach((h,m)=>{var g=Lt(e[m],t[f],0);Array.isArray(g)&&g.length===2&&Ae(g[0])&&Ae(g[1])&&(h[0]=g[0],h[1]=g[1])})}),u};function Zz(e){return e==null?void 0:String(e)}function Uk(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,u=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qt(i[t.dataKey])){var c=xE(r,"value",i[t.dataKey]);if(c)return c.coordinate+n/2}return r!=null&&r[o]?r[o].coordinate+n/2:null}var f=Lt(i,Qt(u)?t.dataKey:u),h=t.scale.map(f);return Ae(h)?h:null}var Jz=e=>{var t=e.flat(2).filter(Ae);return[Math.min(...t),Math.max(...t)]},e6=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],t6=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return e6(Object.keys(e).reduce((n,i)=>{var o=e[i];if(!o)return n;var u=o.stackedData,c=u.reduce((f,h)=>{var m=dA(h,t,r),g=Jz(m);return!We(g[0])||!We(g[1])?f:[Math.min(f[0],g[0]),Math.max(f[1],g[1])]},[1/0,-1/0]);return[Math.min(c[0],n[0]),Math.max(c[1],n[1])]},[1/0,-1/0]))},Hk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Sf=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=bh(t,m=>m.coordinate),o=1/0,u=1,c=i.length;u{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},n6=(e,t)=>t==="centric"?e.angle:e.radius,ki=e=>e.layout.width,ji=e=>e.layout.height,i6=e=>e.layout.scale,pA=e=>e.layout.margin,_h=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Mh=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),a6="data-recharts-item-index",o6="data-recharts-item-id",Yu=60;function Gk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Rd(e){for(var t=1;te.brush.height;function d6(e){var t=Mh(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Yu;return r+i}return r},0)}function f6(e){var t=Mh(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Yu;return r+i}return r},0)}function h6(e){var t=_h(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function m6(e){var t=_h(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Zt=q([ki,ji,pA,c6,d6,f6,h6,m6,DE,D$],(e,t,r,n,i,o,u,c,f,h)=>{var m={left:(r.left||0)+i,right:(r.right||0)+o},g={top:(r.top||0)+u,bottom:(r.bottom||0)+c},v=Rd(Rd({},g),m),b=v.bottom;v.bottom+=n,v=Vz(v,f,h);var j=e-v.left-v.right,k=t-v.top-v.bottom;return Rd(Rd({brushBottom:b},v),{},{width:Math.max(j,0),height:Math.max(k,0)})}),p6=q(Zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),gA=q(ki,ji,(e,t)=>({x:0,y:0,width:e,height:t})),g6=y.createContext(null),Ar=()=>y.useContext(g6)!=null,Ih=e=>e.brush,Th=q([Ih,Zt,pA],(e,t,r)=>({height:e.height,x:Ae(e.x)?e.x:t.left,y:Ae(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ae(e.width)?e.width:t.width}));function v6(e,t,{signal:r,edges:n}={}){let i,o=null;const u=n!=null&&n.includes("leading"),c=n==null||n.includes("trailing"),f=()=>{o!==null&&(e.apply(i,o),i=void 0,o=null)},h=()=>{c&&f(),b()};let m=null;const g=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,h()},t)},v=()=>{m!==null&&(clearTimeout(m),m=null)},b=()=>{v(),i=void 0,o=null},j=()=>{f()},k=function(...S){if(r!=null&&r.aborted)return;i=this,o=S;const N=m==null;g(),u&&N&&f()};return k.schedule=g,k.cancel=b,k.flush=j,r==null||r.addEventListener("abort",b,{once:!0}),k}function y6(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:o}=r,u=Array(2);n&&(u[0]="leading"),i&&(u[1]="trailing");let c,f=null;const h=v6(function(...v){c=e.apply(this,v),f=null},t,{edges:u}),m=function(...v){return o!=null&&(f===null&&(f=Date.now()),Date.now()-f>=o)?(c=e.apply(this,v),f=Date.now(),h.cancel(),h.schedule(),c):(h.apply(this,v),c)},g=()=>(h.flush(),c);return m.cancel=h.cancel,m.flush=g,m}function x6(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return y6(e,t,{leading:n,maxWait:t,trailing:i})}var Nf=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oi[u++]))}},Rn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},vA=(e,t,r)=>{var n=r.width,i=n===void 0?Rn.width:n,o=r.height,u=o===void 0?Rn.height:o,c=r.aspect,f=r.maxHeight,h=mo(i)?e:Number(i),m=mo(u)?t:Number(u);return c&&c>0&&(h?m=h/c:m&&(h=m*c),f&&m!=null&&m>f&&(m=f)),{calculatedWidth:h,calculatedHeight:m}},b6={width:0,height:0,overflow:"visible"},w6={width:0,overflowX:"visible"},k6={height:0,overflowY:"visible"},j6={},S6=e=>{var t=e.width,r=e.height,n=mo(t),i=mo(r);return n&&i?b6:n?w6:i?k6:j6};function N6(e){var t=e.width,r=e.height,n=e.aspect,i=t,o=r;return i===void 0&&o===void 0?(i=Rn.width,o=Rn.height):i===void 0?i=n&&n>0?void 0:Rn.width:o===void 0&&(o=n&&n>0?void 0:Rn.height),{width:i,height:o}}var E6=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Ef(){return Ef=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return L6(i)?y.createElement(yA.Provider,{value:i},t):null}var Q0=()=>y.useContext(yA),$6=y.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?Rn.initialDimension:n,o=e.width,u=e.height,c=e.minWidth,f=c===void 0?Rn.minWidth:c,h=e.minHeight,m=e.maxHeight,g=e.children,v=e.debounce,b=v===void 0?Rn.debounce:v,j=e.id,k=e.className,S=e.onResize,N=e.style,E=N===void 0?{}:N,A=D6(e,E6),P=y.useRef(null),_=y.useRef();_.current=S,y.useImperativeHandle(t,()=>P.current);var O=y.useState({containerWidth:i.width,containerHeight:i.height}),T=O6(O,2),B=T[0],$=T[1],z=y.useCallback((oe,se)=>{$(X=>{var ne=Math.round(oe),te=Math.round(se);return X.containerWidth===ne&&X.containerHeight===te?X:{containerWidth:ne,containerHeight:te}})},[]);y.useEffect(()=>{if(P.current==null||typeof ResizeObserver>"u")return Xs;var oe=I=>{var M,H=I[0];if(H!=null){var ie=H.contentRect,J=ie.width,Z=ie.height;z(J,Z),(M=_.current)===null||M===void 0||M.call(_,J,Z)}};b>0&&(oe=x6(oe,b,{trailing:!0,leading:!1}));var se=new ResizeObserver(oe),X=P.current.getBoundingClientRect(),ne=X.width,te=X.height;return z(ne,te),se.observe(P.current),()=>{se.disconnect()}},[z,b]);var Q=B.containerWidth,U=B.containerHeight;Nf(!r||r>0,"The aspect(%s) must be greater than zero.",r);var ve=vA(Q,U,{width:o,height:u,aspect:r,maxHeight:m}),ue=ve.calculatedWidth,pe=ve.calculatedHeight;return Nf(Q<0||U<0||ue!=null&&ue>0||pe!=null&&pe>0,`The width(%s) and height(%s) of chart should be greater than 0, + */var yk;function p$(){if(yk)return pg;yk=1;var e=Gs(),t=m$();function r(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,o=e.useRef,u=e.useEffect,c=e.useMemo,f=e.useDebugValue;return pg.useSyncExternalStoreWithSelector=function(h,m,g,v,b){var j=o(null);if(j.current===null){var k={hasValue:!1,value:null};j.current=k}else k=j.current;j=c(function(){function N(O){if(!E){if(E=!0,A=O,O=v(O),b!==void 0&&k.hasValue){var T=k.value;if(b(T,O))return P=T}return P=O}if(T=P,n(A,O))return T;var B=v(O);return b!==void 0&&b(T,B)?(A=O,T):(A=O,P=B)}var E=!1,A,P,_=g===void 0?null:g;return[function(){return N(m())},_===null?void 0:function(){return N(_())}]},[m,g,v,b]);var S=i(h,j[0],j[1]);return u(function(){k.hasValue=!0,k.value=S},[S]),f(S),S},pg}var xk;function g$(){return xk||(xk=1,mg.exports=p$()),mg.exports}var v$=g$(),U0=y.createContext(null),y$=e=>e,Nt=()=>{var e=y.useContext(U0);return e?e.store.dispatch:y$},qd=()=>{},x$=()=>qd,b$=(e,t)=>e===t;function Me(e){var t=y.useContext(U0),r=y.useMemo(()=>t?n=>{if(n!=null)return e(n)}:qd,[t,e]);return v$.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:x$,t?t.store.getState:qd,t?t.store.getState:qd,r,b$)}function w$(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function k$(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var bk=e=>Array.isArray(e)?e:[e];function j$(e){const t=Array.isArray(e[0])?e[0]:e;return k$(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function S$(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?N$:WeakRef,ME=E$(),A$=0,wk=1;function Od(){return{s:A$,v:void 0,o:null,p:null}}function C$(e){return e instanceof ME?e.deref():e}function IE(e,t={}){let r=Od();const{resultEqualityCheck:n}=t;let i,o=0;function u(){let c=r;const{length:f}=arguments;for(let g=0,v=f;g{r=Od(),u.resetResultsCount()},u.resultsCount=()=>o,u.resetResultsCount=()=>{o=0},u}function P$(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,u=0,c,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),w$(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const m={...r,...f},{memoize:g,memoizeOptions:v=[],argsMemoize:b=IE,argsMemoizeOptions:j=[]}=m,k=bk(v),S=bk(j),N=j$(i),E=g(function(){return o++,h.apply(null,arguments)},...k),A=b(function(){u++;const _=S$(N,arguments);return c=E.apply(null,_),c},...S);return Object.assign(A,{resultFunc:h,memoizedResultFunc:E,dependencies:N,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:g,argsMemoize:b})};return Object.assign(n,{withTypes:()=>n}),n}var q=P$(IE);function O$(e,t=1){const r=[],n=Math.floor(t),i=(o,u)=>{for(let c=0;c{if(e!==t){const n=kk(e),i=kk(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function TE(e){return typeof e=="symbol"||e instanceof Symbol}const M$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,I$=/^\w*$/;function T$(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||TE(e)?!0:typeof e=="string"&&(I$.test(e)||!M$.test(e))||t!=null}function D$(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(c=>String(c));const i=(c,f)=>{let h=c;for(let m=0;mf==null||c==null?f:typeof c=="object"&&"key"in c?Object.hasOwn(f,c.key)?f[c.key]:i(f,c.path):typeof c=="function"?c(f):Array.isArray(c)?i(f,c):typeof f=="object"?f[c]:f,u=t.map(c=>(Array.isArray(c)&&c.length===1&&(c=c[0]),c==null||typeof c=="function"||Array.isArray(c)||T$(c)?c:{key:c,path:$0(c)}));return e.map(c=>({original:c,criteria:u.map(f=>o(f,c))})).slice().sort((c,f)=>{for(let h=0;hc.original)}function bh(e,...t){const r=t.length;return r>1&&Mv(e,t[0],t[1])?t=[]:r>2&&Mv(t[0],t[1],t[2])&&(t=[t[0]]),D$(e,O$(t),["asc"])}var DE=e=>e.legend.settings,R$=e=>e.legend.size,L$=e=>e.legend.payload;q([L$,DE],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?bh(n,r):n});function $$(e,t){return U$(e)||B$(e,t)||F$(e,t)||z$()}function z$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F$(e,t){if(e){if(typeof e=="string")return jk(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jk(e,t):void 0}}function jk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r_d||Math.abs(e.left-t.left)>_d||Math.abs(e.top-t.top)>_d||Math.abs(e.width-t.width)>_d}function Nk(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function H$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=y.useState({height:0,left:0,top:0,width:0}),r=$$(t,2),n=r[0],i=r[1],o=y.useRef(null),u=y.useRef(n);u.current=n;var c=y.useCallback(f=>{if(o.current!=null&&(o.current.disconnect(),o.current=null),f!=null){var h=Nk(f);if(Sk(h,u.current)&&i(h),typeof ResizeObserver<"u"){var m=new ResizeObserver(()=>{var g=Nk(f);Sk(g,u.current)&&i(g)});m.observe(f),o.current=m}}},[...e]);return y.useEffect(()=>()=>{var f;(f=o.current)===null||f===void 0||f.disconnect()},[]),[n,c]}function Ht(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 W$=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ek=W$,yg=()=>Math.random().toString(36).substring(7).split("").join("."),K$={INIT:`@@redux/INIT${yg()}`,REPLACE:`@@redux/REPLACE${yg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yg()}`},mf=K$;function H0(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function RE(e,t,r){if(typeof e!="function")throw new Error(Ht(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ht(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ht(1));return r(RE)(e,t)}let n=e,i=t,o=new Map,u=o,c=0,f=!1;function h(){u===o&&(u=new Map,o.forEach((S,N)=>{u.set(N,S)}))}function m(){if(f)throw new Error(Ht(3));return i}function g(S){if(typeof S!="function")throw new Error(Ht(4));if(f)throw new Error(Ht(5));let N=!0;h();const E=c++;return u.set(E,S),function(){if(N){if(f)throw new Error(Ht(6));N=!1,h(),u.delete(E),o=null}}}function v(S){if(!H0(S))throw new Error(Ht(7));if(typeof S.type>"u")throw new Error(Ht(8));if(typeof S.type!="string")throw new Error(Ht(17));if(f)throw new Error(Ht(9));try{f=!0,i=n(i,S)}finally{f=!1}return(o=u).forEach(E=>{E()}),S}function b(S){if(typeof S!="function")throw new Error(Ht(10));n=S,v({type:mf.REPLACE})}function j(){const S=g;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Ht(11));function E(){const P=N;P.next&&P.next(m())}return E(),{unsubscribe:S(E)}},[Ek](){return this}}}return v({type:mf.INIT}),{dispatch:v,subscribe:g,getState:m,replaceReducer:b,[Ek]:j}}function G$(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:mf.INIT})>"u")throw new Error(Ht(12));if(typeof r(void 0,{type:mf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ht(13))})}function LE(e){const t=Object.keys(e),r={};for(let o=0;o"u")throw c&&c.type,new Error(Ht(14));h[g]=j,f=f||j!==b}return f=f||n.length!==Object.keys(u).length,f?h:u}}function pf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function V$(...e){return t=>(r,n)=>{const i=t(r,n);let o=()=>{throw new Error(Ht(15))};const u={getState:i.getState,dispatch:(f,...h)=>o(f,...h)},c=e.map(f=>f(u));return o=pf(...c)(i.dispatch),{...i,dispatch:o}}}function $E(e){return H0(e)&&"type"in e&&typeof e.type=="string"}var zE=Symbol.for("immer-nothing"),Ak=Symbol.for("immer-draftable"),mr=Symbol.for("immer-state");function gn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lr=Object,$s=Lr.getPrototypeOf,gf="constructor",wh="prototype",Iv="configurable",vf="enumerable",Qd="writable",ju="value",vi=e=>!!e&&!!e[mr];function bn(e){var t;return e?FE(e)||jh(e)||!!e[Ak]||!!((t=e[gf])!=null&&t[Ak])||Sh(e)||Nh(e):!1}var q$=Lr[wh][gf].toString(),Ck=new WeakMap;function FE(e){if(!e||!W0(e))return!1;const t=$s(e);if(t===null||t===Lr[wh])return!0;const r=Lr.hasOwnProperty.call(t,gf)&&t[gf];if(r===Object)return!0;if(!ds(r))return!1;let n=Ck.get(r);return n===void 0&&(n=Function.toString.call(r),Ck.set(r,n)),n===q$}function kh(e,t,r=!0){Vu(e)===0?(r?Reflect.ownKeys(e):Lr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Vu(e){const t=e[mr];return t?t.type_:jh(e)?1:Sh(e)?2:Nh(e)?3:0}var Pk=(e,t,r=Vu(e))=>r===2?e.has(t):Lr[wh].hasOwnProperty.call(e,t),Tv=(e,t,r=Vu(e))=>r===2?e.get(t):e[t],yf=(e,t,r,n=Vu(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Q$(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var jh=Array.isArray,Sh=e=>e instanceof Map,Nh=e=>e instanceof Set,W0=e=>typeof e=="object",ds=e=>typeof e=="function",xg=e=>typeof e=="boolean";function Y$(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ai=e=>e.copy_||e.base_,K0=e=>e.modified_?e.copy_:e.base_;function Dv(e,t){if(Sh(e))return new Map(e);if(Nh(e))return new Set(e);if(jh(e))return Array[wh].slice.call(e);const r=FE(e);if(t===!0||t==="class_only"&&!r){const n=Lr.getOwnPropertyDescriptors(e);delete n[mr];let i=Reflect.ownKeys(n);for(let o=0;o1&&Lr.defineProperties(e,{set:Md,add:Md,clear:Md,delete:Md}),Lr.freeze(e),t&&kh(e,(r,n)=>{G0(n,!0)},!1)),e}function X$(){gn(2)}var Md={[ju]:X$};function Eh(e){return e===null||!W0(e)?!0:Lr.isFrozen(e)}var xf="MapSet",Rv="Patches",Ok="ArrayMethods",BE={};function po(e){const t=BE[e];return t||gn(0,e),t}var _k=e=>!!BE[e],Su,UE=()=>Su,Z$=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_k(xf)?po(xf):void 0,arrayMethodsPlugin_:_k(Ok)?po(Ok):void 0});function Mk(e,t){t&&(e.patchPlugin_=po(Rv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Lv(e){$v(e),e.drafts_.forEach(J$),e.drafts_=null}function $v(e){e===Su&&(Su=e.parent_)}var Ik=e=>Su=Z$(Su,e);function J$(e){const t=e[mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Tk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[mr].modified_&&(Lv(t),gn(4)),bn(e)&&(e=Dk(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[mr].base_,e,t)}else e=Dk(t,r);return ez(t,e,!0),Lv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zE?e:void 0}function Dk(e,t){if(Eh(t))return t;const r=t[mr];if(!r)return bf(t,e.handledSet_,e);if(!Ah(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);KE(r,e)}return r.copy_}function ez(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&G0(t,r)}function HE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ah=(e,t)=>e.scope_===t,tz=[];function WE(e,t,r,n){const i=ai(e),o=e.type_;if(n!==void 0&&Tv(i,n,o)===t){yf(i,n,r,o);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;kh(i,(f,h)=>{if(vi(h)){const m=c.get(h)||[];m.push(f),c.set(h,m)}})}const u=e.draftLocations_.get(t)??tz;for(const c of u)yf(i,c,r,o)}function rz(e,t,r){e.callbacks_.push(function(i){var c;const o=t;if(!o||!Ah(o,i))return;(c=i.mapSetPlugin_)==null||c.fixSetContents(o);const u=K0(o);WE(e,o.draft_??o,u,r),KE(o,i)})}function KE(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}HE(e)}}function nz(e,t,r){const{scope_:n}=e;if(vi(r)){const i=r[mr];Ah(i,n)&&i.callbacks_.push(function(){Yd(e);const u=K0(i);WE(e,r,u,t)})}else bn(r)&&e.callbacks_.push(function(){const o=ai(e);e.type_===3?o.has(r)&&bf(r,n.handledSet_,n):Tv(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&bf(Tv(e.copy_,t,e.type_),n.handledSet_,n)})}function bf(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||vi(e)||t.has(e)||!bn(e)||Eh(e)||(t.add(e),kh(e,(n,i)=>{if(vi(i)){const o=i[mr];if(Ah(o,r)){const u=K0(o);yf(e,n,u,e.type_),HE(o)}}else bn(i)&&bf(i,t,r)})),e}function iz(e,t){const r=jh(e),n={type_:r?1:0,scope_:t?t.scope_:UE(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,o=wf;r&&(i=[n],o=Nu);const{revoke:u,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=u,[c,n]}var wf={get(e,t){if(t===mr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ai(e);if(!Pk(i,t,e.type_))return az(e,i,t);const o=i[t];if(e.finalized_||!bn(o)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&Y$(t))return o;if(o===bg(e.base_,t)){Yd(e);const u=e.type_===1?+t:t,c=Fv(e.scope_,o,e,u);return e.copy_[u]=c}return o},has(e,t){return t in ai(e)},ownKeys(e){return Reflect.ownKeys(ai(e))},set(e,t,r){const n=GE(ai(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=bg(ai(e),t),o=i==null?void 0:i[mr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Q$(r,i)&&(r!==void 0||Pk(e.base_,t,e.type_)))return!0;Yd(e),zv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),nz(e,t,r)),!0},deleteProperty(e,t){return Yd(e),bg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),zv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ai(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Qd]:!0,[Iv]:e.type_!==1||t!=="length",[vf]:n[vf],[ju]:r[t]}},defineProperty(){gn(11)},getPrototypeOf(e){return $s(e.base_)},setPrototypeOf(){gn(12)}},Nu={};for(let e in wf){let t=wf[e];Nu[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Nu.deleteProperty=function(e,t){return Nu.set.call(this,e,t,void 0)};Nu.set=function(e,t,r){return wf.set.call(this,e[0],t,r,e[0])};function bg(e,t){const r=e[mr];return(r?ai(r):e)[t]}function az(e,t,r){var i;const n=GE(t,r);return n?ju in n?n[ju]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function GE(e,t){if(!(t in e))return;let r=$s(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=$s(r)}}function zv(e){e.modified_||(e.modified_=!0,e.parent_&&zv(e.parent_))}function Yd(e){e.copy_||(e.assigned_=new Map,e.copy_=Dv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oz=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(ds(r)&&!ds(n)){const u=n;n=r;const c=this;return function(h=u,...m){return c.produce(h,g=>n.call(this,g,...m))}}ds(n)||gn(6),i!==void 0&&!ds(i)&&gn(7);let o;if(bn(r)){const u=Ik(this),c=Fv(u,r,void 0);let f=!0;try{o=n(c),f=!1}finally{f?Lv(u):$v(u)}return Mk(u,i),Tk(o,u)}else if(!r||!W0(r)){if(o=n(r),o===void 0&&(o=r),o===zE&&(o=void 0),this.autoFreeze_&&G0(o,!0),i){const u=[],c=[];po(Rv).generateReplacementPatches_(r,o,{patches_:u,inversePatches_:c}),i(u,c)}return o}else gn(1,r)},this.produceWithPatches=(r,n)=>{if(ds(r))return(c,...f)=>this.produceWithPatches(c,h=>r(h,...f));let i,o;return[this.produce(r,n,(c,f)=>{i=c,o=f}),i,o]},xg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),xg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),xg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){bn(t)||gn(8),vi(t)&&(t=Xr(t));const r=Ik(this),n=Fv(r,t,void 0);return n[mr].isManual_=!0,$v(r),n}finishDraft(t,r){const n=t&&t[mr];(!n||!n.isManual_)&&gn(9);const{scope_:i}=n;return Mk(i,r),Tk(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const i=po(Rv).applyPatches_;return vi(t)?i(t,r):this.produce(t,o=>i(o,r))}};function Fv(e,t,r,n){const[i,o]=Sh(t)?po(xf).proxyMap_(t,r):Nh(t)?po(xf).proxySet_(t,r):iz(t,r);return((r==null?void 0:r.scope_)??UE()).drafts_.push(i),o.callbacks_=(r==null?void 0:r.callbacks_)??[],o.key_=n,r&&n!==void 0?rz(r,o,n):o.callbacks_.push(function(f){var m;(m=f.mapSetPlugin_)==null||m.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),i}function Xr(e){return vi(e)||gn(10,e),VE(e)}function VE(e){if(!bn(e)||Eh(e))return e;const t=e[mr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Dv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Dv(e,!0);return kh(r,(i,o)=>{yf(r,i,VE(o))},n),t&&(t.finalized_=!1),r}var sz=new oz,qE=sz.produce;function QE(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var lz=QE(),uz=QE,cz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pf:pf.apply(null,arguments)};function zr(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error($r(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>$E(n)&&n.type===e,r}var YE=class uu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,uu.prototype)}static get[Symbol.species](){return uu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new uu(...t[0].concat(this)):new uu(...t.concat(this))}};function Rk(e){return bn(e)?qE(e,()=>{}):e}function Id(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function dz(e){return typeof e=="boolean"}var fz=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let u=new YE;return r&&(dz(r)?u.push(lz):u.push(uz(r.extraArgument))),u},XE="RTK_autoBatch",st=()=>e=>({payload:e,meta:{[XE]:!0}}),Lk=e=>t=>{setTimeout(t,e)},hz=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(u),r())},o=e(i),u=setTimeout(i,t)},ZE=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,o=!1,u=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?hz(window.requestAnimationFrame,100):Lk(10):e.type==="callback"?e.queueNotification:Lk(e.timeout),h=()=>{u=!1,o&&(o=!1,c.forEach(m=>m()))};return Object.assign({},n,{subscribe(m){const g=()=>i&&m(),v=n.subscribe(g);return c.add(m),()=>{v(),c.delete(m)}},dispatch(m){var g;try{return i=!((g=m==null?void 0:m.meta)!=null&&g[XE]),o=!i,o&&(u||(u=!0,f(h))),n.dispatch(m)}finally{i=!0}}})},mz=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new YE(e);return n&&i.push(ZE(typeof n=="object"?n:void 0)),i};function pz(e){const t=fz(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:u=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(H0(r))c=LE(r);else throw new Error($r(1));let f;typeof n=="function"?f=n(t):f=t();let h=pf;i&&(h=cz({trace:!1,...typeof i=="object"&&i}));const m=V$(...f),g=mz(m);let v=typeof u=="function"?u(g):g();const b=h(...v);return RE(c,o,b)}function JE(e){const t={},r=[];let n;const i={addCase(o,u){const c=typeof o=="string"?o:o.type;if(!c)throw new Error($r(28));if(c in t)throw new Error($r(29));return t[c]=u,i},addAsyncThunk(o,u){return u.pending&&(t[o.pending.type]=u.pending),u.rejected&&(t[o.rejected.type]=u.rejected),u.fulfilled&&(t[o.fulfilled.type]=u.fulfilled),u.settled&&r.push({matcher:o.settled,reducer:u.settled}),i},addMatcher(o,u){return r.push({matcher:o,reducer:u}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function gz(e){return typeof e=="function"}function vz(e,t){let[r,n,i]=JE(t),o;if(gz(e))o=()=>Rk(e());else{const c=Rk(e);o=()=>c}function u(c=o(),f){let h=[r[f.type],...n.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[i]),h.reduce((m,g)=>{if(g)if(vi(m)){const b=g(m,f);return b===void 0?m:b}else{if(bn(m))return qE(m,v=>g(v,f));{const v=g(m,f);if(v===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return m},c)}return u.getInitialState=o,u}var yz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",xz=(e=21)=>{let t="",r=e;for(;r--;)t+=yz[Math.random()*64|0];return t},bz=Symbol.for("rtk-slice-createasyncthunk");function wz(e,t){return`${e}/${t}`}function kz({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[bz];return function(i){const{name:o,reducerPath:u=o}=i;if(!o)throw new Error($r(11));const c=(typeof i.reducers=="function"?i.reducers(Sz()):i.reducers)||{},f=Object.keys(c),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(P,_){const O=typeof P=="string"?P:P.type;if(!O)throw new Error($r(12));if(O in h.sliceCaseReducersByType)throw new Error($r(13));return h.sliceCaseReducersByType[O]=_,m},addMatcher(P,_){return h.sliceMatchers.push({matcher:P,reducer:_}),m},exposeAction(P,_){return h.actionCreators[P]=_,m},exposeCaseReducer(P,_){return h.sliceCaseReducersByName[P]=_,m}};f.forEach(P=>{const _=c[P],O={reducerName:P,type:wz(o,P),createNotation:typeof i.reducers=="function"};Ez(_)?Cz(O,_,m,t):Nz(O,_,m)});function g(){const[P={},_=[],O=void 0]=typeof i.extraReducers=="function"?JE(i.extraReducers):[i.extraReducers],T={...P,...h.sliceCaseReducersByType};return vz(i.initialState,B=>{for(let $ in T)B.addCase($,T[$]);for(let $ of h.sliceMatchers)B.addMatcher($.matcher,$.reducer);for(let $ of _)B.addMatcher($.matcher,$.reducer);O&&B.addDefaultCase(O)})}const v=P=>P,b=new Map,j=new WeakMap;let k;function S(P,_){return k||(k=g()),k(P,_)}function N(){return k||(k=g()),k.getInitialState()}function E(P,_=!1){function O(B){let $=B[P];return typeof $>"u"&&_&&($=Id(j,O,N)),$}function T(B=v){const $=Id(b,_,()=>new WeakMap);return Id($,B,()=>{const z={};for(const[Q,U]of Object.entries(i.selectors??{}))z[Q]=jz(U,B,()=>Id(j,B,N),_);return z})}return{reducerPath:P,getSelectors:T,get selectors(){return T(O)},selectSlice:O}}const A={name:o,reducer:S,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:N,...E(u),injectInto(P,{reducerPath:_,...O}={}){const T=_??u;return P.inject({reducerPath:T,reducer:S},O),{...A,...E(T,!0)}}};return A}}function jz(e,t,r,n){function i(o,...u){let c=t(o);return typeof c>"u"&&n&&(c=r()),e(c,...u)}return i.unwrapped=e,i}var lr=kz();function Sz(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Nz({type:e,reducerName:t,createNotation:r},n,i){let o,u;if("reducer"in n){if(r&&!Az(n))throw new Error($r(17));o=n.reducer,u=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,u?zr(e,u):zr(e))}function Ez(e){return e._reducerDefinitionType==="asyncThunk"}function Az(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Cz({type:e,reducerName:t},r,n,i){if(!i)throw new Error($r(18));const{payloadCreator:o,fulfilled:u,pending:c,rejected:f,settled:h,options:m}=r,g=i(e,o,m);n.exposeAction(t,g),u&&n.addCase(g.fulfilled,u),c&&n.addCase(g.pending,c),f&&n.addCase(g.rejected,f),h&&n.addMatcher(g.settled,h),n.exposeCaseReducer(t,{fulfilled:u||Td,pending:c||Td,rejected:f||Td,settled:h||Td})}function Td(){}var Pz="task",eA="listener",tA="completed",V0="cancelled",Oz=`task-${V0}`,_z=`task-${tA}`,Bv=`${eA}-${V0}`,Mz=`${eA}-${tA}`,Ch=class{constructor(e){Xo(this,"code");Xo(this,"name","TaskAbortError");Xo(this,"message");this.code=e,this.message=`${Pz} ${V0} (reason: ${e})`}},q0=(e,t)=>{if(typeof e!="function")throw new TypeError($r(32))},kf=()=>{},rA=(e,t=kf)=>(e.catch(t),e),nA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),lo=e=>{if(e.aborted)throw new Ch(e.reason)};function iA(e,t){let r=kf;return new Promise((n,i)=>{const o=()=>i(new Ch(e.reason));if(e.aborted){o();return}r=nA(e,o),t.finally(()=>r()).then(n,i)}).finally(()=>{r=kf})}var Iz=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Ch?"cancelled":"rejected",error:r}}finally{t==null||t()}},jf=e=>t=>rA(iA(e,t).then(r=>(lo(e),r))),aA=e=>{const t=jf(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ys}=Object,$k={},Ph="listenerMiddleware",Tz=(e,t)=>{const r=n=>nA(e,()=>n.abort(e.reason));return(n,i)=>{q0(n);const o=new AbortController;r(o);const u=Iz(async()=>{lo(e),lo(o.signal);const c=await n({pause:jf(o.signal),delay:aA(o.signal),signal:o.signal});return lo(o.signal),c},()=>o.abort(_z));return i!=null&&i.autoJoin&&t.push(u.catch(kf)),{result:jf(e)(u),cancel(){o.abort(Oz)}}}},Dz=(e,t)=>{const r=async(n,i)=>{lo(t);let o=()=>{};const c=[new Promise((f,h)=>{let m=e({predicate:n,effect:(g,v)=>{v.unsubscribe(),f([g,v.getState(),v.getOriginalState()])}});o=()=>{m(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await iA(t,Promise.race(c));return lo(t),f}finally{o()}};return((n,i)=>rA(r(n,i)))},oA=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:o}=e;if(t)i=zr(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error($r(21));return q0(o),{predicate:i,type:t,effect:o}},sA=ys(e=>{const{type:t,predicate:r,effect:n}=oA(e);return{id:xz(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error($r(22))}}},{withTypes:()=>sA}),zk=(e,t)=>{const{type:r,effect:n,predicate:i}=oA(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===i)&&o.effect===n)},Uv=e=>{e.pending.forEach(t=>{t.abort(Bv)})},Rz=(e,t)=>()=>{for(const r of t.keys())Uv(r);e.clear()},Fk=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},lA=ys(zr(`${Ph}/add`),{withTypes:()=>lA}),Lz=zr(`${Ph}/removeAll`),uA=ys(zr(`${Ph}/remove`),{withTypes:()=>uA}),$z=(...e)=>{console.error(`${Ph}/error`,...e)},qu=(e={})=>{const t=new Map,r=new Map,n=b=>{const j=r.get(b)??0;r.set(b,j+1)},i=b=>{const j=r.get(b)??1;j===1?r.delete(b):r.set(b,j-1)},{extra:o,onError:u=$z}=e;q0(u);const c=b=>(b.unsubscribe=()=>t.delete(b.id),t.set(b.id,b),j=>{b.unsubscribe(),j!=null&&j.cancelActive&&Uv(b)}),f=(b=>{const j=zk(t,b)??sA(b);return c(j)});ys(f,{withTypes:()=>f});const h=b=>{const j=zk(t,b);return j&&(j.unsubscribe(),b.cancelActive&&Uv(j)),!!j};ys(h,{withTypes:()=>h});const m=async(b,j,k,S)=>{const N=new AbortController,E=Dz(f,N.signal),A=[];try{b.pending.add(N),n(b),await Promise.resolve(b.effect(j,ys({},k,{getOriginalState:S,condition:(P,_)=>E(P,_).then(Boolean),take:E,delay:aA(N.signal),pause:jf(N.signal),extra:o,signal:N.signal,fork:Tz(N.signal,A),unsubscribe:b.unsubscribe,subscribe:()=>{t.set(b.id,b)},cancelActiveListeners:()=>{b.pending.forEach((P,_,O)=>{P!==N&&(P.abort(Bv),O.delete(P))})},cancel:()=>{N.abort(Bv),b.pending.delete(N)},throwIfCancelled:()=>{lo(N.signal)}})))}catch(P){P instanceof Ch||Fk(u,P,{raisedBy:"effect"})}finally{await Promise.all(A),N.abort(Mz),i(b),b.pending.delete(N)}},g=Rz(t,r);return{middleware:b=>j=>k=>{if(!$E(k))return j(k);if(lA.match(k))return f(k.payload);if(Lz.match(k)){g();return}if(uA.match(k))return h(k.payload);let S=b.getState();const N=()=>{if(S===$k)throw new Error($r(23));return S};let E;try{if(E=j(k),t.size>0){const A=b.getState(),P=Array.from(t.values());for(const _ of P){let O=!1;try{O=_.predicate(k,A,S)}catch(T){O=!1,Fk(u,T,{raisedBy:"predicate"})}O&&m(_,k,b,N)}}}finally{S=$k}return E},startListening:f,stopListening:h,clearListeners:g}};function $r(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 zz={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},cA=lr({name:"chartLayout",initialState:zz,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,o;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),Oh=cA.actions,Fz=Oh.setMargin,Bz=Oh.setLayout,Uz=Oh.setChartSize,Hz=Oh.setScale,Wz=cA.reducer;function dA(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function We(e){return Number.isFinite(e)}function Un(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Bk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hs(e){for(var t=1;t{if(t&&r){var n=r.width,i=r.height,o=t.align,u=t.verticalAlign,c=t.layout;if((c==="vertical"||c==="horizontal"&&u==="middle")&&o!=="center"&&Ae(e[o]))return hs(hs({},e),{},{[o]:e[o]+(n||0)});if((c==="horizontal"||c==="vertical"&&o==="center")&&u!=="middle"&&Ae(e[u]))return hs(hs({},e),{},{[u]:e[u]+(i||0)})}return e},Gn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",fA=(e,t,r,n)=>{if(n)return e.map(c=>c.coordinate);var i,o,u=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===r&&(o=!0),c.coordinate));return i||u.push(t),o||u.push(r),u},hA=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,i=e.type,o=e.range,u=e.scale,c=e.realScaleType,f=e.isCategorical,h=e.categoricalDomain,m=e.tickCount,g=e.ticks,v=e.niceTicks,b=e.axisType;if(!u)return null;var j=c==="scaleBand"&&u.bandwidth?u.bandwidth()/2:2,k=i==="category"&&u.bandwidth?u.bandwidth()/j:0;if(k=b==="angleAxis"&&o&&o.length>=2?Yr(o[0]-o[1])*2*k:k,g||v){var S=(g||v||[]).map((N,E)=>{var A=n?n.indexOf(N):N,P=u.map(A);return We(P)?{coordinate:P+k,value:N,offset:k,index:E}:null}).filter(Sr);return S}return f&&h?h.map((N,E)=>{var A=u.map(N);return We(A)?{coordinate:A+k,value:N,index:E,offset:k}:null}).filter(Sr):u.ticks&&m!=null?u.ticks(m).map((N,E)=>{var A=u.map(N);return We(A)?{coordinate:A+k,value:N,index:E,offset:k}:null}).filter(Sr):u.domain().map((N,E)=>{var A=u.map(N);return We(A)?{coordinate:A+k,value:n?n[N]:N,index:E,offset:k}:null}).filter(Sr)},Qz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(h[0]=o,o+=v,h[1]=o):(h[0]=u,u+=v,h[1]=u)}}}},Yz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},Xz={sign:Qz,expand:hL,none:ho,silhouette:mL,wiggle:pL,positive:Yz},Zz=(e,t,r)=>{var n,i=(n=Xz[r])!==null&&n!==void 0?n:ho,o=fL().keys(t).value((c,f)=>Number(Lt(c,f,0))).order(Cv).offset(i),u=o(e);return u.forEach((c,f)=>{c.forEach((h,m)=>{var g=Lt(e[m],t[f],0);Array.isArray(g)&&g.length===2&&Ae(g[0])&&Ae(g[1])&&(h[0]=g[0],h[1]=g[1])})}),u};function Jz(e){return e==null?void 0:String(e)}function Uk(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,u=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qt(i[t.dataKey])){var c=xE(r,"value",i[t.dataKey]);if(c)return c.coordinate+n/2}return r!=null&&r[o]?r[o].coordinate+n/2:null}var f=Lt(i,Qt(u)?t.dataKey:u),h=t.scale.map(f);return Ae(h)?h:null}var e6=e=>{var t=e.flat(2).filter(Ae);return[Math.min(...t),Math.max(...t)]},t6=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],r6=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return t6(Object.keys(e).reduce((n,i)=>{var o=e[i];if(!o)return n;var u=o.stackedData,c=u.reduce((f,h)=>{var m=dA(h,t,r),g=e6(m);return!We(g[0])||!We(g[1])?f:[Math.min(f[0],g[0]),Math.max(f[1],g[1])]},[1/0,-1/0]);return[Math.min(c[0],n[0]),Math.max(c[1],n[1])]},[1/0,-1/0]))},Hk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Sf=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=bh(t,m=>m.coordinate),o=1/0,u=1,c=i.length;u{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},i6=(e,t)=>t==="centric"?e.angle:e.radius,ki=e=>e.layout.width,ji=e=>e.layout.height,a6=e=>e.layout.scale,pA=e=>e.layout.margin,_h=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Mh=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),o6="data-recharts-item-index",s6="data-recharts-item-id",Qu=60;function Gk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dd(e){for(var t=1;te.brush.height;function f6(e){var t=Mh(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Qu;return r+i}return r},0)}function h6(e){var t=Mh(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Qu;return r+i}return r},0)}function m6(e){var t=_h(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function p6(e){var t=_h(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Zt=q([ki,ji,pA,d6,f6,h6,m6,p6,DE,R$],(e,t,r,n,i,o,u,c,f,h)=>{var m={left:(r.left||0)+i,right:(r.right||0)+o},g={top:(r.top||0)+u,bottom:(r.bottom||0)+c},v=Dd(Dd({},g),m),b=v.bottom;v.bottom+=n,v=qz(v,f,h);var j=e-v.left-v.right,k=t-v.top-v.bottom;return Dd(Dd({brushBottom:b},v),{},{width:Math.max(j,0),height:Math.max(k,0)})}),g6=q(Zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),gA=q(ki,ji,(e,t)=>({x:0,y:0,width:e,height:t})),v6=y.createContext(null),Ar=()=>y.useContext(v6)!=null,Ih=e=>e.brush,Th=q([Ih,Zt,pA],(e,t,r)=>({height:e.height,x:Ae(e.x)?e.x:t.left,y:Ae(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ae(e.width)?e.width:t.width}));function y6(e,t,{signal:r,edges:n}={}){let i,o=null;const u=n!=null&&n.includes("leading"),c=n==null||n.includes("trailing"),f=()=>{o!==null&&(e.apply(i,o),i=void 0,o=null)},h=()=>{c&&f(),b()};let m=null;const g=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,h()},t)},v=()=>{m!==null&&(clearTimeout(m),m=null)},b=()=>{v(),i=void 0,o=null},j=()=>{f()},k=function(...S){if(r!=null&&r.aborted)return;i=this,o=S;const N=m==null;g(),u&&N&&f()};return k.schedule=g,k.cancel=b,k.flush=j,r==null||r.addEventListener("abort",b,{once:!0}),k}function x6(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:o}=r,u=Array(2);n&&(u[0]="leading"),i&&(u[1]="trailing");let c,f=null;const h=y6(function(...v){c=e.apply(this,v),f=null},t,{edges:u}),m=function(...v){return o!=null&&(f===null&&(f=Date.now()),Date.now()-f>=o)?(c=e.apply(this,v),f=Date.now(),h.cancel(),h.schedule(),c):(h.apply(this,v),c)},g=()=>(h.flush(),c);return m.cancel=h.cancel,m.flush=g,m}function b6(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return x6(e,t,{leading:n,maxWait:t,trailing:i})}var Nf=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oi[u++]))}},Rn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},vA=(e,t,r)=>{var n=r.width,i=n===void 0?Rn.width:n,o=r.height,u=o===void 0?Rn.height:o,c=r.aspect,f=r.maxHeight,h=mo(i)?e:Number(i),m=mo(u)?t:Number(u);return c&&c>0&&(h?m=h/c:m&&(h=m*c),f&&m!=null&&m>f&&(m=f)),{calculatedWidth:h,calculatedHeight:m}},w6={width:0,height:0,overflow:"visible"},k6={width:0,overflowX:"visible"},j6={height:0,overflowY:"visible"},S6={},N6=e=>{var t=e.width,r=e.height,n=mo(t),i=mo(r);return n&&i?w6:n?k6:i?j6:S6};function E6(e){var t=e.width,r=e.height,n=e.aspect,i=t,o=r;return i===void 0&&o===void 0?(i=Rn.width,o=Rn.height):i===void 0?i=n&&n>0?void 0:Rn.width:o===void 0&&(o=n&&n>0?void 0:Rn.height),{width:i,height:o}}var A6=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Ef(){return Ef=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return $6(i)?y.createElement(yA.Provider,{value:i},t):null}var Q0=()=>y.useContext(yA),z6=y.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?Rn.initialDimension:n,o=e.width,u=e.height,c=e.minWidth,f=c===void 0?Rn.minWidth:c,h=e.minHeight,m=e.maxHeight,g=e.children,v=e.debounce,b=v===void 0?Rn.debounce:v,j=e.id,k=e.className,S=e.onResize,N=e.style,E=N===void 0?{}:N,A=R6(e,A6),P=y.useRef(null),_=y.useRef();_.current=S,y.useImperativeHandle(t,()=>P.current);var O=y.useState({containerWidth:i.width,containerHeight:i.height}),T=_6(O,2),B=T[0],$=T[1],z=y.useCallback((oe,se)=>{$(X=>{var ne=Math.round(oe),te=Math.round(se);return X.containerWidth===ne&&X.containerHeight===te?X:{containerWidth:ne,containerHeight:te}})},[]);y.useEffect(()=>{if(P.current==null||typeof ResizeObserver>"u")return Ys;var oe=I=>{var M,H=I[0];if(H!=null){var ie=H.contentRect,J=ie.width,Z=ie.height;z(J,Z),(M=_.current)===null||M===void 0||M.call(_,J,Z)}};b>0&&(oe=b6(oe,b,{trailing:!0,leading:!1}));var se=new ResizeObserver(oe),X=P.current.getBoundingClientRect(),ne=X.width,te=X.height;return z(ne,te),se.observe(P.current),()=>{se.disconnect()}},[z,b]);var Q=B.containerWidth,U=B.containerHeight;Nf(!r||r>0,"The aspect(%s) must be greater than zero.",r);var ve=vA(Q,U,{width:o,height:u,aspect:r,maxHeight:m}),ue=ve.calculatedWidth,pe=ve.calculatedHeight;return Nf(Q<0||U<0||ue!=null&&ue>0||pe!=null&&pe>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.`,ue,pe,o,u,f,h,r),y.createElement("div",Ef({id:j?"".concat(j):void 0,className:rt("recharts-responsive-container",k),style:qk(qk({},E),{},{width:o,height:u,minWidth:f,minHeight:h,maxHeight:m}),ref:P},A),y.createElement("div",{style:S6({width:o,height:u})},y.createElement(xA,{width:ue,height:pe},g)))}),z6=y.forwardRef((e,t)=>{var r=Q0();if(Un(r.width)&&Un(r.height))return e.children;var n=N6({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,o=n.height,u=vA(void 0,void 0,{width:i,height:o,aspect:e.aspect,maxHeight:e.maxHeight}),c=u.calculatedWidth,f=u.calculatedHeight;return Ae(c)&&Ae(f)?y.createElement(xA,{width:c,height:f},e.children):y.createElement($6,Ef({},e,{width:i,height:o,ref:t}))});function Y0(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 Dh=()=>{var e,t=Ar(),r=Me(p6),n=Me(Th),i=(e=Me(Ih))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},F6={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},bA=()=>{var e;return(e=Me(Zt))!==null&&e!==void 0?e:F6},wA=()=>Me(ki),kA=()=>Me(ji),ft=e=>e.layout.layoutType,Zs=()=>Me(ft),X0=()=>{var e=Zs();if(e==="horizontal"||e==="vertical")return e},jA=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},B6=()=>{var e=Zs();return e!==void 0},Xu=e=>{var t=Nt(),r=Ar(),n=e.width,i=e.height,o=Q0(),u=n,c=i;return o&&(u=o.width>0?o.width:n,c=o.height>0?o.height:i),y.useEffect(()=>{!r&&Un(u)&&Un(c)&&t(Bz({width:u,height:c}))},[t,r,u,c]),null},SA=Symbol.for("immer-nothing"),Yk=Symbol.for("immer-draftable"),Fr=Symbol.for("immer-state");function gn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Au=Object.getPrototypeOf;function Fs(e){return!!e&&!!e[Fr]}function go(e){var t;return e?NA(e)||Array.isArray(e)||!!e[Yk]||!!((t=e.constructor)!=null&&t[Yk])||Zu(e)||Lh(e):!1}var U6=Object.prototype.constructor.toString(),Xk=new WeakMap;function NA(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Xk.get(r);return n===void 0&&(n=Function.toString.call(r),Xk.set(r,n)),n===U6}function Af(e,t,r=!0){Rh(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Rh(e){const t=e[Fr];return t?t.type_:Array.isArray(e)?1:Zu(e)?2:Lh(e)?3:0}function Hv(e,t){return Rh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function EA(e,t,r){const n=Rh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function H6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Zu(e){return e instanceof Map}function Lh(e){return e instanceof Set}function Wa(e){return e.copy_||e.base_}function Wv(e,t){if(Zu(e))return new Map(e);if(Lh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=NA(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Fr];let i=Reflect.ownKeys(n);for(let o=0;o1&&Object.defineProperties(e,{set:Ld,add:Ld,clear:Ld,delete:Ld}),Object.freeze(e),t&&Object.values(e).forEach(r=>Z0(r,!0))),e}function W6(){gn(2)}var Ld={value:W6};function $h(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var K6={};function vo(e){const t=K6[e];return t||gn(0,e),t}var Cu;function AA(){return Cu}function G6(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zk(e,t){t&&(vo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Kv(e){Gv(e),e.drafts_.forEach(V6),e.drafts_=null}function Gv(e){e===Cu&&(Cu=e.parent_)}function Jk(e){return Cu=G6(Cu,e)}function V6(e){const t=e[Fr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ej(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Fr].modified_&&(Kv(t),gn(4)),go(e)&&(e=Cf(t,e),t.parent_||Pf(t,e)),t.patches_&&vo("Patches").generateReplacementPatches_(r[Fr].base_,e,t.patches_,t.inversePatches_)):e=Cf(t,r,[]),Kv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==SA?e:void 0}function Cf(e,t,r){if($h(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Fr];if(!i)return Af(t,(o,u)=>tj(e,i,t,o,u,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Pf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let u=o,c=!1;i.type_===3&&(u=new Set(o),o.clear(),c=!0),Af(u,(f,h)=>tj(e,i,o,f,h,r,c),n),Pf(e,o,!1),r&&e.patches_&&vo("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function tj(e,t,r,n,i,o,u){if(i==null||typeof i!="object"&&!u)return;const c=$h(i);if(!(c&&!u)){if(Fs(i)){const f=o&&t&&t.type_!==3&&!Hv(t.assigned_,n)?o.concat(n):void 0,h=Cf(e,i,f);if(EA(r,n,h),Fs(h))e.canAutoFreeze_=!1;else return}else u&&r.add(i);if(go(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&c)return;Cf(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Zu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Pf(e,i)}}}function Pf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Z0(t,r)}function q6(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:AA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=J0;r&&(i=[n],o=Pu);const{revoke:u,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=u,c}var J0={get(e,t){if(t===Fr)return e;const r=Wa(e);if(!Hv(r,t))return Q6(e,r,t);const n=r[t];return e.finalized_||!go(n)?n:n===wg(e.base_,t)?(kg(e),e.copy_[t]=qv(n,e)):n},has(e,t){return t in Wa(e)},ownKeys(e){return Reflect.ownKeys(Wa(e))},set(e,t,r){const n=CA(Wa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=wg(Wa(e),t),o=i==null?void 0:i[Fr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(H6(r,i)&&(r!==void 0||Hv(e.base_,t)))return!0;kg(e),Vv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return wg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,kg(e),Vv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Wa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){gn(11)},getPrototypeOf(e){return Au(e.base_)},setPrototypeOf(){gn(12)}},Pu={};Af(J0,(e,t)=>{Pu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Pu.deleteProperty=function(e,t){return Pu.set.call(this,e,t,void 0)};Pu.set=function(e,t,r){return J0.set.call(this,e[0],t,r,e[0])};function wg(e,t){const r=e[Fr];return(r?Wa(r):e)[t]}function Q6(e,t,r){var i;const n=CA(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function CA(e,t){if(!(t in e))return;let r=Au(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Au(r)}}function Vv(e){e.modified_||(e.modified_=!0,e.parent_&&Vv(e.parent_))}function kg(e){e.copy_||(e.copy_=Wv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Y6=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const u=this;return function(f=o,...h){return u.produce(f,m=>r.call(this,m,...h))}}typeof r!="function"&&gn(6),n!==void 0&&typeof n!="function"&&gn(7);let i;if(go(t)){const o=Jk(this),u=qv(t,void 0);let c=!0;try{i=r(u),c=!1}finally{c?Kv(o):Gv(o)}return Zk(o,n),ej(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===SA&&(i=void 0),this.autoFreeze_&&Z0(i,!0),n){const o=[],u=[];vo("Patches").generateReplacementPatches_(t,i,o,u),n(o,u)}return i}else gn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(u,...c)=>this.produceWithPatches(u,f=>t(f,...c));let n,i;return[this.produce(t,r,(u,c)=>{n=u,i=c}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){go(e)||gn(8),Fs(e)&&(e=X6(e));const t=Jk(this),r=qv(e,void 0);return r[Fr].isManual_=!0,Gv(t),r}finishDraft(e,t){const r=e&&e[Fr];(!r||!r.isManual_)&&gn(9);const{scope_:n}=r;return Zk(n,t),ej(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=vo("Patches").applyPatches_;return Fs(e)?n(e,t):this.produce(e,i=>n(i,t))}};function qv(e,t){const r=Zu(e)?vo("MapSet").proxyMap_(e,t):Lh(e)?vo("MapSet").proxySet_(e,t):q6(e,t);return(t?t.scope_:AA()).drafts_.push(r),r}function X6(e){return Fs(e)||gn(10,e),PA(e)}function PA(e){if(!go(e)||$h(e))return e;const t=e[Fr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Wv(e,!0);return Af(r,(i,o)=>{EA(r,i,PA(o))},n),t&&(t.finalized_=!1),r}var Z6=new Y6;Z6.produce;var J6={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},OA=lr({name:"legend",initialState:J6,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(t.payload)},prepare:st()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).payload.indexOf(n);o>-1&&(e.payload[o]=i)},prepare:st()},removeLegendPayload:{reducer(e,t){var r=Xr(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:st()}}}),Ju=OA.actions;Ju.setLegendSize;Ju.setLegendSettings;var e8=Ju.addLegendPayload,t8=Ju.replaceLegendPayload,r8=Ju.removeLegendPayload,n8=OA.reducer,jg={exports:{}},Sg={};/** + height and width.`,ue,pe,o,u,f,h,r),y.createElement("div",Ef({id:j?"".concat(j):void 0,className:rt("recharts-responsive-container",k),style:qk(qk({},E),{},{width:o,height:u,minWidth:f,minHeight:h,maxHeight:m}),ref:P},A),y.createElement("div",{style:N6({width:o,height:u})},y.createElement(xA,{width:ue,height:pe},g)))}),F6=y.forwardRef((e,t)=>{var r=Q0();if(Un(r.width)&&Un(r.height))return e.children;var n=E6({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,o=n.height,u=vA(void 0,void 0,{width:i,height:o,aspect:e.aspect,maxHeight:e.maxHeight}),c=u.calculatedWidth,f=u.calculatedHeight;return Ae(c)&&Ae(f)?y.createElement(xA,{width:c,height:f},e.children):y.createElement(z6,Ef({},e,{width:i,height:o,ref:t}))});function Y0(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 Dh=()=>{var e,t=Ar(),r=Me(g6),n=Me(Th),i=(e=Me(Ih))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},B6={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},bA=()=>{var e;return(e=Me(Zt))!==null&&e!==void 0?e:B6},wA=()=>Me(ki),kA=()=>Me(ji),ft=e=>e.layout.layoutType,Xs=()=>Me(ft),X0=()=>{var e=Xs();if(e==="horizontal"||e==="vertical")return e},jA=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},U6=()=>{var e=Xs();return e!==void 0},Yu=e=>{var t=Nt(),r=Ar(),n=e.width,i=e.height,o=Q0(),u=n,c=i;return o&&(u=o.width>0?o.width:n,c=o.height>0?o.height:i),y.useEffect(()=>{!r&&Un(u)&&Un(c)&&t(Uz({width:u,height:c}))},[t,r,u,c]),null},SA=Symbol.for("immer-nothing"),Yk=Symbol.for("immer-draftable"),Fr=Symbol.for("immer-state");function vn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Eu=Object.getPrototypeOf;function zs(e){return!!e&&!!e[Fr]}function go(e){var t;return e?NA(e)||Array.isArray(e)||!!e[Yk]||!!((t=e.constructor)!=null&&t[Yk])||Xu(e)||Lh(e):!1}var H6=Object.prototype.constructor.toString(),Xk=new WeakMap;function NA(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Xk.get(r);return n===void 0&&(n=Function.toString.call(r),Xk.set(r,n)),n===H6}function Af(e,t,r=!0){Rh(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Rh(e){const t=e[Fr];return t?t.type_:Array.isArray(e)?1:Xu(e)?2:Lh(e)?3:0}function Hv(e,t){return Rh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function EA(e,t,r){const n=Rh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function W6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xu(e){return e instanceof Map}function Lh(e){return e instanceof Set}function Wa(e){return e.copy_||e.base_}function Wv(e,t){if(Xu(e))return new Map(e);if(Lh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=NA(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Fr];let i=Reflect.ownKeys(n);for(let o=0;o1&&Object.defineProperties(e,{set:Rd,add:Rd,clear:Rd,delete:Rd}),Object.freeze(e),t&&Object.values(e).forEach(r=>Z0(r,!0))),e}function K6(){vn(2)}var Rd={value:K6};function $h(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var G6={};function vo(e){const t=G6[e];return t||vn(0,e),t}var Au;function AA(){return Au}function V6(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zk(e,t){t&&(vo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Kv(e){Gv(e),e.drafts_.forEach(q6),e.drafts_=null}function Gv(e){e===Au&&(Au=e.parent_)}function Jk(e){return Au=V6(Au,e)}function q6(e){const t=e[Fr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ej(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Fr].modified_&&(Kv(t),vn(4)),go(e)&&(e=Cf(t,e),t.parent_||Pf(t,e)),t.patches_&&vo("Patches").generateReplacementPatches_(r[Fr].base_,e,t.patches_,t.inversePatches_)):e=Cf(t,r,[]),Kv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==SA?e:void 0}function Cf(e,t,r){if($h(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Fr];if(!i)return Af(t,(o,u)=>tj(e,i,t,o,u,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Pf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let u=o,c=!1;i.type_===3&&(u=new Set(o),o.clear(),c=!0),Af(u,(f,h)=>tj(e,i,o,f,h,r,c),n),Pf(e,o,!1),r&&e.patches_&&vo("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function tj(e,t,r,n,i,o,u){if(i==null||typeof i!="object"&&!u)return;const c=$h(i);if(!(c&&!u)){if(zs(i)){const f=o&&t&&t.type_!==3&&!Hv(t.assigned_,n)?o.concat(n):void 0,h=Cf(e,i,f);if(EA(r,n,h),zs(h))e.canAutoFreeze_=!1;else return}else u&&r.add(i);if(go(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&c)return;Cf(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Xu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Pf(e,i)}}}function Pf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Z0(t,r)}function Q6(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:AA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=J0;r&&(i=[n],o=Cu);const{revoke:u,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=u,c}var J0={get(e,t){if(t===Fr)return e;const r=Wa(e);if(!Hv(r,t))return Y6(e,r,t);const n=r[t];return e.finalized_||!go(n)?n:n===wg(e.base_,t)?(kg(e),e.copy_[t]=qv(n,e)):n},has(e,t){return t in Wa(e)},ownKeys(e){return Reflect.ownKeys(Wa(e))},set(e,t,r){const n=CA(Wa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=wg(Wa(e),t),o=i==null?void 0:i[Fr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(W6(r,i)&&(r!==void 0||Hv(e.base_,t)))return!0;kg(e),Vv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return wg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,kg(e),Vv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Wa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){vn(11)},getPrototypeOf(e){return Eu(e.base_)},setPrototypeOf(){vn(12)}},Cu={};Af(J0,(e,t)=>{Cu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Cu.deleteProperty=function(e,t){return Cu.set.call(this,e,t,void 0)};Cu.set=function(e,t,r){return J0.set.call(this,e[0],t,r,e[0])};function wg(e,t){const r=e[Fr];return(r?Wa(r):e)[t]}function Y6(e,t,r){var i;const n=CA(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function CA(e,t){if(!(t in e))return;let r=Eu(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Eu(r)}}function Vv(e){e.modified_||(e.modified_=!0,e.parent_&&Vv(e.parent_))}function kg(e){e.copy_||(e.copy_=Wv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var X6=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const u=this;return function(f=o,...h){return u.produce(f,m=>r.call(this,m,...h))}}typeof r!="function"&&vn(6),n!==void 0&&typeof n!="function"&&vn(7);let i;if(go(t)){const o=Jk(this),u=qv(t,void 0);let c=!0;try{i=r(u),c=!1}finally{c?Kv(o):Gv(o)}return Zk(o,n),ej(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===SA&&(i=void 0),this.autoFreeze_&&Z0(i,!0),n){const o=[],u=[];vo("Patches").generateReplacementPatches_(t,i,o,u),n(o,u)}return i}else vn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(u,...c)=>this.produceWithPatches(u,f=>t(f,...c));let n,i;return[this.produce(t,r,(u,c)=>{n=u,i=c}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){go(e)||vn(8),zs(e)&&(e=Z6(e));const t=Jk(this),r=qv(e,void 0);return r[Fr].isManual_=!0,Gv(t),r}finishDraft(e,t){const r=e&&e[Fr];(!r||!r.isManual_)&&vn(9);const{scope_:n}=r;return Zk(n,t),ej(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=vo("Patches").applyPatches_;return zs(e)?n(e,t):this.produce(e,i=>n(i,t))}};function qv(e,t){const r=Xu(e)?vo("MapSet").proxyMap_(e,t):Lh(e)?vo("MapSet").proxySet_(e,t):Q6(e,t);return(t?t.scope_:AA()).drafts_.push(r),r}function Z6(e){return zs(e)||vn(10,e),PA(e)}function PA(e){if(!go(e)||$h(e))return e;const t=e[Fr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Wv(e,!0);return Af(r,(i,o)=>{EA(r,i,PA(o))},n),t&&(t.finalized_=!1),r}var J6=new X6;J6.produce;var e8={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},OA=lr({name:"legend",initialState:e8,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(t.payload)},prepare:st()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).payload.indexOf(n);o>-1&&(e.payload[o]=i)},prepare:st()},removeLegendPayload:{reducer(e,t){var r=Xr(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:st()}}}),Zu=OA.actions;Zu.setLegendSize;Zu.setLegendSettings;var t8=Zu.addLegendPayload,r8=Zu.replaceLegendPayload,n8=Zu.removeLegendPayload,i8=OA.reducer,jg={exports:{}},Sg={};/** * @license React * use-sync-external-store-with-selector.production.js * @@ -607,12 +612,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var rj;function i8(){if(rj)return Sg;rj=1;var e=Vs();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,u=e.useMemo,c=e.useDebugValue;return Sg.useSyncExternalStoreWithSelector=function(f,h,m,g,v){var b=i(null);if(b.current===null){var j={hasValue:!1,value:null};b.current=j}else j=b.current;b=u(function(){function S(_){if(!N){if(N=!0,E=_,_=g(_),v!==void 0&&j.hasValue){var O=j.value;if(v(O,_))return A=O}return A=_}if(O=A,r(E,_))return O;var T=g(_);return v!==void 0&&v(O,T)?(E=_,O):(E=_,A=T)}var N=!1,E,A,P=m===void 0?null:m;return[function(){return S(h())},P===null?void 0:function(){return S(P())}]},[h,m,g,v]);var k=n(f,b[0],b[1]);return o(function(){j.hasValue=!0,j.value=k},[k]),c(k),k},Sg}var nj;function a8(){return nj||(nj=1,jg.exports=i8()),jg.exports}a8();function o8(e){e()}function s8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){o8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var ij={notify(){},get:()=>[]};function l8(e,t){let r,n=ij,i=0,o=!1;function u(k){m();const S=n.subscribe(k);let N=!1;return()=>{N||(N=!0,S(),g())}}function c(){n.notify()}function f(){j.onStateChange&&j.onStateChange()}function h(){return o}function m(){i++,r||(r=e.subscribe(f),n=s8())}function g(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=ij)}function v(){o||(o=!0,m())}function b(){o&&(o=!1,g())}const j={addNestedSub:u,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:b,getListeners:()=>n};return j}var u8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",c8=u8(),d8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",f8=d8(),h8=()=>c8||f8?y.useLayoutEffect:y.useEffect,m8=h8();function aj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function p8(e,t){if(aj(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i{const f=l8(i);return{store:i,subscription:f,getServerState:n?()=>n:void 0}},[i,n]),u=y.useMemo(()=>i.getState(),[i]);m8(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),u!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,u]);const c=r||v8;return y.createElement(c.Provider,{value:o},t)}var x8=y8,b8=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function w8(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function zh(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(b8.has(n)){if(e[n]==null&&t[n]==null)continue;if(!p8(e[n],t[n]))return!1}else if(!w8(e[n],t[n]))return!1;return!0}function Qv(){return Qv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?rs.separator:t,n=e.contentStyle,i=e.itemStyle,o=e.labelStyle,u=o===void 0?rs.labelStyle:o,c=e.payload,f=e.formatter,h=e.itemSorter,m=e.wrapperClassName,g=e.labelClassName,v=e.label,b=e.labelFormatter,j=e.accessibilityLayer,k=j===void 0?rs.accessibilityLayer:j,S=()=>{if(c&&c.length){var B={padding:0,margin:0},$=_8(c,h),z=$.map((Q,U)=>{if(!Q||Q.type==="none")return null;var ve=Q.formatter||f||O8,ue=Q.value,pe=Q.name,oe=ue,se=pe;if(ve){var X=ve(ue,pe,Q,U,c);if(Array.isArray(X)){var ne=N8(X,2);oe=ne[0],se=ne[1]}else if(X!=null)oe=X;else return null}var te=Zl(Zl({},rs.itemStyle),{},{color:Q.color||rs.itemStyle.color},i);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:te},Bn(se)?y.createElement("span",{className:"recharts-tooltip-item-name"},se):null,Bn(se)?y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,y.createElement("span",{className:"recharts-tooltip-item-value"},oe),y.createElement("span",{className:"recharts-tooltip-item-unit"},Q.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:B},z)}return null},N=Zl(Zl({},rs.contentStyle),n),E=Zl({margin:0},u),A=!Qt(v),P=A?v:"",_=rt("recharts-default-tooltip",m),O=rt("recharts-tooltip-label",g);A&&b&&c!==void 0&&c!==null&&(P=b(v,c));var T=k?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",Qv({className:_,style:N},T),y.createElement("p",{className:O,style:E},y.isValidElement(P)?P:"".concat(P)),S())},Jl="recharts-tooltip-wrapper",I8={visibility:"hidden"};function T8(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return rt(Jl,{["".concat(Jl,"-right")]:Ae(r)&&t&&Ae(t.x)&&r>=t.x,["".concat(Jl,"-left")]:Ae(r)&&t&&Ae(t.x)&&r=t.y,["".concat(Jl,"-top")]:Ae(n)&&t&&Ae(t.y)&&n0?i:0),g=r[n]+i;if(t[n])return u[n]?m:g;var v=f[n];if(v==null)return 0;if(u[n]){var b=m,j=v;return bS?Math.max(m,v):Math.max(g,v)}function D8(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function R8(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,o=e.position,u=e.reverseDirection,c=e.tooltipBox,f=e.useTranslate3d,h=e.viewBox,m,g,v;return c.height>0&&c.width>0&&r?(g=lj({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:o,reverseDirection:u,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),v=lj({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:o,reverseDirection:u,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),m=D8({translateX:g,translateY:v,useTranslate3d:f})):m=I8,{cssProperties:m,cssClasses:T8({translateX:g,translateY:v,coordinate:r})}}var L8=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),ec={isSsr:L8()};function $8(e,t){return U8(e)||B8(e,t)||F8(e,t)||z8()}function z8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F8(e,t){if(e){if(typeof e=="string")return uj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uj(e,t):void 0}}function uj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rec.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=$8(e,2),r=t[0],n=t[1];return y.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{n(i.matches)};return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}}},[]),r}function cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ns(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),h=G8(f,2),m=h[0],g=h[1];y.useEffect(()=>{var N=E=>{if(E.key==="Escape"){var A,P,_,O;g({dismissed:!0,dismissedAtCoordinate:{x:(A=(P=e.coordinate)===null||P===void 0?void 0:P.x)!==null&&A!==void 0?A:0,y:(_=(O=e.coordinate)===null||O===void 0?void 0:O.y)!==null&&_!==void 0?_:0}})}};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),m.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==m.dismissedAtCoordinate.x||((o=(u=e.coordinate)===null||u===void 0?void 0:u.y)!==null&&o!==void 0?o:0)!==m.dismissedAtCoordinate.y)&&g(ns(ns({},m),{},{dismissed:!1}));var v=R8({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}),b=v.cssClasses,j=v.cssProperties,k=e.hasPortalFromProps?{}:ns(ns({transition:X8({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},j),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),S=ns(ns({},k),{},{visibility:!m.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:b,style:S,ref:e.innerRef},e.children)}var J8=y.memo(Z8),MA=()=>{var e;return(e=Me(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;tWe(e.x)&&We(e.y),pj=e=>e.base!=null&&Of(e.base)&&Of(e),eu=e=>e.x,tu=e=>e.y,nF=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(z0(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=mj["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return mj[r]||yh},gj={connectNulls:!1,type:"linear"},iF=e=>{var t=e.type,r=t===void 0?gj.type:t,n=e.points,i=n===void 0?[]:n,o=e.baseLine,u=e.layout,c=e.connectNulls,f=c===void 0?gj.connectNulls:c,h=nF(r,u),m=f?i.filter(Of):i;if(Array.isArray(o)){var g,v=i.map((N,E)=>hj(hj({},N),{},{base:o[E]}));u==="vertical"?g=Od().y(tu).x1(eu).x0(N=>N.base.x):g=Od().x(eu).y1(tu).y0(N=>N.base.y);var b=g.defined(pj).curve(h),j=f?v.filter(pj):v;return b(j)}var k;u==="vertical"&&Ae(o)?k=Od().y(tu).x1(eu).x0(o):Ae(o)?k=Od().x(eu).y1(tu).y0(o):k=sE().x(eu).y(tu);var S=k.defined(Of).curve(h);return S(m)},Zd=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,o=Zs();if((!r||!r.length)&&!n)return null;var u={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},c=r&&r.length?iF(u):n;return y.createElement("path",Yv({},xn(e),F0(e),{className:rt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},aF=["x","y","top","left","width","height","className"];function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r),hF=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,o=e.top,u=o===void 0?0:o,c=e.left,f=c===void 0?0:c,h=e.width,m=h===void 0?0:h,g=e.height,v=g===void 0?0:g,b=e.className,j=cF(e,aF),k=oF({x:r,y:i,top:u,left:f,width:m,height:v},j);return!Ae(r)||!Ae(i)||!Ae(m)||!Ae(v)||!Ae(u)||!Ae(f)?null:y.createElement("path",Xv({},Jr(k),{className:rt("recharts-cross",b),d:fF(r,i,m,v,u,f)}))};function mF(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var _f=1e-4,IA=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],TA=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),yj=(e,t)=>r=>{var n=IA(e,t);return TA(n,r)},pF=(e,t)=>r=>{var n=IA(e,t),i=[...n.map((o,u)=>o*u).slice(1),0];return TA(i,r)},gF=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(o=>parseFloat(o));return[i[0],i[1],i[2],i[3]]},vF=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=yj(e,r),o=yj(t,n),u=pF(e,r),c=h=>h>1?1:h<0?0:h,f=h=>{for(var m=h>1?1:h,g=m,v=0;v<8;++v){var b=i(g)-m,j=u(g);if(Math.abs(b-m)<_f||j<_f)return o(g);g=c(g-b/j)}return o(g)};return f.isStepper=!1,f},xj=function(){return yF(...vF(...arguments))},xF=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,u=t.dt,c=u===void 0?16.67:u,f=1,h=[0],m=0,g=0,v=1e4,b=0;b{var E,A,P;if(N<=0)return 0;if(N>=1)return f;var _=N*S,O=Math.floor(_),T=_-O;return((E=h[O])!==null&&E!==void 0?E:0)+(((A=h[O+1])!==null&&A!==void 0?A:0)-((P=h[O])!==null&&P!==void 0?P:0))*T}},bF=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return xj(e);case"spring":return xF();default:if(e.split("(")[0]==="cubic-bezier")return xj(e)}return typeof e=="function"?e:null},wF=(e,t,r)=>{var n,i=o=>{var u=t.tick(o);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,u);return}n=e.setTimeout(i,u)};return n=e.setTimeout(i,0),()=>{var o;return(o=n)===null||o===void 0?void 0:o()}},DA=y.createContext(wF);DA.Provider;function kF(e){var t=y.useContext(DA);return y.useMemo(()=>e??t,[e,t])}function jF(e,t,r){return(t=SF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SF(e){var t=NF(e,"string");return typeof t=="symbol"?t:t+""}function NF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bj="init",wj="pending",kj="active",EF="completed";function Ag(e){return Math.max(0,e)}class AF{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;jF(this,"state",bj),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=Ag(t.animationDuration),this.animationBegin=Ag(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===bj)return this.state=wj,this.beginStartedTime=t,this.animationBegin;if(this.getState()===wj){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=kj,this.animationStartedTime=t,this.nextAnimationUpdate(0)):Ag(this.animationBegin-r)}if(this.getState()===kj){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=EF}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class CF extends AF{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ui(this.getFrom(),this.getTo(),this.getProgress()))}}class PF{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,o=u=>{u-n>=r?t(u):i=requestAnimationFrame(o)};return i=requestAnimationFrame(o),()=>{i!=null&&cancelAnimationFrame(i)}}}function OF(e,t){return TF(e)||IF(e,t)||MF(e,t)||_F()}function _F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MF(e,t){if(e){if(typeof e=="string")return jj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jj(e,t):void 0}}function jj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},Sj=0,Cg=1;function RA(e){var t=rn(e,DF),r=t.animationId,n=t.isActive,i=t.canBegin,o=t.duration,u=t.easing,c=t.begin,f=t.onAnimationEnd,h=t.onAnimationStart,m=t.children,g=_A(),v=n==="auto"?!ec.isSsr&&!g:n,b=kF(t.animationController),j=y.useState(v?Sj:Cg),k=OF(j,2),S=k[0],N=k[1];return y.useEffect(()=>{v||N(Cg)},[v]),y.useEffect(()=>{var E=bF(u);if(!v||!i||E==null)return Xs;var A=new PF,P=new CF({animationId:r,easing:E,animationDuration:o,animationBegin:c,onAnimationStart:h,onAnimationEnd:f,from:Sj,to:Cg});return b(A,P,N)},[b,r,v,i,o,u,c,h,f]),m(Number(S))}function LA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=y.useRef(ju(t)),n=y.useRef(e);return n.current!==e&&(r.current=ju(t),n.current=e),r.current}var RF=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),LF=(e,t,r)=>e.map(n=>"".concat(RF(n)," ").concat(t,"ms ").concat(r)).join(","),$F=["radius"],zF=["radius"],Nj,Ej,Aj,Cj,Pj,Oj,_j,Mj,Ij,Tj;function Dj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Rj(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var o=ca(r),u=ca(n),c=Math.min(Math.abs(o)/2,Math.abs(u)/2),f=u>=0?1:-1,h=o>=0?1:-1,m=u>=0&&o>=0||u<0&&o<0?1:0,g;if(c>0&&Array.isArray(i)){for(var v=[0,0,0,0],b=0,j=4;bc?c:S}g=Wt(Nj||(Nj=Pn(["M",",",""])),e,t+f*v[0]),v[0]>0&&(g+=Wt(Ej||(Ej=Pn(["A ",",",",0,0,",",",",",""])),v[0],v[0],m,e+h*v[0],t)),g+=Wt(Aj||(Aj=Pn(["L ",",",""])),e+r-h*v[1],t),v[1]>0&&(g+=Wt(Cj||(Cj=Pn(["A ",",",",0,0,",`, + */var rj;function a8(){if(rj)return Sg;rj=1;var e=Gs();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,u=e.useMemo,c=e.useDebugValue;return Sg.useSyncExternalStoreWithSelector=function(f,h,m,g,v){var b=i(null);if(b.current===null){var j={hasValue:!1,value:null};b.current=j}else j=b.current;b=u(function(){function S(_){if(!N){if(N=!0,E=_,_=g(_),v!==void 0&&j.hasValue){var O=j.value;if(v(O,_))return A=O}return A=_}if(O=A,r(E,_))return O;var T=g(_);return v!==void 0&&v(O,T)?(E=_,O):(E=_,A=T)}var N=!1,E,A,P=m===void 0?null:m;return[function(){return S(h())},P===null?void 0:function(){return S(P())}]},[h,m,g,v]);var k=n(f,b[0],b[1]);return o(function(){j.hasValue=!0,j.value=k},[k]),c(k),k},Sg}var nj;function o8(){return nj||(nj=1,jg.exports=a8()),jg.exports}o8();function s8(e){e()}function l8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){s8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var ij={notify(){},get:()=>[]};function u8(e,t){let r,n=ij,i=0,o=!1;function u(k){m();const S=n.subscribe(k);let N=!1;return()=>{N||(N=!0,S(),g())}}function c(){n.notify()}function f(){j.onStateChange&&j.onStateChange()}function h(){return o}function m(){i++,r||(r=e.subscribe(f),n=l8())}function g(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=ij)}function v(){o||(o=!0,m())}function b(){o&&(o=!1,g())}const j={addNestedSub:u,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:b,getListeners:()=>n};return j}var c8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d8=c8(),f8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",h8=f8(),m8=()=>d8||h8?y.useLayoutEffect:y.useEffect,p8=m8();function aj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function g8(e,t){if(aj(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i{const f=u8(i);return{store:i,subscription:f,getServerState:n?()=>n:void 0}},[i,n]),u=y.useMemo(()=>i.getState(),[i]);p8(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),u!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,u]);const c=r||y8;return y.createElement(c.Provider,{value:o},t)}var b8=x8,w8=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function k8(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function zh(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(w8.has(n)){if(e[n]==null&&t[n]==null)continue;if(!g8(e[n],t[n]))return!1}else if(!k8(e[n],t[n]))return!1;return!0}function Qv(){return Qv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?rs.separator:t,n=e.contentStyle,i=e.itemStyle,o=e.labelStyle,u=o===void 0?rs.labelStyle:o,c=e.payload,f=e.formatter,h=e.itemSorter,m=e.wrapperClassName,g=e.labelClassName,v=e.label,b=e.labelFormatter,j=e.accessibilityLayer,k=j===void 0?rs.accessibilityLayer:j,S=()=>{if(c&&c.length){var B={padding:0,margin:0},$=M8(c,h),z=$.map((Q,U)=>{if(!Q||Q.type==="none")return null;var ve=Q.formatter||f||_8,ue=Q.value,pe=Q.name,oe=ue,se=pe;if(ve){var X=ve(ue,pe,Q,U,c);if(Array.isArray(X)){var ne=E8(X,2);oe=ne[0],se=ne[1]}else if(X!=null)oe=X;else return null}var te=Xl(Xl({},rs.itemStyle),{},{color:Q.color||rs.itemStyle.color},i);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:te},Bn(se)?y.createElement("span",{className:"recharts-tooltip-item-name"},se):null,Bn(se)?y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,y.createElement("span",{className:"recharts-tooltip-item-value"},oe),y.createElement("span",{className:"recharts-tooltip-item-unit"},Q.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:B},z)}return null},N=Xl(Xl({},rs.contentStyle),n),E=Xl({margin:0},u),A=!Qt(v),P=A?v:"",_=rt("recharts-default-tooltip",m),O=rt("recharts-tooltip-label",g);A&&b&&c!==void 0&&c!==null&&(P=b(v,c));var T=k?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",Qv({className:_,style:N},T),y.createElement("p",{className:O,style:E},y.isValidElement(P)?P:"".concat(P)),S())},Zl="recharts-tooltip-wrapper",T8={visibility:"hidden"};function D8(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return rt(Zl,{["".concat(Zl,"-right")]:Ae(r)&&t&&Ae(t.x)&&r>=t.x,["".concat(Zl,"-left")]:Ae(r)&&t&&Ae(t.x)&&r=t.y,["".concat(Zl,"-top")]:Ae(n)&&t&&Ae(t.y)&&n0?i:0),g=r[n]+i;if(t[n])return u[n]?m:g;var v=f[n];if(v==null)return 0;if(u[n]){var b=m,j=v;return bS?Math.max(m,v):Math.max(g,v)}function R8(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function L8(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,o=e.position,u=e.reverseDirection,c=e.tooltipBox,f=e.useTranslate3d,h=e.viewBox,m,g,v;return c.height>0&&c.width>0&&r?(g=lj({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:o,reverseDirection:u,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),v=lj({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:o,reverseDirection:u,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),m=R8({translateX:g,translateY:v,useTranslate3d:f})):m=T8,{cssProperties:m,cssClasses:D8({translateX:g,translateY:v,coordinate:r})}}var $8=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ju={isSsr:$8()};function z8(e,t){return H8(e)||U8(e,t)||B8(e,t)||F8()}function F8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B8(e,t){if(e){if(typeof e=="string")return uj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uj(e,t):void 0}}function uj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rJu.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=z8(e,2),r=t[0],n=t[1];return y.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{n(i.matches)};return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}}},[]),r}function cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ns(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),h=V8(f,2),m=h[0],g=h[1];y.useEffect(()=>{var N=E=>{if(E.key==="Escape"){var A,P,_,O;g({dismissed:!0,dismissedAtCoordinate:{x:(A=(P=e.coordinate)===null||P===void 0?void 0:P.x)!==null&&A!==void 0?A:0,y:(_=(O=e.coordinate)===null||O===void 0?void 0:O.y)!==null&&_!==void 0?_:0}})}};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),m.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==m.dismissedAtCoordinate.x||((o=(u=e.coordinate)===null||u===void 0?void 0:u.y)!==null&&o!==void 0?o:0)!==m.dismissedAtCoordinate.y)&&g(ns(ns({},m),{},{dismissed:!1}));var v=L8({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}),b=v.cssClasses,j=v.cssProperties,k=e.hasPortalFromProps?{}:ns(ns({transition:Z8({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},j),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),S=ns(ns({},k),{},{visibility:!m.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:b,style:S,ref:e.innerRef},e.children)}var eF=y.memo(J8),MA=()=>{var e;return(e=Me(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;tWe(e.x)&&We(e.y),pj=e=>e.base!=null&&Of(e.base)&&Of(e),Jl=e=>e.x,eu=e=>e.y,iF=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(z0(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=mj["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return mj[r]||yh},gj={connectNulls:!1,type:"linear"},aF=e=>{var t=e.type,r=t===void 0?gj.type:t,n=e.points,i=n===void 0?[]:n,o=e.baseLine,u=e.layout,c=e.connectNulls,f=c===void 0?gj.connectNulls:c,h=iF(r,u),m=f?i.filter(Of):i;if(Array.isArray(o)){var g,v=i.map((N,E)=>hj(hj({},N),{},{base:o[E]}));u==="vertical"?g=Pd().y(eu).x1(Jl).x0(N=>N.base.x):g=Pd().x(Jl).y1(eu).y0(N=>N.base.y);var b=g.defined(pj).curve(h),j=f?v.filter(pj):v;return b(j)}var k;u==="vertical"&&Ae(o)?k=Pd().y(eu).x1(Jl).x0(o):Ae(o)?k=Pd().x(Jl).y1(eu).y0(o):k=sE().x(Jl).y(eu);var S=k.defined(Of).curve(h);return S(m)},Xd=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,o=Xs();if((!r||!r.length)&&!n)return null;var u={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},c=r&&r.length?aF(u):n;return y.createElement("path",Yv({},xn(e),F0(e),{className:rt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},oF=["x","y","top","left","width","height","className"];function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r),mF=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,o=e.top,u=o===void 0?0:o,c=e.left,f=c===void 0?0:c,h=e.width,m=h===void 0?0:h,g=e.height,v=g===void 0?0:g,b=e.className,j=dF(e,oF),k=sF({x:r,y:i,top:u,left:f,width:m,height:v},j);return!Ae(r)||!Ae(i)||!Ae(m)||!Ae(v)||!Ae(u)||!Ae(f)?null:y.createElement("path",Xv({},en(k),{className:rt("recharts-cross",b),d:hF(r,i,m,v,u,f)}))};function pF(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var _f=1e-4,IA=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],TA=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),yj=(e,t)=>r=>{var n=IA(e,t);return TA(n,r)},gF=(e,t)=>r=>{var n=IA(e,t),i=[...n.map((o,u)=>o*u).slice(1),0];return TA(i,r)},vF=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(o=>parseFloat(o));return[i[0],i[1],i[2],i[3]]},yF=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=yj(e,r),o=yj(t,n),u=gF(e,r),c=h=>h>1?1:h<0?0:h,f=h=>{for(var m=h>1?1:h,g=m,v=0;v<8;++v){var b=i(g)-m,j=u(g);if(Math.abs(b-m)<_f||j<_f)return o(g);g=c(g-b/j)}return o(g)};return f.isStepper=!1,f},xj=function(){return xF(...yF(...arguments))},bF=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,u=t.dt,c=u===void 0?16.67:u,f=1,h=[0],m=0,g=0,v=1e4,b=0;b{var E,A,P;if(N<=0)return 0;if(N>=1)return f;var _=N*S,O=Math.floor(_),T=_-O;return((E=h[O])!==null&&E!==void 0?E:0)+(((A=h[O+1])!==null&&A!==void 0?A:0)-((P=h[O])!==null&&P!==void 0?P:0))*T}},wF=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return xj(e);case"spring":return bF();default:if(e.split("(")[0]==="cubic-bezier")return xj(e)}return typeof e=="function"?e:null},kF=(e,t,r)=>{var n,i=o=>{var u=t.tick(o);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,u);return}n=e.setTimeout(i,u)};return n=e.setTimeout(i,0),()=>{var o;return(o=n)===null||o===void 0?void 0:o()}},DA=y.createContext(kF);DA.Provider;function jF(e){var t=y.useContext(DA);return y.useMemo(()=>e??t,[e,t])}function SF(e,t,r){return(t=NF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NF(e){var t=EF(e,"string");return typeof t=="symbol"?t:t+""}function EF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bj="init",wj="pending",kj="active",AF="completed";function Ag(e){return Math.max(0,e)}class CF{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;SF(this,"state",bj),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=Ag(t.animationDuration),this.animationBegin=Ag(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===bj)return this.state=wj,this.beginStartedTime=t,this.animationBegin;if(this.getState()===wj){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=kj,this.animationStartedTime=t,this.nextAnimationUpdate(0)):Ag(this.animationBegin-r)}if(this.getState()===kj){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=AF}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class PF extends CF{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ui(this.getFrom(),this.getTo(),this.getProgress()))}}class OF{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,o=u=>{u-n>=r?t(u):i=requestAnimationFrame(o)};return i=requestAnimationFrame(o),()=>{i!=null&&cancelAnimationFrame(i)}}}function _F(e,t){return DF(e)||TF(e,t)||IF(e,t)||MF()}function MF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IF(e,t){if(e){if(typeof e=="string")return jj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jj(e,t):void 0}}function jj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},Sj=0,Cg=1;function RA(e){var t=nn(e,RF),r=t.animationId,n=t.isActive,i=t.canBegin,o=t.duration,u=t.easing,c=t.begin,f=t.onAnimationEnd,h=t.onAnimationStart,m=t.children,g=_A(),v=n==="auto"?!Ju.isSsr&&!g:n,b=jF(t.animationController),j=y.useState(v?Sj:Cg),k=_F(j,2),S=k[0],N=k[1];return y.useEffect(()=>{v||N(Cg)},[v]),y.useEffect(()=>{var E=wF(u);if(!v||!i||E==null)return Ys;var A=new OF,P=new PF({animationId:r,easing:E,animationDuration:o,animationBegin:c,onAnimationStart:h,onAnimationEnd:f,from:Sj,to:Cg});return b(A,P,N)},[b,r,v,i,o,u,c,h,f]),m(Number(S))}function LA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=y.useRef(ku(t)),n=y.useRef(e);return n.current!==e&&(r.current=ku(t),n.current=e),r.current}var LF=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),$F=(e,t,r)=>e.map(n=>"".concat(LF(n)," ").concat(t,"ms ").concat(r)).join(","),zF=["radius"],FF=["radius"],Nj,Ej,Aj,Cj,Pj,Oj,_j,Mj,Ij,Tj;function Dj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Rj(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var o=ca(r),u=ca(n),c=Math.min(Math.abs(o)/2,Math.abs(u)/2),f=u>=0?1:-1,h=o>=0?1:-1,m=u>=0&&o>=0||u<0&&o<0?1:0,g;if(c>0&&Array.isArray(i)){for(var v=[0,0,0,0],b=0,j=4;bc?c:S}g=Wt(Nj||(Nj=Pn(["M",",",""])),e,t+f*v[0]),v[0]>0&&(g+=Wt(Ej||(Ej=Pn(["A ",",",",0,0,",",",",",""])),v[0],v[0],m,e+h*v[0],t)),g+=Wt(Aj||(Aj=Pn(["L ",",",""])),e+r-h*v[1],t),v[1]>0&&(g+=Wt(Cj||(Cj=Pn(["A ",",",",0,0,",`, `,",",""])),v[1],v[1],m,e+r,t+f*v[1])),g+=Wt(Pj||(Pj=Pn(["L ",",",""])),e+r,t+n-f*v[2]),v[2]>0&&(g+=Wt(Oj||(Oj=Pn(["A ",",",",0,0,",`, `,",",""])),v[2],v[2],m,e+r-h*v[2],t+n)),g+=Wt(_j||(_j=Pn(["L ",",",""])),e+h*v[3],t+n),v[3]>0&&(g+=Wt(Mj||(Mj=Pn(["A ",",",",0,0,",`, `,",",""])),v[3],v[3],m,e,t+n-f*v[3])),g+="Z"}else if(c>0&&i===+i&&i>0){var N=Math.min(c,i);g=Wt(Ij||(Ij=Pn(["M ",",",` @@ -622,39 +627,39 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `,",",` A `,",",",0,0,",",",",",` L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+f*N,N,N,m,e+h*N,t,e+r-h*N,t,N,N,m,e+r,t+f*N,e+r,t+n-f*N,N,N,m,e+r-h*N,t+n,e+h*N,t+n,N,N,m,e,t+n-f*N)}else g=Wt(Tj||(Tj=Pn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return g},Fj={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},QF=e=>{var t=rn(e,Fj),r=y.useRef(null),n=y.useState(-1),i=WF(n,2),o=i[0],u=i[1];y.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var X=r.current.getTotalLength();X&&u(X)}catch{}},[]);var c=t.x,f=t.y,h=t.width,m=t.height,g=t.radius,v=t.className,b=t.animationEasing,j=t.animationDuration,k=t.animationBegin,S=t.isAnimationActive,N=t.isUpdateAnimationActive,E=y.useRef(h),A=y.useRef(m),P=y.useRef(c),_=y.useRef(f),O=y.useMemo(()=>({x:c,y:f,width:h,height:m,radius:g}),[c,f,h,m,g]),T=LA(O,"rectangle-");if(c!==+c||f!==+f||h!==+h||m!==+m||h===0||m===0)return null;var B=rt("recharts-rectangle",v);if(!N){var $=Jr(t);$.radius;var z=Lj($,$F);return y.createElement("path",Mf({},z,{x:ca(c),y:ca(f),width:ca(h),height:ca(m),radius:typeof g=="number"?g:void 0,className:B,d:zj(c,f,h,m,g)}))}var Q=E.current,U=A.current,ve=P.current,ue=_.current,pe="0px ".concat(o===-1?1:o,"px"),oe="".concat(o,"px ").concat(o,"px"),se=LF(["strokeDasharray"],j,typeof b=="string"?b:Fj.animationEasing);return y.createElement(RA,{animationId:T,key:T,canBegin:o>0,duration:j,easing:b,isActive:N,begin:k},X=>{var ne=ui(Q,h,X),te=ui(U,m,X),I=ui(ve,c,X),M=ui(ue,f,X);r.current&&(E.current=ne,A.current=te,P.current=I,_.current=M);var H;S?X>0?H={transition:se,strokeDasharray:oe}:H={strokeDasharray:pe}:H={strokeDasharray:oe};var ie=Jr(t);ie.radius;var J=Lj(ie,zF);return y.createElement("path",Mf({},J,{radius:typeof g=="number"?g:void 0,className:B,d:zj(I,M,ne,te,g),ref:r,style:Rj(Rj({},H),t.style)}))})};function Bj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Uj(e){for(var t=1;te*180/Math.PI,Vt=(e,t,r,n)=>({x:e+Math.cos(-If*n)*r,y:t+Math.sin(-If*n)*r}),eB=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},tB=(e,t)=>{var r=e.x,n=e.y,i=t.x,o=t.y;return Math.sqrt((r-i)**2+(n-o)**2)},rB=(e,t)=>{var r=e.x,n=e.y,i=t.cx,o=t.cy,u=tB({x:r,y:n},{x:i,y:o});if(u<=0)return{radius:u,angle:0};var c=(r-i)/u,f=Math.acos(c);return n>o&&(f=2*Math.PI-f),{radius:u,angle:JF(f),angleInRadian:f}},nB=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-o*360,endAngle:r-o*360}},iB=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),u=Math.min(i,o);return e+u*360},aB=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=rB({x:r,y:n},t),o=i.radius,u=i.angle,c=t.innerRadius,f=t.outerRadius;if(of||o===0)return null;var h=nB(t),m=h.startAngle,g=h.endAngle,v=u,b;if(m<=g){for(;v>g;)v-=360;for(;v=m&&v<=g}else{for(;v>m;)v-=360;for(;v=g&&v<=m}return b?Uj(Uj({},t),{},{radius:o,angle:iB(v,t)}):null};function $A(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle,u=Vt(t,r,n,i),c=Vt(t,r,n,o);return{points:[u,c],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}var Hj,Wj,Kj,Gj,Vj,qj,Qj;function Zv(){return Zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=Yr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},$d=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,u=e.isExternal,c=e.cornerRadius,f=e.cornerIsExternal,h=c*(u?1:-1)+n,m=Math.asin(c/h)/If,g=f?i:i+o*m,v=Vt(t,r,h,g),b=Vt(t,r,n,g),j=f?i-o*m:i,k=Vt(t,r,h*Math.cos(m*If),j);return{center:v,circleTangency:b,lineTangency:k,theta:m}},zA=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,u=e.endAngle,c=oB(o,u),f=o+c,h=Vt(t,r,i,o),m=Vt(t,r,i,f),g=Wt(Hj||(Hj=qa(["M ",",",` + A `,",",",0,0,",",",","," Z"])),e,t+f*N,N,N,m,e+h*N,t,e+r-h*N,t,N,N,m,e+r,t+f*N,e+r,t+n-f*N,N,N,m,e+r-h*N,t+n,e+h*N,t+n,N,N,m,e,t+n-f*N)}else g=Wt(Tj||(Tj=Pn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return g},Fj={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},YF=e=>{var t=nn(e,Fj),r=y.useRef(null),n=y.useState(-1),i=KF(n,2),o=i[0],u=i[1];y.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var X=r.current.getTotalLength();X&&u(X)}catch{}},[]);var c=t.x,f=t.y,h=t.width,m=t.height,g=t.radius,v=t.className,b=t.animationEasing,j=t.animationDuration,k=t.animationBegin,S=t.isAnimationActive,N=t.isUpdateAnimationActive,E=y.useRef(h),A=y.useRef(m),P=y.useRef(c),_=y.useRef(f),O=y.useMemo(()=>({x:c,y:f,width:h,height:m,radius:g}),[c,f,h,m,g]),T=LA(O,"rectangle-");if(c!==+c||f!==+f||h!==+h||m!==+m||h===0||m===0)return null;var B=rt("recharts-rectangle",v);if(!N){var $=en(t);$.radius;var z=Lj($,zF);return y.createElement("path",Mf({},z,{x:ca(c),y:ca(f),width:ca(h),height:ca(m),radius:typeof g=="number"?g:void 0,className:B,d:zj(c,f,h,m,g)}))}var Q=E.current,U=A.current,ve=P.current,ue=_.current,pe="0px ".concat(o===-1?1:o,"px"),oe="".concat(o,"px ").concat(o,"px"),se=$F(["strokeDasharray"],j,typeof b=="string"?b:Fj.animationEasing);return y.createElement(RA,{animationId:T,key:T,canBegin:o>0,duration:j,easing:b,isActive:N,begin:k},X=>{var ne=ui(Q,h,X),te=ui(U,m,X),I=ui(ve,c,X),M=ui(ue,f,X);r.current&&(E.current=ne,A.current=te,P.current=I,_.current=M);var H;S?X>0?H={transition:se,strokeDasharray:oe}:H={strokeDasharray:pe}:H={strokeDasharray:oe};var ie=en(t);ie.radius;var J=Lj(ie,FF);return y.createElement("path",Mf({},J,{radius:typeof g=="number"?g:void 0,className:B,d:zj(I,M,ne,te,g),ref:r,style:Rj(Rj({},H),t.style)}))})};function Bj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Uj(e){for(var t=1;te*180/Math.PI,Vt=(e,t,r,n)=>({x:e+Math.cos(-If*n)*r,y:t+Math.sin(-If*n)*r}),tB=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},rB=(e,t)=>{var r=e.x,n=e.y,i=t.x,o=t.y;return Math.sqrt((r-i)**2+(n-o)**2)},nB=(e,t)=>{var r=e.x,n=e.y,i=t.cx,o=t.cy,u=rB({x:r,y:n},{x:i,y:o});if(u<=0)return{radius:u,angle:0};var c=(r-i)/u,f=Math.acos(c);return n>o&&(f=2*Math.PI-f),{radius:u,angle:eB(f),angleInRadian:f}},iB=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-o*360,endAngle:r-o*360}},aB=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),u=Math.min(i,o);return e+u*360},oB=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=nB({x:r,y:n},t),o=i.radius,u=i.angle,c=t.innerRadius,f=t.outerRadius;if(of||o===0)return null;var h=iB(t),m=h.startAngle,g=h.endAngle,v=u,b;if(m<=g){for(;v>g;)v-=360;for(;v=m&&v<=g}else{for(;v>m;)v-=360;for(;v=g&&v<=m}return b?Uj(Uj({},t),{},{radius:o,angle:aB(v,t)}):null};function $A(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle,u=Vt(t,r,n,i),c=Vt(t,r,n,o);return{points:[u,c],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}var Hj,Wj,Kj,Gj,Vj,qj,Qj;function Zv(){return Zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=Yr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Ld=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,u=e.isExternal,c=e.cornerRadius,f=e.cornerIsExternal,h=c*(u?1:-1)+n,m=Math.asin(c/h)/If,g=f?i:i+o*m,v=Vt(t,r,h,g),b=Vt(t,r,n,g),j=f?i-o*m:i,k=Vt(t,r,h*Math.cos(m*If),j);return{center:v,circleTangency:b,lineTangency:k,theta:m}},zA=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,u=e.endAngle,c=sB(o,u),f=o+c,h=Vt(t,r,i,o),m=Vt(t,r,i,f),g=Wt(Hj||(Hj=qa(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),h.x,h.y,i,i,+(Math.abs(c)>180),+(o>f),m.x,m.y);if(n>0){var v=Vt(t,r,n,o),b=Vt(t,r,n,f);g+=Wt(Wj||(Wj=qa(["L ",",",` A `,",",`,0, `,",",`, - `,","," Z"])),b.x,b.y,n,n,+(Math.abs(c)>180),+(o<=f),v.x,v.y)}else g+=Wt(Kj||(Kj=qa(["L ",","," Z"])),t,r);return g},sB=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,u=e.forceCornerRadius,c=e.cornerIsExternal,f=e.startAngle,h=e.endAngle,m=Yr(h-f),g=$d({cx:t,cy:r,radius:i,angle:f,sign:m,cornerRadius:o,cornerIsExternal:c}),v=g.circleTangency,b=g.lineTangency,j=g.theta,k=$d({cx:t,cy:r,radius:i,angle:h,sign:-m,cornerRadius:o,cornerIsExternal:c}),S=k.circleTangency,N=k.lineTangency,E=k.theta,A=c?Math.abs(f-h):Math.abs(f-h)-j-E;if(A<0)return u?Wt(Gj||(Gj=qa(["M ",",",` + `,","," Z"])),b.x,b.y,n,n,+(Math.abs(c)>180),+(o<=f),v.x,v.y)}else g+=Wt(Kj||(Kj=qa(["L ",","," Z"])),t,r);return g},lB=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,u=e.forceCornerRadius,c=e.cornerIsExternal,f=e.startAngle,h=e.endAngle,m=Yr(h-f),g=Ld({cx:t,cy:r,radius:i,angle:f,sign:m,cornerRadius:o,cornerIsExternal:c}),v=g.circleTangency,b=g.lineTangency,j=g.theta,k=Ld({cx:t,cy:r,radius:i,angle:h,sign:-m,cornerRadius:o,cornerIsExternal:c}),S=k.circleTangency,N=k.lineTangency,E=k.theta,A=c?Math.abs(f-h):Math.abs(f-h)-j-E;if(A<0)return u?Wt(Gj||(Gj=qa(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),b.x,b.y,o,o,o*2,o,o,-o*2):zA({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:f,endAngle:h});var P=Wt(Vj||(Vj=qa(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` - `])),b.x,b.y,o,o,+(m<0),v.x,v.y,i,i,+(A>180),+(m<0),S.x,S.y,o,o,+(m<0),N.x,N.y);if(n>0){var _=$d({cx:t,cy:r,radius:n,angle:f,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=_.circleTangency,T=_.lineTangency,B=_.theta,$=$d({cx:t,cy:r,radius:n,angle:h,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),z=$.circleTangency,Q=$.lineTangency,U=$.theta,ve=c?Math.abs(f-h):Math.abs(f-h)-B-U;if(ve<0&&o===0)return"".concat(P,"L").concat(t,",").concat(r,"Z");P+=Wt(qj||(qj=qa(["L",",",` + `])),b.x,b.y,o,o,+(m<0),v.x,v.y,i,i,+(A>180),+(m<0),S.x,S.y,o,o,+(m<0),N.x,N.y);if(n>0){var _=Ld({cx:t,cy:r,radius:n,angle:f,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=_.circleTangency,T=_.lineTangency,B=_.theta,$=Ld({cx:t,cy:r,radius:n,angle:h,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),z=$.circleTangency,Q=$.lineTangency,U=$.theta,ve=c?Math.abs(f-h):Math.abs(f-h)-B-U;if(ve<0&&o===0)return"".concat(P,"L").concat(t,",").concat(r,"Z");P+=Wt(qj||(qj=qa(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),Q.x,Q.y,o,o,+(m<0),z.x,z.y,n,n,+(ve>180),+(m>0),O.x,O.y,o,o,+(m<0),T.x,T.y)}else P+=Wt(Qj||(Qj=qa(["L",",","Z"])),t,r);return P},lB={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},uB=e=>{var t=rn(e,lB),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,u=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,m=t.endAngle,g=t.className;if(o0&&Math.abs(h-m)<360?k=sB({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(j,b/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:m}):k=zA({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:h,endAngle:m}),y.createElement("path",Zv({},Jr(t),{className:v,d:k}))};function cB(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(bE(t)){if(e==="centric"){var n=t.cx,i=t.cy,o=t.innerRadius,u=t.outerRadius,c=t.angle,f=Vt(n,i,o,c),h=Vt(n,i,u,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return $A(t)}}function dB(e){return TE(e)?NaN:Number(e)}function Pg(e){return e?(e=dB(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function FA(e,t,r){r&&typeof r!="number"&&Mv(e,t,r)&&(t=r=void 0),e=Pg(e),t===void 0?(t=e,e=0):t=Pg(t),r=r===void 0?ee.chartData,ey=q([kn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Fh=(e,t,r,n)=>n?ey(e):kn(e),fB=(e,t,r)=>r?ey(e):kn(e),hB=q([Fh],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});q([ey],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var mB=q([kn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function ty(e,t){return yB(e)||vB(e,t)||gB(e,t)||pB()}function pB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gB(e,t){if(e){if(typeof e=="string")return Yj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yj(e,t):void 0}}function Yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return hi(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return et(hi(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return St(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Rr))throw Error(tn+"NaN");if(r.s<1)throw Error(tn+(r.s?"NaN":"-Infinity"));return r.eq(Rr)?new n(0):(dt=!1,t=hi(Ou(r,o),Ou(e,o),o),dt=!0,et(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KA(t,e):HA(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(tn+"NaN");return r.s?(dt=!1,t=hi(r,e,0,1).times(e),dt=!0,r.minus(t)):et(new n(r),i)};je.naturalExponential=je.exp=function(){return WA(this)};je.naturalLogarithm=je.ln=function(){return Ou(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?HA(t,e):KA(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(uo+e);if(t=St(i)+1,n=i.d.length-1,r=n*lt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,o,u,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(tn+"NaN")}for(e=St(c),dt=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ln(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=el((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=u=r+3;;)if(o=n,n=o.plus(hi(c,o,u+2)).times(.5),Ln(o.d).slice(0,u)===(t=Ln(n.d)).slice(0,u)){if(t=t.slice(u-3,u+1),i==u&&t=="4999"){if(et(o,r+1,0),o.times(o).eq(c)){n=o;break}}else if(t!="9999")break;u+=4}return dt=!0,et(n,r)};je.times=je.mul=function(e){var t,r,n,i,o,u,c,f,h,m=this,g=m.constructor,v=m.d,b=(e=new g(e)).d;if(!m.s||!e.s)return new g(0);for(e.s*=m.s,r=m.e+e.e,f=v.length,h=b.length,f=0;){for(t=0,i=f+n;i>n;)c=o[i]+b[n]*v[i-n-1]+t,o[i--]=c%Rt|0,t=c/Rt|0;o[i]=(o[i]+t)%Rt|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,dt?et(e,g.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Hn(e,0,Js),t===void 0?t=n.rounding:Hn(t,0,8),et(r,e+St(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=yo(n,!0):(Hn(e,0,Js),t===void 0?t=i.rounding:Hn(t,0,8),n=et(new i(n),e+1,t),r=yo(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?yo(i):(Hn(e,0,Js),t===void 0?t=o.rounding:Hn(t,0,8),n=et(new o(i),e+St(i)+1,t),r=yo(n.abs(),!1,e+St(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return et(new t(e),St(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,o,u,c=this,f=c.constructor,h=12,m=+(e=new f(e));if(!e.s)return new f(Rr);if(c=new f(c),!c.s){if(e.s<1)throw Error(tn+"Infinity");return c}if(c.eq(Rr))return c;if(n=f.precision,e.eq(Rr))return et(c,n);if(t=e.e,r=e.d.length-1,u=t>=r,o=c.s,u){if((r=m<0?-m:m)<=UA){for(i=new f(Rr),t=Math.ceil(n/lt+4),dt=!1;r%2&&(i=i.times(c),Jj(i.d,t)),r=el(r/2),r!==0;)c=c.times(c),Jj(c.d,t);return dt=!0,e.s<0?new f(Rr).div(i):et(i,n)}}else if(o<0)throw Error(tn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,c.s=1,dt=!1,i=e.times(Ou(c,n+h)),dt=!0,i=WA(i),i.s=o,i};je.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=St(i),n=yo(i,r<=o.toExpNeg||r>=o.toExpPos)):(Hn(e,1,Js),t===void 0?t=o.rounding:Hn(t,0,8),i=et(new o(i),e,t),r=St(i),n=yo(i,e<=r||r<=o.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Hn(e,1,Js),t===void 0?t=n.rounding:Hn(t,0,8)),et(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=St(e),r=e.constructor;return yo(e,t<=r.toExpNeg||t>=r.toExpPos)};function HA(e,t){var r,n,i,o,u,c,f,h,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),dt?et(t,g):t;if(f=e.d,h=t.d,u=e.e,i=t.e,f=f.slice(),o=u-i,o){for(o<0?(n=f,o=-o,c=h.length):(n=h,i=u,c=f.length),u=Math.ceil(g/lt),c=u>c?u+1:c+1,o>c&&(o=c,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(c=f.length,o=h.length,c-o<0&&(o=c,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/Rt|0,f[o]%=Rt;for(r&&(f.unshift(r),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,dt?et(t,g):t}function Hn(e,t,r){if(e!==~~e||er)throw Error(uo+e)}function Ln(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;tu?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function r(n,i,o){for(var u=0;o--;)n[o]-=u,u=n[o]1;)n.shift()}return function(n,i,o,u){var c,f,h,m,g,v,b,j,k,S,N,E,A,P,_,O,T,B,$=n.constructor,z=n.s==i.s?1:-1,Q=n.d,U=i.d;if(!n.s)return new $(n);if(!i.s)throw Error(tn+"Division by zero");for(f=n.e-i.e,T=U.length,_=Q.length,b=new $(z),j=b.d=[],h=0;U[h]==(Q[h]||0);)++h;if(U[h]>(Q[h]||0)&&--f,o==null?E=o=$.precision:u?E=o+(St(n)-St(i))+1:E=o,E<0)return new $(0);if(E=E/lt+2|0,h=0,T==1)for(m=0,U=U[0],E++;(h<_||m)&&E--;h++)A=m*Rt+(Q[h]||0),j[h]=A/U|0,m=A%U|0;else{for(m=Rt/(U[0]+1)|0,m>1&&(U=e(U,m),Q=e(Q,m),T=U.length,_=Q.length),P=T,k=Q.slice(0,T),S=k.length;S=Rt/2&&++O;do m=0,c=t(U,k,T,S),c<0?(N=k[0],T!=S&&(N=N*Rt+(k[1]||0)),m=N/O|0,m>1?(m>=Rt&&(m=Rt-1),g=e(U,m),v=g.length,S=k.length,c=t(g,k,v,S),c==1&&(m--,r(g,T16)throw Error(ry+St(e));if(!e.s)return new m(Rr);for(dt=!1,c=g,u=new m(.03125);e.abs().gte(.1);)e=e.times(u),h+=5;for(n=Math.log(Ka(2,h))/Math.LN10*2+5|0,c+=n,r=i=o=new m(Rr),m.precision=c;;){if(i=et(i.times(e),c),r=r.times(++f),u=o.plus(hi(i,r,c)),Ln(u.d).slice(0,c)===Ln(o.d).slice(0,c)){for(;h--;)o=et(o.times(o),c);return m.precision=g,t==null?(dt=!0,et(o,g)):o}o=u}}function St(e){for(var t=e.e*lt,r=e.d[0];r>=10;r/=10)t++;return t}function Og(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(tn+"LN10 precision limit exceeded");return et(new e(e.LN10),t)}function Ji(e){for(var t="";e--;)t+="0";return t}function Ou(e,t){var r,n,i,o,u,c,f,h,m,g=1,v=10,b=e,j=b.d,k=b.constructor,S=k.precision;if(b.s<1)throw Error(tn+(b.s?"NaN":"-Infinity"));if(b.eq(Rr))return new k(0);if(t==null?(dt=!1,h=S):h=t,b.eq(10))return t==null&&(dt=!0),Og(k,h);if(h+=v,k.precision=h,r=Ln(j),n=r.charAt(0),o=St(b),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Ln(b.d),n=r.charAt(0),g++;o=St(b),n>1?(b=new k("0."+r),o++):b=new k(n+"."+r.slice(1))}else return f=Og(k,h+2,S).times(o+""),b=Ou(new k(n+"."+r.slice(1)),h-v).plus(f),k.precision=S,t==null?(dt=!0,et(b,S)):b;for(c=u=b=hi(b.minus(Rr),b.plus(Rr),h),m=et(b.times(b),h),i=3;;){if(u=et(u.times(m),h),f=c.plus(hi(u,new k(i),h)),Ln(f.d).slice(0,h)===Ln(c.d).slice(0,h))return c=c.times(2),o!==0&&(c=c.plus(Og(k,h+2,S).times(o+""))),c=hi(c,new k(g),h),k.precision=S,t==null?(dt=!0,et(c,S)):c;c=f,i+=2}}function Zj(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=el(r/lt),e.d=[],n=(r+1)%lt,r<0&&(n+=lt),nTf||e.e<-Tf))throw Error(ry+r)}else e.s=0,e.e=0,e.d=[0];return e}function et(e,t,r){var n,i,o,u,c,f,h,m,g=e.d;for(u=1,o=g[0];o>=10;o/=10)u++;if(n=t-u,n<0)n+=lt,i=t,h=g[m=0];else{if(m=Math.ceil((n+1)/lt),o=g.length,m>=o)return e;for(h=o=g[m],u=1;o>=10;o/=10)u++;n%=lt,i=n-lt+u}if(r!==void 0&&(o=Ka(10,u-i-1),c=h/o%10|0,f=t<0||g[m+1]!==void 0||h%o,f=r<4?(c||f)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||f||r==6&&(n>0?i>0?h/Ka(10,u-i):0:g[m-1])%10&1||r==(e.s<0?8:7))),t<1||!g[0])return f?(o=St(e),g.length=1,t=t-o-1,g[0]=Ka(10,(lt-t%lt)%lt),e.e=el(-t/lt)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(n==0?(g.length=m,o=1,m--):(g.length=m+1,o=Ka(10,lt-n),g[m]=i>0?(h/Ka(10,u-i)%Ka(10,i)|0)*o:0),f)for(;;)if(m==0){(g[0]+=o)==Rt&&(g[0]=1,++e.e);break}else{if(g[m]+=o,g[m]!=Rt)break;g[m--]=0,o=1}for(n=g.length;g[--n]===0;)g.pop();if(dt&&(e.e>Tf||e.e<-Tf))throw Error(ry+St(e));return e}function KA(e,t){var r,n,i,o,u,c,f,h,m,g,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),dt?et(t,b):t;if(f=e.d,g=t.d,n=t.e,h=e.e,f=f.slice(),u=h-n,u){for(m=u<0,m?(r=f,u=-u,c=g.length):(r=g,n=h,c=f.length),i=Math.max(Math.ceil(b/lt),c)+2,u>i&&(u=i,r.length=1),r.reverse(),i=u;i--;)r.push(0);r.reverse()}else{for(i=f.length,c=g.length,m=i0;--i)f[c++]=0;for(i=g.length;i>u;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+Ji(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Ji(-i-1)+o,r&&(n=r-u)>0&&(o+=Ji(n))):i>=u?(o+=Ji(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Ji(n))):((n=i+1)0&&(i+1===u&&(o+="."),o+=Ji(n))),e.s<0?"-"+o:o}function Jj(e,t){if(e.length>t)return e.length=t,!0}function GA(e){var t,r,n;function i(o){var u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,o instanceof i){u.s=o.s,u.e=o.e,u.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(uo+o);if(o>0)u.s=1;else if(o<0)o=-o,u.s=-1;else{u.s=0,u.e=0,u.d=[0];return}if(o===~~o&&o<1e7){u.e=0,u.d=[o];return}return Zj(u,o.toString())}else if(typeof o!="string")throw Error(uo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),u.s=-1):u.s=1,wB.test(o))Zj(u,o);else throw Error(uo+o)}if(i.prototype=je,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=GA,i.config=i.set=kB,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(uo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(uo+r+": "+n);return this}var ny=GA(bB);Rr=new ny(1);const Ge=ny;function VA(e){var t;return e===0?t=1:t=Math.floor(new Ge(e).abs().log(10).toNumber())+1,t}function qA(e,t,r){for(var n=new Ge(e),i=0,o=[];n.lt(t)&&i<1e5;)o.push(n.toNumber()),n=n.add(r),i++;return o}function _u(e,t){return EB(e)||NB(e,t)||SB(e,t)||jB()}function jB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SB(e,t){if(e){if(typeof e=="string")return e2(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e2(e,t):void 0}}function e2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=_u(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]},iy=(e,t,r)=>{if(e.lte(0))return new Ge(0);var n=VA(e.toNumber()),i=new Ge(10).pow(n),o=e.div(i),u=n!==1?.05:.1,c=new Ge(Math.ceil(o.div(u).toNumber())).add(r).mul(u),f=c.mul(i);return t?new Ge(f.toNumber()):new Ge(Math.ceil(f.toNumber()))},YA=(e,t,r)=>{var n;if(e.lte(0))return new Ge(0);var i=[1,2,2.5,5],o=e.toNumber(),u=Math.floor(new Ge(o).abs().log(10).toNumber()),c=new Ge(10).pow(u),f=e.div(c).toNumber(),h=i.findIndex(b=>b>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=r,h>=i.length){var m=Math.floor(h/i.length);h%=i.length,c=c.mul(new Ge(10).pow(m))}var g=(n=i[h])!==null&&n!==void 0?n:1,v=new Ge(g).mul(c);return t?v:new Ge(Math.ceil(v.toNumber()))},AB=(e,t,r)=>{var n=new Ge(1),i=new Ge(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new Ge(10).pow(VA(e)-1),i=new Ge(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new Ge(Math.floor(e)))}else e===0?i=new Ge(Math.floor((t-1)/2)):r||(i=new Ge(Math.floor(e)));for(var u=Math.floor((t-1)/2),c=[],f=0;f4&&arguments[4]!==void 0?arguments[4]:0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:iy;if(!Number.isFinite((r-t)/(n-1)))return{step:new Ge(0),tickMin:new Ge(0),tickMax:new Ge(0)};var c=u(new Ge(r).sub(t).div(n-1),i,o),f;t<=0&&r>=0?f=new Ge(0):(f=new Ge(t).add(r).div(2),f=f.sub(new Ge(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),m=Math.ceil(new Ge(r).sub(f).div(c).toNumber()),g=h+m+1;return g>n?XA(t,r,n,i,o+1,u):(g0?m+(n-g):m,h=r>0?h:h+(n-g)),{step:c,tickMin:f.sub(new Ge(h).mul(c)),tickMax:f.add(new Ge(m).mul(c))})},t2=function(t){var r=_u(t,2),n=r[0],i=r[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=Math.max(o,2),h=QA([n,i]),m=_u(h,2),g=m[0],v=m[1];if(g===-1/0||v===1/0){var b=v===1/0?[g,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),v];return n>i?b.reverse():b}if(g===v)return AB(g,o,u);var j=c==="snap125"?YA:iy,k=XA(g,v,f,u,0,j),S=k.step,N=k.tickMin,E=k.tickMax,A=qA(N,E.add(new Ge(.1).mul(S)),S);return n>i?A.reverse():A},r2=function(t,r){var n=_u(t,2),i=n[0],o=n[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=QA([i,o]),h=_u(f,2),m=h[0],g=h[1];if(m===-1/0||g===1/0)return[i,o];if(m===g)return[m];var v=c==="snap125"?YA:iy,b=Math.max(r,2),j=v(new Ge(g).sub(m).div(b-1),u,0),k=[...qA(new Ge(m),new Ge(g),j),g];return u===!1&&(k=k.map(S=>Math.round(S))),i>o?k.reverse():k},CB=e=>e.rootProps.barCategoryGap,Bh=e=>e.rootProps.stackOffset,ZA=e=>e.rootProps.reverseStackOrder,ay=e=>e.options.chartName,oy=e=>e.rootProps.syncId,JA=e=>e.rootProps.syncMethod,sy=e=>e.options.eventEmitter,PB=e=>e.rootProps.baseValue,fr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},$a={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},On={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Uh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Hh(e,t,r){if(r!=="auto")return r;if(e!=null)return Gn(e,t)?"category":"number"}function n2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Df(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},ly=q([IB,jA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Hh(t,"angleAxis",i2.type))!==null&&r!==void 0?r:"category";return Df(Df({},i2),{},{type:n})}),TB=(e,t)=>e.polarAxis.radiusAxis[t],uy=q([TB,jA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Hh(t,"radiusAxis",a2.type))!==null&&r!==void 0?r:"category";return Df(Df({},a2),{},{type:n})}),Wh=e=>e.polarOptions,cy=q([ki,ji,Zt],eB),eC=q([Wh,cy],(e,t)=>{if(e!=null)return ya(e.innerRadius,t,0)}),tC=q([Wh,cy],(e,t)=>{if(e!=null)return ya(e.outerRadius,t,t*.8)}),DB=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},rC=q([Wh],DB);q([ly,rC],Uh);var nC=q([cy,eC,tC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});q([uy,nC],Uh);var iC=q([ft,Wh,eC,tC,ki,ji],(e,t,r,n,i,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var u=t.cx,c=t.cy,f=t.startAngle,h=t.endAngle;return{cx:ya(u,i,i/2),cy:ya(c,o,o/2),innerRadius:r,outerRadius:n,startAngle:f,endAngle:h,clockWise:!1}}}),$t=(e,t)=>t,Kh=(e,t,r)=>r;function dy(e){return e==null?void 0:e.id}function aC(e,t,r){var n=t.chartData,i=n===void 0?[]:n,o=r.allowDuplicatedCategory,u=r.dataKey,c=new Map;return e.forEach(f=>{var h,m=(h=f.data)!==null&&h!==void 0?h:i;if(!(m==null||m.length===0)){var g=dy(f);m.forEach((v,b)=>{var j=u==null||o?b:String(Lt(v,u,null)),k=Lt(v,f.dataKey,0),S;c.has(j)?S=c.get(j):S={},Object.assign(S,{[g]:k}),c.set(j,S)})}}),Array.from(c.values())}function fy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Gh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Vh(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function RB(e,t){if(e.length===t.length){for(var r=0;r{var t=ft(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},tl=e=>e.tooltip.settings.axisId;function hy(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(o){function u(){return o.apply(this,arguments)}return u.toString=function(){return o.toString()},u})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(o){var u=i[0],c=i[1];return u<=c?o>=u&&o<=c:o>=c&&o<=u},bandwidth:r?()=>r.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,u)=>{var c=e(o);if(c!=null){if(e.bandwidth&&u!==null&&u!==void 0&&u.position){var f=e.bandwidth();switch(u.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var LB=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!$n(t)){for(var r,n,i=0;in)&&(n=o))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function ma(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function $B(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function my(e){let t,r,n;e.length!==2?(t=ma,r=(c,f)=>ma(e(c),f),n=(c,f)=>e(c)-f):(t=e===ma||e===$B?e:zB,r=e,n=e);function i(c,f,h=0,m=c.length){if(h>>1;r(c[g],f)<0?h=g+1:m=g}while(h>>1;r(c[g],f)<=0?h=g+1:m=g}while(hh&&n(c[g-1],f)>-n(c[g],f)?g-1:g}return{left:i,center:u,right:o}}function zB(){return 0}function oC(e){return e===null?NaN:+e}function*FB(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const BB=my(ma),tc=BB.right;my(oC).center;class o2 extends Map{constructor(t,r=WB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(s2(this,t))}has(t){return super.has(s2(this,t))}set(t,r){return super.set(UB(this,t),r)}delete(t){return super.delete(HB(this,t))}}function s2({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function UB({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function HB({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function WB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KB(e=ma){if(e===ma)return sC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function sC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const GB=Math.sqrt(50),VB=Math.sqrt(10),qB=Math.sqrt(2);function Rf(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),u=o>=GB?10:o>=VB?5:o>=qB?2:1;let c,f,h;return i<0?(h=Math.pow(10,-i)/u,c=Math.round(e*h),f=Math.round(t*h),c/ht&&--f,h=-h):(h=Math.pow(10,i)*u,c=Math.round(e/h),f=Math.round(t/h),c*ht&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const c=o-i+1,f=new Array(c);if(n)if(u<0)for(let h=0;h=n)&&(r=n);return r}function u2(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function lC(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?sC:KB(i);n>r;){if(n-r>600){const f=n-r+1,h=t-r+1,m=Math.log(f),g=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*g*(f-g)/f)*(h-f/2<0?-1:1),b=Math.max(r,Math.floor(t-h*g/f+v)),j=Math.min(n,Math.floor(t+(f-h)*g/f+v));lC(e,t,b,j,i)}const o=e[t];let u=r,c=n;for(ru(e,r,t),i(e[n],o)>0&&ru(e,r,n);u0;)--c}i(e[r],o)===0?ru(e,r,c):(++c,ru(e,c,n)),c<=t&&(r=c+1),t<=c&&(n=c-1)}return e}function ru(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function QB(e,t,r){if(e=Float64Array.from(FB(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return u2(e);if(t>=1)return l2(e);var n,i=(n-1)*t,o=Math.floor(i),u=l2(lC(e,o).subarray(0,o+1)),c=u2(e.subarray(o+1));return u+(c-u)*(i-o)}}function YB(e,t,r=oC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),u=+r(e[o],o,e),c=+r(e[o+1],o+1,e);return u+(c-u)*(i-o)}}function XB(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zd(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=e9.exec(e))?new Nr(t[1],t[2],t[3],1):(t=t9.exec(e))?new Nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=r9.exec(e))?zd(t[1],t[2],t[3],t[4]):(t=n9.exec(e))?zd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=i9.exec(e))?g2(t[1],t[2]/100,t[3]/100,1):(t=a9.exec(e))?g2(t[1],t[2]/100,t[3]/100,t[4]):c2.hasOwnProperty(e)?h2(c2[e]):e==="transparent"?new Nr(NaN,NaN,NaN,0):null}function h2(e){return new Nr(e>>16&255,e>>8&255,e&255,1)}function zd(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nr(e,t,r,n)}function l9(e){return e instanceof rc||(e=Tu(e)),e?(e=e.rgb(),new Nr(e.r,e.g,e.b,e.opacity)):new Nr}function n0(e,t,r,n){return arguments.length===1?l9(e):new Nr(e,t,r,n??1)}function Nr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}vy(Nr,n0,cC(rc,{brighter(e){return e=e==null?Lf:Math.pow(Lf,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mu:Math.pow(Mu,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nr(co(this.r),co(this.g),co(this.b),$f(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:m2,formatHex:m2,formatHex8:u9,formatRgb:p2,toString:p2}));function m2(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}`}function u9(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}${Qa((isNaN(this.opacity)?1:this.opacity)*255)}`}function p2(){const e=$f(this.opacity);return`${e===1?"rgb(":"rgba("}${co(this.r)}, ${co(this.g)}, ${co(this.b)}${e===1?")":`, ${e})`}`}function $f(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function co(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qa(e){return e=co(e),(e<16?"0":"")+e.toString(16)}function g2(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new vn(e,t,r,n)}function dC(e){if(e instanceof vn)return new vn(e.h,e.s,e.l,e.opacity);if(e instanceof rc||(e=Tu(e)),!e)return new vn;if(e instanceof vn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),u=NaN,c=o-i,f=(o+i)/2;return c?(t===o?u=(r-n)/c+(r0&&f<1?0:u,new vn(u,c,f,e.opacity)}function c9(e,t,r,n){return arguments.length===1?dC(e):new vn(e,t,r,n??1)}function vn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}vy(vn,c9,cC(rc,{brighter(e){return e=e==null?Lf:Math.pow(Lf,e),new vn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mu:Math.pow(Mu,e),new vn(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Nr(_g(e>=240?e-240:e+120,i,n),_g(e,i,n),_g(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new vn(v2(this.h),Fd(this.s),Fd(this.l),$f(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(){const e=$f(this.opacity);return`${e===1?"hsl(":"hsla("}${v2(this.h)}, ${Fd(this.s)*100}%, ${Fd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function v2(e){return e=(e||0)%360,e<0?e+360:e}function Fd(e){return Math.max(0,Math.min(1,e||0))}function _g(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const yy=e=>()=>e;function d9(e,t){return function(r){return e+r*t}}function f9(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function h9(e){return(e=+e)==1?fC:function(t,r){return r-t?f9(t,r,e):yy(isNaN(t)?r:t)}}function fC(e,t){var r=t-e;return r?d9(e,r):yy(isNaN(e)?t:e)}const y2=(function e(t){var r=h9(t);function n(i,o){var u=r((i=n0(i)).r,(o=n0(o)).r),c=r(i.g,o.g),f=r(i.b,o.b),h=fC(i.opacity,o.opacity);return function(m){return i.r=u(m),i.g=c(m),i.b=f(m),i.opacity=h(m),i+""}}return n.gamma=e,n})(1);function m9(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),c[u]?c[u]+=o:c[++u]=o),(n=n[0])===(i=i[0])?c[u]?c[u]+=i:c[++u]=i:(c[++u]=null,f.push({i:u,x:zf(n,i)})),r=Mg.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function N9(e,t,r){var n=e[0],i=e[1],o=t[0],u=t[1];return i2?E9:N9,f=h=null,g}function g(v){return v==null||isNaN(v=+v)?o:(f||(f=c(e.map(n),t,r)))(n(u(v)))}return g.invert=function(v){return u(i((h||(h=c(t,e.map(n),zf)))(v)))},g.domain=function(v){return arguments.length?(e=Array.from(v,Ff),m()):e.slice()},g.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},g.rangeRound=function(v){return t=Array.from(v),r=xy,m()},g.clamp=function(v){return arguments.length?(u=v?!0:hr,m()):u!==hr},g.interpolate=function(v){return arguments.length?(r=v,m()):r},g.unknown=function(v){return arguments.length?(o=v,g):o},function(v,b){return n=v,i=b,m()}}function by(){return qh()(hr,hr)}function A9(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bf(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Bs(e){return e=Bf(Math.abs(e)),e?e[1]:NaN}function C9(e,t){return function(r,n){for(var i=r.length,o=[],u=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>n&&(c=Math.max(1,n-f)),o.push(r.substring(i-=c,i+c)),!((f+=c+1)>n));)c=e[u=(u+1)%e.length];return o.reverse().join(t)}}function P9(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var O9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Du(e){if(!(t=O9.exec(e)))throw new Error("invalid format: "+e);var t;return new wy({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]})}Du.prototype=wy.prototype;function wy(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+""}wy.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 _9(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Uf;function M9(e,t){var r=Bf(e,t);if(!r)return Uf=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(Uf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,u=n.length;return o===u?n:o>u?n+new Array(o-u+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Bf(e,Math.max(0,t+o-1))[0]}function b2(e,t){var r=Bf(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const w2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:A9,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)=>b2(e*100,t),r:b2,s:M9,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function k2(e){return e}var j2=Array.prototype.map,S2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function I9(e){var t=e.grouping===void 0||e.thousands===void 0?k2:C9(j2.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?k2:P9(j2.call(e.numerals,String)),u=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(g,v){g=Du(g);var b=g.fill,j=g.align,k=g.sign,S=g.symbol,N=g.zero,E=g.width,A=g.comma,P=g.precision,_=g.trim,O=g.type;O==="n"?(A=!0,O="g"):w2[O]||(P===void 0&&(P=12),_=!0,O="g"),(N||b==="0"&&j==="=")&&(N=!0,b="0",j="=");var T=(v&&v.prefix!==void 0?v.prefix:"")+(S==="$"?r:S==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),B=(S==="$"?n:/[%p]/.test(O)?u:"")+(v&&v.suffix!==void 0?v.suffix:""),$=w2[O],z=/[defgprs%]/.test(O);P=P===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function Q(U){var ve=T,ue=B,pe,oe,se;if(O==="c")ue=$(U)+ue,U="";else{U=+U;var X=U<0||1/U<0;if(U=isNaN(U)?f:$(Math.abs(U),P),_&&(U=_9(U)),X&&+U==0&&k!=="+"&&(X=!1),ve=(X?k==="("?k:c:k==="-"||k==="("?"":k)+ve,ue=(O==="s"&&!isNaN(U)&&Uf!==void 0?S2[8+Uf/3]:"")+ue+(X&&k==="("?")":""),z){for(pe=-1,oe=U.length;++pese||se>57){ue=(se===46?i+U.slice(pe+1):U.slice(pe))+ue,U=U.slice(0,pe);break}}}A&&!N&&(U=t(U,1/0));var ne=ve.length+U.length+ue.length,te=ne>1)+ve+U+ue+te.slice(ne);break;default:U=te+ve+U+ue;break}return o(U)}return Q.toString=function(){return g+""},Q}function m(g,v){var b=Math.max(-8,Math.min(8,Math.floor(Bs(v)/3)))*3,j=Math.pow(10,-b),k=h((g=Du(g),g.type="f",g),{suffix:S2[8+b/3]});return function(S){return k(j*S)}}return{format:h,formatPrefix:m}}var Bd,ky,hC;T9({thousands:",",grouping:[3],currency:["$",""]});function T9(e){return Bd=I9(e),ky=Bd.format,hC=Bd.formatPrefix,Bd}function D9(e){return Math.max(0,-Bs(Math.abs(e)))}function R9(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bs(t)/3)))*3-Bs(Math.abs(e)))}function L9(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bs(t)-Bs(e))+1}function mC(e,t,r,n){var i=t0(e,t,r),o;switch(n=Du(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=R9(i,u))&&(n.precision=o),hC(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=L9(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=D9(i))&&(n.precision=o-(n.type==="%")*2);break}}return ky(n)}function wa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Jv(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return mC(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,u=n[i],c=n[o],f,h,m=10;for(c0;){if(h=e0(u,c,r),h===f)return n[i]=u,n[o]=c,t(n);if(h>0)u=Math.floor(u/h)*h,c=Math.ceil(c/h)*h;else if(h<0)u=Math.ceil(u*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function pC(){var e=by();return e.copy=function(){return nc(e,pC())},nn.apply(e,arguments),wa(e)}function gC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Ff),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gC(e).unknown(t)},e=arguments.length?Array.from(e,Ff):[0,1],wa(r)}function vC(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],u;return oMath.pow(e,t)}function U9(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 A2(e){return(t,r)=>-e(-t,r)}function jy(e){const t=e(N2,E2),r=t.domain;let n=10,i,o;function u(){return i=U9(n),o=B9(n),r()[0]<0?(i=A2(i),o=A2(o),e($9,z9)):e(N2,E2),t}return t.base=function(c){return arguments.length?(n=+c,u()):n},t.domain=function(c){return arguments.length?(r(c),u()):r()},t.ticks=c=>{const f=r();let h=f[0],m=f[f.length-1];const g=m0){for(;v<=b;++v)for(j=1;jm)break;N.push(k)}}else for(;v<=b;++v)for(j=n-1;j>=1;--j)if(k=v>0?j/o(-v):j*o(v),!(km)break;N.push(k)}N.length*2{if(c==null&&(c=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Du(f)).precision==null&&(f.trim=!0),f=ky(f)),c===1/0)return f;const h=Math.max(1,n*c/t.ticks().length);return m=>{let g=m/o(Math.round(i(m)));return g*nr(vC(r(),{floor:c=>o(Math.floor(i(c))),ceil:c=>o(Math.ceil(i(c)))})),t}function yC(){const e=jy(qh()).domain([1,10]);return e.copy=()=>nc(e,yC()).base(e.base()),nn.apply(e,arguments),e}function C2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function P2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Sy(e){var t=1,r=e(C2(t),P2(t));return r.constant=function(n){return arguments.length?e(C2(t=+n),P2(t)):t},wa(r)}function xC(){var e=Sy(qh());return e.copy=function(){return nc(e,xC()).constant(e.constant())},nn.apply(e,arguments)}function O2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function H9(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function W9(e){return e<0?-e*e:e*e}function Ny(e){var t=e(hr,hr),r=1;function n(){return r===1?e(hr,hr):r===.5?e(H9,W9):e(O2(r),O2(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},wa(t)}function Ey(){var e=Ny(qh());return e.copy=function(){return nc(e,Ey()).exponent(e.exponent())},nn.apply(e,arguments),e}function K9(){return Ey.apply(null,arguments).exponent(.5)}function _2(e){return Math.sign(e)*e*e}function G9(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function bC(){var e=by(),t=[0,1],r=!1,n;function i(o){var u=G9(e(o));return isNaN(u)?n:r?Math.round(u):u}return i.invert=function(o){return e.invert(_2(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Ff)).map(_2)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return bC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},nn.apply(i,arguments),wa(i)}function wC(){var e=[],t=[],r=[],n;function i(){var u=0,c=Math.max(1,t.length);for(r=new Array(c-1);++u0?r[c-1]:e[0],c=r?[n[r-1],t]:[n[h-1],n[h]]},u.unknown=function(f){return arguments.length&&(o=f),u},u.thresholds=function(){return n.slice()},u.copy=function(){return kC().domain([e,t]).range(i).unknown(o)},nn.apply(wa(u),arguments)}function jC(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[tc(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var u=t.indexOf(o);return[e[u-1],e[u]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return jC().domain(e).range(t).unknown(r)},nn.apply(i,arguments)}const Ig=new Date,Tg=new Date;function Ot(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const u=i(o),c=i.ceil(o);return o-u(t(o=new Date(+o),u==null?1:Math.floor(u)),o),i.range=(o,u,c)=>{const f=[];if(o=i.ceil(o),c=c==null?1:Math.floor(c),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,c),e(o);while(hOt(u=>{if(u>=u)for(;e(u),!o(u);)u.setTime(u-1)},(u,c)=>{if(u>=u)if(c<0)for(;++c<=0;)for(;t(u,-1),!o(u););else for(;--c>=0;)for(;t(u,1),!o(u););}),r&&(i.count=(o,u)=>(Ig.setTime(+o),Tg.setTime(+u),e(Ig),e(Tg),Math.floor(r(Ig,Tg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?u=>n(u)%o===0:u=>i.count(0,u)%o===0):i)),i}const Hf=Ot(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ot(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Hf);Hf.range;const ci=1e3,Zr=ci*60,di=Zr*60,yi=di*24,Ay=yi*7,M2=yi*30,Dg=yi*365,Ya=Ot(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ci)},(e,t)=>(t-e)/ci,e=>e.getUTCSeconds());Ya.range;const Cy=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ci)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getMinutes());Cy.range;const Py=Ot(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCMinutes());Py.range;const Oy=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ci-e.getMinutes()*Zr)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getHours());Oy.range;const _y=Ot(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getUTCHours());_y.range;const ic=Ot(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zr)/yi,e=>e.getDate()-1);ic.range;const Qh=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>e.getUTCDate()-1);Qh.range;const SC=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>Math.floor(e/yi));SC.range;function So(e){return Ot(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Zr)/Ay)}const Yh=So(0),Wf=So(1),V9=So(2),q9=So(3),Us=So(4),Q9=So(5),Y9=So(6);Yh.range;Wf.range;V9.range;q9.range;Us.range;Q9.range;Y9.range;function No(e){return Ot(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Ay)}const Xh=No(0),Kf=No(1),X9=No(2),Z9=No(3),Hs=No(4),J9=No(5),e7=No(6);Xh.range;Kf.range;X9.range;Z9.range;Hs.range;J9.range;e7.range;const My=Ot(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());My.range;const Iy=Ot(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());Iy.range;const xi=Ot(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());xi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});xi.range;const bi=Ot(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());bi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});bi.range;function NC(e,t,r,n,i,o){const u=[[Ya,1,ci],[Ya,5,5*ci],[Ya,15,15*ci],[Ya,30,30*ci],[o,1,Zr],[o,5,5*Zr],[o,15,15*Zr],[o,30,30*Zr],[i,1,di],[i,3,3*di],[i,6,6*di],[i,12,12*di],[n,1,yi],[n,2,2*yi],[r,1,Ay],[t,1,M2],[t,3,3*M2],[e,1,Dg]];function c(h,m,g){const v=mS).right(u,v);if(b===u.length)return e.every(t0(h/Dg,m/Dg,g));if(b===0)return Hf.every(Math.max(t0(h,m,g),1));const[j,k]=u[v/u[b-1][2]53)return null;"w"in de||(de.w=1),"Z"in de?(Ue=Lg(nu(de.y,0,1)),_e=Ue.getUTCDay(),Ue=_e>4||_e===0?Kf.ceil(Ue):Kf(Ue),Ue=Qh.offset(Ue,(de.V-1)*7),de.y=Ue.getUTCFullYear(),de.m=Ue.getUTCMonth(),de.d=Ue.getUTCDate()+(de.w+6)%7):(Ue=Rg(nu(de.y,0,1)),_e=Ue.getDay(),Ue=_e>4||_e===0?Wf.ceil(Ue):Wf(Ue),Ue=ic.offset(Ue,(de.V-1)*7),de.y=Ue.getFullYear(),de.m=Ue.getMonth(),de.d=Ue.getDate()+(de.w+6)%7)}else("W"in de||"U"in de)&&("w"in de||(de.w="u"in de?de.u%7:"W"in de?1:0),_e="Z"in de?Lg(nu(de.y,0,1)).getUTCDay():Rg(nu(de.y,0,1)).getDay(),de.m=0,de.d="W"in de?(de.w+6)%7+de.W*7-(_e+5)%7:de.w+de.U*7-(_e+6)%7);return"Z"in de?(de.H+=de.Z/100|0,de.M+=de.Z%100,Lg(de)):Rg(de)}}function B(re,ye,Oe,de){for(var Ze=0,Ue=ye.length,_e=Oe.length,xt,Jt;Ze=_e)return-1;if(xt=ye.charCodeAt(Ze++),xt===37){if(xt=ye.charAt(Ze++),Jt=_[xt in I2?ye.charAt(Ze++):xt],!Jt||(de=Jt(re,Oe,de))<0)return-1}else if(xt!=Oe.charCodeAt(de++))return-1}return de}function $(re,ye,Oe){var de=h.exec(ye.slice(Oe));return de?(re.p=m.get(de[0].toLowerCase()),Oe+de[0].length):-1}function z(re,ye,Oe){var de=b.exec(ye.slice(Oe));return de?(re.w=j.get(de[0].toLowerCase()),Oe+de[0].length):-1}function Q(re,ye,Oe){var de=g.exec(ye.slice(Oe));return de?(re.w=v.get(de[0].toLowerCase()),Oe+de[0].length):-1}function U(re,ye,Oe){var de=N.exec(ye.slice(Oe));return de?(re.m=E.get(de[0].toLowerCase()),Oe+de[0].length):-1}function ve(re,ye,Oe){var de=k.exec(ye.slice(Oe));return de?(re.m=S.get(de[0].toLowerCase()),Oe+de[0].length):-1}function ue(re,ye,Oe){return B(re,t,ye,Oe)}function pe(re,ye,Oe){return B(re,r,ye,Oe)}function oe(re,ye,Oe){return B(re,n,ye,Oe)}function se(re){return u[re.getDay()]}function X(re){return o[re.getDay()]}function ne(re){return f[re.getMonth()]}function te(re){return c[re.getMonth()]}function I(re){return i[+(re.getHours()>=12)]}function M(re){return 1+~~(re.getMonth()/3)}function H(re){return u[re.getUTCDay()]}function ie(re){return o[re.getUTCDay()]}function J(re){return f[re.getUTCMonth()]}function Z(re){return c[re.getUTCMonth()]}function ae(re){return i[+(re.getUTCHours()>=12)]}function me(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ye=O(re+="",A);return ye.toString=function(){return re},ye},parse:function(re){var ye=T(re+="",!1);return ye.toString=function(){return re},ye},utcFormat:function(re){var ye=O(re+="",P);return ye.toString=function(){return re},ye},utcParse:function(re){var ye=T(re+="",!0);return ye.toString=function(){return re},ye}}}var I2={"-":"",_:" ",0:"0"},Ft=/^\s*\d+/,o7=/^%/,s7=/[\\^$*+?|[\]().{}]/g;function Ye(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function u7(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function c7(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function d7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function f7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function h7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function T2(e,t,r){var n=Ft.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function D2(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function m7(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function p7(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function g7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function R2(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function v7(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function L2(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function y7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function x7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function b7(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function w7(e,t,r){var n=Ft.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function k7(e,t,r){var n=o7.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function j7(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function S7(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function $2(e,t){return Ye(e.getDate(),t,2)}function N7(e,t){return Ye(e.getHours(),t,2)}function E7(e,t){return Ye(e.getHours()%12||12,t,2)}function A7(e,t){return Ye(1+ic.count(xi(e),e),t,3)}function EC(e,t){return Ye(e.getMilliseconds(),t,3)}function C7(e,t){return EC(e,t)+"000"}function P7(e,t){return Ye(e.getMonth()+1,t,2)}function O7(e,t){return Ye(e.getMinutes(),t,2)}function _7(e,t){return Ye(e.getSeconds(),t,2)}function M7(e){var t=e.getDay();return t===0?7:t}function I7(e,t){return Ye(Yh.count(xi(e)-1,e),t,2)}function AC(e){var t=e.getDay();return t>=4||t===0?Us(e):Us.ceil(e)}function T7(e,t){return e=AC(e),Ye(Us.count(xi(e),e)+(xi(e).getDay()===4),t,2)}function D7(e){return e.getDay()}function R7(e,t){return Ye(Wf.count(xi(e)-1,e),t,2)}function L7(e,t){return Ye(e.getFullYear()%100,t,2)}function $7(e,t){return e=AC(e),Ye(e.getFullYear()%100,t,2)}function z7(e,t){return Ye(e.getFullYear()%1e4,t,4)}function F7(e,t){var r=e.getDay();return e=r>=4||r===0?Us(e):Us.ceil(e),Ye(e.getFullYear()%1e4,t,4)}function B7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ye(t/60|0,"0",2)+Ye(t%60,"0",2)}function z2(e,t){return Ye(e.getUTCDate(),t,2)}function U7(e,t){return Ye(e.getUTCHours(),t,2)}function H7(e,t){return Ye(e.getUTCHours()%12||12,t,2)}function W7(e,t){return Ye(1+Qh.count(bi(e),e),t,3)}function CC(e,t){return Ye(e.getUTCMilliseconds(),t,3)}function K7(e,t){return CC(e,t)+"000"}function G7(e,t){return Ye(e.getUTCMonth()+1,t,2)}function V7(e,t){return Ye(e.getUTCMinutes(),t,2)}function q7(e,t){return Ye(e.getUTCSeconds(),t,2)}function Q7(e){var t=e.getUTCDay();return t===0?7:t}function Y7(e,t){return Ye(Xh.count(bi(e)-1,e),t,2)}function PC(e){var t=e.getUTCDay();return t>=4||t===0?Hs(e):Hs.ceil(e)}function X7(e,t){return e=PC(e),Ye(Hs.count(bi(e),e)+(bi(e).getUTCDay()===4),t,2)}function Z7(e){return e.getUTCDay()}function J7(e,t){return Ye(Kf.count(bi(e)-1,e),t,2)}function eU(e,t){return Ye(e.getUTCFullYear()%100,t,2)}function tU(e,t){return e=PC(e),Ye(e.getUTCFullYear()%100,t,2)}function rU(e,t){return Ye(e.getUTCFullYear()%1e4,t,4)}function nU(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Hs(e):Hs.ceil(e),Ye(e.getUTCFullYear()%1e4,t,4)}function iU(){return"+0000"}function F2(){return"%"}function B2(e){return+e}function U2(e){return Math.floor(+e/1e3)}var is,OC,_C;aU({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 aU(e){return is=a7(e),OC=is.format,is.parse,_C=is.utcFormat,is.utcParse,is}function oU(e){return new Date(e)}function sU(e){return e instanceof Date?+e:+new Date(+e)}function Ty(e,t,r,n,i,o,u,c,f,h){var m=by(),g=m.invert,v=m.domain,b=h(".%L"),j=h(":%S"),k=h("%I:%M"),S=h("%I %p"),N=h("%a %d"),E=h("%b %d"),A=h("%B"),P=h("%Y");function _(O){return(f(O)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>QB(e,o/n))},r.copy=function(){return DC(t).domain(e)},Si.apply(r,arguments)}function Jh(){var e=0,t=.5,r=1,n=1,i,o,u,c,f,h=hr,m,g=!1,v;function b(k){return isNaN(k=+k)?v:(k=.5+((k=+m(k))-o)*(n*k{if(e!=null){var n=e.scale,i=e.type;if(n==="auto")return i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof n=="string")return mU(n)?n:"point"}};function pU(e,t){for(var r=0,n=e.length,i=e[0]t)?r=o+1:n=o}return r}function BC(e,t){if(e){var r=t??e.domain(),n=r.map(o=>{var u;return(u=e(o))!==null&&u!==void 0?u:0}),i=e.range();if(!(r.length===0||i.length<2))return o=>{var u,c,f=pU(n,o);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var h=(u=n[f-1])!==null&&u!==void 0?u:0,m=(c=n[f])!==null&&c!==void 0?c:0;return Math.abs(o-h)<=Math.abs(o-m)?r[f-1]:r[f]}}}function gU(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):BC(e,void 0)}function W2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],Ni=(e,t)=>{var r=HC(e,t);return r??Ct},Pt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:o0,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:Yu},WC=(e,t)=>e.cartesianAxis.yAxis[t],Ei=(e,t)=>{var r=WC(e,t);return r??Pt},SU={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:""},$y=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??SU},pr=(e,t,r)=>{switch(t){case"xAxis":return Ni(e,r);case"yAxis":return Ei(e,r);case"zAxis":return $y(e,r);case"angleAxis":return ly(e,r);case"radiusAxis":return uy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},NU=(e,t,r)=>{switch(t){case"xAxis":return Ni(e,r);case"yAxis":return Ei(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},ac=(e,t,r)=>{switch(t){case"xAxis":return Ni(e,r);case"yAxis":return Ei(e,r);case"angleAxis":return ly(e,r);case"radiusAxis":return uy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},KC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function GC(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var VC=e=>e.graphicalItems.cartesianItems,EU=q([$t,Kh],GC),qC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),nl=q([VC,pr,EU],qC,{memoizeOptions:{resultEqualityCheck:Vh}}),QC=q([nl],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(fy)),YC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),AU=q([nl],YC),XC=e=>e.map(t=>t.data).filter(Boolean).flat(1),CU=q([nl],e=>e.some(t=>!t.data)),ZC=q([nl],XC,{memoizeOptions:{resultEqualityCheck:Vh}}),JC=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,o=t.dataEndIndex;return e.length>0?e:n.slice(i,o+1)},zy=q([ZC,Fh],JC),PU=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Lt(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:Lt(i,n)}))):e.map(n=>({value:n})),eP=(e,t,r,n,i,o)=>{var u=n.chartData,c=u===void 0?[]:u,f=n.dataStartIndex,h=n.dataEndIndex,m=PU(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var g=c.slice(f,h+1),v=g.map(b=>({value:Lt(b,t.dataKey)})).filter(b=>b.value!=null);return[...v,...m]}return m},oc=q([zy,pr,nl,Fh,CU,ZC],eP);function bs(e){if(Bn(e)||e instanceof Date){var t=Number(e);if(We(t))return t}}function G2(e){if(Array.isArray(e)){var t=[bs(e[0]),bs(e[1])];return $n(t)?t:void 0}var r=bs(e);if(r!=null)return[r,r]}function Wn(e){return e.map(bs).filter(Sr)}function OU(e,t){var r=bs(e),n=bs(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var _U=q([oc],e=>e==null?void 0:e.map(t=>t.value).sort(OU));function tP(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function MU(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Fn(t))n=t;else if(Array.isArray(t)){var i=Wn(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:Wn(r.flatMap(o=>{var u=Lt(e,o.dataKey),c,f;if(Array.isArray(u)){var h=UC(u,2);c=h[0],f=h[1]}else c=f=u;if(!(!We(c)||!We(f)))return[n-c,n+f]}))}var _t=e=>{var t=zt(e),r=tl(e);return ac(e,t,r)},Ws=q([_t],e=>e==null?void 0:e.dataKey),IU=q([QC,Fh,_t],aC),rP=(e,t,r,n)=>{var i={},o=t.reduce((u,c)=>{if(c.stackId==null)return u;var f=u[c.stackId];return f==null&&(f=[]),f.push(c),u[c.stackId]=f,u},i);return Object.fromEntries(Object.entries(o).map(u=>{var c=UC(u,2),f=c[0],h=c[1],m=n?[...h].reverse():h,g=m.map(dy);return[f,{stackedData:Xz(e,g,r),graphicalItems:m}]}))},nP=q([IU,QC,Bh,ZA],rP),iP=(e,t,r,n)=>{var i=t.dataStartIndex,o=t.dataEndIndex;if(n==null&&r!=="zAxis")return t6(e,i,o)},TU=q([pr],e=>e.allowDataOverflow),Fy=e=>{var t;if(e==null||!("domain"in e))return o0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Wn(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:o0},aP=q([pr],Fy),oP=q([aP,TU],BA),DU=q([nP,kn,$t,oP],iP,{memoizeOptions:{resultEqualityCheck:Gh}}),By=e=>e.errorBars,RU=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>tP(r,n)),Vf=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],c,f;if(n.length>0&&n.forEach(h=>{var m,g=h.data!=null?[...h.data]:u,v=(m=i[h.id])===null||m===void 0?void 0:m.filter(b=>tP(o,b));g.forEach(b=>{var j,k=Lt(b,(j=r.dataKey)!==null&&j!==void 0?j:h.dataKey),S=MU(b,k,v);if(S.length>=2){var N=Math.min(...S),E=Math.max(...S);(c==null||Nf)&&(f=E)}var A=G2(k);A!=null&&(c=c==null?A[0]:Math.min(c,A[0]),f=f==null?A[1]:Math.max(f,A[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(h=>{var m=G2(Lt(h,r.dataKey));m!=null&&(c=c==null?m[0]:Math.min(c,m[0]),f=f==null?m[1]:Math.max(f,m[1]))}),We(c)&&We(f))return[c,f]},LU=q([zy,pr,AU,By,$t,hB],sP,{memoizeOptions:{resultEqualityCheck:Gh}});function $U(e){var t=e.value;if(Bn(t)||t instanceof Date)return t}var zU=(e,t,r)=>{var n=e.map($U).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&yE(n))?FA(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},lP=e=>e.referenceElements.dots,il=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),FU=q([lP,$t,Kh],il),uP=e=>e.referenceElements.areas,BU=q([uP,$t,Kh],il),cP=e=>e.referenceElements.lines,UU=q([cP,$t,Kh],il),dP=(e,t)=>{if(e!=null){var r=Wn(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},HU=q(FU,$t,dP),fP=(e,t)=>{if(e!=null){var r=Wn(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},WU=q([BU,$t],fP);function KU(e){var t;if(e.x!=null)return Wn([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Wn(r)}function GU(e){var t;if(e.y!=null)return Wn([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Wn(r)}var hP=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?KU(n):GU(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},VU=q([UU,$t],hP),qU=q(HU,VU,WU,(e,t,r)=>Vf(e,r,t)),mP=(e,t,r,n,i,o,u,c)=>{if(r!=null)return r;var f=u==="vertical"&&c==="xAxis"||u==="horizontal"&&c==="yAxis",h=f?Vf(n,o,i):Vf(o,i);return xB(t,h,e.allowDataOverflow)},QU=q([pr,aP,oP,DU,LU,qU,ft,$t],mP,{memoizeOptions:{resultEqualityCheck:Gh}}),YU=[0,1],pP=(e,t,r,n,i,o,u)=>{if(!((e==null||r==null||r.length===0)&&u===void 0)){var c=e.dataKey,f=e.type,h=Gn(t,o);if(h&&c==null){var m;return FA(0,(m=r==null?void 0:r.length)!==null&&m!==void 0?m:0)}return f==="category"?zU(n,e,h):i==="expand"&&!h?YU:u}},Uy=q([pr,ft,zy,oc,Bh,$t,QU],pP),al=q([pr,KC,ay],FC),gP=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=Fy(t),o=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&$n(e)){if(o)return t2(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return r2(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(o&&$n(e))return t2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&$n(e))return r2(e,t.tickCount,t.allowDecimals,"adaptive")}}},Hy=q([Uy,ac,al],gP),vP=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&$n(t)&&Array.isArray(r)&&r.length>0){var i,o,u=t[0],c=(i=r[0])!==null&&i!==void 0?i:0,f=t[1],h=(o=r[r.length-1])!==null&&o!==void 0?o:0;return[Math.min(u,c),Math.max(f,h)]}return t},XU=q([pr,Uy,Hy,$t],vP),ZU=q(oc,pr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Wn(e.map(g=>g.value))).sort((g,v)=>g-v),i=n[0],o=n[n.length-1];if(i==null||o==null)return 1/0;var u=o-i;if(u===0)return 1/0;for(var c=0;ci,(e,t,r,n,i)=>{if(!We(e))return 0;var o=t==="vertical"?n.height:n.width;if(i==="gap")return e*o/2;if(i==="no-gap"){var u=ya(r,e*o),c=e*o/2;return c-u-(c-u)/o*u}return 0}),JU=(e,t,r)=>{var n=Ni(e,t);return n==null||typeof n.padding!="string"?0:yP(e,"xAxis",t,r,n.padding)},eH=(e,t,r)=>{var n=Ei(e,t);return n==null||typeof n.padding!="string"?0:yP(e,"yAxis",t,r,n.padding)},tH=q(Ni,JU,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),rH=q(Ei,eH,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),xP=q([Zt,tH,Th,Ih,(e,t,r)=>r],(e,t,r,n,i)=>{var o=n.padding;return i?[o.left,r.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),bP=q([Zt,ft,rH,Th,Ih,(e,t,r)=>r],(e,t,r,n,i,o)=>{var u=i.padding;return o?[n.height-u.bottom,u.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),sc=(e,t,r,n)=>{var i;switch(t){case"xAxis":return xP(e,r,n);case"yAxis":return bP(e,r,n);case"zAxis":return(i=$y(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return rC(e);case"radiusAxis":return nC(e,r);default:return}},wP=q([pr,sc],Uh),nH=q([al,XU],LB),Wy=q([pr,al,nH,wP],Ly),kP=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,o=r.scale,u=Gn(e,n);if(u&&(i==="number"||o!=="auto"))return t.map(c=>c.value)}},Ky=q([ft,oc,ac,$t],kP),em=q([Wy],hy);q([Wy],gU);q([Wy,_U],BC);q([nl,By,$t],RU);function jP(e,t){return e.idt.id?1:0}var tm=(e,t)=>t,rm=(e,t,r)=>r,iH=q(_h,tm,rm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(jP)),aH=q(Mh,tm,rm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(jP)),SP=(e,t)=>({width:e.width,height:t.height}),oH=(e,t)=>{var r=typeof t.width=="number"?t.width:Yu;return{width:r,height:e.height}},sH=q(Zt,Ni,SP),lH=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},uH=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},cH=q(ji,Zt,iH,tm,rm,(e,t,r,n,i)=>{var o={},u;return r.forEach(c=>{var f=SP(t,c);u==null&&(u=lH(t,n,e));var h=n==="top"&&!i||n==="bottom"&&i;o[c.id]=u-Number(h)*f.height,u+=(h?-1:1)*f.height}),o}),dH=q(ki,Zt,aH,tm,rm,(e,t,r,n,i)=>{var o={},u;return r.forEach(c=>{var f=oH(t,c);u==null&&(u=uH(t,n,e));var h=n==="left"&&!i||n==="right"&&i;o[c.id]=u-Number(h)*f.width,u+=(h?-1:1)*f.width}),o}),fH=(e,t)=>{var r=Ni(e,t);if(r!=null)return cH(e,r.orientation,r.mirror)},hH=q([Zt,Ni,fH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),mH=(e,t)=>{var r=Ei(e,t);if(r!=null)return dH(e,r.orientation,r.mirror)},pH=q([Zt,Ei,mH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),gH=q(Zt,Ei,(e,t)=>{var r=typeof t.width=="number"?t.width:Yu;return{width:r,height:e.height}}),NP=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,o=r.type,u=r.dataKey,c=Gn(e,n),f=t.map(m=>m.value),h=f.filter(m=>m!=null);if(u&&c&&o==="category"&&i&&yE(h))return f}},Gy=q([ft,oc,pr,$t],NP),V2=q([ft,NU,al,em,Gy,Ky,sc,Hy,$t],(e,t,r,n,i,o,u,c,f)=>{if(t!=null){var h=Gn(e,f);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:f,categoricalDomain:o,duplicateDomain:i,isCategorical:h,niceTicks:c,range:u,realScaleType:r,scale:n}}}),vH=(e,t,r,n,i,o,u,c,f)=>{if(!(t==null||n==null)){var h=Gn(e,f),m=t.type,g=t.ticks,v=t.tickCount,b=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,j=m==="category"&&n.bandwidth?n.bandwidth()/b:0;j=f==="angleAxis"&&o!=null&&o.length>=2?Yr(o[0]-o[1])*2*j:j;var k=g||i;return k?k.map((S,N)=>{var E=u?u.indexOf(S):S,A=n.map(E);return We(A)?{index:N,coordinate:A+j,value:S,offset:j}:null}).filter(Sr):h&&c?c.map((S,N)=>{var E=n.map(S);return We(E)?{coordinate:E+j,value:S,index:N,offset:j}:null}).filter(Sr):n.ticks?n.ticks(v).map((S,N)=>{var E=n.map(S);return We(E)?{coordinate:E+j,value:S,index:N,offset:j}:null}).filter(Sr):n.domain().map((S,N)=>{var E=n.map(S);return We(E)?{coordinate:E+j,value:u?u[S]:S,index:N,offset:j}:null}).filter(Sr)}},EP=q([ft,ac,al,em,Hy,sc,Gy,Ky,$t],vH),yH=(e,t,r,n,i,o,u)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var c=Gn(e,u),f=t.tickCount,h=0;return h=u==="angleAxis"&&(n==null?void 0:n.length)>=2?Yr(n[0]-n[1])*2*h:h,c&&o?o.map((m,g)=>{var v=r.map(m);return We(v)?{coordinate:v+h,value:m,index:g,offset:h}:null}).filter(Sr):r.ticks?r.ticks(f).map((m,g)=>{var v=r.map(m);return We(v)?{coordinate:v+h,value:m,index:g,offset:h}:null}).filter(Sr):r.domain().map((m,g)=>{var v=r.map(m);return We(v)?{coordinate:v+h,value:i?i[m]:m,index:g,offset:h}:null}).filter(Sr)}},AP=q([ft,ac,em,sc,Gy,Ky,$t],yH),CP=q(pr,em,(e,t)=>{if(!(e==null||t==null))return Gf(Gf({},e),{},{scale:t})}),xH=q([pr,al,Uy,wP],Ly),bH=q([xH],hy);q((e,t,r)=>$y(e,r),bH,(e,t)=>{if(!(e==null||t==null))return Gf(Gf({},e),{},{scale:t})});var wH=q([ft,_h,Mh],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),kH=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};q([kH],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var o of e){var u=Math.abs(o.coordinate-t);ue.options.defaultTooltipEventType,OP=e=>e.options.validateTooltipEventTypes;function _P(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function lc(e,t){var r=PP(e),n=OP(e);return _P(t,r,n)}function jH(e){return Me(t=>lc(t,e))}var MP=(e,t)=>{var r,n=Number(t);if(!(Fn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},SH=e=>e.tooltip.settings,ta={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},NH={itemInteraction:{click:ta,hover:ta},axisInteraction:{click:ta,hover:ta},keyboardInteraction:ta,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}},IP=lr({name:"tooltip",initialState:NH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:st()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=i)},prepare:st()},removeTooltipEntrySettings:{reducer(e,t){var r=Xr(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:st()},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}}}),an=IP.actions,EH=an.addTooltipEntrySettings,AH=an.replaceTooltipEntrySettings,CH=an.removeTooltipEntrySettings,PH=an.setTooltipSettingsState,OH=an.setActiveMouseOverItemIndex;an.mouseLeaveItem;var TP=an.mouseLeaveChart;an.setActiveClickItemIndex;var DP=an.setMouseOverAxisIndex,_H=an.setMouseClickAxisIndex,du=an.setSyncInteraction,qf=an.setKeyboardInteraction,MH=IP.reducer;function q2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ud(e){for(var t=1;t{if(t==null)return ta;var i=RH(e,t,r);if(i==null)return ta;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(LH(i)){if(o)return Ud(Ud({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Ud(Ud({},ta),{},{coordinate:i.coordinate})};function $H(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 r=Number(e);return Number.isFinite(r)?r:void 0}function zH(e,t){var r=$H(e),n=t[0],i=t[1];if(r===void 0)return!1;var o=Math.min(n,i),u=Math.max(n,i);return r>=o&&r<=u}function FH(e,t,r){if(r==null||t==null)return!0;var n=Lt(e,t);return n==null||!$n(r)?!0:zH(n,r)}var hu=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var o=Number(i);if(!We(o))return i;var u=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(u,Math.min(o,c)),h=t[f];return h==null||FH(h,r,n)?String(f):null},LP=(e,t,r,n,i,o,u)=>{if(o!=null){var c=u[0],f=c==null?void 0:c.getPosition(o);if(f!=null)return f;var h=i==null?void 0:i[Number(o)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},$P=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(n!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(u=>{var c;return((c=u.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},zP=e=>e.options.tooltipPayloadSearcher,ol=e=>e.tooltip;function Q2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Y2(e){for(var t=1;te(t)}function X2(e){if(typeof e=="string")return e}function VH(e){if(!(e==null||typeof e!="object")){var t="name"in e?WH(e.name):void 0,r="unit"in e?KH(e.unit):void 0,n="dataKey"in e?GH(e.dataKey):void 0,i="payload"in e?e.payload:void 0,o="color"in e?X2(e.color):void 0,u="fill"in e?X2(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:o,fill:u}}}function qH(e,t){return e??t}var FP=(e,t,r,n,i,o,u)=>{if(!(t==null||o==null)){var c=r.chartData,f=r.computedData,h=r.dataStartIndex,m=r.dataEndIndex,g=[];return e.reduce((v,b)=>{var j,k=b.dataDefinedOnItem,S=b.settings,N=qH(k,c),E=Array.isArray(N)?dA(N,h,m):N,A=(j=S==null?void 0:S.dataKey)!==null&&j!==void 0?j:n,P=S==null?void 0:S.nameKey,_;if(n&&Array.isArray(E)&&!Array.isArray(E[0])&&u==="axis"?_=xE(E,n,i):_=o(E,t,f,P),Array.isArray(_))_.forEach(T=>{var B,$,z=VH(T),Q=z==null?void 0:z.name,U=z==null?void 0:z.dataKey,ve=z==null?void 0:z.payload,ue=Y2(Y2({},S),{},{name:Q,unit:z==null?void 0:z.unit,color:(B=z==null?void 0:z.color)!==null&&B!==void 0?B:S==null?void 0:S.color,fill:($=z==null?void 0:z.fill)!==null&&$!==void 0?$:S==null?void 0:S.fill});v.push(Kk({tooltipEntrySettings:ue,dataKey:U,payload:ve,value:Lt(ve,U),name:Q==null?void 0:String(Q)}))});else{var O;v.push(Kk({tooltipEntrySettings:S,dataKey:A,payload:_,value:Lt(_,A),name:(O=Lt(_,P))!==null&&O!==void 0?O:S==null?void 0:S.name}))}return v},g)}},Vy=q([_t,KC,ay],FC),QH=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),YH=q([zt,tl],GC),Eo=q([QH,_t,YH],qC,{memoizeOptions:{resultEqualityCheck:Vh}}),XH=q([Eo],e=>e.filter(fy)),BP=q([Eo],XC,{memoizeOptions:{resultEqualityCheck:Vh}}),ZH=q([Eo],e=>e.some(t=>!t.data)),xo=q([BP,kn],JC),JH=q([XH,kn,_t],aC),qy=q([xo,_t,Eo,kn,ZH,BP],eP),UP=q([_t],Fy),eW=q([_t],e=>e.allowDataOverflow),HP=q([UP,eW],BA),tW=q([Eo],e=>e.filter(fy)),rW=q([JH,tW,Bh,ZA],rP),nW=q([rW,kn,zt,HP],iP),iW=q([Eo],YC),aW=q([xo,_t,iW,By,zt,mB],sP,{memoizeOptions:{resultEqualityCheck:Gh}}),oW=q([lP,zt,tl],il),sW=q([oW,zt],dP),lW=q([uP,zt,tl],il),uW=q([lW,zt],fP),cW=q([cP,zt,tl],il),dW=q([cW,zt],hP),fW=q([sW,dW,uW],Vf),hW=q([_t,UP,HP,nW,aW,fW,ft,zt],mP),Ks=q([_t,ft,xo,qy,Bh,zt,hW],pP),mW=q([Ks,_t,Vy],gP),pW=q([_t,Ks,mW,zt],vP),WP=e=>{var t=zt(e),r=tl(e),n=!1;return sc(e,t,r,n)},KP=q([_t,WP],Uh),gW=q([_t,Vy,pW,KP],Ly),GP=q([gW],hy),vW=q([ft,qy,_t,zt],NP),yW=q([ft,qy,_t,zt],kP),xW=(e,t,r,n,i,o,u,c)=>{if(t){var f=t.type,h=Gn(e,c);if(n){var m=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,g=f==="category"&&n.bandwidth?n.bandwidth()/m:0;return g=c==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Yr(i[0]-i[1])*2*g:g,h&&u?u.map((v,b)=>{var j=n.map(v);return We(j)?{coordinate:j+g,value:v,index:b,offset:g}:null}).filter(Sr):n.domain().map((v,b)=>{var j=n.map(v);return We(j)?{coordinate:j+g,value:o?o[v]:v,index:b,offset:g}:null}).filter(Sr)}}},Ai=q([ft,_t,Vy,GP,WP,vW,yW,zt],xW),Qy=q([PP,OP,SH],(e,t,r)=>_P(r.shared,e,t)),VP=e=>e.tooltip.settings.trigger,Yy=e=>e.tooltip.settings.defaultIndex,uc=q([ol,Qy,VP,Yy],RP),Ru=q([uc,xo,Ws,Ks],hu),qP=q([Ai,Ru],MP),bW=q([uc],e=>{if(e)return e.dataKey}),wW=q([uc],e=>{if(e)return e.graphicalItemId}),QP=q([ol,Qy,VP,Yy],$P),kW=q([ki,ji,ft,Zt,Ai,Yy,QP],LP),jW=q([uc,kW],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),SW=q([uc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),NW=q([QP,Ru,kn,Ws,qP,zP,Qy],FP),EW=q([NW],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Z2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J2(e){for(var t=1;tMe(_t),_W=()=>{var e=OW(),t=Me(Ai),r=Me(GP);return Sf(!e||!r?void 0:J2(J2({},e),{},{scale:r}),t)};function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function as(e){for(var t=1;t{var i=t.find(o=>o&&o.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:i.coordinate}}return{x:0,y:0}},RW=(e,t,r,n)=>{var i=t.find(h=>h&&h.index===r);if(i){if(e==="centric"){var o=i.coordinate,u=n.radius;return as(as(as({},n),Vt(n.cx,n.cy,u,o)),{},{angle:o,radius:u})}var c=i.coordinate,f=n.angle;return as(as(as({},n),Vt(n.cx,n.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function LW(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var YP=(e,t,r,n,i)=>{var o,u=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(u<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c0?(f=r[c-1])===null||f===void 0?void 0:f.coordinate:(h=r[u-1])===null||h===void 0?void 0:h.coordinate,j=(m=r[c])===null||m===void 0?void 0:m.coordinate,k=c>=u-1?(g=r[0])===null||g===void 0?void 0:g.coordinate:(v=r[c+1])===null||v===void 0?void 0:v.coordinate,S=void 0;if(!(b==null||j==null||k==null))if(Yr(j-b)!==Yr(k-j)){var N=[];if(Yr(k-j)===Yr(i[1]-i[0])){S=k;var E=j+i[1]-i[0];N[0]=Math.min(E,(E+b)/2),N[1]=Math.max(E,(E+b)/2)}else{S=b;var A=k+i[1]-i[0];N[0]=Math.min(j,(A+j)/2),N[1]=Math.max(j,(A+j)/2)}var P=[Math.min(j,(S+j)/2),Math.max(j,(S+j)/2)];if(e>P[0]&&e<=P[1]||e>=N[0]&&e<=N[1]){var _;return(_=r[c])===null||_===void 0?void 0:_.index}}else{var O=Math.min(b,k),T=Math.max(b,k);if(e>(O+j)/2&&e<=(T+j)/2){var B;return(B=r[c])===null||B===void 0?void 0:B.index}}}else if(t)for(var $=0;$(z.coordinate+U.coordinate)/2||$>0&&$(z.coordinate+U.coordinate)/2&&e<=(z.coordinate+Q.coordinate)/2)return z.index}}return-1},XP=()=>Me(ay),Xy=(e,t)=>t,ZP=(e,t,r)=>r,Zy=(e,t,r,n)=>n,$W=q(Ai,e=>bh(e,t=>t.coordinate)),Jy=q([ol,Xy,ZP,Zy],RP),ex=q([Jy,xo,Ws,Ks],hu),zW=(e,t,r)=>{if(t!=null){var n=ol(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},JP=q([ol,Xy,ZP,Zy],$P),Qf=q([ki,ji,ft,Zt,Ai,Zy,JP],LP),FW=q([Jy,Qf],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),eO=q([Ai,ex],MP),BW=q([JP,ex,kn,Ws,eO,zP,Xy],FP),UW=q([Jy,ex],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),HW=(e,t,r,n,i,o,u)=>{if(!(!e||!r||!n||!i)&&LW(e,u)){var c=r6(e,t),f=YP(c,o,i,r,n),h=DW(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},WW=(e,t,r,n,i,o,u)=>{if(!(!e||!n||!i||!o||!r)){var c=aB(e,r);if(c){var f=n6(c,t),h=YP(f,u,o,n,i),m=RW(t,o,h,c);return{activeIndex:String(h),activeCoordinate:m}}}},KW=(e,t,r,n,i,o,u,c)=>{if(!(!e||!t||!n||!i||!o))return t==="horizontal"||t==="vertical"?HW(e,t,n,i,o,u,c):WW(e,t,r,n,i,o,u)},GW=q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),VW=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(fr)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:RB}});function tS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rS(e){for(var t=1;trS(rS({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),XW)},JW=new Set(Object.values(fr));function eK(e){return JW.has(e)}var tO=lr({name:"zIndex",initialState:ZW,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:st()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!eK(r)&&delete e.zIndexMap[r])},prepare:st()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,o=r.isPanorama;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=i:e.zIndexMap[n].element=i:e.zIndexMap[n]={consumers:0,element:o?void 0:i,panoramaElement:o?i:void 0}},prepare:st()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:st()}}}),nm=tO.actions,tK=nm.registerZIndexPortal,$g=nm.unregisterZIndexPortal,rK=nm.registerZIndexPortalElement,nK=nm.unregisterZIndexPortalElement,iK=tO.reducer;function Ci(e){var t=e.zIndex,r=e.children,n=B6(),i=n&&t!==void 0&&t!==0,o=Ar(),u=y.useRef(void 0),c=y.useRef(new Set),f=Nt(),h=Me(g=>GW(g,t,o));if(y.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(b=>{f($g({zIndex:b}))}),g.clear(),u.current=void 0;return}if(c.current.has(t)||(f(tK({zIndex:t})),c.current.add(t)),h){u.current=h;var v=c.current;v.forEach(b=>{b!==t&&(f($g({zIndex:b})),v.delete(b))})}},[f,t,i,h]),y.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(v=>{f($g({zIndex:v}))}),g.clear()}},[f]),!i)return r;var m=h??u.current;return m?ch.createPortal(r,m):null}function s0(){return s0=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.useContext(rO),zg={exports:{}},iS;function fK(){return iS||(iS=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(f,h,m){this.fn=f,this.context=h,this.once=m||!1}function o(f,h,m,g,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var b=new i(m,g||f,v),j=r?r+h:h;return f._events[j]?f._events[j].fn?f._events[j]=[f._events[j],b]:f._events[j].push(b):(f._events[j]=b,f._eventsCount++),f}function u(f,h){--f._eventsCount===0?f._events=new n:delete f._events[h]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],m,g;if(this._eventsCount===0)return h;for(g in m=this._events)t.call(m,g)&&h.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},c.prototype.listeners=function(h){var m=r?r+h:h,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var v=0,b=g.length,j=new Array(b);v{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Fn(r))return e[r]}},gK={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},nO=lr({name:"options",initialState:gK,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),vK=nO.reducer,yK=nO.actions.createEventEmitter;function xK(e){return e.tooltip.syncInteraction}var bK={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},iO=lr({name:"chartData",initialState:bK,reducers:{setChartData(e,t){if(e.chartData=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 r=t.payload,n=r.startIndex,i=r.endIndex;n!=null&&(e.dataStartIndex=n),i!=null&&(e.dataEndIndex=i)}}}),tx=iO.actions,oS=tx.setChartData,wK=tx.setDataStartEndIndexes;tx.setComputedData;var kK=iO.reducer,jK=["x","y"];function sS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function os(e){for(var t=1;tf.rootProps.className);y.useEffect(()=>{if(e==null)return Xs;var f=(h,m,g)=>{if(t!==g&&e===h){if(m.payload.active===!1){r(du({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var v;if(u&&m!==null&&m!==void 0&&(v=m.payload)!==null&&v!==void 0&&v.coordinate&&m.payload.sourceViewBox){var b=m.payload.coordinate,j=b.x,k=b.y,S=AK(b,jK),N=m.payload.sourceViewBox,E=N.x,A=N.y,P=N.width,_=N.height,O=os(os({},S),{},{x:u.x+(P?(j-E)/P:0)*u.width,y:u.y+(_?(k-A)/_:0)*u.height});r(os(os({},m),{},{payload:os(os({},m.payload),{},{coordinate:O})}))}else r(m);return}if(i!=null){var T;if(typeof n=="function"){var B={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},$=n(i,B);T=i[$]}else n==="value"&&(T=i.find(se=>String(se.value)===m.payload.label));var z=m.payload.coordinate;if(z==null||u==null){r(du({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(T==null){r(du({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:void 0}));return}var Q=z.x,U=z.y,ve=Math.min(Q,u.x+u.width),ue=Math.min(U,u.y+u.height),pe={x:o==="horizontal"?T.coordinate:ve,y:o==="horizontal"?ue:T.coordinate},oe=du({active:m.payload.active,coordinate:pe,dataKey:m.payload.dataKey,index:String(T.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});r(oe)}}};return Lu.on(l0,f),()=>{Lu.off(l0,f)}},[c,r,t,e,n,i,o,u])}function OK(){var e=Me(oy),t=Me(sy),r=Nt();y.useEffect(()=>{if(e==null)return Xs;var n=(i,o,u)=>{t!==u&&e===i&&r(wK(o))};return Lu.on(aS,n),()=>{Lu.off(aS,n)}},[r,t,e])}function _K(){var e=Nt();y.useEffect(()=>{e(yK())},[e]),PK(),OK()}function MK(e,t,r,n,i,o){var u=Me(j=>zW(j,e,t)),c=Me(wW),f=Me(sy),h=Me(oy),m=Me(JA),g=Me(xK),v=(g==null?void 0:g.sourceViewBox)!=null,b=Dh();y.useEffect(()=>{if(!v&&h!=null&&f!=null){var j=du({active:o,coordinate:r,dataKey:u,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:b,graphicalItemId:c});Lu.emit(l0,h,j,f)}},[v,r,u,c,i,n,f,h,m,o,b])}function lS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uS(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{T(PH({shared:E,trigger:A,axisId:O,active:i,defaultIndex:B}))},[T,E,A,O,i,B]);var $=Dh(),z=MA(),Q=jH(E),U=(t=Me(Oe=>UW(Oe,Q,A,B)))!==null&&t!==void 0?t:{},ve=U.activeIndex,ue=U.isActive,pe=Me(Oe=>BW(Oe,Q,A,B)),oe=Me(Oe=>eO(Oe,Q,A,B)),se=Me(Oe=>FW(Oe,Q,A,B)),X=pe,ne=dK(),te=(r=i??ue)!==null&&r!==void 0?r:!1,I=U$([X,te]),M=RK(I,2),H=M[0],ie=M[1],J=Q==="axis"?oe:void 0;MK(Q,A,se,J,ve,te);var Z=_??ne;if(Z==null||$==null||Q==null)return null;var ae=X??dS;te||(ae=dS),h&&ae.length&&(ae=d$(ae.filter(Oe=>Oe.value!=null&&(Oe.hide!==!0||n.includeHidden)),v,BK));var me=ae.length>0,re=uS(uS({},n),{},{payload:ae,label:J,active:te,activeIndex:ve,coordinate:se,accessibilityLayer:z}),ye=y.createElement(J8,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:m,active:te,coordinate:se,hasPayload:me,offset:g,position:b,reverseDirection:j,useTranslate3d:k,viewBox:$,wrapperStyle:S,lastBoundingBox:H,innerRef:ie,hasPortalFromProps:!!_},UK(f,re));return y.createElement(y.Fragment,null,ch.createPortal(ye,Z),te&&y.createElement(cK,{cursor:N,tooltipEventType:Q,coordinate:se,payload:ae,index:ve}))}function KK(e,t,r){return(t=GK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GK(e){var t=VK(e,"string");return typeof t=="symbol"?t:t+""}function VK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class qK{constructor(t){KK(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function fS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function QK(e){for(var t=1;t{try{var r=document.getElementById(mS);r||(r=document.createElement("span"),r.setAttribute("id",mS),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,eG,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},mu=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ec.isSsr)return{width:0,height:0};if(!aO.enableCache)return pS(t,r);var n=tG(t,r),i=hS.get(n);if(i)return i;var o=pS(t,r);return hS.set(n,o),o},oO;function Yf(e,t){return aG(e)||iG(e,t)||nG(e,t)||rG()}function rG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nG(e,t){if(e){if(typeof e=="string")return gS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gS(e,t):void 0}}function gS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var i=[];Qt(t)||(r?i=t.toString().split(""):i=t.toString().split(lO));var o=i.map(c=>({word:c,width:mu(c,n).width})),u=r?0:mu(" ",n).width;return{wordsWithComputedWidth:o,spaceWidth:u}}catch{return null}};function cO(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function NG(e){return Qt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var dO=(e,t,r,n)=>e.reduce((i,o)=>{var u=o.word,c=o.width,f=i[i.length-1];if(f&&c!=null&&(t==null||n||f.width+c+re.reduce((t,r)=>t.width>r.width?t:r),EG="…",jS=(e,t,r,n,i,o,u,c)=>{var f=e.slice(0,t),h=uO({breakAll:r,style:n,children:f+EG});if(!h)return[!1,[]];var m=dO(h.wordsWithComputedWidth,o,u,c),g=m.length>i||fO(m).width>Number(o);return[g,m]},AG=(e,t,r,n,i)=>{var o=e.maxLines,u=e.children,c=e.style,f=e.breakAll,h=Ae(o),m=String(u),g=dO(t,n,r,i);if(!h||i)return g;var v=g.length>o||fO(g).width>Number(n);if(!v)return g;for(var b=0,j=m.length-1,k=0,S;b<=j&&k<=m.length-1;){var N=Math.floor((b+j)/2),E=N-1,A=jS(m,E,f,c,o,n,r,i),P=wS(A,2),_=P[0],O=P[1],T=jS(m,N,f,c,o,n,r,i),B=wS(T,1),$=B[0];if(!_&&!$&&(b=N+1),_&&$&&(j=N-1),!_&&$){S=O;break}k++}return S||g},SS=e=>{var t=Qt(e)?[]:e.toString().split(lO);return[{words:t,width:void 0}]},CG=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,u=e.maxLines;if((t||r)&&!ec.isSsr){var c,f,h=uO({breakAll:o,children:n,style:i});if(h){var m=h.wordsWithComputedWidth,g=h.spaceWidth;c=m,f=g}else return SS(n);return AG({breakAll:o,children:n,maxLines:u,style:i},c,f,t,!!r)}return SS(n)},hO="#808080",PG={angle:0,breakAll:!1,capHeight:"0.71em",fill:hO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},rx=y.forwardRef((e,t)=>{var r=rn(e,PG),n=r.x,i=r.y,o=r.lineHeight,u=r.capHeight,c=r.fill,f=r.scaleToFit,h=r.textAnchor,m=r.verticalAnchor,g=bS(r,yG),v=y.useMemo(()=>CG({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:f,style:g.style,width:g.width}),[g.breakAll,g.children,g.maxLines,f,g.style,g.width]),b=g.dx,j=g.dy,k=g.angle,S=g.className,N=g.breakAll,E=bS(g,xG);if(!Bn(n)||!Bn(i)||v.length===0)return null;var A=Number(n)+(Ae(b)?b:0),P=Number(i)+(Ae(j)?j:0);if(!We(A)||!We(P))return null;var _;switch(m){case"start":_=Fg("calc(".concat(u,")"));break;case"middle":_=Fg("calc(".concat((v.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:_=Fg("calc(".concat(v.length-1," * -").concat(o,")"));break}var O=[],T=v[0];if(f&&T!=null){var B=T.width,$=g.width;O.push("scale(".concat(Ae($)&&Ae(B)?$/B:1,")"))}return k&&O.push("rotate(".concat(k,", ").concat(A,", ").concat(P,")")),O.length&&(E.transform=O.join(" ")),y.createElement("text",u0({},Jr(E),{ref:t,x:A,y:P,className:rt("recharts-text",S),textAnchor:h,fill:c.includes("url")?hO:c}),v.map((z,Q)=>{var U=z.words.join(N?"":" ");return y.createElement("tspan",{x:A,dy:Q===0?_:o,key:"".concat(U,"-").concat(Q)},U)}))});rx.displayName="Text";function NS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,o=e.parentViewBox,u=Y0(t),c=u.x,f=u.y,h=u.height,m=u.upperWidth,g=u.lowerWidth,v=c,b=c+(m-g)/2,j=(v+b)/2,k=(m+g)/2,S=v+m/2,N=h>=0?1:-1,E=N*i,A=N>0?"end":"start",P=N>0?"start":"end",_=m>=0?1:-1,O=_*i,T=_>0?"end":"start",B=_>0?"start":"end",$=o;if(r==="top"){var z={x:v+m/2,y:f-E,horizontalAnchor:"middle",verticalAnchor:A};return $&&(z.height=Math.max(f-$.y,0),z.width=m),z}if(r==="bottom"){var Q={x:b+g/2,y:f+h+E,horizontalAnchor:"middle",verticalAnchor:P};return $&&(Q.height=Math.max($.y+$.height-(f+h),0),Q.width=g),Q}if(r==="left"){var U={x:j-O,y:f+h/2,horizontalAnchor:T,verticalAnchor:"middle"};return $&&(U.width=Math.max(U.x-$.x,0),U.height=h),U}if(r==="right"){var ve={x:j+k+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"};return $&&(ve.width=Math.max($.x+$.width-ve.x,0),ve.height=h),ve}var ue=$?{width:k,height:h}:{};return r==="insideLeft"?_n({x:j+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"},ue):r==="insideRight"?_n({x:j+k-O,y:f+h/2,horizontalAnchor:T,verticalAnchor:"middle"},ue):r==="insideTop"?_n({x:v+m/2,y:f+E,horizontalAnchor:"middle",verticalAnchor:P},ue):r==="insideBottom"?_n({x:b+g/2,y:f+h-E,horizontalAnchor:"middle",verticalAnchor:A},ue):r==="insideTopLeft"?_n({x:v+O,y:f+E,horizontalAnchor:B,verticalAnchor:P},ue):r==="insideTopRight"?_n({x:v+m-O,y:f+E,horizontalAnchor:T,verticalAnchor:P},ue):r==="insideBottomLeft"?_n({x:b+O,y:f+h-E,horizontalAnchor:B,verticalAnchor:A},ue):r==="insideBottomRight"?_n({x:b+g-O,y:f+h-E,horizontalAnchor:T,verticalAnchor:A},ue):r&&typeof r=="object"&&(Ae(r.x)||mo(r.x))&&(Ae(r.y)||mo(r.y))?_n({x:c+ya(r.x,k),y:f+ya(r.y,h),horizontalAnchor:"end",verticalAnchor:"end"},ue):_n({x:S,y:f+h/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ue)},TG=["labelRef"],DG=["content"];function ES(e,t){if(e==null)return{};var r,n,i=RG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,o=e.width,u=e.height,c=e.children,f=y.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:o,height:u}),[t,r,n,i,o,u]);return y.createElement(mO.Provider,{value:f},c)},pO=()=>{var e=y.useContext(mO),t=Dh();return e||(t?Y0(t):void 0)},BG=y.createContext(null),UG=()=>{var e=y.useContext(BG),t=Me(iC);return e||t},HG=e=>{var t=e.value,r=e.formatter,n=Qt(e.children)?t:e.children;return typeof r=="function"?r(n):n},nx=e=>e!=null&&typeof e=="function",WG=(e,t)=>{var r=Yr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},KG=(e,t,r,n,i)=>{var o=e.offset,u=e.className,c=i.cx,f=i.cy,h=i.innerRadius,m=i.outerRadius,g=i.startAngle,v=i.endAngle,b=i.clockWise,j=(h+m)/2,k=WG(g,v),S=k>=0?1:-1,N,E;switch(t){case"insideStart":N=g+S*o,E=b;break;case"insideEnd":N=v-S*o,E=!b;break;case"end":N=v+S*o,E=b;break;default:throw new Error("Unsupported position ".concat(t))}E=k<=0?E:!E;var A=Vt(c,f,j,N),P=Vt(c,f,j,N+(E?1:-1)*359),_="M".concat(A.x,",").concat(A.y,` + A`,",",",0,0,",",",",","Z"])),Q.x,Q.y,o,o,+(m<0),z.x,z.y,n,n,+(ve>180),+(m>0),O.x,O.y,o,o,+(m<0),T.x,T.y)}else P+=Wt(Qj||(Qj=qa(["L",",","Z"])),t,r);return P},uB={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},cB=e=>{var t=nn(e,uB),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,u=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,m=t.endAngle,g=t.className;if(o0&&Math.abs(h-m)<360?k=lB({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(j,b/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:m}):k=zA({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:h,endAngle:m}),y.createElement("path",Zv({},en(t),{className:v,d:k}))};function dB(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(bE(t)){if(e==="centric"){var n=t.cx,i=t.cy,o=t.innerRadius,u=t.outerRadius,c=t.angle,f=Vt(n,i,o,c),h=Vt(n,i,u,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return $A(t)}}function fB(e){return TE(e)?NaN:Number(e)}function Pg(e){return e?(e=fB(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function FA(e,t,r){r&&typeof r!="number"&&Mv(e,t,r)&&(t=r=void 0),e=Pg(e),t===void 0?(t=e,e=0):t=Pg(t),r=r===void 0?ee.chartData,ey=q([kn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Fh=(e,t,r,n)=>n?ey(e):kn(e),hB=(e,t,r)=>r?ey(e):kn(e),mB=q([Fh],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});q([ey],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var pB=q([kn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function ty(e,t){return xB(e)||yB(e,t)||vB(e,t)||gB()}function gB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vB(e,t){if(e){if(typeof e=="string")return Yj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yj(e,t):void 0}}function Yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return hi(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return et(hi(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return St(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Rr))throw Error(rn+"NaN");if(r.s<1)throw Error(rn+(r.s?"NaN":"-Infinity"));return r.eq(Rr)?new n(0):(dt=!1,t=hi(Pu(r,o),Pu(e,o),o),dt=!0,et(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KA(t,e):HA(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(rn+"NaN");return r.s?(dt=!1,t=hi(r,e,0,1).times(e),dt=!0,r.minus(t)):et(new n(r),i)};je.naturalExponential=je.exp=function(){return WA(this)};je.naturalLogarithm=je.ln=function(){return Pu(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?HA(t,e):KA(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(uo+e);if(t=St(i)+1,n=i.d.length-1,r=n*lt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,o,u,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(rn+"NaN")}for(e=St(c),dt=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ln(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Js((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=u=r+3;;)if(o=n,n=o.plus(hi(c,o,u+2)).times(.5),Ln(o.d).slice(0,u)===(t=Ln(n.d)).slice(0,u)){if(t=t.slice(u-3,u+1),i==u&&t=="4999"){if(et(o,r+1,0),o.times(o).eq(c)){n=o;break}}else if(t!="9999")break;u+=4}return dt=!0,et(n,r)};je.times=je.mul=function(e){var t,r,n,i,o,u,c,f,h,m=this,g=m.constructor,v=m.d,b=(e=new g(e)).d;if(!m.s||!e.s)return new g(0);for(e.s*=m.s,r=m.e+e.e,f=v.length,h=b.length,f=0;){for(t=0,i=f+n;i>n;)c=o[i]+b[n]*v[i-n-1]+t,o[i--]=c%Rt|0,t=c/Rt|0;o[i]=(o[i]+t)%Rt|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,dt?et(e,g.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Hn(e,0,Zs),t===void 0?t=n.rounding:Hn(t,0,8),et(r,e+St(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=yo(n,!0):(Hn(e,0,Zs),t===void 0?t=i.rounding:Hn(t,0,8),n=et(new i(n),e+1,t),r=yo(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?yo(i):(Hn(e,0,Zs),t===void 0?t=o.rounding:Hn(t,0,8),n=et(new o(i),e+St(i)+1,t),r=yo(n.abs(),!1,e+St(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return et(new t(e),St(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,o,u,c=this,f=c.constructor,h=12,m=+(e=new f(e));if(!e.s)return new f(Rr);if(c=new f(c),!c.s){if(e.s<1)throw Error(rn+"Infinity");return c}if(c.eq(Rr))return c;if(n=f.precision,e.eq(Rr))return et(c,n);if(t=e.e,r=e.d.length-1,u=t>=r,o=c.s,u){if((r=m<0?-m:m)<=UA){for(i=new f(Rr),t=Math.ceil(n/lt+4),dt=!1;r%2&&(i=i.times(c),Jj(i.d,t)),r=Js(r/2),r!==0;)c=c.times(c),Jj(c.d,t);return dt=!0,e.s<0?new f(Rr).div(i):et(i,n)}}else if(o<0)throw Error(rn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,c.s=1,dt=!1,i=e.times(Pu(c,n+h)),dt=!0,i=WA(i),i.s=o,i};je.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=St(i),n=yo(i,r<=o.toExpNeg||r>=o.toExpPos)):(Hn(e,1,Zs),t===void 0?t=o.rounding:Hn(t,0,8),i=et(new o(i),e,t),r=St(i),n=yo(i,e<=r||r<=o.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Hn(e,1,Zs),t===void 0?t=n.rounding:Hn(t,0,8)),et(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=St(e),r=e.constructor;return yo(e,t<=r.toExpNeg||t>=r.toExpPos)};function HA(e,t){var r,n,i,o,u,c,f,h,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),dt?et(t,g):t;if(f=e.d,h=t.d,u=e.e,i=t.e,f=f.slice(),o=u-i,o){for(o<0?(n=f,o=-o,c=h.length):(n=h,i=u,c=f.length),u=Math.ceil(g/lt),c=u>c?u+1:c+1,o>c&&(o=c,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(c=f.length,o=h.length,c-o<0&&(o=c,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/Rt|0,f[o]%=Rt;for(r&&(f.unshift(r),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,dt?et(t,g):t}function Hn(e,t,r){if(e!==~~e||er)throw Error(uo+e)}function Ln(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;tu?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function r(n,i,o){for(var u=0;o--;)n[o]-=u,u=n[o]1;)n.shift()}return function(n,i,o,u){var c,f,h,m,g,v,b,j,k,S,N,E,A,P,_,O,T,B,$=n.constructor,z=n.s==i.s?1:-1,Q=n.d,U=i.d;if(!n.s)return new $(n);if(!i.s)throw Error(rn+"Division by zero");for(f=n.e-i.e,T=U.length,_=Q.length,b=new $(z),j=b.d=[],h=0;U[h]==(Q[h]||0);)++h;if(U[h]>(Q[h]||0)&&--f,o==null?E=o=$.precision:u?E=o+(St(n)-St(i))+1:E=o,E<0)return new $(0);if(E=E/lt+2|0,h=0,T==1)for(m=0,U=U[0],E++;(h<_||m)&&E--;h++)A=m*Rt+(Q[h]||0),j[h]=A/U|0,m=A%U|0;else{for(m=Rt/(U[0]+1)|0,m>1&&(U=e(U,m),Q=e(Q,m),T=U.length,_=Q.length),P=T,k=Q.slice(0,T),S=k.length;S=Rt/2&&++O;do m=0,c=t(U,k,T,S),c<0?(N=k[0],T!=S&&(N=N*Rt+(k[1]||0)),m=N/O|0,m>1?(m>=Rt&&(m=Rt-1),g=e(U,m),v=g.length,S=k.length,c=t(g,k,v,S),c==1&&(m--,r(g,T16)throw Error(ry+St(e));if(!e.s)return new m(Rr);for(dt=!1,c=g,u=new m(.03125);e.abs().gte(.1);)e=e.times(u),h+=5;for(n=Math.log(Ka(2,h))/Math.LN10*2+5|0,c+=n,r=i=o=new m(Rr),m.precision=c;;){if(i=et(i.times(e),c),r=r.times(++f),u=o.plus(hi(i,r,c)),Ln(u.d).slice(0,c)===Ln(o.d).slice(0,c)){for(;h--;)o=et(o.times(o),c);return m.precision=g,t==null?(dt=!0,et(o,g)):o}o=u}}function St(e){for(var t=e.e*lt,r=e.d[0];r>=10;r/=10)t++;return t}function Og(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(rn+"LN10 precision limit exceeded");return et(new e(e.LN10),t)}function Ji(e){for(var t="";e--;)t+="0";return t}function Pu(e,t){var r,n,i,o,u,c,f,h,m,g=1,v=10,b=e,j=b.d,k=b.constructor,S=k.precision;if(b.s<1)throw Error(rn+(b.s?"NaN":"-Infinity"));if(b.eq(Rr))return new k(0);if(t==null?(dt=!1,h=S):h=t,b.eq(10))return t==null&&(dt=!0),Og(k,h);if(h+=v,k.precision=h,r=Ln(j),n=r.charAt(0),o=St(b),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Ln(b.d),n=r.charAt(0),g++;o=St(b),n>1?(b=new k("0."+r),o++):b=new k(n+"."+r.slice(1))}else return f=Og(k,h+2,S).times(o+""),b=Pu(new k(n+"."+r.slice(1)),h-v).plus(f),k.precision=S,t==null?(dt=!0,et(b,S)):b;for(c=u=b=hi(b.minus(Rr),b.plus(Rr),h),m=et(b.times(b),h),i=3;;){if(u=et(u.times(m),h),f=c.plus(hi(u,new k(i),h)),Ln(f.d).slice(0,h)===Ln(c.d).slice(0,h))return c=c.times(2),o!==0&&(c=c.plus(Og(k,h+2,S).times(o+""))),c=hi(c,new k(g),h),k.precision=S,t==null?(dt=!0,et(c,S)):c;c=f,i+=2}}function Zj(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Js(r/lt),e.d=[],n=(r+1)%lt,r<0&&(n+=lt),nTf||e.e<-Tf))throw Error(ry+r)}else e.s=0,e.e=0,e.d=[0];return e}function et(e,t,r){var n,i,o,u,c,f,h,m,g=e.d;for(u=1,o=g[0];o>=10;o/=10)u++;if(n=t-u,n<0)n+=lt,i=t,h=g[m=0];else{if(m=Math.ceil((n+1)/lt),o=g.length,m>=o)return e;for(h=o=g[m],u=1;o>=10;o/=10)u++;n%=lt,i=n-lt+u}if(r!==void 0&&(o=Ka(10,u-i-1),c=h/o%10|0,f=t<0||g[m+1]!==void 0||h%o,f=r<4?(c||f)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||f||r==6&&(n>0?i>0?h/Ka(10,u-i):0:g[m-1])%10&1||r==(e.s<0?8:7))),t<1||!g[0])return f?(o=St(e),g.length=1,t=t-o-1,g[0]=Ka(10,(lt-t%lt)%lt),e.e=Js(-t/lt)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(n==0?(g.length=m,o=1,m--):(g.length=m+1,o=Ka(10,lt-n),g[m]=i>0?(h/Ka(10,u-i)%Ka(10,i)|0)*o:0),f)for(;;)if(m==0){(g[0]+=o)==Rt&&(g[0]=1,++e.e);break}else{if(g[m]+=o,g[m]!=Rt)break;g[m--]=0,o=1}for(n=g.length;g[--n]===0;)g.pop();if(dt&&(e.e>Tf||e.e<-Tf))throw Error(ry+St(e));return e}function KA(e,t){var r,n,i,o,u,c,f,h,m,g,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),dt?et(t,b):t;if(f=e.d,g=t.d,n=t.e,h=e.e,f=f.slice(),u=h-n,u){for(m=u<0,m?(r=f,u=-u,c=g.length):(r=g,n=h,c=f.length),i=Math.max(Math.ceil(b/lt),c)+2,u>i&&(u=i,r.length=1),r.reverse(),i=u;i--;)r.push(0);r.reverse()}else{for(i=f.length,c=g.length,m=i0;--i)f[c++]=0;for(i=g.length;i>u;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+Ji(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Ji(-i-1)+o,r&&(n=r-u)>0&&(o+=Ji(n))):i>=u?(o+=Ji(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Ji(n))):((n=i+1)0&&(i+1===u&&(o+="."),o+=Ji(n))),e.s<0?"-"+o:o}function Jj(e,t){if(e.length>t)return e.length=t,!0}function GA(e){var t,r,n;function i(o){var u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,o instanceof i){u.s=o.s,u.e=o.e,u.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(uo+o);if(o>0)u.s=1;else if(o<0)o=-o,u.s=-1;else{u.s=0,u.e=0,u.d=[0];return}if(o===~~o&&o<1e7){u.e=0,u.d=[o];return}return Zj(u,o.toString())}else if(typeof o!="string")throw Error(uo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),u.s=-1):u.s=1,kB.test(o))Zj(u,o);else throw Error(uo+o)}if(i.prototype=je,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=GA,i.config=i.set=jB,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(uo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(uo+r+": "+n);return this}var ny=GA(wB);Rr=new ny(1);const Ge=ny;function VA(e){var t;return e===0?t=1:t=Math.floor(new Ge(e).abs().log(10).toNumber())+1,t}function qA(e,t,r){for(var n=new Ge(e),i=0,o=[];n.lt(t)&&i<1e5;)o.push(n.toNumber()),n=n.add(r),i++;return o}function Ou(e,t){return AB(e)||EB(e,t)||NB(e,t)||SB()}function SB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NB(e,t){if(e){if(typeof e=="string")return e2(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e2(e,t):void 0}}function e2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Ou(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]},iy=(e,t,r)=>{if(e.lte(0))return new Ge(0);var n=VA(e.toNumber()),i=new Ge(10).pow(n),o=e.div(i),u=n!==1?.05:.1,c=new Ge(Math.ceil(o.div(u).toNumber())).add(r).mul(u),f=c.mul(i);return t?new Ge(f.toNumber()):new Ge(Math.ceil(f.toNumber()))},YA=(e,t,r)=>{var n;if(e.lte(0))return new Ge(0);var i=[1,2,2.5,5],o=e.toNumber(),u=Math.floor(new Ge(o).abs().log(10).toNumber()),c=new Ge(10).pow(u),f=e.div(c).toNumber(),h=i.findIndex(b=>b>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=r,h>=i.length){var m=Math.floor(h/i.length);h%=i.length,c=c.mul(new Ge(10).pow(m))}var g=(n=i[h])!==null&&n!==void 0?n:1,v=new Ge(g).mul(c);return t?v:new Ge(Math.ceil(v.toNumber()))},CB=(e,t,r)=>{var n=new Ge(1),i=new Ge(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new Ge(10).pow(VA(e)-1),i=new Ge(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new Ge(Math.floor(e)))}else e===0?i=new Ge(Math.floor((t-1)/2)):r||(i=new Ge(Math.floor(e)));for(var u=Math.floor((t-1)/2),c=[],f=0;f4&&arguments[4]!==void 0?arguments[4]:0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:iy;if(!Number.isFinite((r-t)/(n-1)))return{step:new Ge(0),tickMin:new Ge(0),tickMax:new Ge(0)};var c=u(new Ge(r).sub(t).div(n-1),i,o),f;t<=0&&r>=0?f=new Ge(0):(f=new Ge(t).add(r).div(2),f=f.sub(new Ge(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),m=Math.ceil(new Ge(r).sub(f).div(c).toNumber()),g=h+m+1;return g>n?XA(t,r,n,i,o+1,u):(g0?m+(n-g):m,h=r>0?h:h+(n-g)),{step:c,tickMin:f.sub(new Ge(h).mul(c)),tickMax:f.add(new Ge(m).mul(c))})},t2=function(t){var r=Ou(t,2),n=r[0],i=r[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=Math.max(o,2),h=QA([n,i]),m=Ou(h,2),g=m[0],v=m[1];if(g===-1/0||v===1/0){var b=v===1/0?[g,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),v];return n>i?b.reverse():b}if(g===v)return CB(g,o,u);var j=c==="snap125"?YA:iy,k=XA(g,v,f,u,0,j),S=k.step,N=k.tickMin,E=k.tickMax,A=qA(N,E.add(new Ge(.1).mul(S)),S);return n>i?A.reverse():A},r2=function(t,r){var n=Ou(t,2),i=n[0],o=n[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=QA([i,o]),h=Ou(f,2),m=h[0],g=h[1];if(m===-1/0||g===1/0)return[i,o];if(m===g)return[m];var v=c==="snap125"?YA:iy,b=Math.max(r,2),j=v(new Ge(g).sub(m).div(b-1),u,0),k=[...qA(new Ge(m),new Ge(g),j),g];return u===!1&&(k=k.map(S=>Math.round(S))),i>o?k.reverse():k},PB=e=>e.rootProps.barCategoryGap,Bh=e=>e.rootProps.stackOffset,ZA=e=>e.rootProps.reverseStackOrder,ay=e=>e.options.chartName,oy=e=>e.rootProps.syncId,JA=e=>e.rootProps.syncMethod,sy=e=>e.options.eventEmitter,OB=e=>e.rootProps.baseValue,fr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},$a={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},On={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Uh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Hh(e,t,r){if(r!=="auto")return r;if(e!=null)return Gn(e,t)?"category":"number"}function n2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Df(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},ly=q([TB,jA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Hh(t,"angleAxis",i2.type))!==null&&r!==void 0?r:"category";return Df(Df({},i2),{},{type:n})}),DB=(e,t)=>e.polarAxis.radiusAxis[t],uy=q([DB,jA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Hh(t,"radiusAxis",a2.type))!==null&&r!==void 0?r:"category";return Df(Df({},a2),{},{type:n})}),Wh=e=>e.polarOptions,cy=q([ki,ji,Zt],tB),eC=q([Wh,cy],(e,t)=>{if(e!=null)return ya(e.innerRadius,t,0)}),tC=q([Wh,cy],(e,t)=>{if(e!=null)return ya(e.outerRadius,t,t*.8)}),RB=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},rC=q([Wh],RB);q([ly,rC],Uh);var nC=q([cy,eC,tC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});q([uy,nC],Uh);var iC=q([ft,Wh,eC,tC,ki,ji],(e,t,r,n,i,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var u=t.cx,c=t.cy,f=t.startAngle,h=t.endAngle;return{cx:ya(u,i,i/2),cy:ya(c,o,o/2),innerRadius:r,outerRadius:n,startAngle:f,endAngle:h,clockWise:!1}}}),$t=(e,t)=>t,Kh=(e,t,r)=>r;function dy(e){return e==null?void 0:e.id}function aC(e,t,r){var n=t.chartData,i=n===void 0?[]:n,o=r.allowDuplicatedCategory,u=r.dataKey,c=new Map;return e.forEach(f=>{var h,m=(h=f.data)!==null&&h!==void 0?h:i;if(!(m==null||m.length===0)){var g=dy(f);m.forEach((v,b)=>{var j=u==null||o?b:String(Lt(v,u,null)),k=Lt(v,f.dataKey,0),S;c.has(j)?S=c.get(j):S={},Object.assign(S,{[g]:k}),c.set(j,S)})}}),Array.from(c.values())}function fy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Gh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Vh(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function LB(e,t){if(e.length===t.length){for(var r=0;r{var t=ft(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},el=e=>e.tooltip.settings.axisId;function hy(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(o){function u(){return o.apply(this,arguments)}return u.toString=function(){return o.toString()},u})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(o){var u=i[0],c=i[1];return u<=c?o>=u&&o<=c:o>=c&&o<=u},bandwidth:r?()=>r.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,u)=>{var c=e(o);if(c!=null){if(e.bandwidth&&u!==null&&u!==void 0&&u.position){var f=e.bandwidth();switch(u.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var $B=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!$n(t)){for(var r,n,i=0;in)&&(n=o))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function ma(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function zB(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function my(e){let t,r,n;e.length!==2?(t=ma,r=(c,f)=>ma(e(c),f),n=(c,f)=>e(c)-f):(t=e===ma||e===zB?e:FB,r=e,n=e);function i(c,f,h=0,m=c.length){if(h>>1;r(c[g],f)<0?h=g+1:m=g}while(h>>1;r(c[g],f)<=0?h=g+1:m=g}while(hh&&n(c[g-1],f)>-n(c[g],f)?g-1:g}return{left:i,center:u,right:o}}function FB(){return 0}function oC(e){return e===null?NaN:+e}function*BB(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const UB=my(ma),ec=UB.right;my(oC).center;class o2 extends Map{constructor(t,r=KB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(s2(this,t))}has(t){return super.has(s2(this,t))}set(t,r){return super.set(HB(this,t),r)}delete(t){return super.delete(WB(this,t))}}function s2({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function HB({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function WB({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function KB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function GB(e=ma){if(e===ma)return sC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function sC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const VB=Math.sqrt(50),qB=Math.sqrt(10),QB=Math.sqrt(2);function Rf(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),u=o>=VB?10:o>=qB?5:o>=QB?2:1;let c,f,h;return i<0?(h=Math.pow(10,-i)/u,c=Math.round(e*h),f=Math.round(t*h),c/ht&&--f,h=-h):(h=Math.pow(10,i)*u,c=Math.round(e/h),f=Math.round(t/h),c*ht&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const c=o-i+1,f=new Array(c);if(n)if(u<0)for(let h=0;h=n)&&(r=n);return r}function u2(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function lC(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?sC:GB(i);n>r;){if(n-r>600){const f=n-r+1,h=t-r+1,m=Math.log(f),g=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*g*(f-g)/f)*(h-f/2<0?-1:1),b=Math.max(r,Math.floor(t-h*g/f+v)),j=Math.min(n,Math.floor(t+(f-h)*g/f+v));lC(e,t,b,j,i)}const o=e[t];let u=r,c=n;for(tu(e,r,t),i(e[n],o)>0&&tu(e,r,n);u0;)--c}i(e[r],o)===0?tu(e,r,c):(++c,tu(e,c,n)),c<=t&&(r=c+1),t<=c&&(n=c-1)}return e}function tu(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function YB(e,t,r){if(e=Float64Array.from(BB(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return u2(e);if(t>=1)return l2(e);var n,i=(n-1)*t,o=Math.floor(i),u=l2(lC(e,o).subarray(0,o+1)),c=u2(e.subarray(o+1));return u+(c-u)*(i-o)}}function XB(e,t,r=oC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),u=+r(e[o],o,e),c=+r(e[o+1],o+1,e);return u+(c-u)*(i-o)}}function ZB(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?$d(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?$d(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=t9.exec(e))?new Nr(t[1],t[2],t[3],1):(t=r9.exec(e))?new Nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n9.exec(e))?$d(t[1],t[2],t[3],t[4]):(t=i9.exec(e))?$d(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=a9.exec(e))?g2(t[1],t[2]/100,t[3]/100,1):(t=o9.exec(e))?g2(t[1],t[2]/100,t[3]/100,t[4]):c2.hasOwnProperty(e)?h2(c2[e]):e==="transparent"?new Nr(NaN,NaN,NaN,0):null}function h2(e){return new Nr(e>>16&255,e>>8&255,e&255,1)}function $d(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nr(e,t,r,n)}function u9(e){return e instanceof tc||(e=Iu(e)),e?(e=e.rgb(),new Nr(e.r,e.g,e.b,e.opacity)):new Nr}function n0(e,t,r,n){return arguments.length===1?u9(e):new Nr(e,t,r,n??1)}function Nr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}vy(Nr,n0,cC(tc,{brighter(e){return e=e==null?Lf:Math.pow(Lf,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_u:Math.pow(_u,e),new Nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nr(co(this.r),co(this.g),co(this.b),$f(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:m2,formatHex:m2,formatHex8:c9,formatRgb:p2,toString:p2}));function m2(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}`}function c9(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}${Qa((isNaN(this.opacity)?1:this.opacity)*255)}`}function p2(){const e=$f(this.opacity);return`${e===1?"rgb(":"rgba("}${co(this.r)}, ${co(this.g)}, ${co(this.b)}${e===1?")":`, ${e})`}`}function $f(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function co(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qa(e){return e=co(e),(e<16?"0":"")+e.toString(16)}function g2(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new yn(e,t,r,n)}function dC(e){if(e instanceof yn)return new yn(e.h,e.s,e.l,e.opacity);if(e instanceof tc||(e=Iu(e)),!e)return new yn;if(e instanceof yn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),u=NaN,c=o-i,f=(o+i)/2;return c?(t===o?u=(r-n)/c+(r0&&f<1?0:u,new yn(u,c,f,e.opacity)}function d9(e,t,r,n){return arguments.length===1?dC(e):new yn(e,t,r,n??1)}function yn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}vy(yn,d9,cC(tc,{brighter(e){return e=e==null?Lf:Math.pow(Lf,e),new yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_u:Math.pow(_u,e),new yn(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Nr(_g(e>=240?e-240:e+120,i,n),_g(e,i,n),_g(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new yn(v2(this.h),zd(this.s),zd(this.l),$f(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(){const e=$f(this.opacity);return`${e===1?"hsl(":"hsla("}${v2(this.h)}, ${zd(this.s)*100}%, ${zd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function v2(e){return e=(e||0)%360,e<0?e+360:e}function zd(e){return Math.max(0,Math.min(1,e||0))}function _g(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const yy=e=>()=>e;function f9(e,t){return function(r){return e+r*t}}function h9(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function m9(e){return(e=+e)==1?fC:function(t,r){return r-t?h9(t,r,e):yy(isNaN(t)?r:t)}}function fC(e,t){var r=t-e;return r?f9(e,r):yy(isNaN(e)?t:e)}const y2=(function e(t){var r=m9(t);function n(i,o){var u=r((i=n0(i)).r,(o=n0(o)).r),c=r(i.g,o.g),f=r(i.b,o.b),h=fC(i.opacity,o.opacity);return function(m){return i.r=u(m),i.g=c(m),i.b=f(m),i.opacity=h(m),i+""}}return n.gamma=e,n})(1);function p9(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),c[u]?c[u]+=o:c[++u]=o),(n=n[0])===(i=i[0])?c[u]?c[u]+=i:c[++u]=i:(c[++u]=null,f.push({i:u,x:zf(n,i)})),r=Mg.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function E9(e,t,r){var n=e[0],i=e[1],o=t[0],u=t[1];return i2?A9:E9,f=h=null,g}function g(v){return v==null||isNaN(v=+v)?o:(f||(f=c(e.map(n),t,r)))(n(u(v)))}return g.invert=function(v){return u(i((h||(h=c(t,e.map(n),zf)))(v)))},g.domain=function(v){return arguments.length?(e=Array.from(v,Ff),m()):e.slice()},g.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},g.rangeRound=function(v){return t=Array.from(v),r=xy,m()},g.clamp=function(v){return arguments.length?(u=v?!0:hr,m()):u!==hr},g.interpolate=function(v){return arguments.length?(r=v,m()):r},g.unknown=function(v){return arguments.length?(o=v,g):o},function(v,b){return n=v,i=b,m()}}function by(){return qh()(hr,hr)}function C9(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bf(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Fs(e){return e=Bf(Math.abs(e)),e?e[1]:NaN}function P9(e,t){return function(r,n){for(var i=r.length,o=[],u=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>n&&(c=Math.max(1,n-f)),o.push(r.substring(i-=c,i+c)),!((f+=c+1)>n));)c=e[u=(u+1)%e.length];return o.reverse().join(t)}}function O9(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var _9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Tu(e){if(!(t=_9.exec(e)))throw new Error("invalid format: "+e);var t;return new wy({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]})}Tu.prototype=wy.prototype;function wy(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+""}wy.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 M9(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Uf;function I9(e,t){var r=Bf(e,t);if(!r)return Uf=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(Uf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,u=n.length;return o===u?n:o>u?n+new Array(o-u+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Bf(e,Math.max(0,t+o-1))[0]}function b2(e,t){var r=Bf(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const w2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:C9,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)=>b2(e*100,t),r:b2,s:I9,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function k2(e){return e}var j2=Array.prototype.map,S2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function T9(e){var t=e.grouping===void 0||e.thousands===void 0?k2:P9(j2.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?k2:O9(j2.call(e.numerals,String)),u=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(g,v){g=Tu(g);var b=g.fill,j=g.align,k=g.sign,S=g.symbol,N=g.zero,E=g.width,A=g.comma,P=g.precision,_=g.trim,O=g.type;O==="n"?(A=!0,O="g"):w2[O]||(P===void 0&&(P=12),_=!0,O="g"),(N||b==="0"&&j==="=")&&(N=!0,b="0",j="=");var T=(v&&v.prefix!==void 0?v.prefix:"")+(S==="$"?r:S==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),B=(S==="$"?n:/[%p]/.test(O)?u:"")+(v&&v.suffix!==void 0?v.suffix:""),$=w2[O],z=/[defgprs%]/.test(O);P=P===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function Q(U){var ve=T,ue=B,pe,oe,se;if(O==="c")ue=$(U)+ue,U="";else{U=+U;var X=U<0||1/U<0;if(U=isNaN(U)?f:$(Math.abs(U),P),_&&(U=M9(U)),X&&+U==0&&k!=="+"&&(X=!1),ve=(X?k==="("?k:c:k==="-"||k==="("?"":k)+ve,ue=(O==="s"&&!isNaN(U)&&Uf!==void 0?S2[8+Uf/3]:"")+ue+(X&&k==="("?")":""),z){for(pe=-1,oe=U.length;++pese||se>57){ue=(se===46?i+U.slice(pe+1):U.slice(pe))+ue,U=U.slice(0,pe);break}}}A&&!N&&(U=t(U,1/0));var ne=ve.length+U.length+ue.length,te=ne>1)+ve+U+ue+te.slice(ne);break;default:U=te+ve+U+ue;break}return o(U)}return Q.toString=function(){return g+""},Q}function m(g,v){var b=Math.max(-8,Math.min(8,Math.floor(Fs(v)/3)))*3,j=Math.pow(10,-b),k=h((g=Tu(g),g.type="f",g),{suffix:S2[8+b/3]});return function(S){return k(j*S)}}return{format:h,formatPrefix:m}}var Fd,ky,hC;D9({thousands:",",grouping:[3],currency:["$",""]});function D9(e){return Fd=T9(e),ky=Fd.format,hC=Fd.formatPrefix,Fd}function R9(e){return Math.max(0,-Fs(Math.abs(e)))}function L9(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fs(t)/3)))*3-Fs(Math.abs(e)))}function $9(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fs(t)-Fs(e))+1}function mC(e,t,r,n){var i=t0(e,t,r),o;switch(n=Tu(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=L9(i,u))&&(n.precision=o),hC(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=$9(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=R9(i))&&(n.precision=o-(n.type==="%")*2);break}}return ky(n)}function wa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Jv(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return mC(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,u=n[i],c=n[o],f,h,m=10;for(c0;){if(h=e0(u,c,r),h===f)return n[i]=u,n[o]=c,t(n);if(h>0)u=Math.floor(u/h)*h,c=Math.ceil(c/h)*h;else if(h<0)u=Math.ceil(u*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function pC(){var e=by();return e.copy=function(){return rc(e,pC())},an.apply(e,arguments),wa(e)}function gC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Ff),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gC(e).unknown(t)},e=arguments.length?Array.from(e,Ff):[0,1],wa(r)}function vC(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],u;return oMath.pow(e,t)}function H9(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 A2(e){return(t,r)=>-e(-t,r)}function jy(e){const t=e(N2,E2),r=t.domain;let n=10,i,o;function u(){return i=H9(n),o=U9(n),r()[0]<0?(i=A2(i),o=A2(o),e(z9,F9)):e(N2,E2),t}return t.base=function(c){return arguments.length?(n=+c,u()):n},t.domain=function(c){return arguments.length?(r(c),u()):r()},t.ticks=c=>{const f=r();let h=f[0],m=f[f.length-1];const g=m0){for(;v<=b;++v)for(j=1;jm)break;N.push(k)}}else for(;v<=b;++v)for(j=n-1;j>=1;--j)if(k=v>0?j/o(-v):j*o(v),!(km)break;N.push(k)}N.length*2{if(c==null&&(c=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Tu(f)).precision==null&&(f.trim=!0),f=ky(f)),c===1/0)return f;const h=Math.max(1,n*c/t.ticks().length);return m=>{let g=m/o(Math.round(i(m)));return g*nr(vC(r(),{floor:c=>o(Math.floor(i(c))),ceil:c=>o(Math.ceil(i(c)))})),t}function yC(){const e=jy(qh()).domain([1,10]);return e.copy=()=>rc(e,yC()).base(e.base()),an.apply(e,arguments),e}function C2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function P2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Sy(e){var t=1,r=e(C2(t),P2(t));return r.constant=function(n){return arguments.length?e(C2(t=+n),P2(t)):t},wa(r)}function xC(){var e=Sy(qh());return e.copy=function(){return rc(e,xC()).constant(e.constant())},an.apply(e,arguments)}function O2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function W9(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function K9(e){return e<0?-e*e:e*e}function Ny(e){var t=e(hr,hr),r=1;function n(){return r===1?e(hr,hr):r===.5?e(W9,K9):e(O2(r),O2(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},wa(t)}function Ey(){var e=Ny(qh());return e.copy=function(){return rc(e,Ey()).exponent(e.exponent())},an.apply(e,arguments),e}function G9(){return Ey.apply(null,arguments).exponent(.5)}function _2(e){return Math.sign(e)*e*e}function V9(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function bC(){var e=by(),t=[0,1],r=!1,n;function i(o){var u=V9(e(o));return isNaN(u)?n:r?Math.round(u):u}return i.invert=function(o){return e.invert(_2(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Ff)).map(_2)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return bC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},an.apply(i,arguments),wa(i)}function wC(){var e=[],t=[],r=[],n;function i(){var u=0,c=Math.max(1,t.length);for(r=new Array(c-1);++u0?r[c-1]:e[0],c=r?[n[r-1],t]:[n[h-1],n[h]]},u.unknown=function(f){return arguments.length&&(o=f),u},u.thresholds=function(){return n.slice()},u.copy=function(){return kC().domain([e,t]).range(i).unknown(o)},an.apply(wa(u),arguments)}function jC(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[ec(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var u=t.indexOf(o);return[e[u-1],e[u]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return jC().domain(e).range(t).unknown(r)},an.apply(i,arguments)}const Ig=new Date,Tg=new Date;function Ot(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const u=i(o),c=i.ceil(o);return o-u(t(o=new Date(+o),u==null?1:Math.floor(u)),o),i.range=(o,u,c)=>{const f=[];if(o=i.ceil(o),c=c==null?1:Math.floor(c),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,c),e(o);while(hOt(u=>{if(u>=u)for(;e(u),!o(u);)u.setTime(u-1)},(u,c)=>{if(u>=u)if(c<0)for(;++c<=0;)for(;t(u,-1),!o(u););else for(;--c>=0;)for(;t(u,1),!o(u););}),r&&(i.count=(o,u)=>(Ig.setTime(+o),Tg.setTime(+u),e(Ig),e(Tg),Math.floor(r(Ig,Tg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?u=>n(u)%o===0:u=>i.count(0,u)%o===0):i)),i}const Hf=Ot(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ot(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Hf);Hf.range;const ci=1e3,Zr=ci*60,di=Zr*60,yi=di*24,Ay=yi*7,M2=yi*30,Dg=yi*365,Ya=Ot(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ci)},(e,t)=>(t-e)/ci,e=>e.getUTCSeconds());Ya.range;const Cy=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ci)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getMinutes());Cy.range;const Py=Ot(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCMinutes());Py.range;const Oy=Ot(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ci-e.getMinutes()*Zr)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getHours());Oy.range;const _y=Ot(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getUTCHours());_y.range;const nc=Ot(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zr)/yi,e=>e.getDate()-1);nc.range;const Qh=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>e.getUTCDate()-1);Qh.range;const SC=Ot(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yi,e=>Math.floor(e/yi));SC.range;function So(e){return Ot(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Zr)/Ay)}const Yh=So(0),Wf=So(1),q9=So(2),Q9=So(3),Bs=So(4),Y9=So(5),X9=So(6);Yh.range;Wf.range;q9.range;Q9.range;Bs.range;Y9.range;X9.range;function No(e){return Ot(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Ay)}const Xh=No(0),Kf=No(1),Z9=No(2),J9=No(3),Us=No(4),e7=No(5),t7=No(6);Xh.range;Kf.range;Z9.range;J9.range;Us.range;e7.range;t7.range;const My=Ot(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());My.range;const Iy=Ot(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());Iy.range;const xi=Ot(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());xi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});xi.range;const bi=Ot(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());bi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ot(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});bi.range;function NC(e,t,r,n,i,o){const u=[[Ya,1,ci],[Ya,5,5*ci],[Ya,15,15*ci],[Ya,30,30*ci],[o,1,Zr],[o,5,5*Zr],[o,15,15*Zr],[o,30,30*Zr],[i,1,di],[i,3,3*di],[i,6,6*di],[i,12,12*di],[n,1,yi],[n,2,2*yi],[r,1,Ay],[t,1,M2],[t,3,3*M2],[e,1,Dg]];function c(h,m,g){const v=mS).right(u,v);if(b===u.length)return e.every(t0(h/Dg,m/Dg,g));if(b===0)return Hf.every(Math.max(t0(h,m,g),1));const[j,k]=u[v/u[b-1][2]53)return null;"w"in de||(de.w=1),"Z"in de?(Ue=Lg(ru(de.y,0,1)),_e=Ue.getUTCDay(),Ue=_e>4||_e===0?Kf.ceil(Ue):Kf(Ue),Ue=Qh.offset(Ue,(de.V-1)*7),de.y=Ue.getUTCFullYear(),de.m=Ue.getUTCMonth(),de.d=Ue.getUTCDate()+(de.w+6)%7):(Ue=Rg(ru(de.y,0,1)),_e=Ue.getDay(),Ue=_e>4||_e===0?Wf.ceil(Ue):Wf(Ue),Ue=nc.offset(Ue,(de.V-1)*7),de.y=Ue.getFullYear(),de.m=Ue.getMonth(),de.d=Ue.getDate()+(de.w+6)%7)}else("W"in de||"U"in de)&&("w"in de||(de.w="u"in de?de.u%7:"W"in de?1:0),_e="Z"in de?Lg(ru(de.y,0,1)).getUTCDay():Rg(ru(de.y,0,1)).getDay(),de.m=0,de.d="W"in de?(de.w+6)%7+de.W*7-(_e+5)%7:de.w+de.U*7-(_e+6)%7);return"Z"in de?(de.H+=de.Z/100|0,de.M+=de.Z%100,Lg(de)):Rg(de)}}function B(re,ye,Oe,de){for(var Ze=0,Ue=ye.length,_e=Oe.length,xt,Jt;Ze=_e)return-1;if(xt=ye.charCodeAt(Ze++),xt===37){if(xt=ye.charAt(Ze++),Jt=_[xt in I2?ye.charAt(Ze++):xt],!Jt||(de=Jt(re,Oe,de))<0)return-1}else if(xt!=Oe.charCodeAt(de++))return-1}return de}function $(re,ye,Oe){var de=h.exec(ye.slice(Oe));return de?(re.p=m.get(de[0].toLowerCase()),Oe+de[0].length):-1}function z(re,ye,Oe){var de=b.exec(ye.slice(Oe));return de?(re.w=j.get(de[0].toLowerCase()),Oe+de[0].length):-1}function Q(re,ye,Oe){var de=g.exec(ye.slice(Oe));return de?(re.w=v.get(de[0].toLowerCase()),Oe+de[0].length):-1}function U(re,ye,Oe){var de=N.exec(ye.slice(Oe));return de?(re.m=E.get(de[0].toLowerCase()),Oe+de[0].length):-1}function ve(re,ye,Oe){var de=k.exec(ye.slice(Oe));return de?(re.m=S.get(de[0].toLowerCase()),Oe+de[0].length):-1}function ue(re,ye,Oe){return B(re,t,ye,Oe)}function pe(re,ye,Oe){return B(re,r,ye,Oe)}function oe(re,ye,Oe){return B(re,n,ye,Oe)}function se(re){return u[re.getDay()]}function X(re){return o[re.getDay()]}function ne(re){return f[re.getMonth()]}function te(re){return c[re.getMonth()]}function I(re){return i[+(re.getHours()>=12)]}function M(re){return 1+~~(re.getMonth()/3)}function H(re){return u[re.getUTCDay()]}function ie(re){return o[re.getUTCDay()]}function J(re){return f[re.getUTCMonth()]}function Z(re){return c[re.getUTCMonth()]}function ae(re){return i[+(re.getUTCHours()>=12)]}function me(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ye=O(re+="",A);return ye.toString=function(){return re},ye},parse:function(re){var ye=T(re+="",!1);return ye.toString=function(){return re},ye},utcFormat:function(re){var ye=O(re+="",P);return ye.toString=function(){return re},ye},utcParse:function(re){var ye=T(re+="",!0);return ye.toString=function(){return re},ye}}}var I2={"-":"",_:" ",0:"0"},Ft=/^\s*\d+/,s7=/^%/,l7=/[\\^$*+?|[\]().{}]/g;function Ye(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function c7(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function d7(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function f7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function h7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function m7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function T2(e,t,r){var n=Ft.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function D2(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function p7(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function g7(e,t,r){var n=Ft.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function v7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function R2(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function y7(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function L2(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function x7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function b7(e,t,r){var n=Ft.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function w7(e,t,r){var n=Ft.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function k7(e,t,r){var n=Ft.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function j7(e,t,r){var n=s7.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function S7(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function N7(e,t,r){var n=Ft.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function $2(e,t){return Ye(e.getDate(),t,2)}function E7(e,t){return Ye(e.getHours(),t,2)}function A7(e,t){return Ye(e.getHours()%12||12,t,2)}function C7(e,t){return Ye(1+nc.count(xi(e),e),t,3)}function EC(e,t){return Ye(e.getMilliseconds(),t,3)}function P7(e,t){return EC(e,t)+"000"}function O7(e,t){return Ye(e.getMonth()+1,t,2)}function _7(e,t){return Ye(e.getMinutes(),t,2)}function M7(e,t){return Ye(e.getSeconds(),t,2)}function I7(e){var t=e.getDay();return t===0?7:t}function T7(e,t){return Ye(Yh.count(xi(e)-1,e),t,2)}function AC(e){var t=e.getDay();return t>=4||t===0?Bs(e):Bs.ceil(e)}function D7(e,t){return e=AC(e),Ye(Bs.count(xi(e),e)+(xi(e).getDay()===4),t,2)}function R7(e){return e.getDay()}function L7(e,t){return Ye(Wf.count(xi(e)-1,e),t,2)}function $7(e,t){return Ye(e.getFullYear()%100,t,2)}function z7(e,t){return e=AC(e),Ye(e.getFullYear()%100,t,2)}function F7(e,t){return Ye(e.getFullYear()%1e4,t,4)}function B7(e,t){var r=e.getDay();return e=r>=4||r===0?Bs(e):Bs.ceil(e),Ye(e.getFullYear()%1e4,t,4)}function U7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ye(t/60|0,"0",2)+Ye(t%60,"0",2)}function z2(e,t){return Ye(e.getUTCDate(),t,2)}function H7(e,t){return Ye(e.getUTCHours(),t,2)}function W7(e,t){return Ye(e.getUTCHours()%12||12,t,2)}function K7(e,t){return Ye(1+Qh.count(bi(e),e),t,3)}function CC(e,t){return Ye(e.getUTCMilliseconds(),t,3)}function G7(e,t){return CC(e,t)+"000"}function V7(e,t){return Ye(e.getUTCMonth()+1,t,2)}function q7(e,t){return Ye(e.getUTCMinutes(),t,2)}function Q7(e,t){return Ye(e.getUTCSeconds(),t,2)}function Y7(e){var t=e.getUTCDay();return t===0?7:t}function X7(e,t){return Ye(Xh.count(bi(e)-1,e),t,2)}function PC(e){var t=e.getUTCDay();return t>=4||t===0?Us(e):Us.ceil(e)}function Z7(e,t){return e=PC(e),Ye(Us.count(bi(e),e)+(bi(e).getUTCDay()===4),t,2)}function J7(e){return e.getUTCDay()}function eU(e,t){return Ye(Kf.count(bi(e)-1,e),t,2)}function tU(e,t){return Ye(e.getUTCFullYear()%100,t,2)}function rU(e,t){return e=PC(e),Ye(e.getUTCFullYear()%100,t,2)}function nU(e,t){return Ye(e.getUTCFullYear()%1e4,t,4)}function iU(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Us(e):Us.ceil(e),Ye(e.getUTCFullYear()%1e4,t,4)}function aU(){return"+0000"}function F2(){return"%"}function B2(e){return+e}function U2(e){return Math.floor(+e/1e3)}var is,OC,_C;oU({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 oU(e){return is=o7(e),OC=is.format,is.parse,_C=is.utcFormat,is.utcParse,is}function sU(e){return new Date(e)}function lU(e){return e instanceof Date?+e:+new Date(+e)}function Ty(e,t,r,n,i,o,u,c,f,h){var m=by(),g=m.invert,v=m.domain,b=h(".%L"),j=h(":%S"),k=h("%I:%M"),S=h("%I %p"),N=h("%a %d"),E=h("%b %d"),A=h("%B"),P=h("%Y");function _(O){return(f(O)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>YB(e,o/n))},r.copy=function(){return DC(t).domain(e)},Si.apply(r,arguments)}function Jh(){var e=0,t=.5,r=1,n=1,i,o,u,c,f,h=hr,m,g=!1,v;function b(k){return isNaN(k=+k)?v:(k=.5+((k=+m(k))-o)*(n*k{if(e!=null){var n=e.scale,i=e.type;if(n==="auto")return i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof n=="string")return pU(n)?n:"point"}};function gU(e,t){for(var r=0,n=e.length,i=e[0]t)?r=o+1:n=o}return r}function BC(e,t){if(e){var r=t??e.domain(),n=r.map(o=>{var u;return(u=e(o))!==null&&u!==void 0?u:0}),i=e.range();if(!(r.length===0||i.length<2))return o=>{var u,c,f=gU(n,o);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var h=(u=n[f-1])!==null&&u!==void 0?u:0,m=(c=n[f])!==null&&c!==void 0?c:0;return Math.abs(o-h)<=Math.abs(o-m)?r[f-1]:r[f]}}}function vU(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):BC(e,void 0)}function W2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],Ni=(e,t)=>{var r=HC(e,t);return r??Ct},Pt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:o0,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:Qu},WC=(e,t)=>e.cartesianAxis.yAxis[t],Ei=(e,t)=>{var r=WC(e,t);return r??Pt},NU={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:""},$y=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??NU},pr=(e,t,r)=>{switch(t){case"xAxis":return Ni(e,r);case"yAxis":return Ei(e,r);case"zAxis":return $y(e,r);case"angleAxis":return ly(e,r);case"radiusAxis":return uy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},EU=(e,t,r)=>{switch(t){case"xAxis":return Ni(e,r);case"yAxis":return Ei(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},ic=(e,t,r)=>{switch(t){case"xAxis":return Ni(e,r);case"yAxis":return Ei(e,r);case"angleAxis":return ly(e,r);case"radiusAxis":return uy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},KC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function GC(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var VC=e=>e.graphicalItems.cartesianItems,AU=q([$t,Kh],GC),qC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),rl=q([VC,pr,AU],qC,{memoizeOptions:{resultEqualityCheck:Vh}}),QC=q([rl],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(fy)),YC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),CU=q([rl],YC),XC=e=>e.map(t=>t.data).filter(Boolean).flat(1),PU=q([rl],e=>e.some(t=>!t.data)),ZC=q([rl],XC,{memoizeOptions:{resultEqualityCheck:Vh}}),JC=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,o=t.dataEndIndex;return e.length>0?e:n.slice(i,o+1)},zy=q([ZC,Fh],JC),OU=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Lt(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:Lt(i,n)}))):e.map(n=>({value:n})),eP=(e,t,r,n,i,o)=>{var u=n.chartData,c=u===void 0?[]:u,f=n.dataStartIndex,h=n.dataEndIndex,m=OU(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var g=c.slice(f,h+1),v=g.map(b=>({value:Lt(b,t.dataKey)})).filter(b=>b.value!=null);return[...v,...m]}return m},ac=q([zy,pr,rl,Fh,PU,ZC],eP);function bs(e){if(Bn(e)||e instanceof Date){var t=Number(e);if(We(t))return t}}function G2(e){if(Array.isArray(e)){var t=[bs(e[0]),bs(e[1])];return $n(t)?t:void 0}var r=bs(e);if(r!=null)return[r,r]}function Wn(e){return e.map(bs).filter(Sr)}function _U(e,t){var r=bs(e),n=bs(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var MU=q([ac],e=>e==null?void 0:e.map(t=>t.value).sort(_U));function tP(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function IU(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Fn(t))n=t;else if(Array.isArray(t)){var i=Wn(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:Wn(r.flatMap(o=>{var u=Lt(e,o.dataKey),c,f;if(Array.isArray(u)){var h=UC(u,2);c=h[0],f=h[1]}else c=f=u;if(!(!We(c)||!We(f)))return[n-c,n+f]}))}var _t=e=>{var t=zt(e),r=el(e);return ic(e,t,r)},Hs=q([_t],e=>e==null?void 0:e.dataKey),TU=q([QC,Fh,_t],aC),rP=(e,t,r,n)=>{var i={},o=t.reduce((u,c)=>{if(c.stackId==null)return u;var f=u[c.stackId];return f==null&&(f=[]),f.push(c),u[c.stackId]=f,u},i);return Object.fromEntries(Object.entries(o).map(u=>{var c=UC(u,2),f=c[0],h=c[1],m=n?[...h].reverse():h,g=m.map(dy);return[f,{stackedData:Zz(e,g,r),graphicalItems:m}]}))},nP=q([TU,QC,Bh,ZA],rP),iP=(e,t,r,n)=>{var i=t.dataStartIndex,o=t.dataEndIndex;if(n==null&&r!=="zAxis")return r6(e,i,o)},DU=q([pr],e=>e.allowDataOverflow),Fy=e=>{var t;if(e==null||!("domain"in e))return o0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Wn(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:o0},aP=q([pr],Fy),oP=q([aP,DU],BA),RU=q([nP,kn,$t,oP],iP,{memoizeOptions:{resultEqualityCheck:Gh}}),By=e=>e.errorBars,LU=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>tP(r,n)),Vf=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],c,f;if(n.length>0&&n.forEach(h=>{var m,g=h.data!=null?[...h.data]:u,v=(m=i[h.id])===null||m===void 0?void 0:m.filter(b=>tP(o,b));g.forEach(b=>{var j,k=Lt(b,(j=r.dataKey)!==null&&j!==void 0?j:h.dataKey),S=IU(b,k,v);if(S.length>=2){var N=Math.min(...S),E=Math.max(...S);(c==null||Nf)&&(f=E)}var A=G2(k);A!=null&&(c=c==null?A[0]:Math.min(c,A[0]),f=f==null?A[1]:Math.max(f,A[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(h=>{var m=G2(Lt(h,r.dataKey));m!=null&&(c=c==null?m[0]:Math.min(c,m[0]),f=f==null?m[1]:Math.max(f,m[1]))}),We(c)&&We(f))return[c,f]},$U=q([zy,pr,CU,By,$t,mB],sP,{memoizeOptions:{resultEqualityCheck:Gh}});function zU(e){var t=e.value;if(Bn(t)||t instanceof Date)return t}var FU=(e,t,r)=>{var n=e.map(zU).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&yE(n))?FA(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},lP=e=>e.referenceElements.dots,nl=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),BU=q([lP,$t,Kh],nl),uP=e=>e.referenceElements.areas,UU=q([uP,$t,Kh],nl),cP=e=>e.referenceElements.lines,HU=q([cP,$t,Kh],nl),dP=(e,t)=>{if(e!=null){var r=Wn(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},WU=q(BU,$t,dP),fP=(e,t)=>{if(e!=null){var r=Wn(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},KU=q([UU,$t],fP);function GU(e){var t;if(e.x!=null)return Wn([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Wn(r)}function VU(e){var t;if(e.y!=null)return Wn([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Wn(r)}var hP=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?GU(n):VU(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},qU=q([HU,$t],hP),QU=q(WU,qU,KU,(e,t,r)=>Vf(e,r,t)),mP=(e,t,r,n,i,o,u,c)=>{if(r!=null)return r;var f=u==="vertical"&&c==="xAxis"||u==="horizontal"&&c==="yAxis",h=f?Vf(n,o,i):Vf(o,i);return bB(t,h,e.allowDataOverflow)},YU=q([pr,aP,oP,RU,$U,QU,ft,$t],mP,{memoizeOptions:{resultEqualityCheck:Gh}}),XU=[0,1],pP=(e,t,r,n,i,o,u)=>{if(!((e==null||r==null||r.length===0)&&u===void 0)){var c=e.dataKey,f=e.type,h=Gn(t,o);if(h&&c==null){var m;return FA(0,(m=r==null?void 0:r.length)!==null&&m!==void 0?m:0)}return f==="category"?FU(n,e,h):i==="expand"&&!h?XU:u}},Uy=q([pr,ft,zy,ac,Bh,$t,YU],pP),il=q([pr,KC,ay],FC),gP=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=Fy(t),o=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&$n(e)){if(o)return t2(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return r2(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(o&&$n(e))return t2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&$n(e))return r2(e,t.tickCount,t.allowDecimals,"adaptive")}}},Hy=q([Uy,ic,il],gP),vP=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&$n(t)&&Array.isArray(r)&&r.length>0){var i,o,u=t[0],c=(i=r[0])!==null&&i!==void 0?i:0,f=t[1],h=(o=r[r.length-1])!==null&&o!==void 0?o:0;return[Math.min(u,c),Math.max(f,h)]}return t},ZU=q([pr,Uy,Hy,$t],vP),JU=q(ac,pr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Wn(e.map(g=>g.value))).sort((g,v)=>g-v),i=n[0],o=n[n.length-1];if(i==null||o==null)return 1/0;var u=o-i;if(u===0)return 1/0;for(var c=0;ci,(e,t,r,n,i)=>{if(!We(e))return 0;var o=t==="vertical"?n.height:n.width;if(i==="gap")return e*o/2;if(i==="no-gap"){var u=ya(r,e*o),c=e*o/2;return c-u-(c-u)/o*u}return 0}),eH=(e,t,r)=>{var n=Ni(e,t);return n==null||typeof n.padding!="string"?0:yP(e,"xAxis",t,r,n.padding)},tH=(e,t,r)=>{var n=Ei(e,t);return n==null||typeof n.padding!="string"?0:yP(e,"yAxis",t,r,n.padding)},rH=q(Ni,eH,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),nH=q(Ei,tH,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),xP=q([Zt,rH,Th,Ih,(e,t,r)=>r],(e,t,r,n,i)=>{var o=n.padding;return i?[o.left,r.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),bP=q([Zt,ft,nH,Th,Ih,(e,t,r)=>r],(e,t,r,n,i,o)=>{var u=i.padding;return o?[n.height-u.bottom,u.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),oc=(e,t,r,n)=>{var i;switch(t){case"xAxis":return xP(e,r,n);case"yAxis":return bP(e,r,n);case"zAxis":return(i=$y(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return rC(e);case"radiusAxis":return nC(e,r);default:return}},wP=q([pr,oc],Uh),iH=q([il,ZU],$B),Wy=q([pr,il,iH,wP],Ly),kP=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,o=r.scale,u=Gn(e,n);if(u&&(i==="number"||o!=="auto"))return t.map(c=>c.value)}},Ky=q([ft,ac,ic,$t],kP),em=q([Wy],hy);q([Wy],vU);q([Wy,MU],BC);q([rl,By,$t],LU);function jP(e,t){return e.idt.id?1:0}var tm=(e,t)=>t,rm=(e,t,r)=>r,aH=q(_h,tm,rm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(jP)),oH=q(Mh,tm,rm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(jP)),SP=(e,t)=>({width:e.width,height:t.height}),sH=(e,t)=>{var r=typeof t.width=="number"?t.width:Qu;return{width:r,height:e.height}},lH=q(Zt,Ni,SP),uH=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},cH=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},dH=q(ji,Zt,aH,tm,rm,(e,t,r,n,i)=>{var o={},u;return r.forEach(c=>{var f=SP(t,c);u==null&&(u=uH(t,n,e));var h=n==="top"&&!i||n==="bottom"&&i;o[c.id]=u-Number(h)*f.height,u+=(h?-1:1)*f.height}),o}),fH=q(ki,Zt,oH,tm,rm,(e,t,r,n,i)=>{var o={},u;return r.forEach(c=>{var f=sH(t,c);u==null&&(u=cH(t,n,e));var h=n==="left"&&!i||n==="right"&&i;o[c.id]=u-Number(h)*f.width,u+=(h?-1:1)*f.width}),o}),hH=(e,t)=>{var r=Ni(e,t);if(r!=null)return dH(e,r.orientation,r.mirror)},mH=q([Zt,Ni,hH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),pH=(e,t)=>{var r=Ei(e,t);if(r!=null)return fH(e,r.orientation,r.mirror)},gH=q([Zt,Ei,pH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),vH=q(Zt,Ei,(e,t)=>{var r=typeof t.width=="number"?t.width:Qu;return{width:r,height:e.height}}),NP=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,o=r.type,u=r.dataKey,c=Gn(e,n),f=t.map(m=>m.value),h=f.filter(m=>m!=null);if(u&&c&&o==="category"&&i&&yE(h))return f}},Gy=q([ft,ac,pr,$t],NP),V2=q([ft,EU,il,em,Gy,Ky,oc,Hy,$t],(e,t,r,n,i,o,u,c,f)=>{if(t!=null){var h=Gn(e,f);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:f,categoricalDomain:o,duplicateDomain:i,isCategorical:h,niceTicks:c,range:u,realScaleType:r,scale:n}}}),yH=(e,t,r,n,i,o,u,c,f)=>{if(!(t==null||n==null)){var h=Gn(e,f),m=t.type,g=t.ticks,v=t.tickCount,b=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,j=m==="category"&&n.bandwidth?n.bandwidth()/b:0;j=f==="angleAxis"&&o!=null&&o.length>=2?Yr(o[0]-o[1])*2*j:j;var k=g||i;return k?k.map((S,N)=>{var E=u?u.indexOf(S):S,A=n.map(E);return We(A)?{index:N,coordinate:A+j,value:S,offset:j}:null}).filter(Sr):h&&c?c.map((S,N)=>{var E=n.map(S);return We(E)?{coordinate:E+j,value:S,index:N,offset:j}:null}).filter(Sr):n.ticks?n.ticks(v).map((S,N)=>{var E=n.map(S);return We(E)?{coordinate:E+j,value:S,index:N,offset:j}:null}).filter(Sr):n.domain().map((S,N)=>{var E=n.map(S);return We(E)?{coordinate:E+j,value:u?u[S]:S,index:N,offset:j}:null}).filter(Sr)}},EP=q([ft,ic,il,em,Hy,oc,Gy,Ky,$t],yH),xH=(e,t,r,n,i,o,u)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var c=Gn(e,u),f=t.tickCount,h=0;return h=u==="angleAxis"&&(n==null?void 0:n.length)>=2?Yr(n[0]-n[1])*2*h:h,c&&o?o.map((m,g)=>{var v=r.map(m);return We(v)?{coordinate:v+h,value:m,index:g,offset:h}:null}).filter(Sr):r.ticks?r.ticks(f).map((m,g)=>{var v=r.map(m);return We(v)?{coordinate:v+h,value:m,index:g,offset:h}:null}).filter(Sr):r.domain().map((m,g)=>{var v=r.map(m);return We(v)?{coordinate:v+h,value:i?i[m]:m,index:g,offset:h}:null}).filter(Sr)}},AP=q([ft,ic,em,oc,Gy,Ky,$t],xH),CP=q(pr,em,(e,t)=>{if(!(e==null||t==null))return Gf(Gf({},e),{},{scale:t})}),bH=q([pr,il,Uy,wP],Ly),wH=q([bH],hy);q((e,t,r)=>$y(e,r),wH,(e,t)=>{if(!(e==null||t==null))return Gf(Gf({},e),{},{scale:t})});var kH=q([ft,_h,Mh],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),jH=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};q([jH],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var o of e){var u=Math.abs(o.coordinate-t);ue.options.defaultTooltipEventType,OP=e=>e.options.validateTooltipEventTypes;function _P(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function sc(e,t){var r=PP(e),n=OP(e);return _P(t,r,n)}function SH(e){return Me(t=>sc(t,e))}var MP=(e,t)=>{var r,n=Number(t);if(!(Fn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},NH=e=>e.tooltip.settings,ta={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},EH={itemInteraction:{click:ta,hover:ta},axisInteraction:{click:ta,hover:ta},keyboardInteraction:ta,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}},IP=lr({name:"tooltip",initialState:EH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:st()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=i)},prepare:st()},removeTooltipEntrySettings:{reducer(e,t){var r=Xr(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:st()},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}}}),on=IP.actions,AH=on.addTooltipEntrySettings,CH=on.replaceTooltipEntrySettings,PH=on.removeTooltipEntrySettings,OH=on.setTooltipSettingsState,_H=on.setActiveMouseOverItemIndex;on.mouseLeaveItem;var TP=on.mouseLeaveChart;on.setActiveClickItemIndex;var DP=on.setMouseOverAxisIndex,MH=on.setMouseClickAxisIndex,cu=on.setSyncInteraction,qf=on.setKeyboardInteraction,IH=IP.reducer;function q2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bd(e){for(var t=1;t{if(t==null)return ta;var i=LH(e,t,r);if(i==null)return ta;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if($H(i)){if(o)return Bd(Bd({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Bd(Bd({},ta),{},{coordinate:i.coordinate})};function zH(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 r=Number(e);return Number.isFinite(r)?r:void 0}function FH(e,t){var r=zH(e),n=t[0],i=t[1];if(r===void 0)return!1;var o=Math.min(n,i),u=Math.max(n,i);return r>=o&&r<=u}function BH(e,t,r){if(r==null||t==null)return!0;var n=Lt(e,t);return n==null||!$n(r)?!0:FH(n,r)}var fu=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var o=Number(i);if(!We(o))return i;var u=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(u,Math.min(o,c)),h=t[f];return h==null||BH(h,r,n)?String(f):null},LP=(e,t,r,n,i,o,u)=>{if(o!=null){var c=u[0],f=c==null?void 0:c.getPosition(o);if(f!=null)return f;var h=i==null?void 0:i[Number(o)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},$P=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(n!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(u=>{var c;return((c=u.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},zP=e=>e.options.tooltipPayloadSearcher,al=e=>e.tooltip;function Q2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Y2(e){for(var t=1;te(t)}function X2(e){if(typeof e=="string")return e}function qH(e){if(!(e==null||typeof e!="object")){var t="name"in e?KH(e.name):void 0,r="unit"in e?GH(e.unit):void 0,n="dataKey"in e?VH(e.dataKey):void 0,i="payload"in e?e.payload:void 0,o="color"in e?X2(e.color):void 0,u="fill"in e?X2(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:o,fill:u}}}function QH(e,t){return e??t}var FP=(e,t,r,n,i,o,u)=>{if(!(t==null||o==null)){var c=r.chartData,f=r.computedData,h=r.dataStartIndex,m=r.dataEndIndex,g=[];return e.reduce((v,b)=>{var j,k=b.dataDefinedOnItem,S=b.settings,N=QH(k,c),E=Array.isArray(N)?dA(N,h,m):N,A=(j=S==null?void 0:S.dataKey)!==null&&j!==void 0?j:n,P=S==null?void 0:S.nameKey,_;if(n&&Array.isArray(E)&&!Array.isArray(E[0])&&u==="axis"?_=xE(E,n,i):_=o(E,t,f,P),Array.isArray(_))_.forEach(T=>{var B,$,z=qH(T),Q=z==null?void 0:z.name,U=z==null?void 0:z.dataKey,ve=z==null?void 0:z.payload,ue=Y2(Y2({},S),{},{name:Q,unit:z==null?void 0:z.unit,color:(B=z==null?void 0:z.color)!==null&&B!==void 0?B:S==null?void 0:S.color,fill:($=z==null?void 0:z.fill)!==null&&$!==void 0?$:S==null?void 0:S.fill});v.push(Kk({tooltipEntrySettings:ue,dataKey:U,payload:ve,value:Lt(ve,U),name:Q==null?void 0:String(Q)}))});else{var O;v.push(Kk({tooltipEntrySettings:S,dataKey:A,payload:_,value:Lt(_,A),name:(O=Lt(_,P))!==null&&O!==void 0?O:S==null?void 0:S.name}))}return v},g)}},Vy=q([_t,KC,ay],FC),YH=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),XH=q([zt,el],GC),Eo=q([YH,_t,XH],qC,{memoizeOptions:{resultEqualityCheck:Vh}}),ZH=q([Eo],e=>e.filter(fy)),BP=q([Eo],XC,{memoizeOptions:{resultEqualityCheck:Vh}}),JH=q([Eo],e=>e.some(t=>!t.data)),xo=q([BP,kn],JC),eW=q([ZH,kn,_t],aC),qy=q([xo,_t,Eo,kn,JH,BP],eP),UP=q([_t],Fy),tW=q([_t],e=>e.allowDataOverflow),HP=q([UP,tW],BA),rW=q([Eo],e=>e.filter(fy)),nW=q([eW,rW,Bh,ZA],rP),iW=q([nW,kn,zt,HP],iP),aW=q([Eo],YC),oW=q([xo,_t,aW,By,zt,pB],sP,{memoizeOptions:{resultEqualityCheck:Gh}}),sW=q([lP,zt,el],nl),lW=q([sW,zt],dP),uW=q([uP,zt,el],nl),cW=q([uW,zt],fP),dW=q([cP,zt,el],nl),fW=q([dW,zt],hP),hW=q([lW,fW,cW],Vf),mW=q([_t,UP,HP,iW,oW,hW,ft,zt],mP),Ws=q([_t,ft,xo,qy,Bh,zt,mW],pP),pW=q([Ws,_t,Vy],gP),gW=q([_t,Ws,pW,zt],vP),WP=e=>{var t=zt(e),r=el(e),n=!1;return oc(e,t,r,n)},KP=q([_t,WP],Uh),vW=q([_t,Vy,gW,KP],Ly),GP=q([vW],hy),yW=q([ft,qy,_t,zt],NP),xW=q([ft,qy,_t,zt],kP),bW=(e,t,r,n,i,o,u,c)=>{if(t){var f=t.type,h=Gn(e,c);if(n){var m=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,g=f==="category"&&n.bandwidth?n.bandwidth()/m:0;return g=c==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Yr(i[0]-i[1])*2*g:g,h&&u?u.map((v,b)=>{var j=n.map(v);return We(j)?{coordinate:j+g,value:v,index:b,offset:g}:null}).filter(Sr):n.domain().map((v,b)=>{var j=n.map(v);return We(j)?{coordinate:j+g,value:o?o[v]:v,index:b,offset:g}:null}).filter(Sr)}}},Ai=q([ft,_t,Vy,GP,WP,yW,xW,zt],bW),Qy=q([PP,OP,NH],(e,t,r)=>_P(r.shared,e,t)),VP=e=>e.tooltip.settings.trigger,Yy=e=>e.tooltip.settings.defaultIndex,lc=q([al,Qy,VP,Yy],RP),Du=q([lc,xo,Hs,Ws],fu),qP=q([Ai,Du],MP),wW=q([lc],e=>{if(e)return e.dataKey}),kW=q([lc],e=>{if(e)return e.graphicalItemId}),QP=q([al,Qy,VP,Yy],$P),jW=q([ki,ji,ft,Zt,Ai,Yy,QP],LP),SW=q([lc,jW],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),NW=q([lc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),EW=q([QP,Du,kn,Hs,qP,zP,Qy],FP),AW=q([EW],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Z2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J2(e){for(var t=1;tMe(_t),MW=()=>{var e=_W(),t=Me(Ai),r=Me(GP);return Sf(!e||!r?void 0:J2(J2({},e),{},{scale:r}),t)};function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function as(e){for(var t=1;t{var i=t.find(o=>o&&o.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:i.coordinate}}return{x:0,y:0}},LW=(e,t,r,n)=>{var i=t.find(h=>h&&h.index===r);if(i){if(e==="centric"){var o=i.coordinate,u=n.radius;return as(as(as({},n),Vt(n.cx,n.cy,u,o)),{},{angle:o,radius:u})}var c=i.coordinate,f=n.angle;return as(as(as({},n),Vt(n.cx,n.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function $W(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var YP=(e,t,r,n,i)=>{var o,u=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(u<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c0?(f=r[c-1])===null||f===void 0?void 0:f.coordinate:(h=r[u-1])===null||h===void 0?void 0:h.coordinate,j=(m=r[c])===null||m===void 0?void 0:m.coordinate,k=c>=u-1?(g=r[0])===null||g===void 0?void 0:g.coordinate:(v=r[c+1])===null||v===void 0?void 0:v.coordinate,S=void 0;if(!(b==null||j==null||k==null))if(Yr(j-b)!==Yr(k-j)){var N=[];if(Yr(k-j)===Yr(i[1]-i[0])){S=k;var E=j+i[1]-i[0];N[0]=Math.min(E,(E+b)/2),N[1]=Math.max(E,(E+b)/2)}else{S=b;var A=k+i[1]-i[0];N[0]=Math.min(j,(A+j)/2),N[1]=Math.max(j,(A+j)/2)}var P=[Math.min(j,(S+j)/2),Math.max(j,(S+j)/2)];if(e>P[0]&&e<=P[1]||e>=N[0]&&e<=N[1]){var _;return(_=r[c])===null||_===void 0?void 0:_.index}}else{var O=Math.min(b,k),T=Math.max(b,k);if(e>(O+j)/2&&e<=(T+j)/2){var B;return(B=r[c])===null||B===void 0?void 0:B.index}}}else if(t)for(var $=0;$(z.coordinate+U.coordinate)/2||$>0&&$(z.coordinate+U.coordinate)/2&&e<=(z.coordinate+Q.coordinate)/2)return z.index}}return-1},XP=()=>Me(ay),Xy=(e,t)=>t,ZP=(e,t,r)=>r,Zy=(e,t,r,n)=>n,zW=q(Ai,e=>bh(e,t=>t.coordinate)),Jy=q([al,Xy,ZP,Zy],RP),ex=q([Jy,xo,Hs,Ws],fu),FW=(e,t,r)=>{if(t!=null){var n=al(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},JP=q([al,Xy,ZP,Zy],$P),Qf=q([ki,ji,ft,Zt,Ai,Zy,JP],LP),BW=q([Jy,Qf],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),eO=q([Ai,ex],MP),UW=q([JP,ex,kn,Hs,eO,zP,Xy],FP),HW=q([Jy,ex],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),WW=(e,t,r,n,i,o,u)=>{if(!(!e||!r||!n||!i)&&$W(e,u)){var c=n6(e,t),f=YP(c,o,i,r,n),h=RW(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},KW=(e,t,r,n,i,o,u)=>{if(!(!e||!n||!i||!o||!r)){var c=oB(e,r);if(c){var f=i6(c,t),h=YP(f,u,o,n,i),m=LW(t,o,h,c);return{activeIndex:String(h),activeCoordinate:m}}}},GW=(e,t,r,n,i,o,u,c)=>{if(!(!e||!t||!n||!i||!o))return t==="horizontal"||t==="vertical"?WW(e,t,n,i,o,u,c):KW(e,t,r,n,i,o,u)},VW=q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),qW=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(fr)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:LB}});function tS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rS(e){for(var t=1;trS(rS({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),ZW)},eK=new Set(Object.values(fr));function tK(e){return eK.has(e)}var tO=lr({name:"zIndex",initialState:JW,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:st()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!tK(r)&&delete e.zIndexMap[r])},prepare:st()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,o=r.isPanorama;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=i:e.zIndexMap[n].element=i:e.zIndexMap[n]={consumers:0,element:o?void 0:i,panoramaElement:o?i:void 0}},prepare:st()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:st()}}}),nm=tO.actions,rK=nm.registerZIndexPortal,$g=nm.unregisterZIndexPortal,nK=nm.registerZIndexPortalElement,iK=nm.unregisterZIndexPortalElement,aK=tO.reducer;function Ci(e){var t=e.zIndex,r=e.children,n=U6(),i=n&&t!==void 0&&t!==0,o=Ar(),u=y.useRef(void 0),c=y.useRef(new Set),f=Nt(),h=Me(g=>VW(g,t,o));if(y.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(b=>{f($g({zIndex:b}))}),g.clear(),u.current=void 0;return}if(c.current.has(t)||(f(rK({zIndex:t})),c.current.add(t)),h){u.current=h;var v=c.current;v.forEach(b=>{b!==t&&(f($g({zIndex:b})),v.delete(b))})}},[f,t,i,h]),y.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(v=>{f($g({zIndex:v}))}),g.clear()}},[f]),!i)return r;var m=h??u.current;return m?ch.createPortal(r,m):null}function s0(){return s0=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.useContext(rO),zg={exports:{}},iS;function hK(){return iS||(iS=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(f,h,m){this.fn=f,this.context=h,this.once=m||!1}function o(f,h,m,g,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var b=new i(m,g||f,v),j=r?r+h:h;return f._events[j]?f._events[j].fn?f._events[j]=[f._events[j],b]:f._events[j].push(b):(f._events[j]=b,f._eventsCount++),f}function u(f,h){--f._eventsCount===0?f._events=new n:delete f._events[h]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],m,g;if(this._eventsCount===0)return h;for(g in m=this._events)t.call(m,g)&&h.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},c.prototype.listeners=function(h){var m=r?r+h:h,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var v=0,b=g.length,j=new Array(b);v{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Fn(r))return e[r]}},vK={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},nO=lr({name:"options",initialState:vK,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),yK=nO.reducer,xK=nO.actions.createEventEmitter;function bK(e){return e.tooltip.syncInteraction}var wK={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},iO=lr({name:"chartData",initialState:wK,reducers:{setChartData(e,t){if(e.chartData=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 r=t.payload,n=r.startIndex,i=r.endIndex;n!=null&&(e.dataStartIndex=n),i!=null&&(e.dataEndIndex=i)}}}),tx=iO.actions,oS=tx.setChartData,kK=tx.setDataStartEndIndexes;tx.setComputedData;var jK=iO.reducer,SK=["x","y"];function sS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function os(e){for(var t=1;tf.rootProps.className);y.useEffect(()=>{if(e==null)return Ys;var f=(h,m,g)=>{if(t!==g&&e===h){if(m.payload.active===!1){r(cu({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var v;if(u&&m!==null&&m!==void 0&&(v=m.payload)!==null&&v!==void 0&&v.coordinate&&m.payload.sourceViewBox){var b=m.payload.coordinate,j=b.x,k=b.y,S=CK(b,SK),N=m.payload.sourceViewBox,E=N.x,A=N.y,P=N.width,_=N.height,O=os(os({},S),{},{x:u.x+(P?(j-E)/P:0)*u.width,y:u.y+(_?(k-A)/_:0)*u.height});r(os(os({},m),{},{payload:os(os({},m.payload),{},{coordinate:O})}))}else r(m);return}if(i!=null){var T;if(typeof n=="function"){var B={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},$=n(i,B);T=i[$]}else n==="value"&&(T=i.find(se=>String(se.value)===m.payload.label));var z=m.payload.coordinate;if(z==null||u==null){r(cu({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(T==null){r(cu({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:void 0}));return}var Q=z.x,U=z.y,ve=Math.min(Q,u.x+u.width),ue=Math.min(U,u.y+u.height),pe={x:o==="horizontal"?T.coordinate:ve,y:o==="horizontal"?ue:T.coordinate},oe=cu({active:m.payload.active,coordinate:pe,dataKey:m.payload.dataKey,index:String(T.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});r(oe)}}};return Ru.on(l0,f),()=>{Ru.off(l0,f)}},[c,r,t,e,n,i,o,u])}function _K(){var e=Me(oy),t=Me(sy),r=Nt();y.useEffect(()=>{if(e==null)return Ys;var n=(i,o,u)=>{t!==u&&e===i&&r(kK(o))};return Ru.on(aS,n),()=>{Ru.off(aS,n)}},[r,t,e])}function MK(){var e=Nt();y.useEffect(()=>{e(xK())},[e]),OK(),_K()}function IK(e,t,r,n,i,o){var u=Me(j=>FW(j,e,t)),c=Me(kW),f=Me(sy),h=Me(oy),m=Me(JA),g=Me(bK),v=(g==null?void 0:g.sourceViewBox)!=null,b=Dh();y.useEffect(()=>{if(!v&&h!=null&&f!=null){var j=cu({active:o,coordinate:r,dataKey:u,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:b,graphicalItemId:c});Ru.emit(l0,h,j,f)}},[v,r,u,c,i,n,f,h,m,o,b])}function lS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uS(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{T(OH({shared:E,trigger:A,axisId:O,active:i,defaultIndex:B}))},[T,E,A,O,i,B]);var $=Dh(),z=MA(),Q=SH(E),U=(t=Me(Oe=>HW(Oe,Q,A,B)))!==null&&t!==void 0?t:{},ve=U.activeIndex,ue=U.isActive,pe=Me(Oe=>UW(Oe,Q,A,B)),oe=Me(Oe=>eO(Oe,Q,A,B)),se=Me(Oe=>BW(Oe,Q,A,B)),X=pe,ne=fK(),te=(r=i??ue)!==null&&r!==void 0?r:!1,I=H$([X,te]),M=LK(I,2),H=M[0],ie=M[1],J=Q==="axis"?oe:void 0;IK(Q,A,se,J,ve,te);var Z=_??ne;if(Z==null||$==null||Q==null)return null;var ae=X??dS;te||(ae=dS),h&&ae.length&&(ae=f$(ae.filter(Oe=>Oe.value!=null&&(Oe.hide!==!0||n.includeHidden)),v,UK));var me=ae.length>0,re=uS(uS({},n),{},{payload:ae,label:J,active:te,activeIndex:ve,coordinate:se,accessibilityLayer:z}),ye=y.createElement(eF,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:m,active:te,coordinate:se,hasPayload:me,offset:g,position:b,reverseDirection:j,useTranslate3d:k,viewBox:$,wrapperStyle:S,lastBoundingBox:H,innerRef:ie,hasPortalFromProps:!!_},HK(f,re));return y.createElement(y.Fragment,null,ch.createPortal(ye,Z),te&&y.createElement(dK,{cursor:N,tooltipEventType:Q,coordinate:se,payload:ae,index:ve}))}function GK(e,t,r){return(t=VK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VK(e){var t=qK(e,"string");return typeof t=="symbol"?t:t+""}function qK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class QK{constructor(t){GK(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function fS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function YK(e){for(var t=1;t{try{var r=document.getElementById(mS);r||(r=document.createElement("span"),r.setAttribute("id",mS),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,tG,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},hu=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ju.isSsr)return{width:0,height:0};if(!aO.enableCache)return pS(t,r);var n=rG(t,r),i=hS.get(n);if(i)return i;var o=pS(t,r);return hS.set(n,o),o},oO;function Yf(e,t){return oG(e)||aG(e,t)||iG(e,t)||nG()}function nG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iG(e,t){if(e){if(typeof e=="string")return gS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gS(e,t):void 0}}function gS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var i=[];Qt(t)||(r?i=t.toString().split(""):i=t.toString().split(lO));var o=i.map(c=>({word:c,width:hu(c,n).width})),u=r?0:hu(" ",n).width;return{wordsWithComputedWidth:o,spaceWidth:u}}catch{return null}};function cO(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function EG(e){return Qt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var dO=(e,t,r,n)=>e.reduce((i,o)=>{var u=o.word,c=o.width,f=i[i.length-1];if(f&&c!=null&&(t==null||n||f.width+c+re.reduce((t,r)=>t.width>r.width?t:r),AG="…",jS=(e,t,r,n,i,o,u,c)=>{var f=e.slice(0,t),h=uO({breakAll:r,style:n,children:f+AG});if(!h)return[!1,[]];var m=dO(h.wordsWithComputedWidth,o,u,c),g=m.length>i||fO(m).width>Number(o);return[g,m]},CG=(e,t,r,n,i)=>{var o=e.maxLines,u=e.children,c=e.style,f=e.breakAll,h=Ae(o),m=String(u),g=dO(t,n,r,i);if(!h||i)return g;var v=g.length>o||fO(g).width>Number(n);if(!v)return g;for(var b=0,j=m.length-1,k=0,S;b<=j&&k<=m.length-1;){var N=Math.floor((b+j)/2),E=N-1,A=jS(m,E,f,c,o,n,r,i),P=wS(A,2),_=P[0],O=P[1],T=jS(m,N,f,c,o,n,r,i),B=wS(T,1),$=B[0];if(!_&&!$&&(b=N+1),_&&$&&(j=N-1),!_&&$){S=O;break}k++}return S||g},SS=e=>{var t=Qt(e)?[]:e.toString().split(lO);return[{words:t,width:void 0}]},PG=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,u=e.maxLines;if((t||r)&&!Ju.isSsr){var c,f,h=uO({breakAll:o,children:n,style:i});if(h){var m=h.wordsWithComputedWidth,g=h.spaceWidth;c=m,f=g}else return SS(n);return CG({breakAll:o,children:n,maxLines:u,style:i},c,f,t,!!r)}return SS(n)},hO="#808080",OG={angle:0,breakAll:!1,capHeight:"0.71em",fill:hO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},rx=y.forwardRef((e,t)=>{var r=nn(e,OG),n=r.x,i=r.y,o=r.lineHeight,u=r.capHeight,c=r.fill,f=r.scaleToFit,h=r.textAnchor,m=r.verticalAnchor,g=bS(r,xG),v=y.useMemo(()=>PG({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:f,style:g.style,width:g.width}),[g.breakAll,g.children,g.maxLines,f,g.style,g.width]),b=g.dx,j=g.dy,k=g.angle,S=g.className,N=g.breakAll,E=bS(g,bG);if(!Bn(n)||!Bn(i)||v.length===0)return null;var A=Number(n)+(Ae(b)?b:0),P=Number(i)+(Ae(j)?j:0);if(!We(A)||!We(P))return null;var _;switch(m){case"start":_=Fg("calc(".concat(u,")"));break;case"middle":_=Fg("calc(".concat((v.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:_=Fg("calc(".concat(v.length-1," * -").concat(o,")"));break}var O=[],T=v[0];if(f&&T!=null){var B=T.width,$=g.width;O.push("scale(".concat(Ae($)&&Ae(B)?$/B:1,")"))}return k&&O.push("rotate(".concat(k,", ").concat(A,", ").concat(P,")")),O.length&&(E.transform=O.join(" ")),y.createElement("text",u0({},en(E),{ref:t,x:A,y:P,className:rt("recharts-text",S),textAnchor:h,fill:c.includes("url")?hO:c}),v.map((z,Q)=>{var U=z.words.join(N?"":" ");return y.createElement("tspan",{x:A,dy:Q===0?_:o,key:"".concat(U,"-").concat(Q)},U)}))});rx.displayName="Text";function NS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,o=e.parentViewBox,u=Y0(t),c=u.x,f=u.y,h=u.height,m=u.upperWidth,g=u.lowerWidth,v=c,b=c+(m-g)/2,j=(v+b)/2,k=(m+g)/2,S=v+m/2,N=h>=0?1:-1,E=N*i,A=N>0?"end":"start",P=N>0?"start":"end",_=m>=0?1:-1,O=_*i,T=_>0?"end":"start",B=_>0?"start":"end",$=o;if(r==="top"){var z={x:v+m/2,y:f-E,horizontalAnchor:"middle",verticalAnchor:A};return $&&(z.height=Math.max(f-$.y,0),z.width=m),z}if(r==="bottom"){var Q={x:b+g/2,y:f+h+E,horizontalAnchor:"middle",verticalAnchor:P};return $&&(Q.height=Math.max($.y+$.height-(f+h),0),Q.width=g),Q}if(r==="left"){var U={x:j-O,y:f+h/2,horizontalAnchor:T,verticalAnchor:"middle"};return $&&(U.width=Math.max(U.x-$.x,0),U.height=h),U}if(r==="right"){var ve={x:j+k+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"};return $&&(ve.width=Math.max($.x+$.width-ve.x,0),ve.height=h),ve}var ue=$?{width:k,height:h}:{};return r==="insideLeft"?_n({x:j+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"},ue):r==="insideRight"?_n({x:j+k-O,y:f+h/2,horizontalAnchor:T,verticalAnchor:"middle"},ue):r==="insideTop"?_n({x:v+m/2,y:f+E,horizontalAnchor:"middle",verticalAnchor:P},ue):r==="insideBottom"?_n({x:b+g/2,y:f+h-E,horizontalAnchor:"middle",verticalAnchor:A},ue):r==="insideTopLeft"?_n({x:v+O,y:f+E,horizontalAnchor:B,verticalAnchor:P},ue):r==="insideTopRight"?_n({x:v+m-O,y:f+E,horizontalAnchor:T,verticalAnchor:P},ue):r==="insideBottomLeft"?_n({x:b+O,y:f+h-E,horizontalAnchor:B,verticalAnchor:A},ue):r==="insideBottomRight"?_n({x:b+g-O,y:f+h-E,horizontalAnchor:T,verticalAnchor:A},ue):r&&typeof r=="object"&&(Ae(r.x)||mo(r.x))&&(Ae(r.y)||mo(r.y))?_n({x:c+ya(r.x,k),y:f+ya(r.y,h),horizontalAnchor:"end",verticalAnchor:"end"},ue):_n({x:S,y:f+h/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ue)},DG=["labelRef"],RG=["content"];function ES(e,t){if(e==null)return{};var r,n,i=LG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,o=e.width,u=e.height,c=e.children,f=y.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:o,height:u}),[t,r,n,i,o,u]);return y.createElement(mO.Provider,{value:f},c)},pO=()=>{var e=y.useContext(mO),t=Dh();return e||(t?Y0(t):void 0)},UG=y.createContext(null),HG=()=>{var e=y.useContext(UG),t=Me(iC);return e||t},WG=e=>{var t=e.value,r=e.formatter,n=Qt(e.children)?t:e.children;return typeof r=="function"?r(n):n},nx=e=>e!=null&&typeof e=="function",KG=(e,t)=>{var r=Yr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},GG=(e,t,r,n,i)=>{var o=e.offset,u=e.className,c=i.cx,f=i.cy,h=i.innerRadius,m=i.outerRadius,g=i.startAngle,v=i.endAngle,b=i.clockWise,j=(h+m)/2,k=KG(g,v),S=k>=0?1:-1,N,E;switch(t){case"insideStart":N=g+S*o,E=b;break;case"insideEnd":N=v-S*o,E=!b;break;case"end":N=v+S*o,E=b;break;default:throw new Error("Unsupported position ".concat(t))}E=k<=0?E:!E;var A=Vt(c,f,j,N),P=Vt(c,f,j,N+(E?1:-1)*359),_="M".concat(A.x,",").concat(A.y,` A`).concat(j,",").concat(j,",0,1,").concat(E?0:1,`, - `).concat(P.x,",").concat(P.y),O=Qt(e.id)?ju("recharts-radial-line-"):e.id;return y.createElement("text",li({},n,{dominantBaseline:"central",className:rt("recharts-radial-bar-label",u)}),y.createElement("defs",null,y.createElement("path",{id:O,d:_})),y.createElement("textPath",{xlinkHref:"#".concat(O)},r))},GG=(e,t,r)=>{var n=e.cx,i=e.cy,o=e.innerRadius,u=e.outerRadius,c=e.startAngle,f=e.endAngle,h=(c+f)/2;if(r==="outside"){var m=Vt(n,i,u+t,h),g=m.x,v=m.y;return{x:g,y:v,textAnchor:g>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var b=(o+u)/2,j=Vt(n,i,b,h),k=j.x,S=j.y;return{x:k,y:S,textAnchor:"middle",verticalAnchor:"middle"}},Jd=e=>e!=null&&"cx"in e&&Ae(e.cx),VG={angle:0,offset:5,zIndex:fr.label,position:"middle",textBreakAll:!1};function qG(e){if(!Jd(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,i=n*2;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}function ea(e){var t=rn(e,VG),r=t.viewBox,n=t.parentViewBox,i=t.position,o=t.value,u=t.children,c=t.content,f=t.className,h=f===void 0?"":f,m=t.textBreakAll,g=t.labelRef,v=UG(),b=pO(),j=i==="center"?b:v??b,k,S,N;r==null?k=j:Jd(r)?k=r:k=Y0(r);var E=qG(k);if(!k||Qt(o)&&Qt(u)&&!y.isValidElement(c)&&typeof c!="function")return null;var A=fu(fu({},t),{},{viewBox:k});if(y.isValidElement(c)){A.labelRef;var P=ES(A,TG);return y.cloneElement(c,P)}if(typeof c=="function"){A.content;var _=ES(A,DG);if(S=y.createElement(c,_),y.isValidElement(S))return S}else S=HG(t);var O=Jr(t);if(Jd(k)){if(i==="insideStart"||i==="insideEnd"||i==="end")return KG(t,i,S,O,k);N=GG(k,t.offset,t.position)}else{if(!E)return null;var T=IG({viewBox:E,position:i,offset:t.offset,parentViewBox:Jd(n)?void 0:n});N=fu(fu({x:T.x,y:T.y,textAnchor:T.horizontalAnchor,verticalAnchor:T.verticalAnchor},T.width!==void 0?{width:T.width}:{}),T.height!==void 0?{height:T.height}:{})}return y.createElement(Ci,{zIndex:t.zIndex},y.createElement(rx,li({ref:g,className:rt("recharts-label",h)},O,N,{textAnchor:cO(O.textAnchor)?O.textAnchor:N.textAnchor,breakAll:m}),S))}ea.displayName="Label";var QG=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?y.createElement(ea,li({key:"label-implicit"},n)):Bn(e)?y.createElement(ea,li({key:"label-implicit",value:e},n)):y.isValidElement(e)?e.type===ea?y.cloneElement(e,fu({key:"label-implicit"},n)):y.createElement(ea,li({key:"label-implicit",content:e},n)):nx(e)?y.createElement(ea,li({key:"label-implicit",content:e},n)):e&&typeof e=="object"?y.createElement(ea,li({},e,{key:"label-implicit"},n)):null};function YG(e){var t=e.label,r=e.labelRef,n=pO();return QG(t,n,r)||null}var XG=["valueAccessor"],ZG=["dataKey","clockWise","id","textBreakAll","zIndex"];function Xf(){return Xf=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(NG(t))return t},gO=y.createContext(void 0),tV=gO.Provider,vO=y.createContext(void 0);vO.Provider;function rV(){return y.useContext(gO)}function nV(){return y.useContext(vO)}function ef(e){var t=e.valueAccessor,r=t===void 0?eV:t,n=CS(e,XG),i=n.dataKey;n.clockWise;var o=n.id,u=n.textBreakAll,c=n.zIndex,f=CS(n,ZG),h=rV(),m=nV(),g=h||m;return!g||!g.length?null:y.createElement(Ci,{zIndex:c??fr.label},y.createElement(en,{className:"recharts-label-list"},g.map((v,b)=>{var j,k=Qt(i)?r(v,b):Lt(v.payload,i),S=Qt(o)?{}:{id:"".concat(o,"-").concat(b)};return y.createElement(ea,Xf({key:"label-".concat(b)},Jr(v),f,S,{fill:(j=n.fill)!==null&&j!==void 0?j:v.fill,parentViewBox:v.parentViewBox,value:k,textBreakAll:u,viewBox:v.viewBox,index:b,zIndex:0}))})))}ef.displayName="LabelList";function iV(e){var t=e.label;return t?t===!0?y.createElement(ef,{key:"labelList-implicit"}):y.isValidElement(t)||nx(t)?y.createElement(ef,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(ef,Xf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,i=e.className,o=rt("recharts-dot",i);return Ae(t)&&Ae(r)&&Ae(n)?y.createElement("circle",c0({},xn(e),F0(e),{className:o,cx:t,cy:r,r:n})):null},aV={radiusAxis:{},angleAxis:{}},xO=lr({name:"polarAxis",initialState:aV,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),im=xO.actions;im.addRadiusAxis;im.removeRadiusAxis;im.addAngleAxis;im.removeAngleAxis;var oV=xO.reducer;function sV(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var bO=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function PS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function OS(e){for(var t=1;t{n||(i.current===null?r(EH(t)):i.current!==t&&r(AH({prev:i.current,next:t})),i.current=t)},[t,r,n]),y.useLayoutEffect(()=>()=>{i.current&&(r(CH(i.current)),i.current=null)},[r]),null}function vV(e){var t=e.legendPayload,r=Nt(),n=Ar(),i=y.useRef(null);return y.useLayoutEffect(()=>{n||(i.current===null?r(e8(t)):i.current!==t&&r(t8({prev:i.current,next:t})),i.current=t)},[r,n,t]),y.useLayoutEffect(()=>()=>{i.current&&(r(r8(i.current)),i.current=null)},[r]),null}function yV(e,t){return kV(e)||wV(e,t)||bV(e,t)||xV()}function xV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bV(e,t){if(e){if(typeof e=="string")return _S(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_S(e,t):void 0}}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var i of r)n.push({status:"removed",prev:i});for(var o=0;oe[Math.floor(o*r)]);return ax(n,t)}function NV(e,t){var r=t.map((n,i)=>e[i]);return ax(r,t)}function EV(e,t){for(var r=new Map,n=0;n{var b=r(g,v);if(b!=null){var j=n.get(b);if(j!==void 0)return i.add(b),j}}),u=[];for(var c of n){var f=yV(c,2),h=f[0],m=f[1];i.has(h)||u.push(m)}return ax(o,t,u)}function d0(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===ix?SV(e,t):r===jV?NV(e,t):AV(e,t,r)}function kO(e,t){var r=y.useRef(e),n=y.useRef(t.current),i=y.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var o=y.useCallback(function(u,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(c===0){i.current=!0;return}c===1&&(n.current=u),c>0&&i.current&&f&&(t.current=u)},[t]);return{startValue:n.current,syncStepValue:o}}function CV(e,t){return MV(e)||_V(e,t)||OV(e,t)||PV()}function PV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OV(e,t){if(e){if(typeof e=="string")return MS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?MS(e,t):void 0}}function MS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),o(!0)},[e]),c=y.useCallback(()=>{typeof t=="function"&&t(),o(!1)},[t]);return{isAnimating:i,handleAnimationStart:u,handleAnimationEnd:c}}function TV(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,o=e.previousItemsRef,u=e.isAnimationActive,c=e.animationBegin,f=e.animationDuration,h=e.animationEasing,m=e.onAnimationStart,g=e.onAnimationEnd,v=e.animationInterpolateFn,b=e.animationMatchBy,j=e.shouldUpdatePreviousRef,k=e.children,S=e.layout,N=LA(r,n),E=kO(N,o),A=(t=E.startValue)!==null&&t!==void 0?t:null,P=d0(A,i,b??ix);return y.createElement(RA,{animationId:N,begin:c,duration:f,isActive:u,easing:h,onAnimationEnd:g,onAnimationStart:m,key:N},_=>{var O=A==null,T=i==null?i:v(P,_,S),B=j?j(_):_>0;return E.syncStepValue(T,_,B),T==null?null:k(T,_,O)})}var Bg;function DV(e,t){return zV(e)||$V(e,t)||LV(e,t)||RV()}function RV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LV(e,t){if(e){if(typeof e=="string")return IS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?IS(e,t):void 0}}function IS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=y.useState(()=>ju("uid-")),t=DV(e,1),r=t[0];return r},jO=(Bg=ah.useId)!==null&&Bg!==void 0?Bg:FV;function BV(e,t){var r=jO();return t||(e?"".concat(e,"-").concat(r):r)}var UV=y.createContext(void 0),HV=e=>{var t=e.id,r=e.type,n=e.children,i=BV("recharts-".concat(r),t);return y.createElement(UV.Provider,{value:i},n(i))},WV={cartesianItems:[],polarItems:[]},SO=lr({name:"graphicalItems",initialState:WV,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:st()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=i)},prepare:st()},removeCartesianGraphicalItem:{reducer(e,t){var r=Xr(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:st()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:st()},removePolarGraphicalItem:{reducer(e,t){var r=Xr(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:st()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).polarItems.indexOf(n);o>-1&&(e.polarItems[o]=i)},prepare:st()}}}),sl=SO.actions,KV=sl.addCartesianGraphicalItem,GV=sl.replaceCartesianGraphicalItem,VV=sl.removeCartesianGraphicalItem;sl.addPolarGraphicalItem;sl.removePolarGraphicalItem;sl.replacePolarGraphicalItem;var qV=SO.reducer,QV=e=>{var t=Nt(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(KV(e)):r.current!==e&&t(GV({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(VV(r.current)),r.current=null)},[t]),null},YV=y.memo(QV),XV=["points"];function TS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ug(e){for(var t=1;t{var N,E,A=Ug(Ug(Ug({r:3},u),v),{},{index:S,cx:(N=k.x)!==null&&N!==void 0?N:void 0,cy:(E=k.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:k.value,payload:k.payload,points:t});return y.createElement(nq,{key:"dot-".concat(S),option:r,dotProps:A,className:i})}),j={};return c&&f!=null&&(j.clipPath="url(#clipPath-".concat(g?"":"dots-").concat(f,")")),y.createElement(Ci,{zIndex:m},y.createElement(en,Zf({className:n},j),b))}function DS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function RS(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),xq=q([yq,ki,ji],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),ox=()=>Me(xq),bq=()=>Me(EW);function LS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hg(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,o=e.dataKey,u=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var c={index:r,dataKey:o,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Hg(Hg(Hg({},c),vh(i)),F0(i)),h;return y.isValidElement(i)?h=y.cloneElement(i,f):typeof i=="function"?h=i(f):h=y.createElement(yO,f),y.createElement(en,{className:"recharts-active-dot",clipPath:u},h)};function $S(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,o=e.clipPath,u=e.zIndex,c=u===void 0?fr.activeDot:u,f=Me(Ru),h=bq();if(t==null||h==null)return null;var m=t.find(g=>h.includes(g.payload));return Qt(m)?null:y.createElement(Ci,{zIndex:c},y.createElement(Sq,{point:m,childIndex:Number(f),mainColor:r,dataKey:i,activeDot:n,clipPath:o}))}var Nq=e=>{var t=e.chartData,r=Nt(),n=Ar();return y.useEffect(()=>n?()=>{}:(r(oS(t)),()=>{r(oS(void 0))}),[t,r,n]),null},zS={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},AO=lr({name:"brush",initialState:zS,reducers:{setBrushSettings(e,t){return t.payload==null?zS:t.payload}}});AO.actions.setBrushSettings;var Eq=AO.reducer;function Aq(e){return(e%180+180)%180}var Cq=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Aq(i),u=o*Math.PI/180,c=Math.atan(n/r),f=u>c&&u{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Xr(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Xr(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Xr(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),ll=CO.actions;ll.addDot;ll.removeDot;ll.addArea;ll.removeArea;ll.addLine;ll.removeLine;var Oq=CO.reducer;function _q(e,t){return Dq(e)||Tq(e,t)||Iq(e,t)||Mq()}function Mq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iq(e,t){if(e){if(typeof e=="string")return FS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?FS(e,t):void 0}}function FS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=y.useState("".concat(ju("recharts"),"-clip")),n=_q(r,1),i=n[0],o=ox();if(o==null)return null;var u=o.x,c=o.y,f=o.width,h=o.height;return y.createElement(Rq.Provider,{value:i},y.createElement("defs",null,y.createElement("clipPath",{id:i},y.createElement("rect",{x:u,y:c,height:h,width:f}))),t)};function PO(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function Fq(e,t){return PO(e,t+1)}function Bq(e,t,r,n,i){for(var o=(n||[]).slice(),u=t.start,c=t.end,f=0,h=1,m=u,g=function(){var j=n==null?void 0:n[f];if(j===void 0)return{v:PO(n,h)};var k=f,S,N=()=>(S===void 0&&(S=r(j,k)),S),E=j.coordinate,A=f===0||$u(e,E,N,m,c);A||(f=0,m=u,h+=1),A&&(m=E+e*(N()/2+i),f+=h)},v;h<=o.length;)if(v=g(),v)return v.v;return[]}function Uq(e,t,r,n,i){var o=(n||[]).slice(),u=o.length;if(u===0)return[];for(var c=t.start,f=t.end,h=1;h<=u;h++){for(var m=(u-1)%h,g=c,v=!0,b=function(){var P=n[k];if(P==null)return 0;var _=k,O,T=()=>(O===void 0&&(O=r(P,_)),O),B=P.coordinate,$=k===m||$u(e,B,T,g,f);if(!$)return v=!1,1;$&&(g=B+e*(T()/2+i))},j,k=m;k(k===void 0&&(k=r(b,v)),k);if(v===u-1){var N=e*(j.coordinate+e*S()/2-f);o[v]=j=ar(ar({},j),{},{tickCoord:N>0?j.coordinate-N*e:j.coordinate})}else o[v]=j=ar(ar({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var E=$u(e,j.tickCoord,S,c,f);E&&(f=j.tickCoord-e*(S()/2+i),o[v]=ar(ar({},j),{},{isShow:!0}))}},m=u-1;m>=0;m--)h(m);return o}function Vq(e,t,r,n,i,o){var u=(n||[]).slice(),c=u.length,f=t.start,h=t.end;if(o){var m=n[c-1];if(m!=null){var g=r(m,c-1),v=e*(m.coordinate+e*g/2-h);if(u[c-1]=m=ar(ar({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate}),m.tickCoord!=null){var b=$u(e,m.tickCoord,()=>g,f,h);b&&(h=m.tickCoord-e*(g/2+i),u[c-1]=ar(ar({},m),{},{isShow:!0}))}}}for(var j=o?c-1:c,k=function(E){var A=u[E];if(A==null)return 1;var P=A,_,O=()=>(_===void 0&&(_=r(A,E)),_);if(E===0){var T=e*(P.coordinate-e*O()/2-f);u[E]=P=ar(ar({},P),{},{tickCoord:T<0?P.coordinate-T*e:P.coordinate})}else u[E]=P=ar(ar({},P),{},{tickCoord:P.coordinate});if(P.tickCoord!=null){var B=$u(e,P.tickCoord,O,f,h);B&&(f=P.tickCoord+e*(O()/2+i),u[E]=ar(ar({},P),{},{isShow:!0}))}},S=0;S{var T=typeof h=="function"?h(_.value,O):_.value;return j==="width"?$q(mu(T,{fontSize:t,letterSpacing:r}),k,g):mu(T,{fontSize:t,letterSpacing:r})[j]},N=i[0],E=i[1],A=i.length>=2&&N!=null&&E!=null?Yr(E.coordinate-N.coordinate):1,P=zq(o,A,j);return f==="equidistantPreserveStart"?Bq(A,P,S,i,u):f==="equidistantPreserveEnd"?Uq(A,P,S,i,u):(f==="preserveStart"||f==="preserveStartEnd"?b=Vq(A,P,S,i,u,f==="preserveStartEnd"):b=Gq(A,P,S,i,u),b.filter(_=>_.isShow))}var qq=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,o=e.tickSize,u=o===void 0?0:o,c=e.tickMargin,f=c===void 0?0:c,h=0;if(t){Array.from(t).forEach(b=>{if(b){var j=b.getBoundingClientRect();j.width>h&&(h=j.width)}});var m=r?r.getBoundingClientRect().width:0,g=u+f,v=h+g+m+(r?i:0);return Math.round(v)}return 0},Qq={xAxis:{},yAxis:{}},OO=lr({name:"renderedTicks",initialState:Qq,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,o=r.ticks;e[n][i]=o},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),_O=OO.actions,Yq=_O.setRenderedTicks,Xq=_O.removeRenderedTicks,Zq=OO.reducer,Jq=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function US(e,t){return nQ(e)||rQ(e,t)||tQ(e,t)||eQ()}function eQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tQ(e,t){if(e){if(typeof e=="string")return HS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?HS(e,t):void 0}}function HS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return Xs;var o=t.map(u=>({value:u.value,coordinate:u.coordinate,offset:u.offset,index:u.index}));return i(Yq({ticks:o,axisId:n,axisType:r})),()=>{i(Xq({axisId:n,axisType:r}))}},[i,t,n,r]),null}var pQ=y.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,o=e.tickLine,u=e.stroke,c=e.tickFormatter,f=e.unit,h=e.padding,m=e.tickTextProps,g=e.orientation,v=e.mirror,b=e.x,j=e.y,k=e.width,S=e.height,N=e.tickSize,E=e.tickMargin,A=e.fontSize,P=e.letterSpacing,_=e.getTicksConfig,O=e.events,T=e.axisType,B=e.axisId,$=sx(yt(yt({},_),{},{ticks:n}),A,P),z=xn(_),Q=vh(i),U=cO(z.textAnchor)?z.textAnchor:dQ(g,v),ve=fQ(g,v),ue={};typeof o=="object"&&(ue=o);var pe=yt(yt({},z),{},{fill:"none"},ue),oe=$.map(ne=>yt({entry:ne},cQ(ne,b,j,k,S,g,N,v,E))),se=oe.map(ne=>{var te=ne.entry,I=ne.line;return y.createElement(en,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},o&&y.createElement("line",bo({},pe,I,{className:rt("recharts-cartesian-axis-tick-line",jo(o,"className"))})))}),X=oe.map((ne,te)=>{var I,M,H=ne.entry,ie=ne.tick,J=yt(yt(yt(yt({verticalAnchor:ve},z),{},{textAnchor:U,stroke:"none",fill:u},ie),{},{index:te,payload:H,visibleTicksCount:$.length,tickFormatter:c,padding:h},m),{},{angle:(I=(M=m==null?void 0:m.angle)!==null&&M!==void 0?M:z.angle)!==null&&I!==void 0?I:0}),Z=yt(yt({},J),Q);return y.createElement(en,bo({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},xL(O,H,te)),i&&y.createElement(hQ,{option:i,tickProps:Z,value:"".concat(typeof c=="function"?c(H.value,te):H.value).concat(f||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},y.createElement(mQ,{ticks:$,axisId:B,axisType:T}),X.length>0&&y.createElement(Ci,{zIndex:fr.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},X)),se.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},se))}),gQ=y.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,o=e.className,u=e.hide,c=e.ticks,f=e.axisType,h=e.axisId,m=iQ(e,Jq),g=y.useState(""),v=US(g,2),b=v[0],j=v[1],k=y.useState(""),S=US(k,2),N=S[0],E=S[1],A=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return qq({ticks:A.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var P=y.useCallback(_=>{if(_){var O=_.getElementsByClassName("recharts-cartesian-axis-tick-value");A.current=O;var T=O[0];if(T){var B=window.getComputedStyle(T),$=B.fontSize,z=B.letterSpacing;($!==b||z!==N)&&(j($),E(z))}}},[b,N]);return u||n!=null&&n<=0||i!=null&&i<=0?null:y.createElement(Ci,{zIndex:e.zIndex},y.createElement(en,{className:rt("recharts-cartesian-axis",o)},y.createElement(uQ,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:xn(e)}),y.createElement(pQ,{ref:P,axisType:f,events:m,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:N,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:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),y.createElement(FG,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(YG,{label:e.label,labelRef:e.labelRef}),e.children)))}),lx=y.forwardRef((e,t)=>{var r=rn(e,mi);return y.createElement(gQ,bo({},r,{ref:t}))});lx.displayName="CartesianAxis";var vQ=["x1","y1","x2","y2","key"],yQ=["offset"],xQ=["xAxisId","yAxisId"],bQ=["xAxisId","yAxisId"];function KS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t{var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,i=e.y,o=e.width,u=e.height,c=e.ry;return y.createElement("rect",{x:n,y:i,ry:c,width:o,height:u,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function MO(e){var t=e.option,r=e.lineItemProps,n;if(y.isValidElement(t))n=y.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,o=r.x1,u=r.y1,c=r.x2,f=r.y2,h=r.key,m=Jf(r,vQ),g=(i=xn(m))!==null&&i!==void 0?i:{};g.offset;var v=Jf(g,yQ);n=y.createElement("line",Xa({},v,{x1:o,y1:u,x2:c,y2:f,fill:"none",key:h}))}return n}function EQ(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=Jf(e,xQ),c=o.map((f,h)=>{var m=sr(sr({},u),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return y.createElement(MO,{key:"line-".concat(h),option:i,lineItemProps:m})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function AQ(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=Jf(e,bQ),c=o.map((f,h)=>{var m=sr(sr({},u),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return y.createElement(MO,{option:i,lineItemProps:m,key:"line-".concat(h)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function CQ(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,u=e.height,c=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length||c==null)return null;var m=c.map(v=>Math.round(v+i-i)).sort((v,b)=>v-b);i!==m[0]&&m.unshift(0);var g=m.map((v,b)=>{var j=m[b+1],k=j==null,S=k?i+u-v:j-v;if(S<=0)return null;var N=b%t.length;return y.createElement("rect",{key:"react-".concat(b),y:v,x:n,height:S,width:o,stroke:"none",fill:t[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},g)}function PQ(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,u=e.y,c=e.width,f=e.height,h=e.verticalPoints;if(!r||!n||!n.length)return null;var m=h.map(v=>Math.round(v+o-o)).sort((v,b)=>v-b);o!==m[0]&&m.unshift(0);var g=m.map((v,b)=>{var j=m[b+1],k=j==null,S=k?o+c-v:j-v;if(S<=0)return null;var N=b%n.length;return y.createElement("rect",{key:"react-".concat(b),x:v,y:u,width:S,height:f,stroke:"none",fill:n[N],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},g)}var OQ=(e,t)=>{var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return fA(sx(sr(sr(sr({},mi),r),{},{ticks:hA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)},_Q=(e,t)=>{var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return fA(sx(sr(sr(sr({},mi),r),{},{ticks:hA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)},MQ={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:fr.grid};function IO(e){var t=wA(),r=kA(),n=bA(),i=sr(sr({},rn(e,MQ)),{},{x:Ae(e.x)?e.x:n.left,y:Ae(e.y)?e.y:n.top,width:Ae(e.width)?e.width:n.width,height:Ae(e.height)?e.height:n.height}),o=i.xAxisId,u=i.yAxisId,c=i.x,f=i.y,h=i.width,m=i.height,g=i.syncWithTicks,v=i.horizontalValues,b=i.verticalValues,j=Ar(),k=Me($=>V2($,"xAxis",o,j)),S=Me($=>V2($,"yAxis",u,j));if(!Un(h)||!Un(m)||!Ae(c)||!Ae(f))return null;var N=i.verticalCoordinatesGenerator||OQ,E=i.horizontalCoordinatesGenerator||_Q,A=i.horizontalPoints,P=i.verticalPoints;if((!A||!A.length)&&typeof E=="function"){var _=v&&v.length,O=E({yAxis:S?sr(sr({},S),{},{ticks:_?v:S.ticks}):void 0,width:t??h,height:r??m,offset:n},_?!0:g);Nf(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(A=O)}if((!P||!P.length)&&typeof N=="function"){var T=b&&b.length,B=N({xAxis:k?sr(sr({},k),{},{ticks:T?b:k.ticks}):void 0,width:t??h,height:r??m,offset:n},T?!0:g);Nf(Array.isArray(B),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(P=B)}return y.createElement(Ci,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(NQ,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(CQ,Xa({},i,{horizontalPoints:A})),y.createElement(PQ,Xa({},i,{verticalPoints:P})),y.createElement(EQ,Xa({},i,{offset:n,horizontalPoints:A,xAxis:k,yAxis:S})),y.createElement(AQ,Xa({},i,{offset:n,verticalPoints:P,xAxis:k,yAxis:S}))))}IO.displayName="CartesianGrid";var IQ={},TO=lr({name:"errorBars",initialState:IQ,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]||(e[n]=[]),e[n].push(i)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.prev,o=r.next;e[n]&&(e[n]=e[n].map(u=>u.dataKey===i.dataKey&&u.direction===i.direction?o:u))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==i.dataKey||o.direction!==i.direction))}}}),ux=TO.actions;ux.addErrorBar;ux.replaceErrorBar;ux.removeErrorBar;var TQ=TO.reducer;function DO(e,t){var r,n,i=Me(h=>Ni(h,e)),o=Me(h=>Ei(h,t)),u=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Ct.allowDataOverflow,c=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:Pt.allowDataOverflow,f=u||c;return{needClip:f,needClipX:u,needClipY:c}}function DQ(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=ox(),o=DO(t,r),u=o.needClipX,c=o.needClipY,f=o.needClip,h=Me(A=>xP(A,t,!1)),m=Me(A=>bP(A,r,!1));if(!f||!i)return null;var g=i.x,v=i.y,b=i.width,j=i.height,k=u&&h?Math.min(h[0],h[1]):g-b/2,S=c&&m?Math.min(m[0],m[1]):v-j/2,N=u&&h?Math.abs(h[1]-h[0]):b*2,E=c&&m?Math.abs(m[1]-m[0]):j*2;return y.createElement("clipPath",{id:"clipPath-".concat(n)},y.createElement("rect",{x:k,y:S,width:N,height:E}))}function RQ(e){var t=vh(e),r=3,n=2;if(t!=null){var i=t.r,o=t.strokeWidth,u=Number(i),c=Number(o);return(Number.isNaN(u)||u<0)&&(u=r),(Number.isNaN(c)||c<0)&&(c=n),{r:u,strokeWidth:c}}return{r,strokeWidth:n}}function cx(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:NO}function dx(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:NO}var RO=(e,t,r)=>CP(e,"xAxis",cx(e,t),r),LO=(e,t,r)=>AP(e,"xAxis",cx(e,t),r),$O=(e,t,r)=>CP(e,"yAxis",dx(e,t),r),zO=(e,t,r)=>AP(e,"yAxis",dx(e,t),r),LQ=q([ft,RO,$O,LO,zO],(e,t,r,n,i)=>Gn(e,"xAxis")?Sf(t,n,!1):Sf(r,i,!1)),$Q=(e,t)=>t,FO=q([VC,$Q],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),BO=e=>{var t=ft(e),r=Gn(t,"xAxis");return r?"yAxis":"xAxis"},zQ=(e,t)=>{var r=BO(e);return r==="yAxis"?dx(e,t):cx(e,t)},FQ=(e,t,r)=>nP(e,BO(e),zQ(e,t),r),BQ=q([FO,FQ],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,i=dy(e);if(!(n==null||i==null)){var o=(r=t[n])===null||r===void 0?void 0:r.stackedData,u=o==null?void 0:o.find(c=>c.key===i);if(u!=null)return u.map(c=>[c[0],c[1]])}}}),UQ=q([ft,RO,$O,LO,zO,BQ,fB,LQ,FO,PB],(e,t,r,n,i,o,u,c,f,h)=>{var m=u.chartData,g=u.dataStartIndex,v=u.dataEndIndex;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||c==null)){var b=f.data,j;if(b&&b.length>0?j=b:j=m==null?void 0:m.slice(g,v+1),j!=null)return mY({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:o,displayedData:j,chartBaseValue:h,bandSize:c})}}),HQ=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],WQ=["id","baseLine"];function pu(){return pu=Object.assign?Object.assign.bind():function(e){for(var t=1;tg.y||0));return Ae(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.y||0),m)),Ae(m)?y.createElement("rect",{x:cg.x||0));return Ae(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.x||0),m)),Ae(m)?y.createElement("rect",{x:0,y:ce==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[Gs(Gs({},r.next),{},{x:ui(r.prev.x,r.next.x,t),y:ui(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),HO={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:ix,animationInterpolateFn:rY,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:QQ,xAxisId:0,yAxisId:0,zIndex:fr.area};function th(e,t){return e&&e!=="none"?e:t}var nY=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.fill,o=e.legendType,u=e.hide;return[{inactive:u,dataKey:t,type:o,color:th(n,i),value:mA(r,t),payload:e}]},iY=y.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,o=e.fill,u=e.name,c=e.hide,f=e.unit,h=e.tooltipType,m=e.id,g={dataDefinedOnItem:r,getPosition:Xs,settings:{stroke:n,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:mA(u,t),hide:c,type:h,color:th(n,o),unit:f,graphicalItemId:m}};return y.createElement(gV,{tooltipEntrySettings:g})});function aY(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.needClip,o=n.dot,u=n.dataKey,c=xn(n);return y.createElement(aq,{points:r,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:u,baseProps:c,needClip:i,clipPathId:t})}function oY(e){var t=e.showLabels,r=e.children,n=e.points,i=n.map(o=>{var u,c,f={x:(u=o.x)!==null&&u!==void 0?u:0,y:(c=o.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Gs(Gs({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return y.createElement(tV,{value:t?i:void 0},r)}function sY(e){var t=e.points,r=e.baseLine,n=e.needClip,i=e.clipPathId,o=e.props,u=e.animationElapsedTime,c=e.isAnimating,f=e.isEntrance,h=o.layout,m=o.type,g=o.stroke,v=o.connectNulls,b=o.isRange,j=o.shape,k=o.id,S=UO(o,YQ),N=Jr(S),E=Gs(Gs({},N),{},{id:k,points:t,connectNulls:v,type:m,baseLine:r,layout:h,stroke:g,isRange:b,animationElapsedTime:u,isAnimating:c,isEntrance:f});return y.createElement(y.Fragment,null,(t==null?void 0:t.length)>1&&y.createElement(en,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},y.createElement(pV,{option:j,DefaultShape:HO.shape,shapeProps:E})),y.createElement(aY,{points:t,props:S,clipPathId:i}))}function lY(e,t,r){if(Ae(e)){var n=Ae(t)?t:void 0;return ui(n,e,r)}if(Qt(e)||Fn(e)){var i=Ae(t)?t:void 0;return ui(i,0,r)}return e}function uY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=e.previousPointsRef,o=e.previousBaselineRef,u=n.points,c=n.baseLine,f=n.isAnimationActive,h=n.animationBegin,m=n.animationDuration,g=n.animationEasing,v=n.animationMatchBy,b=n.animationInterpolateFn,j=y.useMemo(()=>({points:u,baseLine:c}),[u,c]),k=kO(j,o),S=X0(),N=IV(n.onAnimationStart,n.onAnimationEnd),E=N.isAnimating,A=N.handleAnimationStart,P=N.handleAnimationEnd,_=k.startValue;if(S==null)return null;var O;return Array.isArray(c)&&Array.isArray(_)?O=d0(_,c,v):Array.isArray(c)?O=d0(null,c,v):O=null,y.createElement(TV,{animationInput:j,animationIdPrefix:"recharts-area-",items:u,previousItemsRef:i,isAnimationActive:f,animationBegin:h,animationDuration:m,animationEasing:g,onAnimationStart:A,onAnimationEnd:P,animationInterpolateFn:b,animationMatchBy:v,layout:S},(T,B,$)=>{var z;return B===1?z=c:Array.isArray(c)?z=b(O,B,S):z=$?c:lY(c,_,B),k.syncStepValue(z,B),y.createElement(oY,{showLabels:!E,points:u},n.children,y.createElement(sY,{points:T,baseLine:z,needClip:t,clipPathId:r,props:n,animationElapsedTime:B,isAnimating:E||B<1,isEntrance:$}),y.createElement(iV,{label:n.label}))})}function cY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=y.useRef(null),o=y.useRef();return y.createElement(uY,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:o})}class dY extends y.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,u=t.top,c=t.left,f=t.needClip,h=t.xAxisId,m=t.yAxisId,g=t.width,v=t.height,b=t.id,j=t.baseLine,k=t.zIndex;if(r)return null;var S=rt("recharts-area",o),N=b,E=RQ(n),A=E.r,P=E.strokeWidth,_=bO(n),O=A*2+P,T=f?"url(#clipPath-".concat(_?"":"dots-").concat(N,")"):void 0;return y.createElement(Ci,{zIndex:k},y.createElement(en,{className:S},f&&y.createElement("defs",null,y.createElement(DQ,{clipPathId:N,xAxisId:h,yAxisId:m}),!_&&y.createElement("clipPath",{id:"clipPath-dots-".concat(N)},y.createElement("rect",{x:c-O/2,y:u-O/2,width:g+O,height:v+O}))),y.createElement(cY,{needClip:f,clipPathId:N,props:this.props})),y.createElement($S,{points:i,mainColor:th(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(j)&&y.createElement($S,{points:j,mainColor:th(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}function fY(e){var t,r=e.activeDot,n=e.animationBegin,i=e.animationDuration,o=e.animationEasing,u=e.connectNulls,c=e.dot,f=e.fill,h=e.fillOpacity,m=e.hide,g=e.isAnimationActive,v=e.legendType,b=e.stroke,j=e.xAxisId,k=e.yAxisId,S=UO(e,XQ),N=Zs(),E=XP(),A=DO(j,k),P=A.needClip,_=Ar(),O=(t=Me(pe=>UQ(pe,e.id,_)))!==null&&t!==void 0?t:{},T=O.points,B=O.isRange,$=O.baseLine,z=ox();if(N!=="horizontal"&&N!=="vertical"||z==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var Q=z.height,U=z.width,ve=z.x,ue=z.y;return!T||!T.length?null:y.createElement(dY,eh({},S,{activeDot:r,animationBegin:n,animationDuration:i,animationEasing:o,baseLine:$,connectNulls:u,dot:c,fill:f,fillOpacity:h,height:Q,hide:m,layout:N,isAnimationActive:g,isRange:B,legendType:v,needClip:P,points:T,stroke:b,width:U,left:ve,top:ue,xAxisId:j,yAxisId:k}))}var hY=(e,t,r,n,i)=>{var o=r??t;if(Ae(o))return o;var u=e==="horizontal"?i:n,c=u.scale.domain();if(u.type==="number"){var f=Math.max(c[0],c[1]),h=Math.min(c[0],c[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return o==="dataMin"?c[0]:o==="dataMax"?c[1]:c[0]};function mY(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,i=t.dataKey,o=e.stackedData,u=e.layout,c=e.chartBaseValue,f=e.xAxis,h=e.yAxis,m=e.displayedData,g=e.dataStartIndex,v=e.xAxisTicks,b=e.yAxisTicks,j=e.bandSize,k=o&&o.length,S=hY(u,c,n,f,h),N=u==="horizontal",E=!1,A=m.map((_,O)=>{var T,B,$,z;if(k)z=o[g+O];else{var Q=Lt(_,i);Array.isArray(Q)?(z=Q,E=!0):z=[S,Q]}var U=(T=(B=z)===null||B===void 0?void 0:B[1])!==null&&T!==void 0?T:null,ve=U==null||k&&!r&&Lt(_,i)==null;if(N){var ue;return{x:Uk({axis:f,ticks:v,bandSize:j,entry:_,index:O}),y:ve?null:(ue=h.scale.map(U))!==null&&ue!==void 0?ue:null,value:z,payload:_}}return{x:ve?null:($=f.scale.map(U))!==null&&$!==void 0?$:null,y:Uk({axis:h,ticks:b,bandSize:j,entry:_,index:O}),value:z,payload:_}}),P;return k||E?P=A.map(_=>{var O,T=Array.isArray(_.value)?_.value[0]:null;if(N){var B;return{x:_.x,y:T!=null&&_.y!=null&&(B=h.scale.map(T))!==null&&B!==void 0?B:null,payload:_.payload}}return{x:T!=null&&(O=f.scale.map(T))!==null&&O!==void 0?O:null,y:_.y,payload:_.payload}}):P=N?h.scale.map(S):f.scale.map(S),{points:A,baseLine:P??0,isRange:E}}function pY(e){var t=rn(e,HO),r=Ar();return y.createElement(HV,{id:t.id,type:"area"},n=>y.createElement(y.Fragment,null,y.createElement(vV,{legendPayload:nY(t)}),y.createElement(iY,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),y.createElement(YV,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Zz(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),y.createElement(fY,eh({},t,{id:n}))))}var WO=y.memo(pY,zh);WO.displayName="Area";var gY=["domain","range"],vY=["domain","range"];function qS(e,t){if(e==null)return{};var r,n,i=yY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{if(u!=null)return XS(XS({},o),{},{type:u})},[o,u]);return y.useLayoutEffect(()=>{c!=null&&(r.current===null?t(cq(c)):r.current!==c&&t(dq({prev:r.current,next:c})),r.current=c)},[c,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(fq(r.current)),r.current=null)},[t]),null}var AY=e=>{var t=e.xAxisId,r=e.className,n=Me(gA),i=Ar(),o="xAxis",u=Me(v=>EP(v,o,t,i)),c=Me(v=>sH(v,t)),f=Me(v=>hH(v,t)),h=Me(v=>HC(v,t));if(c==null||f==null||h==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=h0(e,bY);h.id,h.scale;var g=h0(h,wY);return y.createElement(lx,f0({},m,g,{x:f.x,y:f.y,width:c.width,height:c.height,className:rt("recharts-".concat(o," ").concat(o),r),viewBox:n,ticks:u,axisType:o,axisId:t}))},CY={allowDataOverflow:Ct.allowDataOverflow,allowDecimals:Ct.allowDecimals,allowDuplicatedCategory:Ct.allowDuplicatedCategory,angle:Ct.angle,axisLine:mi.axisLine,height:Ct.height,hide:!1,includeHidden:Ct.includeHidden,interval:Ct.interval,label:!1,minTickGap:Ct.minTickGap,mirror:Ct.mirror,orientation:Ct.orientation,padding:Ct.padding,reversed:Ct.reversed,scale:Ct.scale,tick:Ct.tick,tickCount:Ct.tickCount,tickLine:mi.tickLine,tickSize:mi.tickSize,type:Ct.type,niceTicks:Ct.niceTicks,xAxisId:0},PY=e=>{var t=rn(e,CY);return y.createElement(y.Fragment,null,y.createElement(EY,{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}),y.createElement(AY,t))},GO=y.memo(PY,KO);GO.displayName="XAxis";var OY=["type"],_Y=["dangerouslySetInnerHTML","ticks","scale"],MY=["id","scale"];function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(u!=null)return JS(JS({},o),{},{type:u})},[u,o]);return y.useLayoutEffect(()=>{c!=null&&(r.current===null?t(hq(c)):r.current!==c&&t(mq({prev:r.current,next:c})),r.current=c)},[c,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(pq(r.current)),r.current=null)},[t]),null}function $Y(e){var t=e.yAxisId,r=e.className,n=e.width,i=e.label,o=y.useRef(null),u=y.useRef(null),c=Me(gA),f=Ar(),h=Nt(),m="yAxis",g=Me(N=>gH(N,t)),v=Me(N=>pH(N,t)),b=Me(N=>EP(N,m,t,f)),j=Me(N=>WC(N,t));if(y.useLayoutEffect(()=>{if(!(n!=="auto"||!g||nx(i)||y.isValidElement(i)||j==null)){var N=o.current;if(N){var E=N.getCalculatedWidth();Math.round(g.width)!==Math.round(E)&&h(gq({id:t,width:E}))}}},[b,g,h,i,t,n,j]),g==null||v==null||j==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var k=p0(e,_Y);j.id,j.scale;var S=p0(j,MY);return y.createElement(lx,m0({},k,S,{ref:o,labelRef:u,x:v.x,y:v.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:g.width,height:g.height,className:rt("recharts-".concat(m," ").concat(m),r),viewBox:c,ticks:b,axisType:m,axisId:t}))}var zY={allowDataOverflow:Pt.allowDataOverflow,allowDecimals:Pt.allowDecimals,allowDuplicatedCategory:Pt.allowDuplicatedCategory,angle:Pt.angle,axisLine:mi.axisLine,hide:!1,includeHidden:Pt.includeHidden,interval:Pt.interval,label:!1,minTickGap:Pt.minTickGap,mirror:Pt.mirror,orientation:Pt.orientation,padding:Pt.padding,reversed:Pt.reversed,scale:Pt.scale,tick:Pt.tick,tickCount:Pt.tickCount,tickLine:mi.tickLine,tickSize:mi.tickSize,type:Pt.type,niceTicks:Pt.niceTicks,width:Pt.width,yAxisId:0},FY=e=>{var t=rn(e,zY);return y.createElement(y.Fragment,null,y.createElement(LY,{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}),y.createElement($Y,t))},VO=y.memo(FY,KO);VO.displayName="YAxis";var BY=(e,t)=>t,fx=q([BY,ft,iC,zt,KP,Ai,$W,Zt],KW);function UY(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function hx(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(UY(e)){var i=e.currentTarget.getBBox();r=i.width>0?t.width/i.width:1,n=i.height>0?t.height/i.height:1}else{var o=e.currentTarget;r=o.offsetWidth>0?t.width/o.offsetWidth:1,n=o.offsetHeight>0?t.height/o.offsetHeight:1}var u=(c,f)=>({relativeX:Math.round((c-t.left)/r),relativeY:Math.round((f-t.top)/n)});return"touches"in e?Array.from(e.touches).map(c=>u(c.clientX,c.clientY)):u(e.clientX,e.clientY)}var qO=zr("mouseClick"),QO=Qu();QO.startListening({actionCreator:qO,effect:(e,t)=>{var r=e.payload,n=fx(t.getState(),hx(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(_H({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var g0=zr("mouseMove"),YO=Qu(),ss=null,za=null,Wg=null;YO.startListening({actionCreator:g0,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,o=i.throttleDelay,u=i.throttledEvents,c=u==="all"||(u==null?void 0:u.includes("mousemove"));ss!==null&&(cancelAnimationFrame(ss),ss=null),za!==null&&(typeof o!="number"||!c)&&(clearTimeout(za),za=null),Wg=hx(r);var f=()=>{var h=t.getState(),m=lc(h,h.tooltip.settings.shared);if(!Wg){ss=null,za=null;return}if(m==="axis"){var g=fx(h,Wg);(g==null?void 0:g.activeIndex)!=null?t.dispatch(DP({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate})):t.dispatch(TP())}ss=null,za=null};if(!c){f();return}o==="raf"?ss=requestAnimationFrame(f):typeof o=="number"&&za===null&&(za=setTimeout(f,o))}});function HY(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var eN={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},XO=lr({name:"rootProps",initialState:eN,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:eN.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}}}),WY=XO.reducer,KY=XO.actions.updateOptions,GY=null,VY={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)},ZO=lr({name:"polarOptions",initialState:GY,reducers:VY});ZO.actions.updatePolarOptions;var qY=ZO.reducer,JO=zr("keyDown"),e_=zr("focus"),t_=zr("blur"),am=Qu(),ls=null,Fa=null,Wd=null;am.startListening({actionCreator:JO,effect:(e,t)=>{Wd=e.payload,ls!==null&&(cancelAnimationFrame(ls),ls=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,o=n.throttledEvents,u=o==="all"||o.includes("keydown");Fa!==null&&(typeof i!="number"||!u)&&(clearTimeout(Fa),Fa=null);var c=()=>{try{var f=t.getState(),h=f.rootProps.accessibilityLayer!==!1;if(!h)return;var m=f.tooltip.keyboardInteraction,g=Wd;if(g!=="ArrowRight"&&g!=="ArrowLeft"&&g!=="Enter")return;var v=hu(m,xo(f),Ws(f),Ks(f)),b=v==null?-1:Number(v),j=!Number.isFinite(b)||b<0,k=Ai(f),S=xo(f),N=lc(f,f.tooltip.settings.shared);if(g==="Enter"){if(j)return;var E=Qf(f,N,"hover",String(m.index));t.dispatch(qf({active:!m.active,activeIndex:m.index,activeCoordinate:E}));return}var A=wH(f),P=A==="left-to-right"?1:-1,_=g==="ArrowRight"?1:-1,O;if(j){var T=Ws(f),B=Ks(f),$=_*P,z=pe=>({active:!1,index:String(pe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(O=-1,$>0){for(var Q=0;Q=0;U--)if(hu(z(U),S,T,B)!=null){O=U;break}if(O<0)return}else{O=b+_*P;var ve=(k==null?void 0:k.length)||S.length;if(ve===0||O>=ve||O<0)return}var ue=Qf(f,N,"hover",String(O));t.dispatch(qf({active:!0,activeIndex:O.toString(),activeCoordinate:ue}))}finally{ls=null,Fa=null}};if(!u){c();return}i==="raf"?ls=requestAnimationFrame(c):typeof i=="number"&&Fa===null&&(c(),Wd=null,Fa=setTimeout(()=>{Wd?c():(Fa=null,ls=null)},i))}});am.startListening({actionCreator:e_,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var o="0",u=lc(r,r.tooltip.settings.shared),c=Qf(r,u,"hover",String(o));t.dispatch(qf({active:!0,activeIndex:o,activeCoordinate:c}))}}}});am.startListening({actionCreator:t_,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(qf({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function r_(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var i=Reflect.get(r,n);return typeof i=="function"?i.bind(r):i}})}var Vr=zr("externalEvent"),n_=Qu(),Kd=new Map,ou=new Map,Kg=new Map;n_.startListening({actionCreator:Vr,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var o=i.type,u=r_(i);Kg.set(o,{handler:n,reactEvent:u});var c=Kd.get(o);c!==void 0&&(cancelAnimationFrame(c),Kd.delete(o));var f=t.getState(),h=f.eventSettings,m=h.throttleDelay,g=h.throttledEvents,v=g,b=v==="all"||(v==null?void 0:v.includes(o)),j=ou.get(o);j!==void 0&&(typeof m!="number"||!b)&&(clearTimeout(j),ou.delete(o));var k=()=>{var E=Kg.get(o);try{if(!E)return;var A=E.handler,P=E.reactEvent,_=t.getState(),O={activeCoordinate:jW(_),activeDataKey:bW(_),activeIndex:Ru(_),activeLabel:qP(_),activeTooltipIndex:Ru(_),isTooltipActive:SW(_)};A&&A(O,P)}finally{Kd.delete(o),ou.delete(o),Kg.delete(o)}};if(!b){k();return}if(m==="raf"){var S=requestAnimationFrame(k);Kd.set(o,S)}else if(typeof m=="number"){if(!ou.has(o)){k();var N=setTimeout(k,m);ou.set(o,N)}}else k()}}});var QY=q([ol],e=>e.tooltipItemPayloads),YY=q([QY,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(o=>o.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),i_=zr("touchMove"),a_=Qu(),Ba=null,Yi=null,tN=null,su=null;a_.startListening({actionCreator:i_,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){su=r_(r);var n=t.getState(),i=n.eventSettings,o=i.throttleDelay,u=i.throttledEvents,c=u==="all"||u.includes("touchmove");Ba!==null&&(cancelAnimationFrame(Ba),Ba=null),Yi!==null&&(typeof o!="number"||!c)&&(clearTimeout(Yi),Yi=null),tN=Array.from(r.touches).map(h=>hx({clientX:h.clientX,clientY:h.clientY,currentTarget:r.currentTarget}));var f=()=>{if(su!=null){var h=t.getState(),m=lc(h,h.tooltip.settings.shared);if(m==="axis"){var g,v=(g=tN)===null||g===void 0?void 0:g[0];if(v==null){Ba=null,Yi=null;return}var b=fx(h,v);(b==null?void 0:b.activeIndex)!=null&&t.dispatch(DP({activeIndex:b.activeIndex,activeDataKey:void 0,activeCoordinate:b.activeCoordinate}))}else if(m==="item"){var j,k=su.touches[0];if(document.elementFromPoint==null||k==null)return;var S=document.elementFromPoint(k.clientX,k.clientY);if(!S||!S.getAttribute)return;var N=S.getAttribute(a6),E=(j=S.getAttribute(o6))!==null&&j!==void 0?j:void 0,A=Eo(h).find(O=>O.id===E);if(N==null||A==null||E==null)return;var P=A.dataKey,_=YY(h,N,E);t.dispatch(OH({activeDataKey:P,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:E}))}Ba=null,Yi=null}};if(!c){f();return}o==="raf"?Ba=requestAnimationFrame(f):typeof o=="number"&&Yi===null&&(f(),su=null,Yi=setTimeout(()=>{su?f():(Yi=null,Ba=null)},o))}}});var o_={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},s_=lr({name:"eventSettings",initialState:o_,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),XY=s_.actions.setEventSettings,ZY=s_.reducer,JY=LE({brush:Eq,cartesianAxis:vq,chartData:kK,errorBars:TQ,eventSettings:ZY,graphicalItems:qV,layout:Hz,legend:n8,options:vK,polarAxis:oV,polarOptions:qY,referenceElements:Oq,renderedTicks:Zq,rootProps:WY,tooltip:MH,zIndex:iK}),eX=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return mz({reducer:JY,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([QO.middleware,YO.middleware,am.middleware,n_.middleware,a_.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(ZE({type:"raf"}))},devTools:{serialize:{replacer:HY},name:"recharts-".concat(r)}})};function tX(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=Ar(),o=y.useRef(null);if(i)return r;o.current==null&&(o.current=eX(t,n));var u=U0;return y.createElement(x8,{context:u,store:o.current},r)}function rX(e){var t=e.layout,r=e.margin,n=Nt(),i=Ar();return y.useEffect(()=>{i||(n(Fz(t)),n(zz(r)))},[n,i,t,r]),null}var nX=y.memo(rX,zh);function iX(e){var t=Nt();return y.useEffect(()=>{t(KY(e))},[t,e]),null}var aX=e=>{var t=Nt();return y.useEffect(()=>{t(XY(e))},[t,e]),null},oX=y.memo(aX,zh);function rN(e){var t=e.zIndex,r=e.isPanorama,n=y.useRef(null),i=Nt();return y.useLayoutEffect(()=>(n.current&&i(rK({zIndex:t,element:n.current,isPanorama:r})),()=>{i(nK({zIndex:t,isPanorama:r}))}),[i,t,r]),y.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function nN(e){var t=e.children,r=e.isPanorama,n=Me(VW);if(!n||n.length===0)return t;var i=n.filter(u=>u<0),o=n.filter(u=>u>0);return y.createElement(y.Fragment,null,i.map(u=>y.createElement(rN,{key:u,zIndex:u,isPanorama:r})),t,o.map(u=>y.createElement(rN,{key:u,zIndex:u,isPanorama:r})))}var sX=["children"];function lX(e,t){if(e==null)return{};var r,n,i=uX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=wA(),n=kA(),i=MA();if(!Un(r)||!Un(n))return null;var o=e.children,u=e.otherAttributes,c=e.title,f=e.desc,h,m;return u!=null&&(typeof u.tabIndex=="number"?h=u.tabIndex:h=i?0:void 0,typeof u.role=="string"?m=u.role:m=i?"application":void 0),y.createElement(tE,rh({},u,{title:c,desc:f,role:m,tabIndex:h,width:r,height:n,style:cX,ref:t}),o)}),fX=e=>{var t=e.children,r=Me(Th);if(!r)return null;var n=r.width,i=r.height,o=r.y,u=r.x;return y.createElement(tE,{width:n,height:i,x:u,y:o},t)},iN=y.forwardRef((e,t)=>{var r=e.children,n=lX(e,sX),i=Ar();return i?y.createElement(fX,null,y.createElement(nN,{isPanorama:!0},r)):y.createElement(dX,rh({ref:t},n),y.createElement(nN,{isPanorama:!1},r))});function hX(e,t){return vX(e)||gX(e,t)||pX(e,t)||mX()}function mX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pX(e,t){if(e){if(typeof e=="string")return aN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?aN(e,t):void 0}}function aN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var u=n.getBoundingClientRect(),c=u.width/n.offsetWidth;We(c)&&c!==o&&e(Uz(c))}},[n,e,o]),i}function oN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xX(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(_K(),null);function ih(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var CX=y.forwardRef((e,t)=>{var r,n,i=y.useRef(null),o=y.useState({containerWidth:ih((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:ih((n=e.style)===null||n===void 0?void 0:n.height)}),u=nh(o,2),c=u[0],f=u[1],h=y.useCallback((g,v)=>{f(b=>{var j=Math.round(g),k=Math.round(v);return b.containerWidth===j&&b.containerHeight===k?b:{containerWidth:j,containerHeight:k}})},[]),m=y.useCallback(g=>{if(typeof t=="function"&&t(g),i.current!=null&&(i.current.disconnect(),i.current=null),g!=null&&typeof ResizeObserver<"u"){var v=g.getBoundingClientRect(),b=v.width,j=v.height;h(b,j);var k=N=>{var E=N[0];if(E!=null){var A=E.contentRect,P=A.width,_=A.height;h(P,_)}},S=new ResizeObserver(k);S.observe(g),i.current=S}},[t,h]);return y.useEffect(()=>()=>{var g=i.current;g!=null&&g.disconnect()},[h]),y.createElement(y.Fragment,null,y.createElement(Xu,{width:c.containerWidth,height:c.containerHeight}),y.createElement("div",pa({ref:m},e)))}),PX=y.forwardRef((e,t)=>{var r=e.width,n=e.height,i=y.useState({containerWidth:ih(r),containerHeight:ih(n)}),o=nh(i,2),u=o[0],c=o[1],f=y.useCallback((m,g)=>{c(v=>{var b=Math.round(m),j=Math.round(g);return v.containerWidth===b&&v.containerHeight===j?v:{containerWidth:b,containerHeight:j}})},[]),h=y.useCallback(m=>{if(typeof t=="function"&&t(m),m!=null){var g=m.getBoundingClientRect(),v=g.width,b=g.height;f(v,b)}},[t,f]);return y.createElement(y.Fragment,null,y.createElement(Xu,{width:u.containerWidth,height:u.containerHeight}),y.createElement("div",pa({ref:h},e)))}),OX=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return y.createElement(y.Fragment,null,y.createElement(Xu,{width:r,height:n}),y.createElement("div",pa({ref:t},e)))}),_X=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?y.createElement(PX,pa({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?y.createElement(OX,pa({},e,{width:r,height:n,ref:t})):y.createElement(y.Fragment,null,y.createElement(Xu,{width:r,height:n}),y.createElement("div",pa({ref:t},e)))});function MX(e){return e?CX:_X}var IX=y.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,o=e.onClick,u=e.onContextMenu,c=e.onDoubleClick,f=e.onMouseDown,h=e.onMouseEnter,m=e.onMouseLeave,g=e.onMouseMove,v=e.onMouseUp,b=e.onTouchEnd,j=e.onTouchMove,k=e.onTouchStart,S=e.style,N=e.width,E=e.responsive,A=e.dispatchTouchEvents,P=A===void 0?!0:A,_=y.useRef(null),O=Nt(),T=y.useState(null),B=nh(T,2),$=B[0],z=B[1],Q=y.useState(null),U=nh(Q,2),ve=U[0],ue=U[1],pe=yX(),oe=Q0(),se=(oe==null?void 0:oe.width)>0?oe.width:N,X=(oe==null?void 0:oe.height)>0?oe.height:i,ne=y.useCallback(_e=>{pe(_e),typeof t=="function"&&t(_e),z(_e),ue(_e),_e!=null&&(_.current=_e)},[pe,t,z,ue]),te=y.useCallback(_e=>{O(qO(_e)),O(Vr({handler:o,reactEvent:_e}))},[O,o]),I=y.useCallback(_e=>{O(g0(_e)),O(Vr({handler:h,reactEvent:_e}))},[O,h]),M=y.useCallback(_e=>{O(TP()),O(Vr({handler:m,reactEvent:_e}))},[O,m]),H=y.useCallback(_e=>{O(g0(_e)),O(Vr({handler:g,reactEvent:_e}))},[O,g]),ie=y.useCallback(()=>{O(e_())},[O]),J=y.useCallback(()=>{O(t_())},[O]),Z=y.useCallback(_e=>{O(JO(_e.key))},[O]),ae=y.useCallback(_e=>{O(Vr({handler:u,reactEvent:_e}))},[O,u]),me=y.useCallback(_e=>{O(Vr({handler:c,reactEvent:_e}))},[O,c]),re=y.useCallback(_e=>{O(Vr({handler:f,reactEvent:_e}))},[O,f]),ye=y.useCallback(_e=>{O(Vr({handler:v,reactEvent:_e}))},[O,v]),Oe=y.useCallback(_e=>{O(Vr({handler:k,reactEvent:_e}))},[O,k]),de=y.useCallback(_e=>{P&&O(i_(_e)),O(Vr({handler:j,reactEvent:_e}))},[O,P,j]),Ze=y.useCallback(_e=>{O(Vr({handler:b,reactEvent:_e}))},[O,b]),Ue=MX(E);return y.createElement(rO.Provider,{value:$},y.createElement(VR.Provider,{value:ve},y.createElement(Ue,{width:se??(S==null?void 0:S.width),height:X??(S==null?void 0:S.height),className:rt("recharts-wrapper",n),style:xX({position:"relative",cursor:"default",width:se,height:X},S),onClick:te,onContextMenu:ae,onDoubleClick:me,onFocus:ie,onBlur:J,onKeyDown:Z,onMouseDown:re,onMouseEnter:I,onMouseLeave:M,onMouseMove:H,onMouseUp:ye,onTouchEnd:Ze,onTouchMove:de,onTouchStart:Oe,ref:ne},y.createElement(AX,null),r)))}),TX=["width","height","responsive","children","className","style","compact","title","desc"];function DX(e,t){if(e==null)return{};var r,n,i=RX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,o=e.children,u=e.className,c=e.style,f=e.compact,h=e.title,m=e.desc,g=DX(e,TX),v=xn(g);return f?y.createElement(y.Fragment,null,y.createElement(Xu,{width:r,height:n}),y.createElement(iN,{otherAttributes:v,title:h,desc:m},o)):y.createElement(IX,{className:u,style:c,width:r,height:n,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},y.createElement(iN,{otherAttributes:v,title:h,desc:m,ref:t},y.createElement(Lq,null,o)))});function v0(){return v0=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.createElement(WX,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:KX,tooltipPayloadSearcher:pK,categoricalChartProps:e,ref:t}));const VX="rgba(130,130,150,0.14)",uN="rgba(130,130,150,0.85)";function qX(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function l_(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function QX({active:e,payload:t,unit:r}){return!e||!(t!=null&&t.length)?null:l.jsx("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:l.jsx("div",{className:"space-y-1",children:t.map(n=>l.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.color}}),l.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:n.name}),l.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:l_(n.value,r)})]},n.dataKey))})})}function u_({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176}){const o=e.reduce((c,f)=>t.reduce((h,m)=>Math.max(h,Number(f[m.key])||0),c),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(qX(o*1.15),10);return l.jsx("div",{style:{height:i},className:"w-full",children:l.jsx(z6,{width:"100%",height:"100%",children:l.jsxs(GX,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[l.jsx("defs",{children:t.map(c=>l.jsxs("linearGradient",{id:`grad-${c.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:c.color,stopOpacity:.22}),l.jsx("stop",{offset:"100%",stopColor:c.color,stopOpacity:0})]},c.key))}),l.jsx(IO,{vertical:!1,stroke:VX}),l.jsx(GO,{dataKey:"t",hide:!0}),l.jsx(VO,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:c=>l_(c,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:uN}}),l.jsx(WK,{content:l.jsx(QX,{unit:r}),cursor:{stroke:uN,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(c=>l.jsx(WO,{type:"monotone",dataKey:c.key,name:c.label,stroke:c.color,strokeWidth:2,fill:`url(#grad-${c.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},c.key))]})})})}const YX=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function XX(){var u,c,f,h;const{sys:e,hist:t}=RR(),r=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),n=YX.filter(m=>m.key!=="gpu"||r),i={cpu:(u=e==null?void 0:e.cpu)==null?void 0:u.percent,ram:(c=e==null?void 0:e.ram)==null?void 0:c.percent,gpu:r?e.gpu.busy_percent:null,disk:(f=e==null?void 0:e.disk)==null?void 0:f.percent},o={cpu:(h=e==null?void 0:e.cpu)!=null&&h.cores?`${e.cpu.cores} Cores`:"",ram:e?`${Qr(e.ram.used)}/${Qr(e.ram.total)} GB`:"",gpu:r?`${Qr(e.gpu.gtt_used)}/${Qr(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${Qr(e.disk.used)}/${Qr(e.disk.total)} GB`:""};return l.jsxs("div",{className:"flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsx(pi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:n.map(m=>l.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:m.color}}),l.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:m.label}),l.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(i[m.key]??0),"%"]}),o[m.key]&&l.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:o[m.key]})]},m.key))}),l.jsx(u_,{data:t,series:n,unit:"%",yMode:"percent",height:176})]}):l.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&l.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&l.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&l.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}const cN=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function ZX(){const{data:e}=B5(3e3),t=_R(),r=t[t.length-1],n=r?Math.round(r.prompt+r.completion):0;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(oh,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Token-Durchsatz"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e&&l.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[l.jsx("span",{className:"font-space text-3xl font-bold tracking-tight text-foreground tabular-nums",children:n.toLocaleString("de-DE")}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"tok/s aktuell"})]}),e&&l.jsxs("div",{className:"mt-0.5 space-y-0.5 font-mono text-[11px] text-muted-foreground/70",children:[l.jsxs("div",{children:[e.total_tokens.toLocaleString("de-DE")," Tokens gesamt · ",l.jsxs("span",{className:"text-emerald-400/90",children:[e.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," € gespart"]})]}),l.jsxs("div",{className:"text-muted-foreground/55",children:["Input ",e.prompt_tokens.toLocaleString("de-DE")," · Output ",e.completion_tokens.toLocaleString("de-DE")]})]})]}),l.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1.5 pt-1",children:cN.map(i=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:i.label}),l.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((r==null?void 0:r[i.key])??0)})]},i.key))})]}),e?l.jsx(u_,{data:t,series:cN,unit:" tok/s",yMode:"auto",height:150}):l.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),l.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}function JX(){const{data:e}=gh(3e4),{data:t}=wi(),r=((e==null?void 0:e.os)||0)+((e==null?void 0:e.engine)||0)+((e==null?void 0:e.swap)||0)+((e==null?void 0:e.models)||0),n=()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}})),i=(t==null?void 0:t.models)??[],o=(t==null?void 0:t.running)??[],u=i.find(m=>m.role==="hermes"),c=i.find(m=>m.role==="coder-lite")||i.find(m=>m.role==="coder"),f=m=>m?o.includes(m):!1,h=m=>{var g;return((g=m==null?void 0:m.split("/").pop())==null?void 0:g.replace(/\.gguf$/i,""))||"—"};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Basisstation"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geht's der Box gut, gibt's Updates, was läuft gerade."})]}),l.jsx(TR,{frame:"box"}),l.jsxs("button",{onClick:n,className:ee("w-full flex items-center gap-3 rounded-2xl border p-4 text-left transition-all cursor-pointer",r>0?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10":"border-border/60 bg-card/45 hover:border-primary/40"),children:[r>0?l.jsx(fM,{className:"h-6 w-6 shrink-0 text-amber-400"}):l.jsx(qt,{className:"h-6 w-6 shrink-0 text-emerald-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:ee("text-sm font-semibold",r>0?"text-amber-400":"text-foreground"),children:r>0?`${r} Update${r===1?"":"s"} verfügbar`:"Alles aktuell"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r>0?"Antippen, um zu sehen, was genau aktualisiert wird.":"Keine ausstehenden Updates."})]}),r>0&&l.jsxs("span",{className:"shrink-0 flex items-center gap-1 text-xs font-semibold text-amber-400",children:["Ansehen ",l.jsx(Ku,{className:"h-4 w-4"})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:"Was gerade läuft"}),l.jsx("div",{className:"rounded-2xl border border-border/60 overflow-hidden",children:[{icon:pi,label:"Lucys Hirn",model:u==null?void 0:u.name,warm:f(u==null?void 0:u.name)},{icon:Ts,label:"Coder (Vibe-Coding)",model:c==null?void 0:c.name,warm:f(c==null?void 0:c.name)}].map(m=>l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/40 last:border-0",children:[l.jsx("span",{className:ee("h-2 w-2 shrink-0 rounded-full",m.warm?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),l.jsx(m.icon,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-sm text-foreground w-40 shrink-0",children:m.label}),l.jsx("span",{className:"text-xs text-muted-foreground flex-1 truncate font-mono",children:h(m.model)}),l.jsx("span",{className:ee("text-xs shrink-0",m.warm?"text-emerald-400":"text-muted-foreground"),children:m.model?m.warm?"warm":"bereit":"nicht gesetzt"})]},m.label))})]}),l.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[l.jsx(XX,{}),l.jsx(ZX,{})]})]})}const eZ=e=>!!ct(e).protected;function tZ({role:e,roleRec:t,models:r,onAssign:n,onClose:i}){var f,h;const o=t&&t.role===e?t:null,u={};o==null||o.models.forEach(m=>{u[m.name]=m});const c=o?o.models.map(m=>r.find(g=>g.name===m.name)).filter(Boolean):r;return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":`${ct(e).label} konfigurieren`,children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(so,{role:e})," festlegen"]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell für ",l.jsx("strong",{className:"text-foreground",children:ct(e).label}),l.jsx("span",{className:"block text-[10px] text-muted-foreground/70 mt-0.5",children:ct(e).desc})]}),(o==null?void 0:o.recommended)&&l.jsxs("button",{onClick:()=>n(o.recommended),title:(f=u[o.recommended])==null?void 0:f.reason,className:"shrink-0 h-7 px-3 text-[11px] font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg cursor-pointer flex items-center gap-1",children:[l.jsx(ga,{className:"h-3 w-3"})," Auto: ",(h=o.recommended.split("/").pop())==null?void 0:h.replace(/\.gguf$/i,"")]})]}),l.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[eZ(e)?l.jsx("div",{className:"w-full px-3 py-2 rounded-lg text-[11px] text-muted-foreground border border-border/30 bg-background/20 flex items-center gap-1.5",children:"🔒 Diese Rolle ist lebenswichtig und kann nicht leer bleiben — wähle stattdessen ein anderes Modell."}):l.jsx("button",{onClick:()=>n(""),className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:l.jsx("span",{children:"Zuweisung entfernen"})}),c.map(m=>{var k;const g=u[m.name],v=m.role===e,b=!!(g!=null&&g.recommended),j=!!g&&!g.suitable;return l.jsxs("button",{onClick:()=>n(m.name),className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border",b?"border-primary/50 bg-primary/10":v?"text-primary font-bold bg-primary/5 border-primary/30":j?"border-border/20 bg-background/10 opacity-60":"text-foreground bg-background/20 border-border/30"),children:[l.jsxs("div",{className:"flex flex-col text-left min-w-0",children:[l.jsxs("span",{className:"truncate max-w-[260px] font-semibold flex items-center gap-1.5",children:[(k=m.name.split("/").pop())==null?void 0:k.replace(/\.gguf$/i,""),b&&l.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wide text-primary bg-primary/15 px-1.5 py-0.5 rounded",children:"Empfohlen"})]}),l.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:g?`${g.params_b}B · ${m.quant} · ${g.reason}`:`${or(m.size_bytes)} · ${m.quant}`})]}),v&&l.jsx(qt,{className:"h-4 w-4 shrink-0 text-primary"})]},m.name)})]})]})})}const rZ=["fast","heavy","heavy_chars"],nZ=["coder_lite","coder","coding_escalate_chars"];function iZ(){const e=Kn(),{data:t,isLoading:r}=zD(),[n,i]=y.useState(null),[o,u]=y.useState(!1),[c,f]=y.useState(""),[h,m]=y.useState(0);if(y.useEffect(()=>{t!=null&&t.policy&&!n&&i({...t.policy})},[t,n]),r||!t||!n)return l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-xs text-muted-foreground",children:"Lade Routing-Policy…"});const g=N=>t.fields.find(E=>E.key===N),v=Object.keys(n).some(N=>n[N]!==t.policy[N]),b=(N,E)=>{i(A=>A&&{...A,[N]:E}),f("")},j=N=>b(N,t.defaults[N]);async function k(){if(!n)return;const N={};for(const E of Object.keys(n))n[E]!==t.policy[E]&&(N[E]=n[E]);if(Object.keys(N).length!==0){u(!0),f("");try{const{policy:E}=await LD(N);i({...E}),e.invalidateQueries({queryKey:Be.routingPolicy}),e.invalidateQueries({queryKey:Be.routing}),m(Date.now()),setTimeout(()=>m(0),2e3)}catch(E){f(E.message||String(E))}finally{u(!1)}}}function S({k:N}){const E=g(N),A=n[N],P=n[N]===t.defaults[N];return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("label",{className:"text-[10px] font-semibold text-muted-foreground",children:E.label}),!P&&l.jsxs("button",{onClick:()=>j(N),className:"flex items-center gap-0.5 text-[9px] text-muted-foreground/60 hover:text-foreground transition-colors cursor-pointer",title:`Auf Default zurücksetzen (${String(t.defaults[N])||"leer"})`,children:[l.jsx($M,{className:"h-2.5 w-2.5"})," Default"]})]}),E.type==="bool"?l.jsxs("button",{onClick:()=>b(N,!A),className:ee("flex h-8 w-full items-center justify-between rounded-lg border px-3 text-[11px] font-semibold transition-all cursor-pointer",A?"border-emerald-500/40 bg-emerald-500/10 text-emerald-300":"border-border/40 bg-background/40 text-muted-foreground"),children:[l.jsx("span",{children:A?"An":"Aus"}),l.jsx("span",{className:ee("h-3.5 w-3.5 rounded-full transition-colors",A?"bg-emerald-400":"bg-muted-foreground/40")})]}):E.type==="int"?l.jsx("input",{type:"number",value:A,min:E.min,max:E.max,"aria-label":E.label,onChange:_=>b(N,Number(_.target.value)),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"}):l.jsx("input",{type:"text",value:A,"aria-label":E.label,spellCheck:!1,placeholder:N==="coder_lite"?"(leer = aus)":"",onChange:_=>b(N,_.target.value),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"})]})}return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(KM,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lane-Routing & Policy"}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-300 border border-emerald-500/20",children:"hot-reload"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx("span",{className:"text-[10px] text-red-400 max-w-[280px] truncate",title:c,children:c}),h>0&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400",children:[l.jsx(qt,{className:"h-3.5 w-3.5"})," gespeichert"]}),l.jsxs("button",{onClick:k,disabled:!v||o,className:ee("h-8 px-4 rounded-lg text-[10px] font-bold uppercase tracking-wide transition-all flex items-center gap-1.5",v&&!o?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer shadow-md shadow-primary/10":"bg-background/40 text-muted-foreground/50 border border-border/40 cursor-not-allowed"),children:[o?l.jsx(qs,{className:"h-3.5 w-3.5 animate-spin"}):null,"Speichern"]})]})]}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed -mt-1",children:["Welches echte Modell hinter den virtuellen Lanes ",l.jsx("code",{className:"text-cyan-300",children:"chat"})," und"," ",l.jsx("code",{className:"text-cyan-300",children:"coding"})," steckt. Änderungen greifen sofort (kein Neustart). Die Keyword-Heuristiken bleiben im Code."]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(MM,{className:"h-4 w-4 text-teal-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"chat"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(= auto)"})]}),rZ.map(N=>l.jsx(S,{k:N},N))]}),l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(pM,{className:"h-4 w-4 text-indigo-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"coding"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(agentisch → immer Coder)"})]}),nZ.map(N=>l.jsx(S,{k:N},N))]})]}),l.jsx("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4",children:l.jsx("div",{className:"max-w-xs",children:l.jsx(S,{k:"fast_no_think"})})})]})}function aZ(){var ve,ue,pe;const e=Kn(),{data:t}=wi(4e3),{data:r}=I0(),{data:n}=ko(),{data:i}=U5(),{showAlert:o,dialogElement:u}=ba(),[c,f]=y.useState(!1),[h,m]=y.useState(!1),g=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=(ve=r==null?void 0:r.groups)==null?void 0:ve.brains,j=(b==null?void 0:b.members)??[],k=oe=>g.find(se=>se.name===oe),S=oe=>{var se;return((se=oe.split("/").pop())==null?void 0:se.replace(/\.gguf$/i,""))||oe},N=j.map(k).filter(Boolean),E=1024**3,A=i==null?void 0:i.budget,P=N.reduce((oe,se)=>oe+(se.size_bytes||0),0)/E,_=((ue=n==null?void 0:n.gpu)==null?void 0:ue.gtt_total)||((pe=n==null?void 0:n.gpu)==null?void 0:pe.vram_total)||0,O=(A==null?void 0:A.gtt_gb)||(_?_/E:0),T=(A==null?void 0:A.warm_projected_gb)??P,B=O>0?Math.min(100,T/O*100):0,$=g.filter(oe=>!j.includes(oe.name)&&!oe.incomplete);async function z(oe){m(!0);try{await z5("brains",oe,(b==null?void 0:b.swap)??!1,(b==null?void 0:b.persist)??!0),e.invalidateQueries({queryKey:Be.groups}),e.invalidateQueries({queryKey:Be.models}),e.invalidateQueries({queryKey:Be.hermesBrain})}catch(se){o("Fehler",`Immer-bereit-Set konnte nicht geändert werden: ${(se==null?void 0:se.message)||se}`)}finally{m(!1)}}function Q(oe){const se=k(oe);if(se&&ct(se.role).protected){o("Geschützt",`„${ct(se.role).label}" ist lebenswichtig und bleibt immer bereit.`);return}z(j.filter(X=>X!==oe))}function U(oe){f(!1),z([...j,oe])}return b?l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[l.jsx(dN,{}),l.jsxs("div",{className:"space-y-1.5",children:[N.length===0&&l.jsx("div",{className:"text-xs text-muted-foreground",children:"Noch keine Modelle im Set."}),N.map(oe=>{const se=v.includes(oe.name),X=ct(oe.role).protected;return l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("span",{className:ee("h-2 w-2 shrink-0 rounded-full ring-2 ring-black/40",se?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40"),title:se?"Gerade warm (bereit)":"Reserviert — lädt bei Bedarf sofort"}),oe.role&&l.jsx(so,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",title:oe.name,children:S(oe.name)}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:or(oe.size_bytes)})]}),X?l.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-muted-foreground",title:"Lebenswichtig — bleibt immer im Set.",children:"🔒"}):l.jsx("button",{onClick:()=>Q(oe.name),disabled:h,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground transition-colors hover:bg-red-500/5 hover:text-red-400 cursor-pointer disabled:opacity-50",title:"Aus dem Immer-bereit-Set nehmen (lädt dann nur noch bei Bedarf)",children:l.jsx(gi,{className:"h-3.5 w-3.5"})})]},oe.name)})]}),l.jsxs("button",{onClick:()=>f(!0),disabled:h||$.length===0,className:"flex h-8 w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-border/50 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary cursor-pointer disabled:opacity-50",children:[l.jsx(cv,{className:"h-3.5 w-3.5"})," Modell dauerhaft bereithalten"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",title:"Modellgewichte + KV-Cache, berechnet aus den echten Architektur-Daten jedes Modells (Layer × KV-Köpfe × Kontext) und seiner KV-Quantisierung. So viel legt llama.cpp beim Laden wirklich für den eingestellten Kontext an — kein Aufschlag mehr.",children:[l.jsx(fa,{className:"h-3.5 w-3.5"})," Reserviert fürs Set"]}),l.jsxs("span",{className:"font-mono font-bold text-foreground",children:[T.toFixed(1),O>0?` / ${O.toFixed(0)}`:""," GB"]})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:ee("h-full rounded-full transition-all duration-500",B>=85?"bg-red-500":B>=65?"bg-amber-500":"bg-teal-500"),style:{width:`${B}%`}})}),A&&!A.fits&&l.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-amber-400",children:[l.jsx(Er,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsxs("span",{children:["Zusammen mit dem größten Gelegenheits-Modell (~",A.largest_ondemand_gb," GB) wird der Speicher knapp. Das Set bleibt dabei immer geladen — wird es wirklich eng, schlägt das Laden des großen Modells fehl (es wartet dann, statt das Set zu verdrängen)."]})]}),A&&A.fits&&l.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-emerald-400",children:[l.jsx(qt,{className:"h-3.5 w-3.5 shrink-0"})," Passt auch neben dem größten Gelegenheits-Modell — nichts wird verdrängt."]})]}),c&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-label":"Modell zum Immer-bereit-Set hinzufügen",children:l.jsxs("div",{className:"w-full max-w-md space-y-3 rounded-2xl border border-border/80 bg-card p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Dauerhaft bereithalten"}),l.jsx("button",{onClick:()=>f(!1),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Wähle ein Modell, das ohne Ladezeit bereitstehen soll:"}),l.jsx("div",{className:"max-h-60 space-y-1.5 overflow-y-auto pr-1",children:$.map(oe=>l.jsxs("button",{onClick:()=>U(oe.name),className:"flex w-full items-center justify-between gap-2 rounded-lg border border-border/30 bg-background/20 px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[oe.role&&l.jsx(so,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:S(oe.name)})]}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:or(oe.size_bytes)})]},oe.name))})]})}),u]}):l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsx(dN,{}),l.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Es gibt noch kein Immer-bereit-Set. Es entsteht automatisch, sobald Lucys Hirn zugewiesen ist."}),u]})}function dN(){return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ga,{className:"h-4.5 w-4.5 text-primary"}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground",children:"Immer-bereit-Set"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Diese Modelle hält Lucy immer bereit — sie antworten ohne Ladezeit."})]})]})}function oZ(){var Ue,_e,xt,Jt;const e=Kn(),{data:t,isLoading:r,error:n}=wi(4e3),{data:i}=gh(4e3),{data:o}=U5(),{data:u}=ko(),{data:c}=I0(),{showAlert:f,showConfirm:h,showPrompt:m,dialogElement:g}=ba(),v=O0(),b=G=>!!ct(G).protected,j=(t==null?void 0:t.models)??[],k=(t==null?void 0:t.running)??[],S=n?String(n):"",N=()=>{e.invalidateQueries({queryKey:Be.models}),e.invalidateQueries({queryKey:Be.routing})},E=(Ue=c==null?void 0:c.groups)==null?void 0:Ue.brains,A=(E==null?void 0:E.members)??[],P=G=>A.includes(G),_=A.some(G=>k.includes(G));async function O(G){if(!E){f("Keine brains-Gruppe","Es existiert noch keine Ko-Residenz-Gruppe „brains“ in der Engine-Konfiguration. Lege sie erst über die Gruppen-Verwaltung an.");return}const Pe=A.includes(G)?A.filter(Ve=>Ve!==G):[...A,G];try{await z5("brains",Pe,E.swap??!1,E.persist??!0),e.invalidateQueries({queryKey:Be.groups}),N()}catch(Ve){f("Fehler",`Ko-Residenz konnte nicht geändert werden: ${Ve.message||Ve}`)}}const[T,B]=y.useState(null),[$,z]=y.useState(null),[Q,U]=y.useState(null),[ve,ue]=y.useState("grid"),[pe,oe]=y.useState("all"),se=j.filter(G=>pe==="in_use"?!!G.role||k.includes(G.name):!0);async function X(G){try{await we(`/api/models/${encodeURIComponent(G)}/load`,{method:"POST"}),N()}catch(Ne){f("Fehler",`Fehler beim Laden des Modells: ${Ne.message}`)}}async function ne(G){if(E&&_&&!P(G)){const Ne=A.filter(Pe=>k.includes(Pe)).map(Pe=>Pe.split("/").pop()).join(", ");h("Verdrängt das Hirn?",`„${G.split("/").pop()}“ ist nicht in der Ko-Residenz-Gruppe „brains“. Beim Laden wirft es das aktuell warme Hirn (${Ne}) raus — Lucy verliert Hirn bzw. Augen. + `).concat(P.x,",").concat(P.y),O=Qt(e.id)?ku("recharts-radial-line-"):e.id;return y.createElement("text",li({},n,{dominantBaseline:"central",className:rt("recharts-radial-bar-label",u)}),y.createElement("defs",null,y.createElement("path",{id:O,d:_})),y.createElement("textPath",{xlinkHref:"#".concat(O)},r))},VG=(e,t,r)=>{var n=e.cx,i=e.cy,o=e.innerRadius,u=e.outerRadius,c=e.startAngle,f=e.endAngle,h=(c+f)/2;if(r==="outside"){var m=Vt(n,i,u+t,h),g=m.x,v=m.y;return{x:g,y:v,textAnchor:g>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var b=(o+u)/2,j=Vt(n,i,b,h),k=j.x,S=j.y;return{x:k,y:S,textAnchor:"middle",verticalAnchor:"middle"}},Zd=e=>e!=null&&"cx"in e&&Ae(e.cx),qG={angle:0,offset:5,zIndex:fr.label,position:"middle",textBreakAll:!1};function QG(e){if(!Zd(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,i=n*2;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}function ea(e){var t=nn(e,qG),r=t.viewBox,n=t.parentViewBox,i=t.position,o=t.value,u=t.children,c=t.content,f=t.className,h=f===void 0?"":f,m=t.textBreakAll,g=t.labelRef,v=HG(),b=pO(),j=i==="center"?b:v??b,k,S,N;r==null?k=j:Zd(r)?k=r:k=Y0(r);var E=QG(k);if(!k||Qt(o)&&Qt(u)&&!y.isValidElement(c)&&typeof c!="function")return null;var A=du(du({},t),{},{viewBox:k});if(y.isValidElement(c)){A.labelRef;var P=ES(A,DG);return y.cloneElement(c,P)}if(typeof c=="function"){A.content;var _=ES(A,RG);if(S=y.createElement(c,_),y.isValidElement(S))return S}else S=WG(t);var O=en(t);if(Zd(k)){if(i==="insideStart"||i==="insideEnd"||i==="end")return GG(t,i,S,O,k);N=VG(k,t.offset,t.position)}else{if(!E)return null;var T=TG({viewBox:E,position:i,offset:t.offset,parentViewBox:Zd(n)?void 0:n});N=du(du({x:T.x,y:T.y,textAnchor:T.horizontalAnchor,verticalAnchor:T.verticalAnchor},T.width!==void 0?{width:T.width}:{}),T.height!==void 0?{height:T.height}:{})}return y.createElement(Ci,{zIndex:t.zIndex},y.createElement(rx,li({ref:g,className:rt("recharts-label",h)},O,N,{textAnchor:cO(O.textAnchor)?O.textAnchor:N.textAnchor,breakAll:m}),S))}ea.displayName="Label";var YG=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?y.createElement(ea,li({key:"label-implicit"},n)):Bn(e)?y.createElement(ea,li({key:"label-implicit",value:e},n)):y.isValidElement(e)?e.type===ea?y.cloneElement(e,du({key:"label-implicit"},n)):y.createElement(ea,li({key:"label-implicit",content:e},n)):nx(e)?y.createElement(ea,li({key:"label-implicit",content:e},n)):e&&typeof e=="object"?y.createElement(ea,li({},e,{key:"label-implicit"},n)):null};function XG(e){var t=e.label,r=e.labelRef,n=pO();return YG(t,n,r)||null}var ZG=["valueAccessor"],JG=["dataKey","clockWise","id","textBreakAll","zIndex"];function Xf(){return Xf=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(EG(t))return t},gO=y.createContext(void 0),rV=gO.Provider,vO=y.createContext(void 0);vO.Provider;function nV(){return y.useContext(gO)}function iV(){return y.useContext(vO)}function Jd(e){var t=e.valueAccessor,r=t===void 0?tV:t,n=CS(e,ZG),i=n.dataKey;n.clockWise;var o=n.id,u=n.textBreakAll,c=n.zIndex,f=CS(n,JG),h=nV(),m=iV(),g=h||m;return!g||!g.length?null:y.createElement(Ci,{zIndex:c??fr.label},y.createElement(tn,{className:"recharts-label-list"},g.map((v,b)=>{var j,k=Qt(i)?r(v,b):Lt(v.payload,i),S=Qt(o)?{}:{id:"".concat(o,"-").concat(b)};return y.createElement(ea,Xf({key:"label-".concat(b)},en(v),f,S,{fill:(j=n.fill)!==null&&j!==void 0?j:v.fill,parentViewBox:v.parentViewBox,value:k,textBreakAll:u,viewBox:v.viewBox,index:b,zIndex:0}))})))}Jd.displayName="LabelList";function aV(e){var t=e.label;return t?t===!0?y.createElement(Jd,{key:"labelList-implicit"}):y.isValidElement(t)||nx(t)?y.createElement(Jd,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Jd,Xf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,i=e.className,o=rt("recharts-dot",i);return Ae(t)&&Ae(r)&&Ae(n)?y.createElement("circle",c0({},xn(e),F0(e),{className:o,cx:t,cy:r,r:n})):null},oV={radiusAxis:{},angleAxis:{}},xO=lr({name:"polarAxis",initialState:oV,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),im=xO.actions;im.addRadiusAxis;im.removeRadiusAxis;im.addAngleAxis;im.removeAngleAxis;var sV=xO.reducer;function lV(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var bO=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function PS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function OS(e){for(var t=1;t{n||(i.current===null?r(AH(t)):i.current!==t&&r(CH({prev:i.current,next:t})),i.current=t)},[t,r,n]),y.useLayoutEffect(()=>()=>{i.current&&(r(PH(i.current)),i.current=null)},[r]),null}function yV(e){var t=e.legendPayload,r=Nt(),n=Ar(),i=y.useRef(null);return y.useLayoutEffect(()=>{n||(i.current===null?r(t8(t)):i.current!==t&&r(r8({prev:i.current,next:t})),i.current=t)},[r,n,t]),y.useLayoutEffect(()=>()=>{i.current&&(r(n8(i.current)),i.current=null)},[r]),null}function xV(e,t){return jV(e)||kV(e,t)||wV(e,t)||bV()}function bV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wV(e,t){if(e){if(typeof e=="string")return _S(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_S(e,t):void 0}}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var i of r)n.push({status:"removed",prev:i});for(var o=0;oe[Math.floor(o*r)]);return ax(n,t)}function EV(e,t){var r=t.map((n,i)=>e[i]);return ax(r,t)}function AV(e,t){for(var r=new Map,n=0;n{var b=r(g,v);if(b!=null){var j=n.get(b);if(j!==void 0)return i.add(b),j}}),u=[];for(var c of n){var f=xV(c,2),h=f[0],m=f[1];i.has(h)||u.push(m)}return ax(o,t,u)}function d0(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===ix?NV(e,t):r===SV?EV(e,t):CV(e,t,r)}function kO(e,t){var r=y.useRef(e),n=y.useRef(t.current),i=y.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var o=y.useCallback(function(u,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(c===0){i.current=!0;return}c===1&&(n.current=u),c>0&&i.current&&f&&(t.current=u)},[t]);return{startValue:n.current,syncStepValue:o}}function PV(e,t){return IV(e)||MV(e,t)||_V(e,t)||OV()}function OV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _V(e,t){if(e){if(typeof e=="string")return MS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?MS(e,t):void 0}}function MS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),o(!0)},[e]),c=y.useCallback(()=>{typeof t=="function"&&t(),o(!1)},[t]);return{isAnimating:i,handleAnimationStart:u,handleAnimationEnd:c}}function DV(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,o=e.previousItemsRef,u=e.isAnimationActive,c=e.animationBegin,f=e.animationDuration,h=e.animationEasing,m=e.onAnimationStart,g=e.onAnimationEnd,v=e.animationInterpolateFn,b=e.animationMatchBy,j=e.shouldUpdatePreviousRef,k=e.children,S=e.layout,N=LA(r,n),E=kO(N,o),A=(t=E.startValue)!==null&&t!==void 0?t:null,P=d0(A,i,b??ix);return y.createElement(RA,{animationId:N,begin:c,duration:f,isActive:u,easing:h,onAnimationEnd:g,onAnimationStart:m,key:N},_=>{var O=A==null,T=i==null?i:v(P,_,S),B=j?j(_):_>0;return E.syncStepValue(T,_,B),T==null?null:k(T,_,O)})}var Bg;function RV(e,t){return FV(e)||zV(e,t)||$V(e,t)||LV()}function LV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $V(e,t){if(e){if(typeof e=="string")return IS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?IS(e,t):void 0}}function IS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=y.useState(()=>ku("uid-")),t=RV(e,1),r=t[0];return r},jO=(Bg=ah.useId)!==null&&Bg!==void 0?Bg:BV;function UV(e,t){var r=jO();return t||(e?"".concat(e,"-").concat(r):r)}var HV=y.createContext(void 0),WV=e=>{var t=e.id,r=e.type,n=e.children,i=UV("recharts-".concat(r),t);return y.createElement(HV.Provider,{value:i},n(i))},KV={cartesianItems:[],polarItems:[]},SO=lr({name:"graphicalItems",initialState:KV,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:st()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=i)},prepare:st()},removeCartesianGraphicalItem:{reducer(e,t){var r=Xr(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:st()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:st()},removePolarGraphicalItem:{reducer(e,t){var r=Xr(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:st()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=Xr(e).polarItems.indexOf(n);o>-1&&(e.polarItems[o]=i)},prepare:st()}}}),ol=SO.actions,GV=ol.addCartesianGraphicalItem,VV=ol.replaceCartesianGraphicalItem,qV=ol.removeCartesianGraphicalItem;ol.addPolarGraphicalItem;ol.removePolarGraphicalItem;ol.replacePolarGraphicalItem;var QV=SO.reducer,YV=e=>{var t=Nt(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(GV(e)):r.current!==e&&t(VV({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(qV(r.current)),r.current=null)},[t]),null},XV=y.memo(YV),ZV=["points"];function TS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ug(e){for(var t=1;t{var N,E,A=Ug(Ug(Ug({r:3},u),v),{},{index:S,cx:(N=k.x)!==null&&N!==void 0?N:void 0,cy:(E=k.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:k.value,payload:k.payload,points:t});return y.createElement(iq,{key:"dot-".concat(S),option:r,dotProps:A,className:i})}),j={};return c&&f!=null&&(j.clipPath="url(#clipPath-".concat(g?"":"dots-").concat(f,")")),y.createElement(Ci,{zIndex:m},y.createElement(tn,Zf({className:n},j),b))}function DS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function RS(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),bq=q([xq,ki,ji],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),ox=()=>Me(bq),wq=()=>Me(AW);function LS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hg(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,o=e.dataKey,u=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var c={index:r,dataKey:o,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Hg(Hg(Hg({},c),vh(i)),F0(i)),h;return y.isValidElement(i)?h=y.cloneElement(i,f):typeof i=="function"?h=i(f):h=y.createElement(yO,f),y.createElement(tn,{className:"recharts-active-dot",clipPath:u},h)};function $S(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,o=e.clipPath,u=e.zIndex,c=u===void 0?fr.activeDot:u,f=Me(Du),h=wq();if(t==null||h==null)return null;var m=t.find(g=>h.includes(g.payload));return Qt(m)?null:y.createElement(Ci,{zIndex:c},y.createElement(Nq,{point:m,childIndex:Number(f),mainColor:r,dataKey:i,activeDot:n,clipPath:o}))}var Eq=e=>{var t=e.chartData,r=Nt(),n=Ar();return y.useEffect(()=>n?()=>{}:(r(oS(t)),()=>{r(oS(void 0))}),[t,r,n]),null},zS={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},AO=lr({name:"brush",initialState:zS,reducers:{setBrushSettings(e,t){return t.payload==null?zS:t.payload}}});AO.actions.setBrushSettings;var Aq=AO.reducer;function Cq(e){return(e%180+180)%180}var Pq=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Cq(i),u=o*Math.PI/180,c=Math.atan(n/r),f=u>c&&u{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Xr(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Xr(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Xr(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),sl=CO.actions;sl.addDot;sl.removeDot;sl.addArea;sl.removeArea;sl.addLine;sl.removeLine;var _q=CO.reducer;function Mq(e,t){return Rq(e)||Dq(e,t)||Tq(e,t)||Iq()}function Iq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tq(e,t){if(e){if(typeof e=="string")return FS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?FS(e,t):void 0}}function FS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=y.useState("".concat(ku("recharts"),"-clip")),n=Mq(r,1),i=n[0],o=ox();if(o==null)return null;var u=o.x,c=o.y,f=o.width,h=o.height;return y.createElement(Lq.Provider,{value:i},y.createElement("defs",null,y.createElement("clipPath",{id:i},y.createElement("rect",{x:u,y:c,height:h,width:f}))),t)};function PO(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function Bq(e,t){return PO(e,t+1)}function Uq(e,t,r,n,i){for(var o=(n||[]).slice(),u=t.start,c=t.end,f=0,h=1,m=u,g=function(){var j=n==null?void 0:n[f];if(j===void 0)return{v:PO(n,h)};var k=f,S,N=()=>(S===void 0&&(S=r(j,k)),S),E=j.coordinate,A=f===0||Lu(e,E,N,m,c);A||(f=0,m=u,h+=1),A&&(m=E+e*(N()/2+i),f+=h)},v;h<=o.length;)if(v=g(),v)return v.v;return[]}function Hq(e,t,r,n,i){var o=(n||[]).slice(),u=o.length;if(u===0)return[];for(var c=t.start,f=t.end,h=1;h<=u;h++){for(var m=(u-1)%h,g=c,v=!0,b=function(){var P=n[k];if(P==null)return 0;var _=k,O,T=()=>(O===void 0&&(O=r(P,_)),O),B=P.coordinate,$=k===m||Lu(e,B,T,g,f);if(!$)return v=!1,1;$&&(g=B+e*(T()/2+i))},j,k=m;k(k===void 0&&(k=r(b,v)),k);if(v===u-1){var N=e*(j.coordinate+e*S()/2-f);o[v]=j=ar(ar({},j),{},{tickCoord:N>0?j.coordinate-N*e:j.coordinate})}else o[v]=j=ar(ar({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var E=Lu(e,j.tickCoord,S,c,f);E&&(f=j.tickCoord-e*(S()/2+i),o[v]=ar(ar({},j),{},{isShow:!0}))}},m=u-1;m>=0;m--)h(m);return o}function qq(e,t,r,n,i,o){var u=(n||[]).slice(),c=u.length,f=t.start,h=t.end;if(o){var m=n[c-1];if(m!=null){var g=r(m,c-1),v=e*(m.coordinate+e*g/2-h);if(u[c-1]=m=ar(ar({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate}),m.tickCoord!=null){var b=Lu(e,m.tickCoord,()=>g,f,h);b&&(h=m.tickCoord-e*(g/2+i),u[c-1]=ar(ar({},m),{},{isShow:!0}))}}}for(var j=o?c-1:c,k=function(E){var A=u[E];if(A==null)return 1;var P=A,_,O=()=>(_===void 0&&(_=r(A,E)),_);if(E===0){var T=e*(P.coordinate-e*O()/2-f);u[E]=P=ar(ar({},P),{},{tickCoord:T<0?P.coordinate-T*e:P.coordinate})}else u[E]=P=ar(ar({},P),{},{tickCoord:P.coordinate});if(P.tickCoord!=null){var B=Lu(e,P.tickCoord,O,f,h);B&&(f=P.tickCoord+e*(O()/2+i),u[E]=ar(ar({},P),{},{isShow:!0}))}},S=0;S{var T=typeof h=="function"?h(_.value,O):_.value;return j==="width"?zq(hu(T,{fontSize:t,letterSpacing:r}),k,g):hu(T,{fontSize:t,letterSpacing:r})[j]},N=i[0],E=i[1],A=i.length>=2&&N!=null&&E!=null?Yr(E.coordinate-N.coordinate):1,P=Fq(o,A,j);return f==="equidistantPreserveStart"?Uq(A,P,S,i,u):f==="equidistantPreserveEnd"?Hq(A,P,S,i,u):(f==="preserveStart"||f==="preserveStartEnd"?b=qq(A,P,S,i,u,f==="preserveStartEnd"):b=Vq(A,P,S,i,u),b.filter(_=>_.isShow))}var Qq=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,o=e.tickSize,u=o===void 0?0:o,c=e.tickMargin,f=c===void 0?0:c,h=0;if(t){Array.from(t).forEach(b=>{if(b){var j=b.getBoundingClientRect();j.width>h&&(h=j.width)}});var m=r?r.getBoundingClientRect().width:0,g=u+f,v=h+g+m+(r?i:0);return Math.round(v)}return 0},Yq={xAxis:{},yAxis:{}},OO=lr({name:"renderedTicks",initialState:Yq,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,o=r.ticks;e[n][i]=o},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),_O=OO.actions,Xq=_O.setRenderedTicks,Zq=_O.removeRenderedTicks,Jq=OO.reducer,eQ=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function US(e,t){return iQ(e)||nQ(e,t)||rQ(e,t)||tQ()}function tQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rQ(e,t){if(e){if(typeof e=="string")return HS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?HS(e,t):void 0}}function HS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return Ys;var o=t.map(u=>({value:u.value,coordinate:u.coordinate,offset:u.offset,index:u.index}));return i(Xq({ticks:o,axisId:n,axisType:r})),()=>{i(Zq({axisId:n,axisType:r}))}},[i,t,n,r]),null}var gQ=y.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,o=e.tickLine,u=e.stroke,c=e.tickFormatter,f=e.unit,h=e.padding,m=e.tickTextProps,g=e.orientation,v=e.mirror,b=e.x,j=e.y,k=e.width,S=e.height,N=e.tickSize,E=e.tickMargin,A=e.fontSize,P=e.letterSpacing,_=e.getTicksConfig,O=e.events,T=e.axisType,B=e.axisId,$=sx(yt(yt({},_),{},{ticks:n}),A,P),z=xn(_),Q=vh(i),U=cO(z.textAnchor)?z.textAnchor:fQ(g,v),ve=hQ(g,v),ue={};typeof o=="object"&&(ue=o);var pe=yt(yt({},z),{},{fill:"none"},ue),oe=$.map(ne=>yt({entry:ne},dQ(ne,b,j,k,S,g,N,v,E))),se=oe.map(ne=>{var te=ne.entry,I=ne.line;return y.createElement(tn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},o&&y.createElement("line",bo({},pe,I,{className:rt("recharts-cartesian-axis-tick-line",jo(o,"className"))})))}),X=oe.map((ne,te)=>{var I,M,H=ne.entry,ie=ne.tick,J=yt(yt(yt(yt({verticalAnchor:ve},z),{},{textAnchor:U,stroke:"none",fill:u},ie),{},{index:te,payload:H,visibleTicksCount:$.length,tickFormatter:c,padding:h},m),{},{angle:(I=(M=m==null?void 0:m.angle)!==null&&M!==void 0?M:z.angle)!==null&&I!==void 0?I:0}),Z=yt(yt({},J),Q);return y.createElement(tn,bo({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},bL(O,H,te)),i&&y.createElement(mQ,{option:i,tickProps:Z,value:"".concat(typeof c=="function"?c(H.value,te):H.value).concat(f||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},y.createElement(pQ,{ticks:$,axisId:B,axisType:T}),X.length>0&&y.createElement(Ci,{zIndex:fr.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},X)),se.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},se))}),vQ=y.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,o=e.className,u=e.hide,c=e.ticks,f=e.axisType,h=e.axisId,m=aQ(e,eQ),g=y.useState(""),v=US(g,2),b=v[0],j=v[1],k=y.useState(""),S=US(k,2),N=S[0],E=S[1],A=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return Qq({ticks:A.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var P=y.useCallback(_=>{if(_){var O=_.getElementsByClassName("recharts-cartesian-axis-tick-value");A.current=O;var T=O[0];if(T){var B=window.getComputedStyle(T),$=B.fontSize,z=B.letterSpacing;($!==b||z!==N)&&(j($),E(z))}}},[b,N]);return u||n!=null&&n<=0||i!=null&&i<=0?null:y.createElement(Ci,{zIndex:e.zIndex},y.createElement(tn,{className:rt("recharts-cartesian-axis",o)},y.createElement(cQ,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:xn(e)}),y.createElement(gQ,{ref:P,axisType:f,events:m,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:N,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:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),y.createElement(BG,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(XG,{label:e.label,labelRef:e.labelRef}),e.children)))}),lx=y.forwardRef((e,t)=>{var r=nn(e,mi);return y.createElement(vQ,bo({},r,{ref:t}))});lx.displayName="CartesianAxis";var yQ=["x1","y1","x2","y2","key"],xQ=["offset"],bQ=["xAxisId","yAxisId"],wQ=["xAxisId","yAxisId"];function KS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sr(e){for(var t=1;t{var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,i=e.y,o=e.width,u=e.height,c=e.ry;return y.createElement("rect",{x:n,y:i,ry:c,width:o,height:u,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function MO(e){var t=e.option,r=e.lineItemProps,n;if(y.isValidElement(t))n=y.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,o=r.x1,u=r.y1,c=r.x2,f=r.y2,h=r.key,m=Jf(r,yQ),g=(i=xn(m))!==null&&i!==void 0?i:{};g.offset;var v=Jf(g,xQ);n=y.createElement("line",Xa({},v,{x1:o,y1:u,x2:c,y2:f,fill:"none",key:h}))}return n}function AQ(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=Jf(e,bQ),c=o.map((f,h)=>{var m=sr(sr({},u),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return y.createElement(MO,{key:"line-".concat(h),option:i,lineItemProps:m})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function CQ(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=Jf(e,wQ),c=o.map((f,h)=>{var m=sr(sr({},u),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return y.createElement(MO,{option:i,lineItemProps:m,key:"line-".concat(h)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function PQ(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,u=e.height,c=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length||c==null)return null;var m=c.map(v=>Math.round(v+i-i)).sort((v,b)=>v-b);i!==m[0]&&m.unshift(0);var g=m.map((v,b)=>{var j=m[b+1],k=j==null,S=k?i+u-v:j-v;if(S<=0)return null;var N=b%t.length;return y.createElement("rect",{key:"react-".concat(b),y:v,x:n,height:S,width:o,stroke:"none",fill:t[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},g)}function OQ(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,u=e.y,c=e.width,f=e.height,h=e.verticalPoints;if(!r||!n||!n.length)return null;var m=h.map(v=>Math.round(v+o-o)).sort((v,b)=>v-b);o!==m[0]&&m.unshift(0);var g=m.map((v,b)=>{var j=m[b+1],k=j==null,S=k?o+c-v:j-v;if(S<=0)return null;var N=b%n.length;return y.createElement("rect",{key:"react-".concat(b),x:v,y:u,width:S,height:f,stroke:"none",fill:n[N],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},g)}var _Q=(e,t)=>{var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return fA(sx(sr(sr(sr({},mi),r),{},{ticks:hA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)},MQ=(e,t)=>{var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return fA(sx(sr(sr(sr({},mi),r),{},{ticks:hA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)},IQ={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:fr.grid};function IO(e){var t=wA(),r=kA(),n=bA(),i=sr(sr({},nn(e,IQ)),{},{x:Ae(e.x)?e.x:n.left,y:Ae(e.y)?e.y:n.top,width:Ae(e.width)?e.width:n.width,height:Ae(e.height)?e.height:n.height}),o=i.xAxisId,u=i.yAxisId,c=i.x,f=i.y,h=i.width,m=i.height,g=i.syncWithTicks,v=i.horizontalValues,b=i.verticalValues,j=Ar(),k=Me($=>V2($,"xAxis",o,j)),S=Me($=>V2($,"yAxis",u,j));if(!Un(h)||!Un(m)||!Ae(c)||!Ae(f))return null;var N=i.verticalCoordinatesGenerator||_Q,E=i.horizontalCoordinatesGenerator||MQ,A=i.horizontalPoints,P=i.verticalPoints;if((!A||!A.length)&&typeof E=="function"){var _=v&&v.length,O=E({yAxis:S?sr(sr({},S),{},{ticks:_?v:S.ticks}):void 0,width:t??h,height:r??m,offset:n},_?!0:g);Nf(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(A=O)}if((!P||!P.length)&&typeof N=="function"){var T=b&&b.length,B=N({xAxis:k?sr(sr({},k),{},{ticks:T?b:k.ticks}):void 0,width:t??h,height:r??m,offset:n},T?!0:g);Nf(Array.isArray(B),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(P=B)}return y.createElement(Ci,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(EQ,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(PQ,Xa({},i,{horizontalPoints:A})),y.createElement(OQ,Xa({},i,{verticalPoints:P})),y.createElement(AQ,Xa({},i,{offset:n,horizontalPoints:A,xAxis:k,yAxis:S})),y.createElement(CQ,Xa({},i,{offset:n,verticalPoints:P,xAxis:k,yAxis:S}))))}IO.displayName="CartesianGrid";var TQ={},TO=lr({name:"errorBars",initialState:TQ,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]||(e[n]=[]),e[n].push(i)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.prev,o=r.next;e[n]&&(e[n]=e[n].map(u=>u.dataKey===i.dataKey&&u.direction===i.direction?o:u))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==i.dataKey||o.direction!==i.direction))}}}),ux=TO.actions;ux.addErrorBar;ux.replaceErrorBar;ux.removeErrorBar;var DQ=TO.reducer;function DO(e,t){var r,n,i=Me(h=>Ni(h,e)),o=Me(h=>Ei(h,t)),u=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Ct.allowDataOverflow,c=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:Pt.allowDataOverflow,f=u||c;return{needClip:f,needClipX:u,needClipY:c}}function RQ(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=ox(),o=DO(t,r),u=o.needClipX,c=o.needClipY,f=o.needClip,h=Me(A=>xP(A,t,!1)),m=Me(A=>bP(A,r,!1));if(!f||!i)return null;var g=i.x,v=i.y,b=i.width,j=i.height,k=u&&h?Math.min(h[0],h[1]):g-b/2,S=c&&m?Math.min(m[0],m[1]):v-j/2,N=u&&h?Math.abs(h[1]-h[0]):b*2,E=c&&m?Math.abs(m[1]-m[0]):j*2;return y.createElement("clipPath",{id:"clipPath-".concat(n)},y.createElement("rect",{x:k,y:S,width:N,height:E}))}function LQ(e){var t=vh(e),r=3,n=2;if(t!=null){var i=t.r,o=t.strokeWidth,u=Number(i),c=Number(o);return(Number.isNaN(u)||u<0)&&(u=r),(Number.isNaN(c)||c<0)&&(c=n),{r:u,strokeWidth:c}}return{r,strokeWidth:n}}function cx(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:NO}function dx(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:NO}var RO=(e,t,r)=>CP(e,"xAxis",cx(e,t),r),LO=(e,t,r)=>AP(e,"xAxis",cx(e,t),r),$O=(e,t,r)=>CP(e,"yAxis",dx(e,t),r),zO=(e,t,r)=>AP(e,"yAxis",dx(e,t),r),$Q=q([ft,RO,$O,LO,zO],(e,t,r,n,i)=>Gn(e,"xAxis")?Sf(t,n,!1):Sf(r,i,!1)),zQ=(e,t)=>t,FO=q([VC,zQ],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),BO=e=>{var t=ft(e),r=Gn(t,"xAxis");return r?"yAxis":"xAxis"},FQ=(e,t)=>{var r=BO(e);return r==="yAxis"?dx(e,t):cx(e,t)},BQ=(e,t,r)=>nP(e,BO(e),FQ(e,t),r),UQ=q([FO,BQ],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,i=dy(e);if(!(n==null||i==null)){var o=(r=t[n])===null||r===void 0?void 0:r.stackedData,u=o==null?void 0:o.find(c=>c.key===i);if(u!=null)return u.map(c=>[c[0],c[1]])}}}),HQ=q([ft,RO,$O,LO,zO,UQ,hB,$Q,FO,OB],(e,t,r,n,i,o,u,c,f,h)=>{var m=u.chartData,g=u.dataStartIndex,v=u.dataEndIndex;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||c==null)){var b=f.data,j;if(b&&b.length>0?j=b:j=m==null?void 0:m.slice(g,v+1),j!=null)return pY({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:o,displayedData:j,chartBaseValue:h,bandSize:c})}}),WQ=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],KQ=["id","baseLine"];function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;tg.y||0));return Ae(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.y||0),m)),Ae(m)?y.createElement("rect",{x:cg.x||0));return Ae(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.x||0),m)),Ae(m)?y.createElement("rect",{x:0,y:ce==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[Ks(Ks({},r.next),{},{x:ui(r.prev.x,r.next.x,t),y:ui(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),HO={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:ix,animationInterpolateFn:nY,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:YQ,xAxisId:0,yAxisId:0,zIndex:fr.area};function th(e,t){return e&&e!=="none"?e:t}var iY=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.fill,o=e.legendType,u=e.hide;return[{inactive:u,dataKey:t,type:o,color:th(n,i),value:mA(r,t),payload:e}]},aY=y.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,o=e.fill,u=e.name,c=e.hide,f=e.unit,h=e.tooltipType,m=e.id,g={dataDefinedOnItem:r,getPosition:Ys,settings:{stroke:n,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:mA(u,t),hide:c,type:h,color:th(n,o),unit:f,graphicalItemId:m}};return y.createElement(vV,{tooltipEntrySettings:g})});function oY(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.needClip,o=n.dot,u=n.dataKey,c=xn(n);return y.createElement(oq,{points:r,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:u,baseProps:c,needClip:i,clipPathId:t})}function sY(e){var t=e.showLabels,r=e.children,n=e.points,i=n.map(o=>{var u,c,f={x:(u=o.x)!==null&&u!==void 0?u:0,y:(c=o.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ks(Ks({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return y.createElement(rV,{value:t?i:void 0},r)}function lY(e){var t=e.points,r=e.baseLine,n=e.needClip,i=e.clipPathId,o=e.props,u=e.animationElapsedTime,c=e.isAnimating,f=e.isEntrance,h=o.layout,m=o.type,g=o.stroke,v=o.connectNulls,b=o.isRange,j=o.shape,k=o.id,S=UO(o,XQ),N=en(S),E=Ks(Ks({},N),{},{id:k,points:t,connectNulls:v,type:m,baseLine:r,layout:h,stroke:g,isRange:b,animationElapsedTime:u,isAnimating:c,isEntrance:f});return y.createElement(y.Fragment,null,(t==null?void 0:t.length)>1&&y.createElement(tn,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},y.createElement(gV,{option:j,DefaultShape:HO.shape,shapeProps:E})),y.createElement(oY,{points:t,props:S,clipPathId:i}))}function uY(e,t,r){if(Ae(e)){var n=Ae(t)?t:void 0;return ui(n,e,r)}if(Qt(e)||Fn(e)){var i=Ae(t)?t:void 0;return ui(i,0,r)}return e}function cY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=e.previousPointsRef,o=e.previousBaselineRef,u=n.points,c=n.baseLine,f=n.isAnimationActive,h=n.animationBegin,m=n.animationDuration,g=n.animationEasing,v=n.animationMatchBy,b=n.animationInterpolateFn,j=y.useMemo(()=>({points:u,baseLine:c}),[u,c]),k=kO(j,o),S=X0(),N=TV(n.onAnimationStart,n.onAnimationEnd),E=N.isAnimating,A=N.handleAnimationStart,P=N.handleAnimationEnd,_=k.startValue;if(S==null)return null;var O;return Array.isArray(c)&&Array.isArray(_)?O=d0(_,c,v):Array.isArray(c)?O=d0(null,c,v):O=null,y.createElement(DV,{animationInput:j,animationIdPrefix:"recharts-area-",items:u,previousItemsRef:i,isAnimationActive:f,animationBegin:h,animationDuration:m,animationEasing:g,onAnimationStart:A,onAnimationEnd:P,animationInterpolateFn:b,animationMatchBy:v,layout:S},(T,B,$)=>{var z;return B===1?z=c:Array.isArray(c)?z=b(O,B,S):z=$?c:uY(c,_,B),k.syncStepValue(z,B),y.createElement(sY,{showLabels:!E,points:u},n.children,y.createElement(lY,{points:T,baseLine:z,needClip:t,clipPathId:r,props:n,animationElapsedTime:B,isAnimating:E||B<1,isEntrance:$}),y.createElement(aV,{label:n.label}))})}function dY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=y.useRef(null),o=y.useRef();return y.createElement(cY,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:o})}class fY extends y.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,u=t.top,c=t.left,f=t.needClip,h=t.xAxisId,m=t.yAxisId,g=t.width,v=t.height,b=t.id,j=t.baseLine,k=t.zIndex;if(r)return null;var S=rt("recharts-area",o),N=b,E=LQ(n),A=E.r,P=E.strokeWidth,_=bO(n),O=A*2+P,T=f?"url(#clipPath-".concat(_?"":"dots-").concat(N,")"):void 0;return y.createElement(Ci,{zIndex:k},y.createElement(tn,{className:S},f&&y.createElement("defs",null,y.createElement(RQ,{clipPathId:N,xAxisId:h,yAxisId:m}),!_&&y.createElement("clipPath",{id:"clipPath-dots-".concat(N)},y.createElement("rect",{x:c-O/2,y:u-O/2,width:g+O,height:v+O}))),y.createElement(dY,{needClip:f,clipPathId:N,props:this.props})),y.createElement($S,{points:i,mainColor:th(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(j)&&y.createElement($S,{points:j,mainColor:th(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}function hY(e){var t,r=e.activeDot,n=e.animationBegin,i=e.animationDuration,o=e.animationEasing,u=e.connectNulls,c=e.dot,f=e.fill,h=e.fillOpacity,m=e.hide,g=e.isAnimationActive,v=e.legendType,b=e.stroke,j=e.xAxisId,k=e.yAxisId,S=UO(e,ZQ),N=Xs(),E=XP(),A=DO(j,k),P=A.needClip,_=Ar(),O=(t=Me(pe=>HQ(pe,e.id,_)))!==null&&t!==void 0?t:{},T=O.points,B=O.isRange,$=O.baseLine,z=ox();if(N!=="horizontal"&&N!=="vertical"||z==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var Q=z.height,U=z.width,ve=z.x,ue=z.y;return!T||!T.length?null:y.createElement(fY,eh({},S,{activeDot:r,animationBegin:n,animationDuration:i,animationEasing:o,baseLine:$,connectNulls:u,dot:c,fill:f,fillOpacity:h,height:Q,hide:m,layout:N,isAnimationActive:g,isRange:B,legendType:v,needClip:P,points:T,stroke:b,width:U,left:ve,top:ue,xAxisId:j,yAxisId:k}))}var mY=(e,t,r,n,i)=>{var o=r??t;if(Ae(o))return o;var u=e==="horizontal"?i:n,c=u.scale.domain();if(u.type==="number"){var f=Math.max(c[0],c[1]),h=Math.min(c[0],c[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return o==="dataMin"?c[0]:o==="dataMax"?c[1]:c[0]};function pY(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,i=t.dataKey,o=e.stackedData,u=e.layout,c=e.chartBaseValue,f=e.xAxis,h=e.yAxis,m=e.displayedData,g=e.dataStartIndex,v=e.xAxisTicks,b=e.yAxisTicks,j=e.bandSize,k=o&&o.length,S=mY(u,c,n,f,h),N=u==="horizontal",E=!1,A=m.map((_,O)=>{var T,B,$,z;if(k)z=o[g+O];else{var Q=Lt(_,i);Array.isArray(Q)?(z=Q,E=!0):z=[S,Q]}var U=(T=(B=z)===null||B===void 0?void 0:B[1])!==null&&T!==void 0?T:null,ve=U==null||k&&!r&&Lt(_,i)==null;if(N){var ue;return{x:Uk({axis:f,ticks:v,bandSize:j,entry:_,index:O}),y:ve?null:(ue=h.scale.map(U))!==null&&ue!==void 0?ue:null,value:z,payload:_}}return{x:ve?null:($=f.scale.map(U))!==null&&$!==void 0?$:null,y:Uk({axis:h,ticks:b,bandSize:j,entry:_,index:O}),value:z,payload:_}}),P;return k||E?P=A.map(_=>{var O,T=Array.isArray(_.value)?_.value[0]:null;if(N){var B;return{x:_.x,y:T!=null&&_.y!=null&&(B=h.scale.map(T))!==null&&B!==void 0?B:null,payload:_.payload}}return{x:T!=null&&(O=f.scale.map(T))!==null&&O!==void 0?O:null,y:_.y,payload:_.payload}}):P=N?h.scale.map(S):f.scale.map(S),{points:A,baseLine:P??0,isRange:E}}function gY(e){var t=nn(e,HO),r=Ar();return y.createElement(WV,{id:t.id,type:"area"},n=>y.createElement(y.Fragment,null,y.createElement(yV,{legendPayload:iY(t)}),y.createElement(aY,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),y.createElement(XV,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Jz(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),y.createElement(hY,eh({},t,{id:n}))))}var WO=y.memo(gY,zh);WO.displayName="Area";var vY=["domain","range"],yY=["domain","range"];function qS(e,t){if(e==null)return{};var r,n,i=xY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{if(u!=null)return XS(XS({},o),{},{type:u})},[o,u]);return y.useLayoutEffect(()=>{c!=null&&(r.current===null?t(dq(c)):r.current!==c&&t(fq({prev:r.current,next:c})),r.current=c)},[c,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(hq(r.current)),r.current=null)},[t]),null}var CY=e=>{var t=e.xAxisId,r=e.className,n=Me(gA),i=Ar(),o="xAxis",u=Me(v=>EP(v,o,t,i)),c=Me(v=>lH(v,t)),f=Me(v=>mH(v,t)),h=Me(v=>HC(v,t));if(c==null||f==null||h==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=h0(e,wY);h.id,h.scale;var g=h0(h,kY);return y.createElement(lx,f0({},m,g,{x:f.x,y:f.y,width:c.width,height:c.height,className:rt("recharts-".concat(o," ").concat(o),r),viewBox:n,ticks:u,axisType:o,axisId:t}))},PY={allowDataOverflow:Ct.allowDataOverflow,allowDecimals:Ct.allowDecimals,allowDuplicatedCategory:Ct.allowDuplicatedCategory,angle:Ct.angle,axisLine:mi.axisLine,height:Ct.height,hide:!1,includeHidden:Ct.includeHidden,interval:Ct.interval,label:!1,minTickGap:Ct.minTickGap,mirror:Ct.mirror,orientation:Ct.orientation,padding:Ct.padding,reversed:Ct.reversed,scale:Ct.scale,tick:Ct.tick,tickCount:Ct.tickCount,tickLine:mi.tickLine,tickSize:mi.tickSize,type:Ct.type,niceTicks:Ct.niceTicks,xAxisId:0},OY=e=>{var t=nn(e,PY);return y.createElement(y.Fragment,null,y.createElement(AY,{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}),y.createElement(CY,t))},GO=y.memo(OY,KO);GO.displayName="XAxis";var _Y=["type"],MY=["dangerouslySetInnerHTML","ticks","scale"],IY=["id","scale"];function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(u!=null)return JS(JS({},o),{},{type:u})},[u,o]);return y.useLayoutEffect(()=>{c!=null&&(r.current===null?t(mq(c)):r.current!==c&&t(pq({prev:r.current,next:c})),r.current=c)},[c,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(gq(r.current)),r.current=null)},[t]),null}function zY(e){var t=e.yAxisId,r=e.className,n=e.width,i=e.label,o=y.useRef(null),u=y.useRef(null),c=Me(gA),f=Ar(),h=Nt(),m="yAxis",g=Me(N=>vH(N,t)),v=Me(N=>gH(N,t)),b=Me(N=>EP(N,m,t,f)),j=Me(N=>WC(N,t));if(y.useLayoutEffect(()=>{if(!(n!=="auto"||!g||nx(i)||y.isValidElement(i)||j==null)){var N=o.current;if(N){var E=N.getCalculatedWidth();Math.round(g.width)!==Math.round(E)&&h(vq({id:t,width:E}))}}},[b,g,h,i,t,n,j]),g==null||v==null||j==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var k=p0(e,MY);j.id,j.scale;var S=p0(j,IY);return y.createElement(lx,m0({},k,S,{ref:o,labelRef:u,x:v.x,y:v.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:g.width,height:g.height,className:rt("recharts-".concat(m," ").concat(m),r),viewBox:c,ticks:b,axisType:m,axisId:t}))}var FY={allowDataOverflow:Pt.allowDataOverflow,allowDecimals:Pt.allowDecimals,allowDuplicatedCategory:Pt.allowDuplicatedCategory,angle:Pt.angle,axisLine:mi.axisLine,hide:!1,includeHidden:Pt.includeHidden,interval:Pt.interval,label:!1,minTickGap:Pt.minTickGap,mirror:Pt.mirror,orientation:Pt.orientation,padding:Pt.padding,reversed:Pt.reversed,scale:Pt.scale,tick:Pt.tick,tickCount:Pt.tickCount,tickLine:mi.tickLine,tickSize:mi.tickSize,type:Pt.type,niceTicks:Pt.niceTicks,width:Pt.width,yAxisId:0},BY=e=>{var t=nn(e,FY);return y.createElement(y.Fragment,null,y.createElement($Y,{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}),y.createElement(zY,t))},VO=y.memo(BY,KO);VO.displayName="YAxis";var UY=(e,t)=>t,fx=q([UY,ft,iC,zt,KP,Ai,zW,Zt],GW);function HY(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function hx(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(HY(e)){var i=e.currentTarget.getBBox();r=i.width>0?t.width/i.width:1,n=i.height>0?t.height/i.height:1}else{var o=e.currentTarget;r=o.offsetWidth>0?t.width/o.offsetWidth:1,n=o.offsetHeight>0?t.height/o.offsetHeight:1}var u=(c,f)=>({relativeX:Math.round((c-t.left)/r),relativeY:Math.round((f-t.top)/n)});return"touches"in e?Array.from(e.touches).map(c=>u(c.clientX,c.clientY)):u(e.clientX,e.clientY)}var qO=zr("mouseClick"),QO=qu();QO.startListening({actionCreator:qO,effect:(e,t)=>{var r=e.payload,n=fx(t.getState(),hx(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(MH({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var g0=zr("mouseMove"),YO=qu(),ss=null,za=null,Wg=null;YO.startListening({actionCreator:g0,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,o=i.throttleDelay,u=i.throttledEvents,c=u==="all"||(u==null?void 0:u.includes("mousemove"));ss!==null&&(cancelAnimationFrame(ss),ss=null),za!==null&&(typeof o!="number"||!c)&&(clearTimeout(za),za=null),Wg=hx(r);var f=()=>{var h=t.getState(),m=sc(h,h.tooltip.settings.shared);if(!Wg){ss=null,za=null;return}if(m==="axis"){var g=fx(h,Wg);(g==null?void 0:g.activeIndex)!=null?t.dispatch(DP({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate})):t.dispatch(TP())}ss=null,za=null};if(!c){f();return}o==="raf"?ss=requestAnimationFrame(f):typeof o=="number"&&za===null&&(za=setTimeout(f,o))}});function WY(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var eN={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},XO=lr({name:"rootProps",initialState:eN,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:eN.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}}}),KY=XO.reducer,GY=XO.actions.updateOptions,VY=null,qY={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)},ZO=lr({name:"polarOptions",initialState:VY,reducers:qY});ZO.actions.updatePolarOptions;var QY=ZO.reducer,JO=zr("keyDown"),e_=zr("focus"),t_=zr("blur"),am=qu(),ls=null,Fa=null,Hd=null;am.startListening({actionCreator:JO,effect:(e,t)=>{Hd=e.payload,ls!==null&&(cancelAnimationFrame(ls),ls=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,o=n.throttledEvents,u=o==="all"||o.includes("keydown");Fa!==null&&(typeof i!="number"||!u)&&(clearTimeout(Fa),Fa=null);var c=()=>{try{var f=t.getState(),h=f.rootProps.accessibilityLayer!==!1;if(!h)return;var m=f.tooltip.keyboardInteraction,g=Hd;if(g!=="ArrowRight"&&g!=="ArrowLeft"&&g!=="Enter")return;var v=fu(m,xo(f),Hs(f),Ws(f)),b=v==null?-1:Number(v),j=!Number.isFinite(b)||b<0,k=Ai(f),S=xo(f),N=sc(f,f.tooltip.settings.shared);if(g==="Enter"){if(j)return;var E=Qf(f,N,"hover",String(m.index));t.dispatch(qf({active:!m.active,activeIndex:m.index,activeCoordinate:E}));return}var A=kH(f),P=A==="left-to-right"?1:-1,_=g==="ArrowRight"?1:-1,O;if(j){var T=Hs(f),B=Ws(f),$=_*P,z=pe=>({active:!1,index:String(pe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(O=-1,$>0){for(var Q=0;Q=0;U--)if(fu(z(U),S,T,B)!=null){O=U;break}if(O<0)return}else{O=b+_*P;var ve=(k==null?void 0:k.length)||S.length;if(ve===0||O>=ve||O<0)return}var ue=Qf(f,N,"hover",String(O));t.dispatch(qf({active:!0,activeIndex:O.toString(),activeCoordinate:ue}))}finally{ls=null,Fa=null}};if(!u){c();return}i==="raf"?ls=requestAnimationFrame(c):typeof i=="number"&&Fa===null&&(c(),Hd=null,Fa=setTimeout(()=>{Hd?c():(Fa=null,ls=null)},i))}});am.startListening({actionCreator:e_,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var o="0",u=sc(r,r.tooltip.settings.shared),c=Qf(r,u,"hover",String(o));t.dispatch(qf({active:!0,activeIndex:o,activeCoordinate:c}))}}}});am.startListening({actionCreator:t_,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(qf({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function r_(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var i=Reflect.get(r,n);return typeof i=="function"?i.bind(r):i}})}var Vr=zr("externalEvent"),n_=qu(),Wd=new Map,au=new Map,Kg=new Map;n_.startListening({actionCreator:Vr,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var o=i.type,u=r_(i);Kg.set(o,{handler:n,reactEvent:u});var c=Wd.get(o);c!==void 0&&(cancelAnimationFrame(c),Wd.delete(o));var f=t.getState(),h=f.eventSettings,m=h.throttleDelay,g=h.throttledEvents,v=g,b=v==="all"||(v==null?void 0:v.includes(o)),j=au.get(o);j!==void 0&&(typeof m!="number"||!b)&&(clearTimeout(j),au.delete(o));var k=()=>{var E=Kg.get(o);try{if(!E)return;var A=E.handler,P=E.reactEvent,_=t.getState(),O={activeCoordinate:SW(_),activeDataKey:wW(_),activeIndex:Du(_),activeLabel:qP(_),activeTooltipIndex:Du(_),isTooltipActive:NW(_)};A&&A(O,P)}finally{Wd.delete(o),au.delete(o),Kg.delete(o)}};if(!b){k();return}if(m==="raf"){var S=requestAnimationFrame(k);Wd.set(o,S)}else if(typeof m=="number"){if(!au.has(o)){k();var N=setTimeout(k,m);au.set(o,N)}}else k()}}});var YY=q([al],e=>e.tooltipItemPayloads),XY=q([YY,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(o=>o.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),i_=zr("touchMove"),a_=qu(),Ba=null,Yi=null,tN=null,ou=null;a_.startListening({actionCreator:i_,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){ou=r_(r);var n=t.getState(),i=n.eventSettings,o=i.throttleDelay,u=i.throttledEvents,c=u==="all"||u.includes("touchmove");Ba!==null&&(cancelAnimationFrame(Ba),Ba=null),Yi!==null&&(typeof o!="number"||!c)&&(clearTimeout(Yi),Yi=null),tN=Array.from(r.touches).map(h=>hx({clientX:h.clientX,clientY:h.clientY,currentTarget:r.currentTarget}));var f=()=>{if(ou!=null){var h=t.getState(),m=sc(h,h.tooltip.settings.shared);if(m==="axis"){var g,v=(g=tN)===null||g===void 0?void 0:g[0];if(v==null){Ba=null,Yi=null;return}var b=fx(h,v);(b==null?void 0:b.activeIndex)!=null&&t.dispatch(DP({activeIndex:b.activeIndex,activeDataKey:void 0,activeCoordinate:b.activeCoordinate}))}else if(m==="item"){var j,k=ou.touches[0];if(document.elementFromPoint==null||k==null)return;var S=document.elementFromPoint(k.clientX,k.clientY);if(!S||!S.getAttribute)return;var N=S.getAttribute(o6),E=(j=S.getAttribute(s6))!==null&&j!==void 0?j:void 0,A=Eo(h).find(O=>O.id===E);if(N==null||A==null||E==null)return;var P=A.dataKey,_=XY(h,N,E);t.dispatch(_H({activeDataKey:P,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:E}))}Ba=null,Yi=null}};if(!c){f();return}o==="raf"?Ba=requestAnimationFrame(f):typeof o=="number"&&Yi===null&&(f(),ou=null,Yi=setTimeout(()=>{ou?f():(Yi=null,Ba=null)},o))}}});var o_={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},s_=lr({name:"eventSettings",initialState:o_,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),ZY=s_.actions.setEventSettings,JY=s_.reducer,eX=LE({brush:Aq,cartesianAxis:yq,chartData:jK,errorBars:DQ,eventSettings:JY,graphicalItems:QV,layout:Wz,legend:i8,options:yK,polarAxis:sV,polarOptions:QY,referenceElements:_q,renderedTicks:Jq,rootProps:KY,tooltip:IH,zIndex:aK}),tX=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return pz({reducer:eX,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([QO.middleware,YO.middleware,am.middleware,n_.middleware,a_.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(ZE({type:"raf"}))},devTools:{serialize:{replacer:WY},name:"recharts-".concat(r)}})};function rX(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=Ar(),o=y.useRef(null);if(i)return r;o.current==null&&(o.current=tX(t,n));var u=U0;return y.createElement(b8,{context:u,store:o.current},r)}function nX(e){var t=e.layout,r=e.margin,n=Nt(),i=Ar();return y.useEffect(()=>{i||(n(Bz(t)),n(Fz(r)))},[n,i,t,r]),null}var iX=y.memo(nX,zh);function aX(e){var t=Nt();return y.useEffect(()=>{t(GY(e))},[t,e]),null}var oX=e=>{var t=Nt();return y.useEffect(()=>{t(ZY(e))},[t,e]),null},sX=y.memo(oX,zh);function rN(e){var t=e.zIndex,r=e.isPanorama,n=y.useRef(null),i=Nt();return y.useLayoutEffect(()=>(n.current&&i(nK({zIndex:t,element:n.current,isPanorama:r})),()=>{i(iK({zIndex:t,isPanorama:r}))}),[i,t,r]),y.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function nN(e){var t=e.children,r=e.isPanorama,n=Me(qW);if(!n||n.length===0)return t;var i=n.filter(u=>u<0),o=n.filter(u=>u>0);return y.createElement(y.Fragment,null,i.map(u=>y.createElement(rN,{key:u,zIndex:u,isPanorama:r})),t,o.map(u=>y.createElement(rN,{key:u,zIndex:u,isPanorama:r})))}var lX=["children"];function uX(e,t){if(e==null)return{};var r,n,i=cX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=wA(),n=kA(),i=MA();if(!Un(r)||!Un(n))return null;var o=e.children,u=e.otherAttributes,c=e.title,f=e.desc,h,m;return u!=null&&(typeof u.tabIndex=="number"?h=u.tabIndex:h=i?0:void 0,typeof u.role=="string"?m=u.role:m=i?"application":void 0),y.createElement(tE,rh({},u,{title:c,desc:f,role:m,tabIndex:h,width:r,height:n,style:dX,ref:t}),o)}),hX=e=>{var t=e.children,r=Me(Th);if(!r)return null;var n=r.width,i=r.height,o=r.y,u=r.x;return y.createElement(tE,{width:n,height:i,x:u,y:o},t)},iN=y.forwardRef((e,t)=>{var r=e.children,n=uX(e,lX),i=Ar();return i?y.createElement(hX,null,y.createElement(nN,{isPanorama:!0},r)):y.createElement(fX,rh({ref:t},n),y.createElement(nN,{isPanorama:!1},r))});function mX(e,t){return yX(e)||vX(e,t)||gX(e,t)||pX()}function pX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gX(e,t){if(e){if(typeof e=="string")return aN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?aN(e,t):void 0}}function aN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var u=n.getBoundingClientRect(),c=u.width/n.offsetWidth;We(c)&&c!==o&&e(Hz(c))}},[n,e,o]),i}function oN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bX(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(MK(),null);function ih(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var PX=y.forwardRef((e,t)=>{var r,n,i=y.useRef(null),o=y.useState({containerWidth:ih((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:ih((n=e.style)===null||n===void 0?void 0:n.height)}),u=nh(o,2),c=u[0],f=u[1],h=y.useCallback((g,v)=>{f(b=>{var j=Math.round(g),k=Math.round(v);return b.containerWidth===j&&b.containerHeight===k?b:{containerWidth:j,containerHeight:k}})},[]),m=y.useCallback(g=>{if(typeof t=="function"&&t(g),i.current!=null&&(i.current.disconnect(),i.current=null),g!=null&&typeof ResizeObserver<"u"){var v=g.getBoundingClientRect(),b=v.width,j=v.height;h(b,j);var k=N=>{var E=N[0];if(E!=null){var A=E.contentRect,P=A.width,_=A.height;h(P,_)}},S=new ResizeObserver(k);S.observe(g),i.current=S}},[t,h]);return y.useEffect(()=>()=>{var g=i.current;g!=null&&g.disconnect()},[h]),y.createElement(y.Fragment,null,y.createElement(Yu,{width:c.containerWidth,height:c.containerHeight}),y.createElement("div",pa({ref:m},e)))}),OX=y.forwardRef((e,t)=>{var r=e.width,n=e.height,i=y.useState({containerWidth:ih(r),containerHeight:ih(n)}),o=nh(i,2),u=o[0],c=o[1],f=y.useCallback((m,g)=>{c(v=>{var b=Math.round(m),j=Math.round(g);return v.containerWidth===b&&v.containerHeight===j?v:{containerWidth:b,containerHeight:j}})},[]),h=y.useCallback(m=>{if(typeof t=="function"&&t(m),m!=null){var g=m.getBoundingClientRect(),v=g.width,b=g.height;f(v,b)}},[t,f]);return y.createElement(y.Fragment,null,y.createElement(Yu,{width:u.containerWidth,height:u.containerHeight}),y.createElement("div",pa({ref:h},e)))}),_X=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return y.createElement(y.Fragment,null,y.createElement(Yu,{width:r,height:n}),y.createElement("div",pa({ref:t},e)))}),MX=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?y.createElement(OX,pa({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?y.createElement(_X,pa({},e,{width:r,height:n,ref:t})):y.createElement(y.Fragment,null,y.createElement(Yu,{width:r,height:n}),y.createElement("div",pa({ref:t},e)))});function IX(e){return e?PX:MX}var TX=y.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,o=e.onClick,u=e.onContextMenu,c=e.onDoubleClick,f=e.onMouseDown,h=e.onMouseEnter,m=e.onMouseLeave,g=e.onMouseMove,v=e.onMouseUp,b=e.onTouchEnd,j=e.onTouchMove,k=e.onTouchStart,S=e.style,N=e.width,E=e.responsive,A=e.dispatchTouchEvents,P=A===void 0?!0:A,_=y.useRef(null),O=Nt(),T=y.useState(null),B=nh(T,2),$=B[0],z=B[1],Q=y.useState(null),U=nh(Q,2),ve=U[0],ue=U[1],pe=xX(),oe=Q0(),se=(oe==null?void 0:oe.width)>0?oe.width:N,X=(oe==null?void 0:oe.height)>0?oe.height:i,ne=y.useCallback(_e=>{pe(_e),typeof t=="function"&&t(_e),z(_e),ue(_e),_e!=null&&(_.current=_e)},[pe,t,z,ue]),te=y.useCallback(_e=>{O(qO(_e)),O(Vr({handler:o,reactEvent:_e}))},[O,o]),I=y.useCallback(_e=>{O(g0(_e)),O(Vr({handler:h,reactEvent:_e}))},[O,h]),M=y.useCallback(_e=>{O(TP()),O(Vr({handler:m,reactEvent:_e}))},[O,m]),H=y.useCallback(_e=>{O(g0(_e)),O(Vr({handler:g,reactEvent:_e}))},[O,g]),ie=y.useCallback(()=>{O(e_())},[O]),J=y.useCallback(()=>{O(t_())},[O]),Z=y.useCallback(_e=>{O(JO(_e.key))},[O]),ae=y.useCallback(_e=>{O(Vr({handler:u,reactEvent:_e}))},[O,u]),me=y.useCallback(_e=>{O(Vr({handler:c,reactEvent:_e}))},[O,c]),re=y.useCallback(_e=>{O(Vr({handler:f,reactEvent:_e}))},[O,f]),ye=y.useCallback(_e=>{O(Vr({handler:v,reactEvent:_e}))},[O,v]),Oe=y.useCallback(_e=>{O(Vr({handler:k,reactEvent:_e}))},[O,k]),de=y.useCallback(_e=>{P&&O(i_(_e)),O(Vr({handler:j,reactEvent:_e}))},[O,P,j]),Ze=y.useCallback(_e=>{O(Vr({handler:b,reactEvent:_e}))},[O,b]),Ue=IX(E);return y.createElement(rO.Provider,{value:$},y.createElement(qR.Provider,{value:ve},y.createElement(Ue,{width:se??(S==null?void 0:S.width),height:X??(S==null?void 0:S.height),className:rt("recharts-wrapper",n),style:bX({position:"relative",cursor:"default",width:se,height:X},S),onClick:te,onContextMenu:ae,onDoubleClick:me,onFocus:ie,onBlur:J,onKeyDown:Z,onMouseDown:re,onMouseEnter:I,onMouseLeave:M,onMouseMove:H,onMouseUp:ye,onTouchEnd:Ze,onTouchMove:de,onTouchStart:Oe,ref:ne},y.createElement(CX,null),r)))}),DX=["width","height","responsive","children","className","style","compact","title","desc"];function RX(e,t){if(e==null)return{};var r,n,i=LX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,o=e.children,u=e.className,c=e.style,f=e.compact,h=e.title,m=e.desc,g=RX(e,DX),v=xn(g);return f?y.createElement(y.Fragment,null,y.createElement(Yu,{width:r,height:n}),y.createElement(iN,{otherAttributes:v,title:h,desc:m},o)):y.createElement(TX,{className:u,style:c,width:r,height:n,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},y.createElement(iN,{otherAttributes:v,title:h,desc:m,ref:t},y.createElement($q,null,o)))});function v0(){return v0=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.createElement(KX,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:GX,tooltipPayloadSearcher:gK,categoricalChartProps:e,ref:t}));const qX="rgba(130,130,150,0.14)",uN="rgba(130,130,150,0.85)";function QX(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function l_(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function YX({active:e,payload:t,unit:r}){return!e||!(t!=null&&t.length)?null:l.jsx("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:l.jsx("div",{className:"space-y-1",children:t.map(n=>l.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.color}}),l.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:n.name}),l.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:l_(n.value,r)})]},n.dataKey))})})}function u_({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176}){const o=e.reduce((c,f)=>t.reduce((h,m)=>Math.max(h,Number(f[m.key])||0),c),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(QX(o*1.15),10);return l.jsx("div",{style:{height:i},className:"w-full",children:l.jsx(F6,{width:"100%",height:"100%",children:l.jsxs(VX,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[l.jsx("defs",{children:t.map(c=>l.jsxs("linearGradient",{id:`grad-${c.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:c.color,stopOpacity:.22}),l.jsx("stop",{offset:"100%",stopColor:c.color,stopOpacity:0})]},c.key))}),l.jsx(IO,{vertical:!1,stroke:qX}),l.jsx(GO,{dataKey:"t",hide:!0}),l.jsx(VO,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:c=>l_(c,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:uN}}),l.jsx(KK,{content:l.jsx(YX,{unit:r}),cursor:{stroke:uN,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(c=>l.jsx(WO,{type:"monotone",dataKey:c.key,name:c.label,stroke:c.color,strokeWidth:2,fill:`url(#grad-${c.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},c.key))]})})})}const XX=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function ZX(){var u,c,f,h;const{sys:e,hist:t}=LR(),r=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),n=XX.filter(m=>m.key!=="gpu"||r),i={cpu:(u=e==null?void 0:e.cpu)==null?void 0:u.percent,ram:(c=e==null?void 0:e.ram)==null?void 0:c.percent,gpu:r?e.gpu.busy_percent:null,disk:(f=e==null?void 0:e.disk)==null?void 0:f.percent},o={cpu:(h=e==null?void 0:e.cpu)!=null&&h.cores?`${e.cpu.cores} Cores`:"",ram:e?`${Qr(e.ram.used)}/${Qr(e.ram.total)} GB`:"",gpu:r?`${Qr(e.gpu.gtt_used)}/${Qr(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${Qr(e.disk.used)}/${Qr(e.disk.total)} GB`:""};return l.jsxs("div",{className:"flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsx(pi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:n.map(m=>l.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:m.color}}),l.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:m.label}),l.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(i[m.key]??0),"%"]}),o[m.key]&&l.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:o[m.key]})]},m.key))}),l.jsx(u_,{data:t,series:n,unit:"%",yMode:"percent",height:176})]}):l.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&l.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&l.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&l.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}const cN=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function JX(){const{data:e}=B5(3e3),t=MR(),r=t[t.length-1],n=r?Math.round(r.prompt+r.completion):0;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(oh,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Token-Durchsatz"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e&&l.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[l.jsx("span",{className:"font-space text-3xl font-bold tracking-tight text-foreground tabular-nums",children:n.toLocaleString("de-DE")}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"tok/s aktuell"})]}),e&&l.jsxs("div",{className:"mt-0.5 space-y-0.5 font-mono text-[11px] text-muted-foreground/70",children:[l.jsxs("div",{children:[e.total_tokens.toLocaleString("de-DE")," Tokens gesamt · ",l.jsxs("span",{className:"text-emerald-400/90",children:[e.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," € gespart"]})]}),l.jsxs("div",{className:"text-muted-foreground/55",children:["Input ",e.prompt_tokens.toLocaleString("de-DE")," · Output ",e.completion_tokens.toLocaleString("de-DE")]})]})]}),l.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1.5 pt-1",children:cN.map(i=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:i.label}),l.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((r==null?void 0:r[i.key])??0)})]},i.key))})]}),e?l.jsx(u_,{data:t,series:cN,unit:" tok/s",yMode:"auto",height:150}):l.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),l.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}function eZ(){const{data:e}=gh(3e4),{data:t}=wi(),r=((e==null?void 0:e.os)||0)+((e==null?void 0:e.engine)||0)+((e==null?void 0:e.swap)||0)+((e==null?void 0:e.models)||0),n=()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}})),i=(t==null?void 0:t.models)??[],o=(t==null?void 0:t.running)??[],u=i.find(m=>m.role==="hermes"),c=i.find(m=>m.role==="coder-lite")||i.find(m=>m.role==="coder"),f=m=>m?o.includes(m):!1,h=m=>{var g;return((g=m==null?void 0:m.split("/").pop())==null?void 0:g.replace(/\.gguf$/i,""))||"—"};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Basisstation"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geht's der Box gut, gibt's Updates, was läuft gerade."})]}),l.jsx(DR,{frame:"box"}),l.jsxs("button",{onClick:n,className:ee("w-full flex items-center gap-3 rounded-2xl border p-4 text-left transition-all cursor-pointer",r>0?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10":"border-border/60 bg-card/45 hover:border-primary/40"),children:[r>0?l.jsx(hM,{className:"h-6 w-6 shrink-0 text-amber-400"}):l.jsx(qt,{className:"h-6 w-6 shrink-0 text-emerald-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:ee("text-sm font-semibold",r>0?"text-amber-400":"text-foreground"),children:r>0?`${r} Update${r===1?"":"s"} verfügbar`:"Alles aktuell"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r>0?"Antippen, um zu sehen, was genau aktualisiert wird.":"Keine ausstehenden Updates."})]}),r>0&&l.jsxs("span",{className:"shrink-0 flex items-center gap-1 text-xs font-semibold text-amber-400",children:["Ansehen ",l.jsx(Wu,{className:"h-4 w-4"})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:"Was gerade läuft"}),l.jsx("div",{className:"rounded-2xl border border-border/60 overflow-hidden",children:[{icon:pi,label:"Lucys Hirn",model:u==null?void 0:u.name,warm:f(u==null?void 0:u.name)},{icon:Ts,label:"Coder (Vibe-Coding)",model:c==null?void 0:c.name,warm:f(c==null?void 0:c.name)}].map(m=>l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/40 last:border-0",children:[l.jsx("span",{className:ee("h-2 w-2 shrink-0 rounded-full",m.warm?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),l.jsx(m.icon,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-sm text-foreground w-40 shrink-0",children:m.label}),l.jsx("span",{className:"text-xs text-muted-foreground flex-1 truncate font-mono",children:h(m.model)}),l.jsx("span",{className:ee("text-xs shrink-0",m.warm?"text-emerald-400":"text-muted-foreground"),children:m.model?m.warm?"warm":"bereit":"nicht gesetzt"})]},m.label))})]}),l.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[l.jsx(ZX,{}),l.jsx(JX,{})]})]})}const tZ=e=>!!ct(e).protected;function rZ({role:e,roleRec:t,models:r,onAssign:n,onClose:i}){var f,h;const o=t&&t.role===e?t:null,u={};o==null||o.models.forEach(m=>{u[m.name]=m});const c=o?o.models.map(m=>r.find(g=>g.name===m.name)).filter(Boolean):r;return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":`${ct(e).label} konfigurieren`,children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(so,{role:e})," festlegen"]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell für ",l.jsx("strong",{className:"text-foreground",children:ct(e).label}),l.jsx("span",{className:"block text-[10px] text-muted-foreground/70 mt-0.5",children:ct(e).desc})]}),(o==null?void 0:o.recommended)&&l.jsxs("button",{onClick:()=>n(o.recommended),title:(f=u[o.recommended])==null?void 0:f.reason,className:"shrink-0 h-7 px-3 text-[11px] font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg cursor-pointer flex items-center gap-1",children:[l.jsx(ga,{className:"h-3 w-3"})," Auto: ",(h=o.recommended.split("/").pop())==null?void 0:h.replace(/\.gguf$/i,"")]})]}),l.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[tZ(e)?l.jsx("div",{className:"w-full px-3 py-2 rounded-lg text-[11px] text-muted-foreground border border-border/30 bg-background/20 flex items-center gap-1.5",children:"🔒 Diese Rolle ist lebenswichtig und kann nicht leer bleiben — wähle stattdessen ein anderes Modell."}):l.jsx("button",{onClick:()=>n(""),className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:l.jsx("span",{children:"Zuweisung entfernen"})}),c.map(m=>{var k;const g=u[m.name],v=m.role===e,b=!!(g!=null&&g.recommended),j=!!g&&!g.suitable;return l.jsxs("button",{onClick:()=>n(m.name),className:ee("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border",b?"border-primary/50 bg-primary/10":v?"text-primary font-bold bg-primary/5 border-primary/30":j?"border-border/20 bg-background/10 opacity-60":"text-foreground bg-background/20 border-border/30"),children:[l.jsxs("div",{className:"flex flex-col text-left min-w-0",children:[l.jsxs("span",{className:"truncate max-w-[260px] font-semibold flex items-center gap-1.5",children:[(k=m.name.split("/").pop())==null?void 0:k.replace(/\.gguf$/i,""),b&&l.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wide text-primary bg-primary/15 px-1.5 py-0.5 rounded",children:"Empfohlen"})]}),l.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:g?`${g.params_b}B · ${m.quant} · ${g.reason}`:`${or(m.size_bytes)} · ${m.quant}`})]}),v&&l.jsx(qt,{className:"h-4 w-4 shrink-0 text-primary"})]},m.name)})]})]})})}const nZ=["fast","heavy","heavy_chars"],iZ=["coder_lite","coder","coding_escalate_chars"];function aZ(){const e=Kn(),{data:t,isLoading:r}=FD(),[n,i]=y.useState(null),[o,u]=y.useState(!1),[c,f]=y.useState(""),[h,m]=y.useState(0);if(y.useEffect(()=>{t!=null&&t.policy&&!n&&i({...t.policy})},[t,n]),r||!t||!n)return l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-xs text-muted-foreground",children:"Lade Routing-Policy…"});const g=N=>t.fields.find(E=>E.key===N),v=Object.keys(n).some(N=>n[N]!==t.policy[N]),b=(N,E)=>{i(A=>A&&{...A,[N]:E}),f("")},j=N=>b(N,t.defaults[N]);async function k(){if(!n)return;const N={};for(const E of Object.keys(n))n[E]!==t.policy[E]&&(N[E]=n[E]);if(Object.keys(N).length!==0){u(!0),f("");try{const{policy:E}=await $D(N);i({...E}),e.invalidateQueries({queryKey:Be.routingPolicy}),e.invalidateQueries({queryKey:Be.routing}),m(Date.now()),setTimeout(()=>m(0),2e3)}catch(E){f(E.message||String(E))}finally{u(!1)}}}function S({k:N}){const E=g(N),A=n[N],P=n[N]===t.defaults[N];return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("label",{className:"text-[10px] font-semibold text-muted-foreground",children:E.label}),!P&&l.jsxs("button",{onClick:()=>j(N),className:"flex items-center gap-0.5 text-[9px] text-muted-foreground/60 hover:text-foreground transition-colors cursor-pointer",title:`Auf Default zurücksetzen (${String(t.defaults[N])||"leer"})`,children:[l.jsx(zM,{className:"h-2.5 w-2.5"})," Default"]})]}),E.type==="bool"?l.jsxs("button",{onClick:()=>b(N,!A),className:ee("flex h-8 w-full items-center justify-between rounded-lg border px-3 text-[11px] font-semibold transition-all cursor-pointer",A?"border-emerald-500/40 bg-emerald-500/10 text-emerald-300":"border-border/40 bg-background/40 text-muted-foreground"),children:[l.jsx("span",{children:A?"An":"Aus"}),l.jsx("span",{className:ee("h-3.5 w-3.5 rounded-full transition-colors",A?"bg-emerald-400":"bg-muted-foreground/40")})]}):E.type==="int"?l.jsx("input",{type:"number",value:A,min:E.min,max:E.max,"aria-label":E.label,onChange:_=>b(N,Number(_.target.value)),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"}):l.jsx("input",{type:"text",value:A,"aria-label":E.label,spellCheck:!1,placeholder:N==="coder_lite"?"(leer = aus)":"",onChange:_=>b(N,_.target.value),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"})]})}return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(GM,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lane-Routing & Policy"}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-300 border border-emerald-500/20",children:"hot-reload"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx("span",{className:"text-[10px] text-red-400 max-w-[280px] truncate",title:c,children:c}),h>0&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400",children:[l.jsx(qt,{className:"h-3.5 w-3.5"})," gespeichert"]}),l.jsxs("button",{onClick:k,disabled:!v||o,className:ee("h-8 px-4 rounded-lg text-[10px] font-bold uppercase tracking-wide transition-all flex items-center gap-1.5",v&&!o?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer shadow-md shadow-primary/10":"bg-background/40 text-muted-foreground/50 border border-border/40 cursor-not-allowed"),children:[o?l.jsx(Vs,{className:"h-3.5 w-3.5 animate-spin"}):null,"Speichern"]})]})]}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed -mt-1",children:["Welches echte Modell hinter den virtuellen Lanes ",l.jsx("code",{className:"text-cyan-300",children:"chat"})," und"," ",l.jsx("code",{className:"text-cyan-300",children:"coding"})," steckt. Änderungen greifen sofort (kein Neustart). Die Keyword-Heuristiken bleiben im Code."]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(IM,{className:"h-4 w-4 text-teal-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"chat"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(= auto)"})]}),nZ.map(N=>l.jsx(S,{k:N},N))]}),l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(gM,{className:"h-4 w-4 text-indigo-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"coding"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(agentisch → immer Coder)"})]}),iZ.map(N=>l.jsx(S,{k:N},N))]})]}),l.jsx("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4",children:l.jsx("div",{className:"max-w-xs",children:l.jsx(S,{k:"fast_no_think"})})})]})}function oZ(){var ve,ue,pe;const e=Kn(),{data:t}=wi(4e3),{data:r}=I0(),{data:n}=ko(),{data:i}=U5(),{showAlert:o,dialogElement:u}=ba(),[c,f]=y.useState(!1),[h,m]=y.useState(!1),g=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=(ve=r==null?void 0:r.groups)==null?void 0:ve.brains,j=(b==null?void 0:b.members)??[],k=oe=>g.find(se=>se.name===oe),S=oe=>{var se;return((se=oe.split("/").pop())==null?void 0:se.replace(/\.gguf$/i,""))||oe},N=j.map(k).filter(Boolean),E=1024**3,A=i==null?void 0:i.budget,P=N.reduce((oe,se)=>oe+(se.size_bytes||0),0)/E,_=((ue=n==null?void 0:n.gpu)==null?void 0:ue.gtt_total)||((pe=n==null?void 0:n.gpu)==null?void 0:pe.vram_total)||0,O=(A==null?void 0:A.gtt_gb)||(_?_/E:0),T=(A==null?void 0:A.warm_projected_gb)??P,B=O>0?Math.min(100,T/O*100):0,$=g.filter(oe=>!j.includes(oe.name)&&!oe.incomplete);async function z(oe){m(!0);try{await z5("brains",oe,(b==null?void 0:b.swap)??!1,(b==null?void 0:b.persist)??!0),e.invalidateQueries({queryKey:Be.groups}),e.invalidateQueries({queryKey:Be.models}),e.invalidateQueries({queryKey:Be.hermesBrain})}catch(se){o("Fehler",`Immer-bereit-Set konnte nicht geändert werden: ${(se==null?void 0:se.message)||se}`)}finally{m(!1)}}function Q(oe){const se=k(oe);if(se&&ct(se.role).protected){o("Geschützt",`„${ct(se.role).label}" ist lebenswichtig und bleibt immer bereit.`);return}z(j.filter(X=>X!==oe))}function U(oe){f(!1),z([...j,oe])}return b?l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[l.jsx(dN,{}),l.jsxs("div",{className:"space-y-1.5",children:[N.length===0&&l.jsx("div",{className:"text-xs text-muted-foreground",children:"Noch keine Modelle im Set."}),N.map(oe=>{const se=v.includes(oe.name),X=ct(oe.role).protected;return l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("span",{className:ee("h-2 w-2 shrink-0 rounded-full ring-2 ring-black/40",se?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40"),title:se?"Gerade warm (bereit)":"Reserviert — lädt bei Bedarf sofort"}),oe.role&&l.jsx(so,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",title:oe.name,children:S(oe.name)}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:or(oe.size_bytes)})]}),X?l.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-muted-foreground",title:"Lebenswichtig — bleibt immer im Set.",children:"🔒"}):l.jsx("button",{onClick:()=>Q(oe.name),disabled:h,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground transition-colors hover:bg-red-500/5 hover:text-red-400 cursor-pointer disabled:opacity-50",title:"Aus dem Immer-bereit-Set nehmen (lädt dann nur noch bei Bedarf)",children:l.jsx(gi,{className:"h-3.5 w-3.5"})})]},oe.name)})]}),l.jsxs("button",{onClick:()=>f(!0),disabled:h||$.length===0,className:"flex h-8 w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-border/50 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary cursor-pointer disabled:opacity-50",children:[l.jsx(cv,{className:"h-3.5 w-3.5"})," Modell dauerhaft bereithalten"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",title:"Modellgewichte + KV-Cache, berechnet aus den echten Architektur-Daten jedes Modells (Layer × KV-Köpfe × Kontext) und seiner KV-Quantisierung. So viel legt llama.cpp beim Laden wirklich für den eingestellten Kontext an — kein Aufschlag mehr.",children:[l.jsx(fa,{className:"h-3.5 w-3.5"})," Reserviert fürs Set"]}),l.jsxs("span",{className:"font-mono font-bold text-foreground",children:[T.toFixed(1),O>0?` / ${O.toFixed(0)}`:""," GB"]})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:ee("h-full rounded-full transition-all duration-500",B>=85?"bg-red-500":B>=65?"bg-amber-500":"bg-teal-500"),style:{width:`${B}%`}})}),A&&!A.fits&&l.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-amber-400",children:[l.jsx(Er,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsxs("span",{children:["Zusammen mit dem größten Gelegenheits-Modell (~",A.largest_ondemand_gb," GB) wird der Speicher knapp. Das Set bleibt dabei immer geladen — wird es wirklich eng, schlägt das Laden des großen Modells fehl (es wartet dann, statt das Set zu verdrängen)."]})]}),A&&A.fits&&l.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-emerald-400",children:[l.jsx(qt,{className:"h-3.5 w-3.5 shrink-0"})," Passt auch neben dem größten Gelegenheits-Modell — nichts wird verdrängt."]})]}),c&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-label":"Modell zum Immer-bereit-Set hinzufügen",children:l.jsxs("div",{className:"w-full max-w-md space-y-3 rounded-2xl border border-border/80 bg-card p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Dauerhaft bereithalten"}),l.jsx("button",{onClick:()=>f(!1),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer",children:l.jsx(gi,{className:"h-4 w-4"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Wähle ein Modell, das ohne Ladezeit bereitstehen soll:"}),l.jsx("div",{className:"max-h-60 space-y-1.5 overflow-y-auto pr-1",children:$.map(oe=>l.jsxs("button",{onClick:()=>U(oe.name),className:"flex w-full items-center justify-between gap-2 rounded-lg border border-border/30 bg-background/20 px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[oe.role&&l.jsx(so,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:S(oe.name)})]}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:or(oe.size_bytes)})]},oe.name))})]})}),u]}):l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsx(dN,{}),l.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Es gibt noch kein Immer-bereit-Set. Es entsteht automatisch, sobald Lucys Hirn zugewiesen ist."}),u]})}function dN(){return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ga,{className:"h-4.5 w-4.5 text-primary"}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground",children:"Immer-bereit-Set"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Diese Modelle hält Lucy immer bereit — sie antworten ohne Ladezeit."})]})]})}function sZ(){var Ue,_e,xt,Jt;const e=Kn(),{data:t,isLoading:r,error:n}=wi(4e3),{data:i}=gh(4e3),{data:o}=U5(),{data:u}=ko(),{data:c}=I0(),{showAlert:f,showConfirm:h,showPrompt:m,dialogElement:g}=ba(),v=O0(),b=G=>!!ct(G).protected,j=(t==null?void 0:t.models)??[],k=(t==null?void 0:t.running)??[],S=n?String(n):"",N=()=>{e.invalidateQueries({queryKey:Be.models}),e.invalidateQueries({queryKey:Be.routing})},E=(Ue=c==null?void 0:c.groups)==null?void 0:Ue.brains,A=(E==null?void 0:E.members)??[],P=G=>A.includes(G),_=A.some(G=>k.includes(G));async function O(G){if(!E){f("Keine brains-Gruppe","Es existiert noch keine Ko-Residenz-Gruppe „brains“ in der Engine-Konfiguration. Lege sie erst über die Gruppen-Verwaltung an.");return}const Pe=A.includes(G)?A.filter(Ve=>Ve!==G):[...A,G];try{await z5("brains",Pe,E.swap??!1,E.persist??!0),e.invalidateQueries({queryKey:Be.groups}),N()}catch(Ve){f("Fehler",`Ko-Residenz konnte nicht geändert werden: ${Ve.message||Ve}`)}}const[T,B]=y.useState(null),[$,z]=y.useState(null),[Q,U]=y.useState(null),[ve,ue]=y.useState("grid"),[pe,oe]=y.useState("all"),se=j.filter(G=>pe==="in_use"?!!G.role||k.includes(G.name):!0);async function X(G){try{await we(`/api/models/${encodeURIComponent(G)}/load`,{method:"POST"}),N()}catch(Ne){f("Fehler",`Fehler beim Laden des Modells: ${Ne.message}`)}}async function ne(G){if(E&&_&&!P(G)){const Ne=A.filter(Pe=>k.includes(Pe)).map(Pe=>Pe.split("/").pop()).join(", ");h("Verdrängt das Hirn?",`„${G.split("/").pop()}“ ist nicht in der Ko-Residenz-Gruppe „brains“. Beim Laden wirft es das aktuell warme Hirn (${Ne}) raus — Lucy verliert Hirn bzw. Augen. Trotzdem exklusiv laden? Tipp: Mit dem 🧠-Schalter machst du das Modell dauerhaft ko-resident, dann bleiben beide warm.`,()=>X(G));return}X(G)}async function te(G){const Ne=j.find(Pe=>Pe.name===G);if(Ne&&b(Ne.role)){f("Geschützt",`„${ct(Ne.role).label}" ist lebenswichtig für Lucy und bleibt geladen. Zum Entladen erst im Experten-Modus die Rolle einem anderen Modell geben.`);return}try{await we(`/api/models/${encodeURIComponent(G)}/unload`,{method:"POST"}),N()}catch(Pe){f("Fehler",`Fehler beim Entladen des Modells: ${Pe.message}`)}}async function I(){try{await we("/api/models/unload",{method:"POST"}),N()}catch(G){f("Fehler",`Fehler beim Entladen aller Modelle: ${G.message}`)}}async function M(G,Ne){try{const Pe=await we(`/api/models/${encodeURIComponent(Ne)}/role`,{method:"POST",body:JSON.stringify({role:G||null})});N(),Pe!=null&&Pe.warning&&f("Hirn gesetzt — Hinweis",Pe.warning)}catch(Pe){f("Fehler",`Fehler beim Zuweisen der Rolle: ${Pe.message||Pe}`)}}function H(G){B(G),z(null),we(`/api/roles/${encodeURIComponent(G)}/recommend`).then(Ne=>z(Ne)).catch(()=>{})}async function ie(G,Ne){let Pe=null;try{Pe=await we(`/api/models/${encodeURIComponent(G)}/ctx/auto`)}catch{}const Ve=Pe?`Optimal für dein Setup: ${(Pe.ctx/1024).toFixed(0)}k (${Pe.ctx}) — GTT ${Pe.gtt_gb} GB − reserviert ${Pe.reserved_gb} GB (${Pe.mode}) → ${Pe.budget_gb} GB frei. »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";m("Kontextlänge anpassen",Ve,String(Ne||32768),async nt=>{if(nt)try{await we(`/api/models/${encodeURIComponent(G)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(nt,10)})}),N()}catch(K){f("Fehler",`Fehler beim Setzen des Kontexts: ${K.message||K}`)}},void 0,Pe?{autoValue:String(Pe.ctx),autoLabel:`Auto (${(Pe.ctx/1024).toFixed(0)}k)`}:void 0)}async function J(G){const Ne=j.find(Pe=>Pe.name===G);if(Ne&&b(Ne.role)){f("Geschützt",`„${ct(Ne.role).label}" ist lebenswichtig für Lucy und kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}h("Modell löschen?",`Modell '${G}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await we(`/api/models/${encodeURIComponent(G)}`,{method:"DELETE"}),N()}catch(Pe){f("Fehler",`Fehler beim Löschen: ${Pe.message||Pe}`)}})}async function Z(G,Ne,Pe,Ve){try{await we("/api/models/install",{method:"POST",body:JSON.stringify({repo:G,role:Ne,quant:Pe,jinja:Ve})}),f("Herunterladen gestartet",`Download für '${G}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(nt){f("Fehler",`Fehler beim Starten des Upgrades: ${nt.message||nt}`)}}async function ae(G){const Ne=o==null?void 0:o.budget,Pe=Ne&&!Ne.fits?` @@ -668,6 +673,6 @@ Trotzdem exklusiv laden? Tipp: Mit dem 🧠-Schalter machst du das Modell dauerh stroke-dasharray: 4 6; animation: flow-dash 1s linear infinite; } - `}),l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fa,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Speicher-Pool: ",or(re)," Gewichte",Oe>0?` · ${or(Oe)} real belegt (inkl. KV)`:""," / ",or(Ze)]}),v&&k.length>0&&l.jsx("button",{onClick:I,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),l.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:me.length===0?l.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):me.map((G,Ne)=>{var nt;const Pe=(G.size_bytes||0)/Ze*100,Ve=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][Ne%4];return l.jsxs("div",{style:{width:`${Pe}%`},className:ee("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Ve),title:`${G.name} (${or(G.size_bytes)})`,children:[l.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[G.role?`[${ct(G.role).short}] `:"",(nt=G.name.split("/").pop())==null?void 0:nt.replace(".gguf","")]}),l.jsx("span",{className:"text-[8px] font-mono opacity-80",children:or(G.size_bytes)})]},G.name)})})]}),l.jsx(aZ,{}),v&&l.jsx(iZ,{}),l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:v?"Gateway Steckplatz-Belegung (Slot-Zuweisung)":"Wer macht was bei Lucy — zum Ändern antippen"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:GD.map(G=>{var Ve;const Ne=j.find(nt=>nt.role===G),Pe=Ne?k.includes(Ne.name):!1;return l.jsxs("div",{onClick:()=>H(G),className:ee("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",Pe?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":Ne?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(so,{role:G}),Pe&&l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),l.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:Ne==null?void 0:Ne.name,children:Ne?(Ve=Ne.name.split("/").pop())==null?void 0:Ve.replace(/\.gguf$/i,""):"nicht zugewiesen"}),l.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},G)})})]}),(o==null?void 0:o.current)&&l.jsxs("div",{className:"rounded-2xl border border-indigo-500/30 bg-indigo-500/5 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yn,{className:"h-4.5 w-4.5 text-indigo-400"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Hirn (Hermes)"}),o.current.version!=null&&l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-indigo-500/15 text-indigo-300 border border-indigo-500/25",children:["v",o.current.version]})]}),l.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"agent"}})),className:"h-7 px-3 rounded-lg border border-indigo-500/30 bg-indigo-500/5 text-indigo-300 text-[9px] font-bold uppercase hover:bg-indigo-500/15 transition-all cursor-pointer",title:"Hirn-Wechsel passiert jetzt zentral im Hermes-Tab",children:"Im Hermes-Tab wechseln →"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-background/30 border border-border/30 p-3.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:o.current.name,children:o.current.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsx("span",{children:o.current.params_b?`${o.current.params_b}B`:"—"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:o.current.quant||"GGUF"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:or(o.current.size_bytes||0)})]})]}),o.update_available&&o.recommended?l.jsxs("button",{onClick:()=>ae(o.recommended.repo),className:ee("h-8 px-3 shrink-0 flex items-center justify-center gap-1.5 rounded-lg text-[10px] font-bold uppercase transition-all cursor-pointer shadow-md",o.budget&&!o.budget.fits?"bg-red-500 text-white hover:bg-red-400 shadow-red-500/10":"bg-amber-500 text-black hover:bg-amber-400 shadow-amber-500/10"),children:[l.jsx(Ds,{className:"h-3.5 w-3.5"})," Aktualisieren"]}):l.jsxs("span",{className:"h-8 px-3 shrink-0 flex items-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/15 rounded-lg select-none",children:[l.jsx(qt,{className:"h-4 w-4"})," Neueste Generation"]})]}),o.update_available&&o.recommended&&l.jsxs("div",{className:"text-[10px] text-amber-400/90 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),"Neuere Generation verfügbar: ",l.jsx("span",{className:"font-mono font-bold",children:o.recommended.name.replace(/-GGUF$/i,"")}),"(v",o.recommended.version,", ",o.recommended.params_b,"B) — von NousResearch."]}),o.budget&&l.jsxs("div",{className:ee("text-[10px] flex items-start gap-1.5 leading-relaxed",o.budget.fits?"text-muted-foreground/80":"text-red-400 font-semibold"),children:[l.jsx(fa,{className:"h-3 w-3 shrink-0 mt-0.5"}),l.jsxs("span",{children:["Always-On-Brain ~",o.budget.brain_gb," GB + größtes on-demand (~",o.budget.largest_ondemand_gb," GB) = ",(o.budget.brain_gb+o.budget.largest_ondemand_gb).toFixed(1)," / ",o.budget.gtt_gb," GB",o.budget.fits?" · passt gleichzeitig ✓":" · passt NICHT gleichzeitig ⚠ — heavy/coder würden das Brain verdrängen. Kleineres Brain oder weniger Kontext."]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[l.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",se.length," von ",j.length,")"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>oe("all"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),l.jsx("button",{onClick:()=>oe("in_use"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>ue("grid"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),l.jsx("button",{onClick:()=>ue("list"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ve==="grid"?l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:se.length===0?l.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):se.map(G=>{const Ne=k.includes(G.name),Pe=i==null?void 0:i.model_list.find(nt=>nt.role===G.role),Ve=uf(G.name);return l.jsxs("div",{className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",Ne?"border-primary/45 shadow-primary/5":G.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex items-start justify-between gap-3",children:l.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[l.jsx("div",{className:ee("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ve.color),title:Ve.name,children:Ve.initial}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:G.name,children:G.name.split("/").pop()}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[l.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:G.quant||"GGUF"}),Ne&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[l.jsx(oh,{className:"h-3 w-3 animate-pulse"})," Warm"]}),G.role&&l.jsx(so,{role:G.role,dense:!0}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[9px] font-semibold text-muted-foreground",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&P(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[9px] font-mono text-fuchsia-300 font-bold uppercase",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm, verdrängt es nicht.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),l.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:l.jsx(bv,{caps:G.capabilities})})]}),l.jsxs("div",{className:"space-y-3 pt-1",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(fa,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),l.jsx("div",{className:"text-foreground font-semibold",children:or(G.size_bytes)})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(KN,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),l.jsx("div",{className:"text-foreground font-semibold",children:xv(G.ctx)})]})]})]}),Pe&&l.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),l.jsxs("span",{children:["Upgrade verfügbar: ",Pe.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>Z(Pe.repo,G.role,G.quant||"Q4_K_M",G.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[l.jsx(Ds,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[(()=>{const nt=b(G.role),K=Ne&&nt,Le=G.incomplete&&!Ne||K;return l.jsx("button",{onClick:()=>Ne?te(G.name):ne(G.name),disabled:Le,title:K?`„${ct(G.role).label}" bleibt geladen (geschützt).`:void 0,className:ee("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",Le?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ne?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:K?"🔒 geladen":Ne?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ie(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",P(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:P(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>U(G),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ga,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>J(G.name),disabled:b(G.role),className:ee("h-7 w-7 rounded-lg border border-border/40 flex items-center justify-center transition-colors",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${ct(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(of,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})}):l.jsx("div",{className:"space-y-2",children:se.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):se.map(G=>{const Ne=k.includes(G.name),Pe=uf(G.name);return l.jsxs("div",{className:ee("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",Ne?"border-primary/45":G.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("div",{className:ee("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Pe.color),title:Pe.name,children:Pe.initial}),l.jsxs("div",{className:"min-w-0 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:G.name,children:G.name.split("/").pop()}),G.role&&l.jsx(so,{role:G.role,dense:!0,className:"shrink-0"}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[8px] font-semibold text-muted-foreground shrink-0",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&P(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[8px] font-mono text-fuchsia-300 font-bold uppercase shrink-0",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),Ne&&l.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsxs("span",{children:["Größe: ",or(G.size_bytes)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Kontext: ",xv(G.ctx)]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:"font-mono text-[9px]",children:G.quant||"GGUF"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[l.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:l.jsx(bv,{caps:G.capabilities})}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[(()=>{const Ve=b(G.role),nt=Ne&&Ve,K=G.incomplete&&!Ne||nt;return l.jsx("button",{onClick:()=>Ne?te(G.name):ne(G.name),disabled:K,title:nt?`„${ct(G.role).label}" bleibt geladen (geschützt).`:void 0,className:ee("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",K?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ne?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:nt?"🔒 geladen":Ne?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ie(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",P(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:P(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>U(G),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ga,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>J(G.name),disabled:b(G.role),className:ee("h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 transition-all",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${ct(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(of,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})})]}),T&&l.jsx(tZ,{role:T,roleRec:$,models:j,onAssign:G=>{M(T,G),B(null)},onClose:()=>B(null)}),Q&&l.jsx(K5,{model:Q,onClose:()=>U(null),onChanged:N}),g]})}function Gg({icon:e,title:t,sub:r,onClick:n}){return l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-left transition-all hover:border-primary/40 cursor-pointer",children:[l.jsx(e,{className:"h-6 w-6 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-foreground",children:t}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r})]}),l.jsx(Ku,{className:"h-5 w-5 text-muted-foreground shrink-0"})]})}function sZ(){const[e,t]=y.useState(null);return e?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-1.5 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l.jsx(RN,{className:"h-4 w-4"})," Maschinenraum"]}),e==="modelle"?l.jsx(oZ,{}):l.jsx(q5,{})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Maschinenraum"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Nur nötig, wenn du wirklich was ändern willst."})]}),l.jsx($5,{})]}),l.jsx(Gg,{icon:pi,title:"Modelle",sub:"Hirne, Coder, Immer-bereit-Set, Bibliothek",onClick:()=>t("modelle")}),l.jsx(Gg,{icon:qN,title:"Wartung und Logs",sub:"Updates, Backup, Dienste, Logs, Zugangsdaten",onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}}))}),l.jsx(Gg,{icon:yn,title:"Hermes und Verdrahtung",sub:"Agent, Gehirn-Modell, PC-Verbindung",onClick:()=>t("hermes")})]})}const lZ=[{id:"start",label:"Start",icon:oh},{id:"vibe",label:"Vibe-Coding",icon:Ts},{id:"konstitution",label:"Konstitution",icon:oM},{id:"maschinenraum",label:"Maschinenraum",icon:Gu}];function uZ(){const[e,t]=y.useState("start"),[r,n]=y.useState(!1),[i,o]=y.useState("maintenance"),{data:u}=M0();y.useEffect(()=>{const f=h=>{var m;o(((m=h.detail)==null?void 0:m.tab)||"maintenance"),n(!0)};return window.addEventListener("open-system-drawer",f),()=>window.removeEventListener("open-system-drawer",f)},[]);const c=u&&u.engine_reachable&&(u.brain?u.brain.ready:!0);return l.jsxs("div",{className:"flex h-full relative",children:[l.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:l.jsx("div",{className:"absolute inset-0 opacity-30 animate-aurora bg-gradient-to-tr from-teal-500/15 via-indigo-500/10 to-purple-500/15 blur-[130px]"})}),l.jsx(Q5,{open:r,onClose:()=>n(!1),defaultTab:i}),l.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md",children:[l.jsxs("div",{className:"flex items-center gap-2 px-5 py-4 border-b border-border/40",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20"}),l.jsxs("div",{className:"leading-tight",children:[l.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),l.jsx("div",{className:"text-[10px] text-muted-foreground",children:"3 · Prototyp"})]})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4",children:lZ.map(f=>l.jsxs("button",{onClick:()=>t(f.id),className:ee("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-all cursor-pointer",e===f.id?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(f.icon,{className:"h-4.5 w-4.5 shrink-0"})," ",f.label]},f.id))}),l.jsxs("div",{className:"px-3 py-3 border-t border-border/40 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 px-2 text-xs text-muted-foreground",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full",c?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c?"Box läuft":"prüfen"]}),l.jsxs("a",{href:"#dashboard",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(RN,{className:"h-3.5 w-3.5"})," zurück zu MC2"]})]})]}),l.jsxs("main",{className:"flex-1 min-w-0 overflow-y-auto p-6 scrollbar-thin",children:[e==="start"&&l.jsx(JX,{}),e==="vibe"&&l.jsx(G5,{}),e==="konstitution"&&l.jsx(V5,{}),e==="maschinenraum"&&l.jsx(sZ,{})]})]})}const cZ={ok:"bg-emerald-500",warn:"bg-amber-500",alert:"bg-red-500",muted:"bg-muted-foreground/40",loading:"bg-muted-foreground/40 animate-pulse"},dZ={ok:"hover:border-emerald-500/40",warn:"hover:border-amber-500/50",alert:"hover:border-red-500/50",muted:"hover:border-primary/40",loading:"hover:border-border/60"};function ni({icon:e,title:t,value:r,unit:n,tone:i="muted",hint:o,onClick:u}){return l.jsxs("button",{onClick:u,className:ee("group relative flex flex-col items-start rounded-2xl border border-border/60 bg-card/45 p-5 text-left shadow-lg shadow-black/15 backdrop-blur-md transition-all duration-200 cursor-pointer hover:bg-card/70 hover:shadow-xl",dZ[i]),children:[l.jsxs("div",{className:"mb-4 flex w-full items-center justify-between",children:[l.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl border border-border/40 bg-background/30 text-foreground/80 transition-colors group-hover:text-primary",children:l.jsx(e,{className:"h-5 w-5"})}),l.jsx("span",{className:ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",cZ[i]),title:o})]}),l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-2xl font-bold tracking-tight text-foreground font-space tabular-nums",children:r}),n&&l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n})]}),l.jsxs("div",{className:"mt-1 flex w-full items-center justify-between",children:[l.jsx("span",{className:"text-sm font-semibold text-foreground/90",children:t}),l.jsx(Ku,{className:"h-4 w-4 text-muted-foreground/40 transition-all group-hover:translate-x-0.5 group-hover:text-primary"})]}),o&&l.jsx("span",{className:"mt-0.5 text-[11px] text-muted-foreground",children:o})]})}const tf=e=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:e}}));function fZ({onNavigate:e}){var _,O;const{data:t}=wi(4e3),{data:r}=F5(4e3),{data:n}=gh(8e3),{data:i}=vv(),{data:o}=ph(),{data:u}=H5(),c=Z5(),{showAlert:f,dialogElement:h}=ba(),m=Kn(),[g,v]=y.useState({});async function b(T,B){v($=>({...$,[T]:!0}));try{if(B.kind==="loadModel")await we(`/api/models/${encodeURIComponent(B.model)}/load`,{method:"POST"});else{const $=await we("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:B.service})});$.ok||f("Reparatur nicht ganz geklappt",($.err||"Unbekannter Fehler")+(B.needsSudo?` + `}),l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fa,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Speicher-Pool: ",or(re)," Gewichte",Oe>0?` · ${or(Oe)} real belegt (inkl. KV)`:""," / ",or(Ze)]}),v&&k.length>0&&l.jsx("button",{onClick:I,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),l.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:me.length===0?l.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):me.map((G,Ne)=>{var nt;const Pe=(G.size_bytes||0)/Ze*100,Ve=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][Ne%4];return l.jsxs("div",{style:{width:`${Pe}%`},className:ee("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Ve),title:`${G.name} (${or(G.size_bytes)})`,children:[l.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[G.role?`[${ct(G.role).short}] `:"",(nt=G.name.split("/").pop())==null?void 0:nt.replace(".gguf","")]}),l.jsx("span",{className:"text-[8px] font-mono opacity-80",children:or(G.size_bytes)})]},G.name)})})]}),l.jsx(oZ,{}),v&&l.jsx(aZ,{}),l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:v?"Gateway Steckplatz-Belegung (Slot-Zuweisung)":"Wer macht was bei Lucy — zum Ändern antippen"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:VD.map(G=>{var Ve;const Ne=j.find(nt=>nt.role===G),Pe=Ne?k.includes(Ne.name):!1;return l.jsxs("div",{onClick:()=>H(G),className:ee("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",Pe?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":Ne?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(so,{role:G}),Pe&&l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),l.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:Ne==null?void 0:Ne.name,children:Ne?(Ve=Ne.name.split("/").pop())==null?void 0:Ve.replace(/\.gguf$/i,""):"nicht zugewiesen"}),l.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},G)})})]}),(o==null?void 0:o.current)&&l.jsxs("div",{className:"rounded-2xl border border-indigo-500/30 bg-indigo-500/5 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Jr,{className:"h-4.5 w-4.5 text-indigo-400"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Hirn (Hermes)"}),o.current.version!=null&&l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-indigo-500/15 text-indigo-300 border border-indigo-500/25",children:["v",o.current.version]})]}),l.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"agent"}})),className:"h-7 px-3 rounded-lg border border-indigo-500/30 bg-indigo-500/5 text-indigo-300 text-[9px] font-bold uppercase hover:bg-indigo-500/15 transition-all cursor-pointer",title:"Hirn-Wechsel passiert jetzt zentral im Hermes-Tab",children:"Im Hermes-Tab wechseln →"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-background/30 border border-border/30 p-3.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:o.current.name,children:o.current.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsx("span",{children:o.current.params_b?`${o.current.params_b}B`:"—"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:o.current.quant||"GGUF"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:or(o.current.size_bytes||0)})]})]}),o.update_available&&o.recommended?l.jsxs("button",{onClick:()=>ae(o.recommended.repo),className:ee("h-8 px-3 shrink-0 flex items-center justify-center gap-1.5 rounded-lg text-[10px] font-bold uppercase transition-all cursor-pointer shadow-md",o.budget&&!o.budget.fits?"bg-red-500 text-white hover:bg-red-400 shadow-red-500/10":"bg-amber-500 text-black hover:bg-amber-400 shadow-amber-500/10"),children:[l.jsx(Ds,{className:"h-3.5 w-3.5"})," Aktualisieren"]}):l.jsxs("span",{className:"h-8 px-3 shrink-0 flex items-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/15 rounded-lg select-none",children:[l.jsx(qt,{className:"h-4 w-4"})," Neueste Generation"]})]}),o.update_available&&o.recommended&&l.jsxs("div",{className:"text-[10px] text-amber-400/90 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),"Neuere Generation verfügbar: ",l.jsx("span",{className:"font-mono font-bold",children:o.recommended.name.replace(/-GGUF$/i,"")}),"(v",o.recommended.version,", ",o.recommended.params_b,"B) — von NousResearch."]}),o.budget&&l.jsxs("div",{className:ee("text-[10px] flex items-start gap-1.5 leading-relaxed",o.budget.fits?"text-muted-foreground/80":"text-red-400 font-semibold"),children:[l.jsx(fa,{className:"h-3 w-3 shrink-0 mt-0.5"}),l.jsxs("span",{children:["Always-On-Brain ~",o.budget.brain_gb," GB + größtes on-demand (~",o.budget.largest_ondemand_gb," GB) = ",(o.budget.brain_gb+o.budget.largest_ondemand_gb).toFixed(1)," / ",o.budget.gtt_gb," GB",o.budget.fits?" · passt gleichzeitig ✓":" · passt NICHT gleichzeitig ⚠ — heavy/coder würden das Brain verdrängen. Kleineres Brain oder weniger Kontext."]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[l.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",se.length," von ",j.length,")"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>oe("all"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),l.jsx("button",{onClick:()=>oe("in_use"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>ue("grid"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),l.jsx("button",{onClick:()=>ue("list"),className:ee("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ve==="grid"?l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:se.length===0?l.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):se.map(G=>{const Ne=k.includes(G.name),Pe=i==null?void 0:i.model_list.find(nt=>nt.role===G.role),Ve=uf(G.name);return l.jsxs("div",{className:ee("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",Ne?"border-primary/45 shadow-primary/5":G.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex items-start justify-between gap-3",children:l.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[l.jsx("div",{className:ee("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ve.color),title:Ve.name,children:Ve.initial}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:G.name,children:G.name.split("/").pop()}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[l.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:G.quant||"GGUF"}),Ne&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[l.jsx(oh,{className:"h-3 w-3 animate-pulse"})," Warm"]}),G.role&&l.jsx(so,{role:G.role,dense:!0}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[9px] font-semibold text-muted-foreground",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&P(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[9px] font-mono text-fuchsia-300 font-bold uppercase",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm, verdrängt es nicht.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),l.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:l.jsx(bv,{caps:G.capabilities})})]}),l.jsxs("div",{className:"space-y-3 pt-1",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(fa,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),l.jsx("div",{className:"text-foreground font-semibold",children:or(G.size_bytes)})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(KN,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),l.jsx("div",{className:"text-foreground font-semibold",children:xv(G.ctx)})]})]})]}),Pe&&l.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),l.jsxs("span",{children:["Upgrade verfügbar: ",Pe.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>Z(Pe.repo,G.role,G.quant||"Q4_K_M",G.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[l.jsx(Ds,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[(()=>{const nt=b(G.role),K=Ne&&nt,Le=G.incomplete&&!Ne||K;return l.jsx("button",{onClick:()=>Ne?te(G.name):ne(G.name),disabled:Le,title:K?`„${ct(G.role).label}" bleibt geladen (geschützt).`:void 0,className:ee("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",Le?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ne?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:K?"🔒 geladen":Ne?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ie(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",P(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:P(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>U(G),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ga,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>J(G.name),disabled:b(G.role),className:ee("h-7 w-7 rounded-lg border border-border/40 flex items-center justify-center transition-colors",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${ct(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(of,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})}):l.jsx("div",{className:"space-y-2",children:se.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):se.map(G=>{const Ne=k.includes(G.name),Pe=uf(G.name);return l.jsxs("div",{className:ee("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",Ne?"border-primary/45":G.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("div",{className:ee("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Pe.color),title:Pe.name,children:Pe.initial}),l.jsxs("div",{className:"min-w-0 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:G.name,children:G.name.split("/").pop()}),G.role&&l.jsx(so,{role:G.role,dense:!0,className:"shrink-0"}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[8px] font-semibold text-muted-foreground shrink-0",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&P(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[8px] font-mono text-fuchsia-300 font-bold uppercase shrink-0",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),Ne&&l.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsxs("span",{children:["Größe: ",or(G.size_bytes)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Kontext: ",xv(G.ctx)]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:"font-mono text-[9px]",children:G.quant||"GGUF"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[l.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:l.jsx(bv,{caps:G.capabilities})}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[(()=>{const Ve=b(G.role),nt=Ne&&Ve,K=G.incomplete&&!Ne||nt;return l.jsx("button",{onClick:()=>Ne?te(G.name):ne(G.name),disabled:K,title:nt?`„${ct(G.role).label}" bleibt geladen (geschützt).`:void 0,className:ee("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",K?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ne?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:nt?"🔒 geladen":Ne?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ie(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",P(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:P(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>U(G),className:ee("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ga,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>J(G.name),disabled:b(G.role),className:ee("h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 transition-all",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${ct(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(of,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})})]}),T&&l.jsx(rZ,{role:T,roleRec:$,models:j,onAssign:G=>{M(T,G),B(null)},onClose:()=>B(null)}),Q&&l.jsx(K5,{model:Q,onClose:()=>U(null),onChanged:N}),g]})}function Gg({icon:e,title:t,sub:r,onClick:n}){return l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-left transition-all hover:border-primary/40 cursor-pointer",children:[l.jsx(e,{className:"h-6 w-6 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-foreground",children:t}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r})]}),l.jsx(Wu,{className:"h-5 w-5 text-muted-foreground shrink-0"})]})}function lZ(){const[e,t]=y.useState(null);return e?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-1.5 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l.jsx(RN,{className:"h-4 w-4"})," Maschinenraum"]}),e==="modelle"?l.jsx(sZ,{}):l.jsx(q5,{})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Maschinenraum"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Nur nötig, wenn du wirklich was ändern willst."})]}),l.jsx($5,{})]}),l.jsx(Gg,{icon:pi,title:"Modelle",sub:"Hirne, Coder, Immer-bereit-Set, Bibliothek",onClick:()=>t("modelle")}),l.jsx(Gg,{icon:qN,title:"Wartung und Logs",sub:"Updates, Backup, Dienste, Logs, Zugangsdaten",onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}}))}),l.jsx(Gg,{icon:Jr,title:"Hermes und Verdrahtung",sub:"Agent, Gehirn-Modell, PC-Verbindung",onClick:()=>t("hermes")})]})}const uZ=[{id:"start",label:"Start",icon:oh},{id:"vibe",label:"Vibe-Coding",icon:Ts},{id:"konstitution",label:"Konstitution",icon:sM},{id:"maschinenraum",label:"Maschinenraum",icon:Ku}];function cZ(){const[e,t]=y.useState("start"),[r,n]=y.useState(!1),[i,o]=y.useState("maintenance"),{data:u}=M0();y.useEffect(()=>{const f=h=>{var m;o(((m=h.detail)==null?void 0:m.tab)||"maintenance"),n(!0)};return window.addEventListener("open-system-drawer",f),()=>window.removeEventListener("open-system-drawer",f)},[]);const c=u&&u.engine_reachable&&(u.brain?u.brain.ready:!0);return l.jsxs("div",{className:"flex h-full relative",children:[l.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:l.jsx("div",{className:"absolute inset-0 opacity-30 animate-aurora bg-gradient-to-tr from-teal-500/15 via-indigo-500/10 to-purple-500/15 blur-[130px]"})}),l.jsx(Q5,{open:r,onClose:()=>n(!1),defaultTab:i}),l.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md",children:[l.jsxs("div",{className:"flex items-center gap-2 px-5 py-4 border-b border-border/40",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20"}),l.jsxs("div",{className:"leading-tight",children:[l.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),l.jsx("div",{className:"text-[10px] text-muted-foreground",children:"3 · Prototyp"})]})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4",children:uZ.map(f=>l.jsxs("button",{onClick:()=>t(f.id),className:ee("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-all cursor-pointer",e===f.id?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(f.icon,{className:"h-4.5 w-4.5 shrink-0"})," ",f.label]},f.id))}),l.jsxs("div",{className:"px-3 py-3 border-t border-border/40 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 px-2 text-xs text-muted-foreground",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full",c?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c?"Box läuft":"prüfen"]}),l.jsxs("a",{href:"#dashboard",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(RN,{className:"h-3.5 w-3.5"})," zurück zu MC2"]})]})]}),l.jsxs("main",{className:"flex-1 min-w-0 overflow-y-auto p-6 scrollbar-thin",children:[e==="start"&&l.jsx(eZ,{}),e==="vibe"&&l.jsx(G5,{}),e==="konstitution"&&l.jsx(V5,{}),e==="maschinenraum"&&l.jsx(lZ,{})]})]})}const dZ={ok:"bg-emerald-500",warn:"bg-amber-500",alert:"bg-red-500",muted:"bg-muted-foreground/40",loading:"bg-muted-foreground/40 animate-pulse"},fZ={ok:"hover:border-emerald-500/40",warn:"hover:border-amber-500/50",alert:"hover:border-red-500/50",muted:"hover:border-primary/40",loading:"hover:border-border/60"};function ni({icon:e,title:t,value:r,unit:n,tone:i="muted",hint:o,onClick:u}){return l.jsxs("button",{onClick:u,className:ee("group relative flex flex-col items-start rounded-2xl border border-border/60 bg-card/45 p-5 text-left shadow-lg shadow-black/15 backdrop-blur-md transition-all duration-200 cursor-pointer hover:bg-card/70 hover:shadow-xl",fZ[i]),children:[l.jsxs("div",{className:"mb-4 flex w-full items-center justify-between",children:[l.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl border border-border/40 bg-background/30 text-foreground/80 transition-colors group-hover:text-primary",children:l.jsx(e,{className:"h-5 w-5"})}),l.jsx("span",{className:ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",dZ[i]),title:o})]}),l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-2xl font-bold tracking-tight text-foreground font-space tabular-nums",children:r}),n&&l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n})]}),l.jsxs("div",{className:"mt-1 flex w-full items-center justify-between",children:[l.jsx("span",{className:"text-sm font-semibold text-foreground/90",children:t}),l.jsx(Wu,{className:"h-4 w-4 text-muted-foreground/40 transition-all group-hover:translate-x-0.5 group-hover:text-primary"})]}),o&&l.jsx("span",{className:"mt-0.5 text-[11px] text-muted-foreground",children:o})]})}const ef=e=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:e}}));function hZ({onNavigate:e}){var _,O;const{data:t}=wi(4e3),{data:r}=F5(4e3),{data:n}=gh(8e3),{data:i}=vv(),{data:o}=ph(),{data:u}=H5(),c=Z5(),{showAlert:f,dialogElement:h}=ba(),m=Kn(),[g,v]=y.useState({});async function b(T,B){v($=>({...$,[T]:!0}));try{if(B.kind==="loadModel")await we(`/api/models/${encodeURIComponent(B.model)}/load`,{method:"POST"});else{const $=await we("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:B.service})});$.ok||f("Reparatur nicht ganz geklappt",($.err||"Unbekannter Fehler")+(B.needsSudo?` -Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}m.invalidateQueries({queryKey:Be.health}),m.invalidateQueries({queryKey:Be.services}),m.invalidateQueries({queryKey:Be.models})}catch($){f("Reparatur fehlgeschlagen",String(($==null?void 0:$.message)||$))}finally{v($=>({...$,[T]:!1}))}}const j=((_=t==null?void 0:t.running)==null?void 0:_.length)??0,k=(r==null?void 0:r.services.filter(T=>T.ok).length)??0,S=(r==null?void 0:r.services.length)??0,N=S-k,E=(i==null?void 0:i.length)??0,A=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((O=n==null?void 0:n.components)==null?void 0:O.filter(T=>T.update===!0).length)??0),P=(u==null?void 0:u.gateway.ok)&&(u==null?void 0:u.memory.ok);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),l.jsx(hZ,{verdict:c.verdict,memory:c.memory}),l.jsx(mZ,{problems:c.problems,pendingCount:A,busy:g,onRepair:b}),l.jsxs("section",{children:[l.jsx(y0,{children:"Bereiche"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(ni,{icon:af,title:"Modelle",value:j,unit:"warm",tone:j>0?"ok":"muted",hint:"Speicher, laden & Rollen",onClick:()=>e("models")}),l.jsx(ni,{icon:xa,title:"Gedächtnis",value:i?E:"…",unit:"Notizen",tone:i?"ok":"loading",hint:"Lucys geteiltes Wissen",onClick:()=>e("memory")}),l.jsx(ni,{icon:uh,title:"Dienste",value:r?`${k}/${S}`:"…",unit:"laufen",tone:r?N>0?"warn":"ok":"loading",hint:"Status & Neustart",onClick:()=>tf("maintenance")}),l.jsx(ni,{icon:VN,title:"Updates",value:n?A>0?A:"0":"…",unit:A>0?"bereit":"aktuell",tone:n?A>0?"warn":"ok":"loading",hint:"Prüfen & einspielen",onClick:()=>tf("maintenance")}),l.jsx(ni,{icon:bu,title:"Verbinden",value:"Zed",unit:P?"· bereit":"",tone:u?P?"ok":"warn":"loading",hint:"IDE- & Agent-Configs",onClick:()=>e("connect")}),l.jsx(ni,{icon:zM,title:"Logs",value:r?N:"…",unit:"Fehler",tone:r?N>0?"alert":"ok":"loading",hint:"Verlauf & Diagnose",onClick:()=>tf("logs")})]})]}),l.jsxs("section",{children:[l.jsx(y0,{children:"Mehr"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(ni,{icon:yn,title:"Hermes",value:o?o.gateway_reachable?"bereit":"offline":"…",tone:o?o.gateway_reachable?"ok":"alert":"loading",hint:"Agent-Status & Verdrahtung",onClick:()=>e("agent")}),l.jsx(ni,{icon:Rs,title:"Terminal",value:"öffnen",tone:"muted",hint:"Interaktives Agent-Terminal",onClick:()=>e("terminal")}),l.jsx(ni,{icon:Rs,title:"Konsole",value:o?o.box_console_reachable?"bereit":"offline":"…",tone:o?o.box_console_reachable?"ok":"warn":"loading",hint:"Direkte Box-Shell (SSH)",onClick:()=>e("konsole")})]})]}),h]})}function y0({children:e}){return l.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function hZ({verdict:e,memory:t}){const r={loading:{ring:"border-border/60 bg-card/45",icon:qs,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:UN,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Er,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:"Nichts Schlimmes — nur ein Hinweis."},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Er,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:"Ein wichtiger Dienst hakt."}}[e],n=r.icon,i={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],o={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return l.jsxs("div",{className:ee("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between",r.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(n,{className:ee("h-6 w-6",r.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:r.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:r.sub})]})]}),l.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(fa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:ee("font-mono font-bold",i),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(0)} / ${t.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:ee("h-full rounded-full transition-all duration-500",o),style:{width:`${t.pct}%`}})})]})]})}function mZ({problems:e,pendingCount:t,busy:r,onRepair:n}){const i=t>0,o=e.length===0&&!i;return l.jsxs("section",{children:[l.jsx(y0,{children:"Braucht dich"}),o?l.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4",children:[l.jsx(qt,{className:"h-5 w-5 shrink-0 text-emerald-400"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):l.jsxs("div",{className:"space-y-2",children:[e.map(u=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:l.jsx(u.icon,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-bold text-foreground",children:u.label}),l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.detail})]})]}),u.repair&&l.jsxs("button",{onClick:()=>u.repair&&n(u.id,u.repair),disabled:!!r[u.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60",children:[r[u.id]?l.jsx(qs,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Gu,{className:"h-3.5 w-3.5"}),u.repair.label]})]},u.id)),i&&l.jsxs("button",{onClick:()=>tf("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:l.jsx(VN,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden, ob du es einspielst."})]})]}),l.jsx(Ku,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})]})}function pZ(){var j,k,S,N,E;MR();const[e,t]=y.useState(()=>{const A=window.location.hash.slice(1);return uu.some(P=>P.id===A)?A:"dashboard"}),r=y.useCallback(A=>{window.location.hash.slice(1)===A?t(A):window.location.hash=A},[]),[n,i]=y.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,u]=y.useState(!1),[c,f]=y.useState("maintenance"),[h,m]=y.useState(()=>window.location.hash==="#mc3"),{data:g}=M0(),{data:v}=ko(2e4);y.useEffect(()=>{document.documentElement.classList.add("dark")},[]),y.useEffect(()=>{const A=P=>{var O;f(((O=P.detail)==null?void 0:O.tab)||"maintenance"),u(!0)};return window.addEventListener("open-system-drawer",A),()=>window.removeEventListener("open-system-drawer",A)},[]),y.useEffect(()=>{const A=P=>{var O;const _=(O=P.detail)==null?void 0:O.view;_&&r(_)};return window.addEventListener("mc-navigate",A),()=>window.removeEventListener("mc-navigate",A)},[r]),y.useEffect(()=>{const A=()=>{m(window.location.hash==="#mc3");const P=window.location.hash.slice(1);uu.some(_=>_.id===P)&&t(P)};return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]);const b=uu.find(A=>A.id===e);return h?l.jsx(uZ,{}):l.jsxs("div",{className:"flex h-full relative",children:[l.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[l.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),l.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),l.jsx(rD,{onNavigate:r}),l.jsx(Q5,{open:o,onClose:()=>u(!1),defaultTab:c}),l.jsxs("aside",{className:ee("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:[l.jsxs("div",{className:ee("flex items-center py-4 border-b border-border/40 shrink-0",n?"flex-col gap-3 px-2":"justify-between px-5"),children:[l.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!n&&l.jsxs("div",{className:"leading-tight",children:[l.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),l.jsx("button",{onClick:()=>{i(A=>{const P=!A;return localStorage.setItem("mc_sidebar_collapsed",P.toString()),P})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":n?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:n?"Maximieren":"Minimieren",children:n?l.jsx(Ku,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(dM,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:uu.map(A=>l.jsxs("a",{href:`#${A.id}`,"aria-current":e===A.id?"page":void 0,className:ee("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",n?"justify-center p-2.5":"gap-3 px-3 py-2",e===A.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:n?A.label:void 0,"aria-label":n?A.label:void 0,children:[l.jsx(A.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!n&&l.jsx("span",{className:"truncate",children:A.label})]},A.id))}),l.jsx("div",{className:ee("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",n?"px-2 text-center":"px-5"),children:n?l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",g?g.engine_reachable?g.brain&&!g.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:g?g.engine_reachable?g.brain&&!g.brain.ready?`Hirn offline (${g.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):l.jsxs("div",{className:"space-y-2 text-left",children:[g?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full animate-pulse",g.engine_reachable?"bg-emerald-500":"bg-amber-500")}),l.jsxs("span",{className:"truncate",children:["Engine ",g.engine_reachable?"online":"offline"]})]}),g.brain&&!g.brain.ready&&l.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${g.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),l.jsxs("span",{className:"truncate",children:["Hirn offline",g.brain.model?` (${g.brain.model})`:""]})]})]}):l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",l.jsx("span",{className:"truncate",children:"Backend offline"})]}),(v==null?void 0:v.versions)&&l.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[l.jsxs("div",{className:"truncate",title:v.versions.mc2?`${v.versions.mc2.branch}-${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""} (${v.versions.mc2.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"MC2:"})," ",v.versions.mc2?`${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""}`:"—"]}),l.jsxs("div",{className:"truncate",title:((j=v.versions.engine)==null?void 0:j.type)==="git"?`${v.versions.engine.branch}-${v.versions.engine.hash}${v.versions.engine.dirty?"*":""} (${v.versions.engine.date})`:((k=v.versions.engine)==null?void 0:k.version_text)||"unbekannt",children:[l.jsx("strong",{children:"Engine:"})," ",((S=v.versions.engine)==null?void 0:S.type)==="git"?`${v.versions.engine.hash}${v.versions.engine.dirty?"*":""}`:((E=(N=v.versions.engine)==null?void 0:N.version_text)==null?void 0:E.split(" ").pop())||"—"]}),l.jsxs("div",{className:"truncate",title:v.versions.hermes_ui?`${v.versions.hermes_ui.branch}-${v.versions.hermes_ui.hash}${v.versions.hermes_ui.dirty?"*":""} (${v.versions.hermes_ui.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"Hermes UI:"})," ",v.versions.hermes_ui?`${v.versions.hermes_ui.hash}${v.versions.hermes_ui.dirty?"*":""}`:"—"]}),l.jsxs("div",{className:"truncate",title:v.versions.hermes_agent?`${v.versions.hermes_agent.branch}-${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""} (${v.versions.hermes_agent.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"Hermes Agent:"})," ",v.versions.hermes_agent?`${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:b.hint}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($5,{}),l.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),l.jsxs("button",{onClick:()=>{const A=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(A)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[l.jsx(gM,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Suchen"}),l.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),l.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[e==="dashboard"&&l.jsx(fZ,{onNavigate:A=>r(A)}),e==="models"&&l.jsx(oR,{}),e==="connect"&&l.jsx(G5,{}),e==="memory"&&l.jsx(V5,{}),e==="agent"&&l.jsx(q5,{}),e==="terminal"&&l.jsx(pR,{}),e==="konsole"&&l.jsx(gR,{}),e==="guide"&&l.jsx(yR,{}),!["dashboard","models","connect","memory","agent","terminal","konsole","guide"].includes(e)&&l.jsx(xR,{title:b.label,hint:b.hint})]})]})]})}class gZ extends w0.Component{constructor(){super(...arguments);Xo(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:l.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[l.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),l.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),l.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const vZ=new H3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});v3.createRoot(document.getElementById("root")).render(l.jsx(w0.StrictMode,{children:l.jsx(gZ,{children:l.jsx(W3,{client:vZ,children:l.jsx(pZ,{})})})}));export{ps as R,fs as S,of as T,UM as a,b0 as g,l as j,y as r}; +Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}m.invalidateQueries({queryKey:Be.health}),m.invalidateQueries({queryKey:Be.services}),m.invalidateQueries({queryKey:Be.models})}catch($){f("Reparatur fehlgeschlagen",String(($==null?void 0:$.message)||$))}finally{v($=>({...$,[T]:!1}))}}const j=((_=t==null?void 0:t.running)==null?void 0:_.length)??0,k=(r==null?void 0:r.services.filter(T=>T.ok).length)??0,S=(r==null?void 0:r.services.length)??0,N=S-k,E=(i==null?void 0:i.length)??0,A=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((O=n==null?void 0:n.components)==null?void 0:O.filter(T=>T.update===!0).length)??0),P=(u==null?void 0:u.gateway.ok)&&(u==null?void 0:u.memory.ok);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),l.jsx(mZ,{verdict:c.verdict,memory:c.memory}),l.jsx(pZ,{problems:c.problems,pendingCount:A,busy:g,onRepair:b}),l.jsxs("section",{children:[l.jsx(y0,{children:"Bereiche"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(ni,{icon:nf,title:"Modelle",value:j,unit:"warm",tone:j>0?"ok":"muted",hint:"Speicher, laden & Rollen",onClick:()=>e("models")}),l.jsx(ni,{icon:xa,title:"Gedächtnis",value:i?E:"…",unit:"Notizen",tone:i?"ok":"loading",hint:"Lucys geteiltes Wissen",onClick:()=>e("memory")}),l.jsx(ni,{icon:uh,title:"Dienste",value:r?`${k}/${S}`:"…",unit:"laufen",tone:r?N>0?"warn":"ok":"loading",hint:"Status & Neustart",onClick:()=>ef("maintenance")}),l.jsx(ni,{icon:VN,title:"Updates",value:n?A>0?A:"0":"…",unit:A>0?"bereit":"aktuell",tone:n?A>0?"warn":"ok":"loading",hint:"Prüfen & einspielen",onClick:()=>ef("maintenance")}),l.jsx(ni,{icon:xu,title:"Verbinden",value:"Zed",unit:P?"· bereit":"",tone:u?P?"ok":"warn":"loading",hint:"IDE- & Agent-Configs",onClick:()=>e("connect")}),l.jsx(ni,{icon:FM,title:"Logs",value:r?N:"…",unit:"Fehler",tone:r?N>0?"alert":"ok":"loading",hint:"Verlauf & Diagnose",onClick:()=>ef("logs")})]})]}),l.jsxs("section",{children:[l.jsx(y0,{children:"Mehr"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(ni,{icon:Jr,title:"Hermes",value:o?o.gateway_reachable?"bereit":"offline":"…",tone:o?o.gateway_reachable?"ok":"alert":"loading",hint:"Agent-Status & Verdrahtung",onClick:()=>e("agent")}),l.jsx(ni,{icon:af,title:"Terminal",value:"öffnen",tone:"muted",hint:"Interaktives Agent-Terminal",onClick:()=>e("terminal")}),l.jsx(ni,{icon:af,title:"Konsole",value:o?o.box_console_reachable?"bereit":"offline":"…",tone:o?o.box_console_reachable?"ok":"warn":"loading",hint:"Direkte Box-Shell (SSH)",onClick:()=>e("konsole")})]})]}),h]})}function y0({children:e}){return l.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function mZ({verdict:e,memory:t}){const r={loading:{ring:"border-border/60 bg-card/45",icon:Vs,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:UN,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Er,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:"Nichts Schlimmes — nur ein Hinweis."},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Er,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:"Ein wichtiger Dienst hakt."}}[e],n=r.icon,i={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],o={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return l.jsxs("div",{className:ee("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between",r.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(n,{className:ee("h-6 w-6",r.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:r.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:r.sub})]})]}),l.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(fa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:ee("font-mono font-bold",i),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(0)} / ${t.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:ee("h-full rounded-full transition-all duration-500",o),style:{width:`${t.pct}%`}})})]})]})}function pZ({problems:e,pendingCount:t,busy:r,onRepair:n}){const i=t>0,o=e.length===0&&!i;return l.jsxs("section",{children:[l.jsx(y0,{children:"Braucht dich"}),o?l.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4",children:[l.jsx(qt,{className:"h-5 w-5 shrink-0 text-emerald-400"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):l.jsxs("div",{className:"space-y-2",children:[e.map(u=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:l.jsx(u.icon,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-bold text-foreground",children:u.label}),l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.detail})]})]}),u.repair&&l.jsxs("button",{onClick:()=>u.repair&&n(u.id,u.repair),disabled:!!r[u.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60",children:[r[u.id]?l.jsx(Vs,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Ku,{className:"h-3.5 w-3.5"}),u.repair.label]})]},u.id)),i&&l.jsxs("button",{onClick:()=>ef("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:l.jsx(VN,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden, ob du es einspielst."})]})]}),l.jsx(Wu,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})]})}function gZ(){var j,k,S,N,E;IR();const[e,t]=y.useState(()=>{const A=window.location.hash.slice(1);return lu.some(P=>P.id===A)?A:"dashboard"}),r=y.useCallback(A=>{window.location.hash.slice(1)===A?t(A):window.location.hash=A},[]),[n,i]=y.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,u]=y.useState(!1),[c,f]=y.useState("maintenance"),[h,m]=y.useState(()=>window.location.hash==="#mc3"),{data:g}=M0(),{data:v}=ko(2e4);y.useEffect(()=>{document.documentElement.classList.add("dark")},[]),y.useEffect(()=>{const A=P=>{var O;f(((O=P.detail)==null?void 0:O.tab)||"maintenance"),u(!0)};return window.addEventListener("open-system-drawer",A),()=>window.removeEventListener("open-system-drawer",A)},[]),y.useEffect(()=>{const A=P=>{var O;const _=(O=P.detail)==null?void 0:O.view;_&&r(_)};return window.addEventListener("mc-navigate",A),()=>window.removeEventListener("mc-navigate",A)},[r]),y.useEffect(()=>{const A=()=>{m(window.location.hash==="#mc3");const P=window.location.hash.slice(1);lu.some(_=>_.id===P)&&t(P)};return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]);const b=lu.find(A=>A.id===e);return h?l.jsx(cZ,{}):l.jsxs("div",{className:"flex h-full relative",children:[l.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[l.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),l.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),l.jsx(nD,{onNavigate:r}),l.jsx(Q5,{open:o,onClose:()=>u(!1),defaultTab:c}),l.jsxs("aside",{className:ee("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:[l.jsxs("div",{className:ee("flex items-center py-4 border-b border-border/40 shrink-0",n?"flex-col gap-3 px-2":"justify-between px-5"),children:[l.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!n&&l.jsxs("div",{className:"leading-tight",children:[l.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),l.jsx("button",{onClick:()=>{i(A=>{const P=!A;return localStorage.setItem("mc_sidebar_collapsed",P.toString()),P})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":n?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:n?"Maximieren":"Minimieren",children:n?l.jsx(Wu,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(fM,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:lu.map(A=>l.jsxs("a",{href:`#${A.id}`,"aria-current":e===A.id?"page":void 0,className:ee("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",n?"justify-center p-2.5":"gap-3 px-3 py-2",e===A.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:n?A.label:void 0,"aria-label":n?A.label:void 0,children:[l.jsx(A.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!n&&l.jsx("span",{className:"truncate",children:A.label})]},A.id))}),l.jsx("div",{className:ee("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",n?"px-2 text-center":"px-5"),children:n?l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:ee("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",g?g.engine_reachable?g.brain&&!g.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:g?g.engine_reachable?g.brain&&!g.brain.ready?`Hirn offline (${g.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):l.jsxs("div",{className:"space-y-2 text-left",children:[g?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ee("h-2 w-2 rounded-full animate-pulse",g.engine_reachable?"bg-emerald-500":"bg-amber-500")}),l.jsxs("span",{className:"truncate",children:["Engine ",g.engine_reachable?"online":"offline"]})]}),g.brain&&!g.brain.ready&&l.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${g.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),l.jsxs("span",{className:"truncate",children:["Hirn offline",g.brain.model?` (${g.brain.model})`:""]})]})]}):l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",l.jsx("span",{className:"truncate",children:"Backend offline"})]}),(v==null?void 0:v.versions)&&l.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[l.jsxs("div",{className:"truncate",title:v.versions.mc2?`${v.versions.mc2.branch}-${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""} (${v.versions.mc2.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"MC2:"})," ",v.versions.mc2?`${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""}`:"—"]}),l.jsxs("div",{className:"truncate",title:((j=v.versions.engine)==null?void 0:j.type)==="git"?`${v.versions.engine.branch}-${v.versions.engine.hash}${v.versions.engine.dirty?"*":""} (${v.versions.engine.date})`:((k=v.versions.engine)==null?void 0:k.version_text)||"unbekannt",children:[l.jsx("strong",{children:"Engine:"})," ",((S=v.versions.engine)==null?void 0:S.type)==="git"?`${v.versions.engine.hash}${v.versions.engine.dirty?"*":""}`:((E=(N=v.versions.engine)==null?void 0:N.version_text)==null?void 0:E.split(" ").pop())||"—"]}),l.jsxs("div",{className:"truncate",title:v.versions.hermes_ui?`${v.versions.hermes_ui.branch}-${v.versions.hermes_ui.hash}${v.versions.hermes_ui.dirty?"*":""} (${v.versions.hermes_ui.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"Hermes UI:"})," ",v.versions.hermes_ui?`${v.versions.hermes_ui.hash}${v.versions.hermes_ui.dirty?"*":""}`:"—"]}),l.jsxs("div",{className:"truncate",title:v.versions.hermes_agent?`${v.versions.hermes_agent.branch}-${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""} (${v.versions.hermes_agent.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"Hermes Agent:"})," ",v.versions.hermes_agent?`${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:b.hint}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($5,{}),l.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),l.jsxs("button",{onClick:()=>{const A=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(A)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[l.jsx(vM,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Suchen"}),l.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),l.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[e==="dashboard"&&l.jsx(hZ,{onNavigate:A=>r(A)}),e==="models"&&l.jsx(sR,{}),e==="connect"&&l.jsx(G5,{}),e==="memory"&&l.jsx(V5,{}),e==="agent"&&l.jsx(q5,{}),e==="terminal"&&l.jsx(gR,{}),e==="konsole"&&l.jsx(vR,{}),e==="guide"&&l.jsx(xR,{}),!["dashboard","models","connect","memory","agent","terminal","konsole","guide"].includes(e)&&l.jsx(bR,{title:b.label,hint:b.hint})]})]})]})}class vZ extends w0.Component{constructor(){super(...arguments);Xo(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:l.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[l.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),l.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),l.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const yZ=new H3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});v3.createRoot(document.getElementById("root")).render(l.jsx(w0.StrictMode,{children:l.jsx(vZ,{children:l.jsx(W3,{client:yZ,children:l.jsx(gZ,{})})})}));export{ps as R,fs as S,of as T,HM as a,b0 as g,l as j,y as r}; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 4516538..bc66ed6 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,7 +7,7 @@ Mission Control 2.0 - + diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 2ec52a9..30d37e2 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -373,9 +373,11 @@ export interface AgentStatus { gateway_url: string terminal_url: string box_console_url?: string + hermes_ui_url?: string gateway_reachable: boolean terminal_reachable: boolean box_console_reachable?: boolean + hermes_ui_reachable?: boolean home_exists: boolean brain_model?: string has_config: boolean diff --git a/frontend/src/nav.ts b/frontend/src/nav.ts index 00a2660..7dc95d7 100644 --- a/frontend/src/nav.ts +++ b/frontend/src/nav.ts @@ -4,7 +4,7 @@ import { Brain, Plug, Bot, - TerminalSquare, + AppWindow, SquareTerminal, HelpCircle, type LucideIcon, @@ -26,7 +26,7 @@ export const NAV: NavItem[] = [ { id: "memory", label: "Gedächtnis", hint: "Geteiltes Memory verwalten", icon: Brain }, { id: "connect", label: "Verbinden", hint: "IDE-/Agent-Configs erzeugen", icon: Plug }, { id: "agent", label: "Hermes", hint: "Agent-Status & Verdrahtung", icon: Bot }, - { id: "terminal", label: "Hermes-Terminal", hint: "Interaktives Hermes-Agent-Terminal", icon: TerminalSquare }, + { id: "terminal", label: "Hermes GUI", hint: "Eingebaute Hermes-Weboberfläche (Threads & Tool-Calls)", icon: AppWindow }, { id: "konsole", label: "Konsole", hint: "Direkte Box-Shell (SSH-artig)", icon: SquareTerminal }, { id: "guide", label: "Anleitung", hint: "Einrichten & Vibe-Coding", icon: HelpCircle }, ] diff --git a/frontend/src/views/TerminalView.tsx b/frontend/src/views/TerminalView.tsx index 4f3b6e3..210381f 100644 --- a/frontend/src/views/TerminalView.tsx +++ b/frontend/src/views/TerminalView.tsx @@ -1,21 +1,21 @@ -import { TerminalSquare, ExternalLink, AlertTriangle } from "lucide-react" +import { Bot, ExternalLink, AlertTriangle } from "lucide-react" import { useAgentStatus } from "@/lib/queries" import { resolveExternalUrl } from "@/lib/utils" export function TerminalView() { const { data: agent } = useAgentStatus(5_000) - const url = agent?.terminal_url ? resolveExternalUrl(agent.terminal_url) : undefined - const ok = agent?.terminal_reachable + const url = agent?.hermes_ui_url ? resolveExternalUrl(agent.hermes_ui_url) : undefined + const ok = agent?.hermes_ui_reachable return (

- Hermes Terminal + Hermes GUI

- Interaktiver Agent (hermes chat) mit Tools & PC-Steuerung — „mehr als Chatten". + Die eingebaute Hermes-Weboberfläche — Threads, sichtbare Tool-Calls & Chat, direkt im Cockpit statt im Terminal.

@@ -37,18 +37,18 @@ export function TerminalView() { {ok === false && (
-
Terminal nicht erreichbar
+
Hermes-GUI nicht erreichbar

- Der hermes-terminal-Dienst (ttyd) läuft nicht. - Auf der Box: systemctl --user restart hermes-terminal. + Der hermes-builtin-ui-Dienst (hermes serve) läuft nicht. + Auf der Box: systemctl --user restart hermes-builtin-ui.

)} -