diff --git a/README.md b/README.md index d241161..1e3f5ed 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,9 @@ Trials can run on any provider: export OPENAI_API_KEY= # codex CLI + any openai/* model export GEMINI_API_KEY= # gemini CLI + any gemini/* model export ZAI_API_KEY= # GLM models via the mini-SWE-agent harness + +# Optional: one-click hosted trial + public experiment link from the dashboard +export ODDISH_API_KEY= ``` ## Usage @@ -84,6 +87,7 @@ calibration but are sound are exported to `out/easy/`. Re-running the same command resumes the run from wherever it parked. Ctrl-C stops active model trials, keeps completed trials, and leaves unfinished work ready to resume. +The local dashboard starts automatically and opens the task page as soon as the run is created.
Options @@ -98,7 +102,9 @@ trials, keeps completed trials, and leaves unfinished work ready to resume. - `--config FILE.json` / `--preset NAME` — Full RunConfig (agents + per-model bands) - `--brief TEXT` — Steer the task generation scope (eg "port the FFT subsystem...") - `--review` — Pause at the two human gates (scope pick, final QA) instead of auto +- `--draft` — Export after Static CI with no sweeps or calibration - `--yes` — Skip the cost preview confirmation +- `--no-open-dashboard` — Do not open the task page in a browser - `--runs-dir PATH` — Choose the directory for runs (default: `.programsmith/runs`) - `--allow-copyleft` — Allow copyleft-licensed sources @@ -133,9 +139,12 @@ programsmith serve programsmith stop ``` -Serves the local dashboard at `http://localhost:8765`: live pipeline DAG for each run, agent -output, sweep results, file explorer, and optional review gates. Evaluation sweeps remain parked -unless `serve --spend` is used. +Serves the local dashboard at `http://localhost:8765`. Each exported task has a direct download +button and can launch one low-priority Oddish trial, show its agent trajectory, and return a public +experiment link. Build diagnostics, files, sweep results, and optional review gates remain +available without dominating the task page. Add a full-scope Oddish API key in Settings to enable +the hosted run; Oddish free-plan limits apply. Evaluation sweeps remain parked unless +`serve --spend` is used. `programsmith serve` returns after the dashboard is healthy; `programsmith stop` is the explicit shutdown command. diff --git a/pyproject.toml b/pyproject.toml index c84c248..6a0cbd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ dependencies = [ "rich>=13", "fastapi>=0.110", "uvicorn>=0.29", + "httpx>=0.27", ] [project.urls] diff --git a/src/programsmith/cli.py b/src/programsmith/cli.py index 00943e2..b271f83 100644 --- a/src/programsmith/cli.py +++ b/src/programsmith/cli.py @@ -702,6 +702,17 @@ def _ensure_dashboard(runs_dir: Path, host: str, port: int, *, run_key: str | No return f"{base}/run/{run_key}" if run_key else base +def _open_dashboard(url: str) -> bool: + """Open a local dashboard without ever making task creation depend on desktop integration.""" + if os.getenv("CI") or os.getenv("PROGRAMSMITH_NO_BROWSER"): + return False + try: + import webbrowser + return bool(webbrowser.open(url, new=2)) + except Exception: # noqa: BLE001 — missing browser/headless sessions are expected + return False + + def _cmd_purge_synthetic(args: argparse.Namespace) -> int: """Strip ALL synthetic data from a run and roll the FSM back to its last REAL stage. Removes any manifest oracle/sweep entry tagged `simulated`, deletes a synthetic-built task skeleton when the @@ -1118,6 +1129,9 @@ def _cmd_create_hero(args: argparse.Namespace) -> int: ux.console.print(" check the owner/name spelling (private repos need a reachable URL); " "pin a commit with --sha to skip HEAD resolution") return 1 + dashboard_run_url = f"{dashboard_url}/run/{key}" if dashboard_url else None + if dashboard_run_url and getattr(args, "open_dashboard", True): + _open_dashboard(dashboard_run_url) if verdict == "exists": ux.console.print(f"[dim]▶ {key}: run exists — resuming from where it parked[/dim]") # A resumed run that already DROPPED can't be driven — re-surface WHY (the recorded gate @@ -1134,7 +1148,6 @@ def _cmd_create_hero(args: argparse.Namespace) -> int: if out.advice: ux.console.print(f" {out.advice}") return 1 - dashboard_run_url = f"{dashboard_url}/run/{key}" if dashboard_url else None outcome = ux.drive_run_foreground(run_dir, ctx=_drive_ctx(args), interval=args.interval, notes_path=runs_dir.parent / "WORKFLOW_NOTES.md") ux.summary_panel({key: outcome}) @@ -1614,6 +1627,10 @@ def _add_drive_flags(dp): help="port for the auto-started dashboard (default: 8765)") dp.add_argument("--dashboard-host", default="127.0.0.1", help="host for the auto-started dashboard (default: 127.0.0.1)") + dp.add_argument("--open-dashboard", dest="open_dashboard", action="store_true", default=True, + help="open the task dashboard in your browser once the run is created (default: on)") + dp.add_argument("--no-open-dashboard", dest="open_dashboard", action="store_false", + help="start the dashboard without opening a browser tab") # ---- hero commands (the README surface) ---- pcre = sub.add_parser( diff --git a/src/programsmith/config.py b/src/programsmith/config.py index 8f10db7..5674a00 100644 --- a/src/programsmith/config.py +++ b/src/programsmith/config.py @@ -53,6 +53,16 @@ class LhConfig(BaseModel): openai_api_key: str | None = None gemini_api_key: str | None = None # Google AI Studio key (GEMINI_API_KEY / GOOGLE_API_KEY) zai_api_key: str | None = None # Z.ai key (GLM models) + + # ---- hosted Oddish handoff ------------------------------------------------- + # ProgramSmith can upload an exported task, launch one hosted trial, and publish the resulting + # experiment. The key belongs to the local operator's Oddish account and is stored with the same + # owner-only permissions as model credentials. It is never exposed unmasked by the dashboard. + oddish_api_key: str | None = None + oddish_api_url: str = "https://abundant-ai--api.modal.run" + oddish_dashboard_url: str = "https://www.oddish.app" + oddish_agent: str = "claude-code" + oddish_model: str = "anthropic/claude-sonnet-4-6" # Per-TRIAL cost cap handed to the mini-swe solver (`-l`; 0 = disabled). Deliberately 0 by # default: the product policy is cost preview + confirm before a sweep, not a silent cap that # kills long legitimate trials. Always passed explicitly (mini's own default would cap quietly). @@ -123,6 +133,11 @@ def load(cls) -> "LhConfig": cfg.gemini_api_key = (os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY") or cfg.gemini_api_key) cfg.zai_api_key = os.getenv("ZAI_API_KEY") or cfg.zai_api_key + cfg.oddish_api_key = os.getenv("ODDISH_API_KEY") or cfg.oddish_api_key + cfg.oddish_api_url = os.getenv("ODDISH_API_URL") or cfg.oddish_api_url + cfg.oddish_dashboard_url = ( + os.getenv("ODDISH_DASHBOARD_URL") or cfg.oddish_dashboard_url + ) if v := os.getenv("PROGRAMSMITH_TRIAL_COST_LIMIT"): try: cfg.trial_cost_limit = float(v) @@ -153,6 +168,7 @@ def mask(v: str | None) -> str | None: d["openai_api_key"] = mask(self.openai_api_key) d["gemini_api_key"] = mask(self.gemini_api_key) d["zai_api_key"] = mask(self.zai_api_key) + d["oddish_api_key"] = mask(self.oddish_api_key) return d diff --git a/src/programsmith/oddish.py b/src/programsmith/oddish.py new file mode 100644 index 0000000..fe6913f --- /dev/null +++ b/src/programsmith/oddish.py @@ -0,0 +1,399 @@ +"""Small, dependency-light bridge from an exported ProgramSmith task to hosted Oddish. + +The hosted Oddish API already owns task storage, sandbox execution, trajectories, and public +experiment pages. ProgramSmith only performs the client-side handoff: + +1. archive and upload one exported Harbor task; +2. submit one agent trial and request a public experiment; +3. persist the returned identifiers beside the local run; and +4. proxy a compact public status/trajectory view for the local dashboard. + +The Oddish API key is read from :class:`programsmith.config.LhConfig`; it is never written into the +per-run state file or returned to the browser. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import tarfile +import tempfile +import time +from datetime import datetime, timezone +from pathlib import Path +from typing import Any +from urllib.parse import quote + +import httpx + + +STATE_FILE = "oddish.json" +_TRANSIENT = {408, 425, 429, 500, 502, 503, 504} +_TERMINAL = {"success", "failed", "cancelled", "canceled", "skipped", "error"} + + +class OddishError(RuntimeError): + """A concise, user-actionable Oddish handoff error.""" + + +def _now() -> str: + return datetime.now(timezone.utc).isoformat() + + +def _state_path(run_dir: str | Path) -> Path: + return Path(run_dir) / STATE_FILE + + +def load_state(run_dir: str | Path) -> dict[str, Any]: + path = _state_path(run_dir) + if not path.is_file(): + return {"status": "idle", "trials": []} + try: + value = json.loads(path.read_text()) + except (OSError, json.JSONDecodeError): + return {"status": "failed", "error": "Oddish state is unreadable", "trials": []} + return value if isinstance(value, dict) else {"status": "idle", "trials": []} + + +def save_state(run_dir: str | Path, state: dict[str, Any]) -> dict[str, Any]: + path = _state_path(run_dir) + path.parent.mkdir(parents=True, exist_ok=True) + payload = {**state, "updated_at": _now()} + tmp = path.with_suffix(".tmp") + tmp.write_text(json.dumps(payload, indent=2) + "\n") + os.replace(tmp, path) + return payload + + +def task_content_hash(task_dir: str | Path) -> str: + """Return a stable hash of one task tree without following symlinks.""" + root = Path(task_dir).resolve() + digest = hashlib.sha256() + for path in sorted(root.rglob("*"), key=lambda item: item.relative_to(root).as_posix()): + rel = path.relative_to(root).as_posix() + if path.is_dir() and not path.is_symlink(): + continue + digest.update(rel.encode("utf-8")) + digest.update(b"\0") + if path.is_symlink(): + digest.update(b"symlink\0") + digest.update(os.readlink(path).encode("utf-8")) + elif path.is_file(): + digest.update(path.read_bytes()) + digest.update(b"\0") + return digest.hexdigest() + + +def _error_detail(response: httpx.Response) -> str: + try: + body = response.json() + except ValueError: + return response.text.strip() or f"HTTP {response.status_code}" + detail = body.get("detail") if isinstance(body, dict) else None + if isinstance(detail, dict): + return str(detail.get("message") or detail) + return str(detail or (body.get("message") if isinstance(body, dict) else body)) + + +def _request( + client: httpx.Client, + method: str, + url: str, + *, + attempts: int = 3, + **kwargs: Any, +) -> httpx.Response: + last_error: Exception | None = None + for attempt in range(attempts): + try: + response = client.request(method, url, **kwargs) + except httpx.TransportError as exc: + last_error = exc + if attempt + 1 >= attempts: + break + time.sleep(min(2**attempt, 4)) + continue + if response.status_code not in _TRANSIENT or attempt + 1 >= attempts: + return response + retry_after = response.headers.get("Retry-After") + try: + delay = float(retry_after) if retry_after else min(2**attempt, 4) + except ValueError: + delay = min(2**attempt, 4) + time.sleep(min(max(delay, 0), 10)) + raise OddishError(f"Could not reach Oddish: {last_error}") + + +def _require_ok(response: httpx.Response, action: str) -> dict[str, Any]: + if response.status_code < 200 or response.status_code >= 300: + detail = _error_detail(response) + if response.status_code == 401: + detail = "Oddish rejected the API key. Replace it in Settings and retry." + elif response.status_code == 403 and "publish" in detail.lower(): + detail = ( + "This Oddish key cannot publish experiments. Create a full-scope key in " + "Oddish Settings, then retry." + ) + raise OddishError(f"{action} failed: {detail}") + try: + payload = response.json() + except ValueError as exc: + raise OddishError(f"{action} returned an invalid response") from exc + if not isinstance(payload, dict): + raise OddishError(f"{action} returned an invalid response") + return payload + + +def _archive_task(task_dir: Path) -> Path: + fd, name = tempfile.mkstemp(prefix=f"programsmith-{task_dir.name}-", suffix=".tar.gz") + os.close(fd) + archive = Path(name) + with tarfile.open(archive, "w:gz", compresslevel=1) as tar: + for item in sorted(task_dir.iterdir(), key=lambda value: value.name): + tar.add(item, arcname=item.name, recursive=True) + return archive + + +def _upload_task( + client: httpx.Client, + *, + api_url: str, + task_dir: Path, +) -> dict[str, Any]: + content_hash = task_content_hash(task_dir) + init = _require_ok( + _request( + client, + "POST", + f"{api_url}/tasks/upload/init", + json={"name": task_dir.name, "content_hash": content_hash}, + ), + "Task upload", + ) + init["content_hash"] = content_hash + if init.get("content_unchanged"): + return init + + upload_url = init.get("upload_url") + if not isinstance(upload_url, str) or not upload_url: + raise OddishError("Oddish did not provide a task upload URL") + + archive = _archive_task(task_dir) + try: + headers = dict(init.get("upload_headers") or {}) + headers.setdefault("Content-Length", str(archive.stat().st_size)) + with archive.open("rb") as body, httpx.Client(timeout=600, follow_redirects=True) as uploader: + uploaded = _request( + uploader, + "PUT", + upload_url, + headers=headers, + content=body, + attempts=1, + ) + if uploaded.status_code not in {200, 201, 204}: + raise OddishError(f"Task storage upload failed: {_error_detail(uploaded)}") + finally: + archive.unlink(missing_ok=True) + + complete = { + "task_id": init["task_id"], + "name": init["name"], + "version": init["version"], + "content_hash": content_hash, + } + return _require_ok( + _request( + client, + "POST", + f"{api_url}/tasks/upload/complete", + json=complete, + ), + "Task upload", + ) + + +def submit_task( + run_dir: str | Path, + task_dir: str | Path, + *, + api_key: str, + api_url: str, + dashboard_url: str, + agent: str, + model: str, +) -> dict[str, Any]: + """Upload *task_dir*, launch one public Oddish trial, and persist the handoff.""" + rd = Path(run_dir) + task = Path(task_dir).resolve() + if not task.is_dir(): + raise OddishError("The exported task is missing") + api = api_url.rstrip("/") + dashboard = dashboard_url.rstrip("/") + state = save_state( + rd, + { + "status": "submitting", + "agent": agent, + "model": model, + "task_name": task.name, + "trials": [], + }, + ) + try: + headers = {"Authorization": f"Bearer {api_key}"} + with httpx.Client(timeout=600, headers=headers, follow_redirects=True) as client: + uploaded = _upload_task(client, api_url=api, task_dir=task) + task_id = str(uploaded["task_id"]) + payload = { + "task_id": task_id, + "append_to_task": bool(uploaded.get("existing_task")), + "configs": [{"agent": agent, "model": model, "n_trials": 1}], + "priority": "low", + "run_analysis": False, + "run_probe": False, + "gate_baselines": True, + "publish_experiment": True, + "content_hash": uploaded.get("content_hash") or task_content_hash(task), + } + idempotency_key = hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode() + ).hexdigest() + submitted = _require_ok( + _request( + client, + "POST", + f"{api}/tasks/sweep", + json=payload, + headers={"Idempotency-Key": idempotency_key}, + attempts=1, + ), + "Oddish run", + ) + experiment_id = submitted.get("experiment_id") + share: dict[str, Any] = {} + if experiment_id: + share_response = _request( + client, + "GET", + f"{api}/experiments/{quote(str(experiment_id), safe='')}/share", + ) + share = _require_ok(share_response, "Public experiment link") + + public_token = share.get("public_token") + public_url = f"{dashboard}/share/{public_token}" if public_token else None + experiment_url = ( + f"{dashboard}/experiments/{quote(str(experiment_id), safe='')}" + if experiment_id + else f"{dashboard}/dashboard" + ) + return save_state( + rd, + { + **state, + "status": "queued", + "task_id": task_id, + "experiment_id": experiment_id, + "experiment_name": submitted.get("experiment_name"), + "experiment_url": experiment_url, + "public_token": public_token, + "public_url": public_url, + "trial_ids": submitted.get("new_trial_ids") or [], + "trials": [], + "error": None, + }, + ) + except Exception as exc: + error = str(exc) if isinstance(exc, OddishError) else f"Oddish handoff failed: {exc}" + save_state(rd, {**state, "status": "failed", "error": error}) + raise OddishError(error) from exc + + +def _public_get(api_url: str, path: str) -> Any: + with httpx.Client(timeout=30, follow_redirects=True) as client: + response = _request(client, "GET", f"{api_url.rstrip('/')}{path}") + if response.status_code < 200 or response.status_code >= 300: + raise OddishError(f"Could not read the public Oddish run: {_error_detail(response)}") + try: + return response.json() + except ValueError as exc: + raise OddishError("Oddish returned an invalid public-run response") from exc + + +def _compact_trial(trial: dict[str, Any]) -> dict[str, Any]: + result = trial.get("result") if isinstance(trial.get("result"), dict) else {} + return { + "id": trial.get("id"), + "index": trial.get("index"), + "status": str(trial.get("status") or "queued").lower(), + "agent": trial.get("agent"), + "model": trial.get("model"), + "reward": trial.get("reward"), + "started_at": trial.get("started_at"), + "finished_at": trial.get("finished_at"), + "duration_seconds": trial.get("trajectory_duration_seconds"), + "tool_calls": trial.get("total_tool_calls"), + "cost_usd": trial.get("cost_usd") or result.get("cost_usd"), + "error": ( + trial.get("error_message") + or trial.get("error") + or result.get("error") + or result.get("harbor_exception") + ), + } + + +def refresh_state(run_dir: str | Path, *, api_url: str) -> dict[str, Any]: + """Refresh a saved handoff through the unauthenticated public experiment API.""" + rd = Path(run_dir) + state = load_state(rd) + token = state.get("public_token") + task_id = state.get("task_id") + if not token or not task_id or state.get("status") in {"idle", "submitting", "failed"}: + return state + try: + encoded_token = quote(str(token), safe="") + encoded_task = quote(str(task_id), safe="") + raw_trials = _public_get( + api_url, + f"/public/experiments/{encoded_token}/tasks/{encoded_task}/trials", + ) + if isinstance(raw_trials, dict): + raw_trials = raw_trials.get("trials") or [] + trials = [_compact_trial(item) for item in raw_trials if isinstance(item, dict)] + statuses = {item["status"] for item in trials} + if not trials or statuses <= {"queued", "pending", "retrying"}: + status = "queued" + elif any(value in {"running", "building", "verifying"} for value in statuses): + status = "running" + elif statuses and statuses <= _TERMINAL: + status = "failed" if statuses <= {"failed", "cancelled", "canceled", "error"} else "complete" + else: + status = "running" + return save_state(rd, {**state, "status": status, "trials": trials, "error": None}) + except OddishError as exc: + # A temporary public-read failure must not erase a successfully submitted run. Keep the + # last good payload and surface a non-terminal refresh error for the UI. + return {**state, "refresh_error": str(exc)} + + +def get_trajectory( + run_dir: str | Path, + *, + api_url: str, + trial_id: str | None = None, +) -> dict[str, Any] | list[Any] | None: + state = load_state(run_dir) + token = state.get("public_token") + selected = trial_id or next( + (str(item.get("id")) for item in state.get("trials", []) if item.get("id")), + None, + ) + if not token or not selected: + return None + return _public_get( + api_url, + f"/public/experiments/{quote(str(token), safe='')}/trials/" + f"{quote(selected, safe='')}/trajectory", + ) diff --git a/src/programsmith/ui/api.py b/src/programsmith/ui/api.py index d2d6a5f..7a2f148 100644 --- a/src/programsmith/ui/api.py +++ b/src/programsmith/ui/api.py @@ -18,13 +18,17 @@ from __future__ import annotations import json +import shutil import subprocess +import tempfile import threading import time from pathlib import Path from fastapi import APIRouter, HTTPException +from fastapi.responses import FileResponse from pydantic import BaseModel +from starlette.background import BackgroundTask from ..cells.task_matrix import TaskMatrixOutput, apply_selection, propose from ..config import LhConfig @@ -149,6 +153,12 @@ class SettingsBody(BaseModel): openai_api_key: str | None = None gemini_api_key: str | None = None zai_api_key: str | None = None + # Hosted Oddish handoff. The key is treated exactly like the provider secrets above. + oddish_api_key: str | None = None + oddish_api_url: str | None = None + oddish_dashboard_url: str | None = None + oddish_agent: str | None = None + oddish_model: str | None = None @router.post("/settings") @@ -160,7 +170,7 @@ def set_settings(body: SettingsBody) -> dict: for field, val in body.model_dump(exclude_none=True).items(): if field in { "claude_code_oauth_token", "anthropic_api_key", "openai_api_key", - "gemini_api_key", "zai_api_key", + "gemini_api_key", "zai_api_key", "oddish_api_key", }: val = val.strip() or None setattr(cfg, field, val) @@ -291,6 +301,20 @@ def _manifest_context(man: Manifest | None) -> dict: } +def _exported_task_dir(run_dir: Path, manifest: Manifest | None) -> Path | None: + """Resolve only a finished/exported task artifact, never the mutable work-in-progress tree.""" + if manifest is None: + return None + snapshot = manifest.snapshot or {} + raw = snapshot.get("outbox_path") if isinstance(snapshot, dict) else None + if not raw: + return None + path = Path(str(raw)).expanduser() + if not path.is_absolute(): + path = (Path.cwd() / path).resolve() + return path if path.is_dir() else None + + @router.get("/runs/{key}") def get_run(key: str) -> dict: s = _store() @@ -343,6 +367,11 @@ def get_run(key: str) -> dict: "drive": drive_info, "waiting": waiting, "jobs": get_jobs(run_dir), + "artifact": { + "available": _exported_task_dir(run_dir, manifest) is not None, + "download_url": f"/api/runs/{key}/download", + "calibrated": summary.status in {"done", "easy"}, + }, } @@ -561,6 +590,122 @@ def _entries(sub: str) -> list[dict]: return {"tasks": _entries("tasks"), "easy": _entries("easy"), "drafts": _entries("drafts")} +# ---- finished task actions ------------------------------------------------------------ + +@router.get("/runs/{key}/download") +def download_task(key: str): + """Download the immutable exported Harbor task as a zip archive.""" + s = _store() + run_dir = Path(s.runs_dir) / key + try: + manifest = s.get_manifest(key) + except FileNotFoundError: + raise HTTPException(404, f"no run {key!r}") + task_dir = _exported_task_dir(run_dir, manifest) + if task_dir is None: + raise HTTPException(409, "The task is not exported yet") + + temp_dir = Path(tempfile.mkdtemp(prefix="programsmith-download-")) + archive = Path(shutil.make_archive(str(temp_dir / task_dir.name), "zip", task_dir.parent, task_dir.name)) + return FileResponse( + archive, + media_type="application/zip", + filename=f"{task_dir.name}.zip", + background=BackgroundTask(shutil.rmtree, temp_dir, ignore_errors=True), + ) + + +class OddishRunBody(BaseModel): + agent: str | None = None + model: str | None = None + + +@router.get("/runs/{key}/oddish") +def oddish_status(key: str) -> dict: + """Compact hosted-run status. Public experiment reads require no browser credential.""" + s = _store() + run_dir = Path(s.runs_dir) / key + if not run_state_exists(run_dir): + raise HTTPException(404, f"no run {key!r}") + from ..oddish import refresh_state + return refresh_state(run_dir, api_url=LhConfig.load().oddish_api_url) + + +@router.get("/runs/{key}/oddish/trajectory") +def oddish_trajectory(key: str, trial_id: str | None = None): + s = _store() + run_dir = Path(s.runs_dir) / key + if not run_state_exists(run_dir): + raise HTTPException(404, f"no run {key!r}") + from ..oddish import OddishError, get_trajectory + try: + value = get_trajectory( + run_dir, + api_url=LhConfig.load().oddish_api_url, + trial_id=trial_id, + ) + except OddishError as exc: + raise HTTPException(502, str(exc)) + if value is None: + raise HTTPException(404, "No Oddish trajectory is available yet") + return value + + +@router.post("/runs/{key}/oddish") +def run_on_oddish(key: str, body: OddishRunBody) -> dict: + """Launch one hosted Oddish trial for an exported task and publish its experiment.""" + s = _store() + run_dir = Path(s.runs_dir) / key + if not run_state_exists(run_dir): + raise HTTPException(404, f"no run {key!r}") + manifest = s.get_manifest(key) + task_dir = _exported_task_dir(run_dir, manifest) + if task_dir is None: + raise HTTPException(409, "Finish and export the task before running it on Oddish") + + cfg = LhConfig.load() + if not cfg.oddish_api_key: + raise HTTPException( + 422, + "Connect Oddish in Settings first. Create a full-scope key at " + f"{cfg.oddish_dashboard_url}/settings.", + ) + from ..oddish import load_state, save_state, submit_task + existing = load_state(run_dir) + if existing.get("status") in {"submitting", "queued", "running", "complete"}: + return existing + + agent = (body.agent or cfg.oddish_agent).strip() + model = (body.model or cfg.oddish_model).strip() + if not agent or not model: + raise HTTPException(422, "Oddish agent and model are required") + pending = save_state( + run_dir, + { + "status": "submitting", + "task_name": task_dir.name, + "agent": agent, + "model": model, + "trials": [], + }, + ) + + def _submit() -> str: + result = submit_task( + run_dir, + task_dir, + api_key=cfg.oddish_api_key or "", + api_url=cfg.oddish_api_url, + dashboard_url=cfg.oddish_dashboard_url, + agent=agent, + model=model, + ) + return result.get("public_url") or result.get("experiment_url") or "submitted" + + run_in_background(run_dir, "oddish", _submit, stale_sec=1800) + return pending + + # ---- file / directory browser (task-detail viewer) ------------------------------------ @router.get("/runs/{key}/files") diff --git a/src/programsmith/ui/frontend/dist/assets/index-dxwYZDPn.js b/src/programsmith/ui/frontend/dist/assets/index-C1wOaHIr.js similarity index 72% rename from src/programsmith/ui/frontend/dist/assets/index-dxwYZDPn.js rename to src/programsmith/ui/frontend/dist/assets/index-C1wOaHIr.js index 2656aab..03c94ac 100644 --- a/src/programsmith/ui/frontend/dist/assets/index-dxwYZDPn.js +++ b/src/programsmith/ui/frontend/dist/assets/index-C1wOaHIr.js @@ -256,7 +256,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann transparent, ${(e.vars||e).palette.action.hover}, transparent - )`,content:`""`,position:`absolute`,transform:`translateX(-100%)`,bottom:0,left:0,right:0,top:0}}},{props:{animation:`wave`},style:Zy||{"&::after":{animation:`${Yy} 2s linear 0.5s infinite`}}},...i?[{props:{animation:`wave`},style:i}]:[]]}})),$y=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiSkeleton`}),{animation:r=`pulse`,className:i,component:a=`span`,height:o,style:s,variant:c=`text`,width:l,...u}=n,d={...n,animation:r,component:a,variant:c,hasChildren:!!u.children};return(0,V.jsx)(Qy,{as:a,ref:t,className:U(qy(d).root,i),ownerState:d,...u,style:{width:l,height:o,...s}})});function eb(e){return W(`PrivateSwitchBase`,e)}Z(`PrivateSwitchBase`,[`root`,`checked`,`disabled`,`input`,`edgeStart`,`edgeEnd`]);var tb=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e;return q({root:[`root`,n&&`checked`,r&&`disabled`,i&&`edge${K(i)}`],input:[`input`]},eb,t)},nb=J(qd,{name:`MuiSwitchBase`})({padding:9,borderRadius:`50%`,variants:[{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e===`start`&&t.size!==`small`,style:{marginLeft:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e===`end`&&t.size!==`small`,style:{marginRight:-12}}]}),rb=J(`input`,{name:`MuiSwitchBase`,shouldForwardProp:su})({cursor:`inherit`,position:`absolute`,opacity:0,width:`100%`,height:`100%`,top:0,left:0,margin:0,padding:0,zIndex:1}),ib=w.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:s=!1,edge:c=!1,icon:l,id:u,name:d,onBlur:f,onChange:p,onFocus:m,readOnly:h,required:g=!1,tabIndex:_,type:v,value:y,slots:b={},slotProps:x={},...S}=e,{nativeButton:C,...w}=S,[T,E]=gy({controlled:r,default:!!a,name:`SwitchBase`,state:`checked`}),D=lm(),O=e=>{m&&m(e),D&&D.onFocus&&D.onFocus(e)},k=e=>{f&&f(e),D&&D.onBlur&&D.onBlur(e)},A=e=>{if(e.nativeEvent.defaultPrevented||h)return;let t=e.target.checked;E(t),p&&p(e,t)},j=o;D&&j===void 0&&(j=D.disabled);let M=v===`checkbox`||v===`radio`,N={...e,checked:T,disabled:j,disableFocusRipple:s,edge:c},P=tb(N),F={slots:b,slotProps:x},[I,L]=Ru(`root`,{ref:t,elementType:nb,className:P.root,shouldForwardComponentProp:!0,externalForwardedProps:{...F,component:`span`,...w},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O(t)},onBlur:t=>{e.onBlur?.(t),k(t)}}),ownerState:N,additionalProps:{centerRipple:!0,focusRipple:!s,role:void 0,tabIndex:null}}),[ee,te]=Ru(`input`,{elementType:rb,className:P.input,externalForwardedProps:F,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),A(t)}}),ownerState:N,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:j,id:M?u:void 0,name:d,readOnly:h,required:g,tabIndex:_,type:v,...v===`checkbox`&&y===void 0?{}:{value:y}}});return(0,V.jsxs)(I,{...L,children:[(0,V.jsx)(ee,{...te}),T?i:l]})});function ab(e){return W(`MuiSwitch`,e)}var ob=Z(`MuiSwitch`,[`root`,`edgeStart`,`edgeEnd`,`switchBase`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`,`checked`,`disabled`,`input`,`thumb`,`track`]),sb=e=>{let{classes:t,edge:n,size:r,color:i,checked:a,disabled:o}=e,s=q({root:[`root`,n&&`edge${K(n)}`,`size${K(r)}`],switchBase:[`switchBase`,`color${K(i)}`,a&&`checked`,o&&`disabled`],thumb:[`thumb`],track:[`track`],input:[`input`]},ab,t);return{...t,...s}},cb=J(`span`,{name:`MuiSwitch`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.edge&&t[`edge${K(n.edge)}`],t[`size${K(n.size)}`]]}})({display:`inline-flex`,width:58,height:38,overflow:`hidden`,padding:12,boxSizing:`border-box`,position:`relative`,flexShrink:0,zIndex:0,verticalAlign:`middle`,"@media print":{colorAdjust:`exact`},variants:[{props:{edge:`start`},style:{marginLeft:-8}},{props:{edge:`end`},style:{marginRight:-8}},{props:{size:`small`},style:{width:40,height:24,padding:7,[`& .${ob.thumb}`]:{width:16,height:16},[`& .${ob.switchBase}`]:{padding:4,[`&.${ob.checked}`]:{transform:`translateX(16px)`}}}}]}),lb=J(ib,{name:`MuiSwitch`,slot:`SwitchBase`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.switchBase,{[`& .${ob.input}`]:t.input},n.color!=="default"&&t[`color${K(n.color)}`]]}})(Y(({theme:e})=>({position:`absolute`,top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode===`light`?e.palette.common.white:e.palette.grey[300]}`,...Cu(e,[`left`,`transform`],{duration:e.transitions.duration.shortest}),[`&.${ob.checked}`]:{transform:`translateX(20px)`},[`&.${ob.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode===`light`?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${ob.checked} + .${ob.track}`]:{opacity:.5},[`&.${ob.disabled} + .${ob.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode===`light`?.12:.2}`},[`& .${ob.input}`]:{left:`-100%`,width:`300%`}})),Y(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[...Object.entries(e.palette).filter(du([`light`])).map(([t])=>({props:{color:t},style:{[`&.${ob.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${ob.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${ob.checked} + .${ob.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),ub=J(`span`,{name:`MuiSwitch`,slot:`Track`})(Y(({theme:e})=>({height:`100%`,width:`100%`,borderRadius:14/2,zIndex:-1,...Cu(e,[`opacity`,`background-color`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{boxSizing:`border-box`,border:`1px solid ButtonBorder`},backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode===`light`?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode===`light`?.38:.3}`}))),db=J(`span`,{name:`MuiSwitch`,slot:`Thumb`})(Y(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:`currentColor`,boxSizing:`border-box`,border:`1px solid transparent`,width:20,height:20,borderRadius:`50%`}))),fb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiSwitch`}),{className:r,color:i=`primary`,edge:a=!1,size:o=`medium`,sx:s,slots:c={},slotProps:l={},...u}=n,d={...n,color:i,edge:a,size:o},f=sb(d),p=l.input,m={slots:c,slotProps:l},[h,g]=Ru(`root`,{className:U(f.root,r),elementType:cb,externalForwardedProps:m,ownerState:d,additionalProps:{sx:s}}),[_,v]=Ru(`thumb`,{className:f.thumb,elementType:db,externalForwardedProps:m,ownerState:d}),y=(0,V.jsx)(_,{...v}),[b,x]=Ru(`track`,{className:f.track,elementType:ub,externalForwardedProps:m,ownerState:d});return(0,V.jsxs)(h,{...g,children:[(0,V.jsx)(lb,{type:`checkbox`,icon:y,checkedIcon:y,ref:t,ownerState:d,...u,classes:{...f,root:f.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...l.switchBase&&{root:typeof l.switchBase==`function`?l.switchBase(d):l.switchBase},input:Jl(typeof p==`function`?p(d):p,{role:`switch`})}}),(0,V.jsx)(b,{...x})]})});function pb(e){return W(`MuiTextField`,e)}Z(`MuiTextField`,[`root`]);var mb={standard:hh,filled:Nm,outlined:Hg},hb=e=>{let{classes:t}=e;return q({root:[`root`]},pb,t)},gb=J(zm,{name:`MuiTextField`,slot:`Root`})({}),_b=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,fullWidth:d=!1,helperText:f,id:p,inputRef:m,label:h,maxRows:g,minRows:_,multiline:v=!1,name:y,onBlur:b,onChange:x,onFocus:S,placeholder:C,required:w=!1,rows:T,select:E=!1,slots:D={},slotProps:O={},type:k,value:A,variant:j=`outlined`,...M}=n,N={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:d,multiline:v,required:w,select:E,variant:j},P=hb(N),F=uc(p),I=f&&F?`${F}-helper-text`:void 0,L=h&&F?`${F}-label`:void 0,ee=mb[j],te={slots:D,slotProps:O},[ne,re]=Ru(`select`,{elementType:Gy,externalForwardedProps:te,ownerState:N}),R=E&&re.native,z={},ie=te.slotProps.inputLabel;j===`outlined`&&(ie&&ie.shrink!==void 0&&(z.notched=ie.shrink),z.label=h),E&&(R||(z.id=void 0),z[`aria-describedby`]=void 0);let[ae,oe]=Ru(`root`,{elementType:gb,shouldForwardComponentProp:!0,externalForwardedProps:{...te,...M},ownerState:N,className:U(P.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:d,required:w,color:s,variant:j}}),[se,ce]=Ru(`input`,{elementType:ee,externalForwardedProps:te,additionalProps:z,ownerState:N}),[le,B]=Ru(`inputLabel`,{elementType:Th,externalForwardedProps:te,ownerState:N}),[ue,de]=Ru(`htmlInput`,{elementType:`input`,externalForwardedProps:te,ownerState:N}),[fe,pe]=Ru(`formHelperText`,{elementType:Gm,externalForwardedProps:te,ownerState:N}),me=(0,V.jsx)(se,{"aria-describedby":I,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:d,multiline:v,name:y,rows:T,maxRows:g,minRows:_,type:k,value:A,id:F,inputRef:m,onBlur:b,onChange:x,onFocus:S,placeholder:C,inputProps:de,slots:{input:D.htmlInput?ue:void 0},...ce});return(0,V.jsxs)(ae,{...oe,children:[h!=null&&h!==``&&(0,V.jsx)(le,{htmlFor:E&&!R?void 0:F,id:L,...E&&!R&&{component:`div`},...B,children:h}),E?(0,V.jsx)(ne,{"aria-describedby":I,id:F,labelId:L,value:A,input:me,...re,children:a}):me,f&&(0,V.jsx)(fe,{id:I,...pe,children:f})]})});function vb(e){return W(`MuiToggleButton`,e)}var yb=Z(`MuiToggleButton`,[`root`,`disabled`,`selected`,`standard`,`primary`,`secondary`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`fullWidth`]),bb=w.createContext({}),xb=w.createContext(void 0);function Sb(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}var Cb=e=>{let{classes:t,fullWidth:n,selected:r,disabled:i,size:a,color:o}=e;return q({root:[`root`,r&&`selected`,i&&`disabled`,n&&`fullWidth`,`size${K(a)}`,o]},vb,t)},wb=J(qd,{name:`MuiToggleButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`size${K(n.size)}`]]}})(Y(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${yb.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:`none`,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[{props:{color:`standard`},style:{[`&.${yb.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(du()).map(([t])=>({props:{color:t},style:{[`&.${yb.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:`100%`}},{props:{size:`small`},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),Tb=w.forwardRef(function(e,t){let{value:n,...r}=w.useContext(bb),i=w.useContext(xb),a=X({props:tc({...r,selected:Sb(e.value,n)},e),name:`MuiToggleButton`}),{children:o,className:s,color:c=`standard`,disabled:l=!1,disableFocusRipple:u=!1,fullWidth:d=!1,onChange:f,onClick:p,selected:m,size:h=`medium`,value:g,..._}=a,v={...a,color:c,disabled:l,disableFocusRipple:u,fullWidth:d,size:h},y=Cb(v),b=e=>{p&&(p(e,g),e.defaultPrevented)||f&&f(e,g)},x=i||``;return(0,V.jsx)(wb,{className:U(r.className,y.root,s,x),internalNativeButton:!0,disabled:l,focusRipple:!u,ref:t,onClick:b,onChange:f,value:g,ownerState:v,"aria-pressed":m,..._,children:o})});function Eb(e){return w.Children.toArray(e).filter(e=>w.isValidElement(e))}function Db(e){return W(`MuiToggleButtonGroup`,e)}var Ob=Z(`MuiToggleButtonGroup`,[`root`,`selected`,`horizontal`,`vertical`,`disabled`,`grouped`,`fullWidth`,`firstButton`,`lastButton`,`middleButton`]),kb=e=>{let{classes:t,orientation:n,fullWidth:r,disabled:i}=e;return q({root:[`root`,n,r&&`fullWidth`],grouped:[`grouped`,i&&`disabled`],firstButton:[`firstButton`],lastButton:[`lastButton`],middleButton:[`middleButton`]},Db,t)},Ab=J(`div`,{name:`MuiToggleButtonGroup`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Ob.grouped}`]:t.grouped},{[`& .${Ob.firstButton}`]:t.firstButton},{[`& .${Ob.lastButton}`]:t.lastButton},{[`& .${Ob.middleButton}`]:t.middleButton},t.root,n.orientation===`vertical`&&t.vertical,n.fullWidth&&t.fullWidth]}})(Y(({theme:e})=>({display:`inline-flex`,borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:`vertical`},style:{flexDirection:`column`,[`& .${Ob.grouped}`]:{[`&.${Ob.selected} + .${Ob.grouped}.${Ob.selected}`]:{borderTop:0,marginTop:0}},[`& .${Ob.firstButton},& .${Ob.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Ob.lastButton},& .${Ob.middleButton}`]:{marginTop:-1,borderTop:`1px solid transparent`,borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Ob.lastButton}.${yb.disabled},& .${Ob.middleButton}.${yb.disabled}`]:{borderTop:`1px solid transparent`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{orientation:`horizontal`},style:{[`& .${Ob.grouped}`]:{[`&.${Ob.selected} + .${Ob.grouped}.${Ob.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Ob.firstButton},& .${Ob.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Ob.lastButton},& .${Ob.middleButton}`]:{marginLeft:-1,borderLeft:`1px solid transparent`,borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Ob.lastButton}.${yb.disabled},& .${Ob.middleButton}.${yb.disabled}`]:{borderLeft:`1px solid transparent`}}}]}))),jb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiToggleButtonGroup`}),{children:r,className:i,color:a=`standard`,disabled:o=!1,exclusive:s=!1,fullWidth:c=!1,onChange:l,orientation:u=`horizontal`,size:d=`medium`,value:f,...p}=n,m={...n,disabled:o,fullWidth:c,orientation:u,size:d},h=kb(m),g=w.useCallback((e,t)=>{if(!l)return;let n=f&&f.indexOf(t),r;f&&n>=0?(r=f.slice(),r.splice(n,1)):r=f?f.concat(t):[t],l(e,r)},[l,f]),_=w.useCallback((e,t)=>{l&&l(e,f===t?null:t)},[l,f]),v=w.useMemo(()=>({className:h.grouped,onChange:s?_:g,value:f,size:d,fullWidth:c,color:a,disabled:o}),[h.grouped,s,_,g,f,d,c,a,o]),y=Eb(r),b=y.length,x=e=>{let t=e===0,n=e===b-1;return t&&n?``:t?h.firstButton:n?h.lastButton:h.middleButton};return(0,V.jsx)(Ab,{role:`group`,className:U(h.root,i),ref:t,ownerState:m,...p,children:(0,V.jsx)(bb.Provider,{value:v,children:y.map((e,t)=>(0,V.jsx)(xb.Provider,{value:x(t),children:e},t))})})});function Mb(e){return W(`MuiToolbar`,e)}Z(`MuiToolbar`,[`root`,`gutters`,`regular`,`dense`]);var Nb=e=>{let{classes:t,disableGutters:n,variant:r}=e;return q({root:[`root`,!n&&`gutters`,r]},Mb,t)},Pb=J(`div`,{name:`MuiToolbar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Y(({theme:e})=>({position:`relative`,display:`flex`,alignItems:`center`,variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up(`sm`)]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:`dense`},style:{minHeight:48}},{props:{variant:`regular`},style:e.mixins.toolbar}]}))),Fb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiToolbar`}),{className:r,component:i=`div`,disableGutters:a=!1,variant:o=`regular`,...s}=n,c={...n,component:i,disableGutters:a,variant:o};return(0,V.jsx)(Pb,{as:i,className:U(Nb(c).root,r),ref:t,ownerState:c,...s})});function Ib(e){return W(`MuiTooltip`,e)}var Lb=Z(`MuiTooltip`,[`popper`,`popperInteractive`,`popperArrow`,`popperClose`,`tooltip`,`tooltipArrow`,`touch`,`tooltipPlacementLeft`,`tooltipPlacementRight`,`tooltipPlacementTop`,`tooltipPlacementBottom`,`arrow`]);function Rb(e){return Math.round(e*1e5)/1e5}var zb=e=>{let{classes:t,disableInteractive:n,arrow:r,touch:i,placement:a}=e;return q({popper:[`popper`,!n&&`popperInteractive`,r&&`popperArrow`],tooltip:[`tooltip`,r&&`tooltipArrow`,i&&`touch`,`tooltipPlacement${K(a.split(`-`)[0])}`],arrow:[`arrow`]},Ib,t)},Bb=J(ty,{name:`MuiTooltip`,slot:`Popper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(Y(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:`none`,variants:[{props:({ownerState:e,open:t})=>t&&!e.disableInteractive,style:{pointerEvents:`auto`}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Lb.arrow}`]:{top:0,marginTop:`-0.71em`,"&::before":{transformOrigin:`0 100%`}},[`&[data-popper-placement*="top"] .${Lb.arrow}`]:{bottom:0,marginBottom:`-0.71em`,"&::before":{transformOrigin:`100% 0`}},[`&[data-popper-placement*="right"] .${Lb.arrow}`]:{height:`1em`,width:`0.71em`,insetInlineStart:0,marginInlineStart:`-0.71em`,"&::before":{transformOrigin:`100% 100%`}},[`&[data-popper-placement*="left"] .${Lb.arrow}`]:{height:`1em`,width:`0.71em`,insetInlineEnd:0,marginInlineEnd:`-0.71em`,"&::before":{transformOrigin:`0 0`}}}}]}))),Vb=J(`div`,{name:`MuiTooltip`,slot:`Tooltip`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${K(n.placement.split(`-`)[0])}`]]}})(Y(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:`4px 8px`,fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:`break-word`,fontWeight:e.typography.fontWeightMedium,[`.${Lb.popper}[data-popper-placement*="left"] &`]:{transformOrigin:`right center`,marginInlineEnd:`14px`},[`.${Lb.popper}[data-popper-placement*="right"] &`]:{transformOrigin:`left center`,marginInlineStart:`14px`},[`.${Lb.popper}[data-popper-placement*="top"] &`]:{transformOrigin:`center bottom`,marginBottom:`14px`},[`.${Lb.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:`center top`,marginTop:`14px`},variants:[{props:({ownerState:e})=>e.arrow,style:{position:`relative`,marginBlock:0}},{props:({ownerState:e})=>e.touch,style:{padding:`8px 16px`,fontSize:e.typography.pxToRem(14),lineHeight:`${Rb(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>e.touch,style:{[`.${Lb.popper}[data-popper-placement*="left"] &`]:{marginInlineEnd:`24px`},[`.${Lb.popper}[data-popper-placement*="right"] &`]:{marginInlineStart:`24px`},[`.${Lb.popper}[data-popper-placement*="top"] &`]:{marginBottom:`24px`},[`.${Lb.popper}[data-popper-placement*="bottom"] &`]:{marginTop:`24px`}}}]}))),Hb=J(`span`,{name:`MuiTooltip`,slot:`Arrow`})(Y(({theme:e})=>({overflow:`hidden`,position:`absolute`,width:`1em`,height:`0.71em`,boxSizing:`border-box`,color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:`""`,margin:`auto`,display:`block`,width:`100%`,height:`100%`,backgroundColor:`currentColor`,transform:`rotate(45deg)`}}))),Ub=!1,Wb=new Ed,Gb={x:0,y:0};function Kb(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}var qb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiTooltip`}),{arrow:r=!1,children:i,classes:a,describeChild:o=!1,disableFocusListener:s=!1,disableHoverListener:c=!1,disableInteractive:l=!1,disableTouchListener:u=!1,enterDelay:d=100,enterNextDelay:f=0,enterTouchDelay:p=700,followCursor:m=!1,id:h,leaveDelay:g=0,leaveTouchDelay:_=1500,onClose:v,onOpen:y,open:b,placement:x=`bottom`,slotProps:S={},slots:C={},title:T,...E}=n,D=w.isValidElement(i)?i:(0,V.jsx)(`span`,{children:i}),O=Il(),[k,A]=w.useState(),[j,M]=w.useState(null),N=w.useRef(!1),P=l||m,F=Dd(),I=Dd(),L=Dd(),ee=Dd(),[te,ne]=gy({controlled:b,default:!1,name:`Tooltip`,state:`open`}),re=te,R=Wl(h),z=w.useRef(),ie=_d(()=>{z.current!==void 0&&(document.body.style.WebkitUserSelect=z.current,z.current=void 0),ee.clear()});w.useEffect(()=>ie,[ie]);let ae=e=>{Wb.clear(),Ub=!0,ne(!0),y&&!re&&y(e)},oe=_d(e=>{Wb.start(800+g,()=>{Ub=!1}),ne(!1),v&&re&&v(e),F.start(O.transitions.duration.shortest,()=>{N.current=!1})}),se=e=>{k?.disabled||N.current&&e.type!==`touchstart`||(k&&k.removeAttribute(`title`),I.clear(),L.clear(),d||Ub&&f?I.start(Ub?f:d,()=>{ae(e)}):ae(e))},ce=e=>{I.clear(),L.start(g,()=>{oe(e)})},[,le]=w.useState(!1),B=e=>{let t=e?.target??k;if(!t||t.disabled||!hd(t)){le(!1);let n=e??new Event(`blur`);!e&&t&&(Object.defineProperty(n,"target",{value:t}),Object.defineProperty(n,"currentTarget",{value:t})),ce(n)}},ue=e=>{if(k||A(e.currentTarget),hd(e.target)){let t=e=>{e.target.disabled&&B(e),e.target.removeEventListener(`blur`,t)};e.target.addEventListener(`blur`,t),le(!0),se(e)}},de=e=>{N.current=!0;let t=D.props;t.onTouchStart&&t.onTouchStart(e)},fe=e=>{de(e),L.clear(),F.clear(),ie(),z.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect=`none`,ee.start(p,()=>{document.body.style.WebkitUserSelect=z.current,se(e)})},pe=e=>{D.props.onTouchEnd&&D.props.onTouchEnd(e),ie(),L.start(_,()=>{oe(e)})};w.useEffect(()=>{if(!re)return;function e(e){e.key===`Escape`&&oe(e)}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[oe,re]);let me=Kl(zu(D),A,t);!T&&T!==0&&(re=!1);let he=w.useRef(),ge=e=>{let t=D.props;t.onMouseMove&&t.onMouseMove(e),Gb={x:e.clientX,y:e.clientY},he.current&&he.current.update()},_e={},ve=typeof T==`string`;o?(_e.title=!re&&ve&&!c?T:null,_e[`aria-describedby`]=re?R:null):(_e[`aria-label`]=ve?T:null,_e[`aria-labelledby`]=re&&!ve?R:null);let ye={..._e,...E,...D.props,className:U(E.className,D.props.className),onTouchStart:de,ref:me,...m?{onMouseMove:ge}:{}},be={};u||(ye.onTouchStart=fe,ye.onTouchEnd=pe),c||(ye.onMouseOver=Kb(se,ye.onMouseOver),ye.onMouseLeave=Kb(ce,ye.onMouseLeave),P||(be.onMouseOver=se,be.onMouseLeave=ce)),s||(ye.onFocus=Kb(ue,ye.onFocus),ye.onBlur=Kb(B,ye.onBlur),P||(be.onFocus=ue,be.onBlur=B));let xe={...n,arrow:r,disableInteractive:P,placement:x,touch:N.current},Se=typeof S.popper==`function`?S.popper(xe):S.popper,Ce=w.useMemo(()=>{let e=[{name:`arrow`,enabled:!!j,options:{element:j,padding:4}}];return Se?.popperOptions?.modifiers&&(e=e.concat(Se.popperOptions.modifiers)),{...Se?.popperOptions,modifiers:e}},[j,Se?.popperOptions]),we=zb(xe),Te={slots:C,slotProps:{arrow:S.arrow,popper:Se,tooltip:S.tooltip,transition:S.transition}},[Ee,De]=Ru(`popper`,{elementType:Bb,externalForwardedProps:Te,ownerState:xe,className:we.popper}),[Oe,ke]=Ru(`transition`,{elementType:th,externalForwardedProps:Te,ownerState:xe}),[Ae,je]=Ru(`tooltip`,{elementType:Vb,className:we.tooltip,externalForwardedProps:Te,ownerState:xe}),[Me,Ne]=Ru(`arrow`,{elementType:Hb,className:we.arrow,externalForwardedProps:Te,ownerState:xe,ref:M});return(0,V.jsxs)(w.Fragment,{children:[w.cloneElement(D,ye),(0,V.jsx)(Ee,{as:ty,placement:x,anchorEl:m?{getBoundingClientRect:()=>({top:Gb.y,left:Gb.x,right:Gb.x,bottom:Gb.y,width:0,height:0})}:k,popperRef:he,open:k?re:!1,id:R,transition:!0,...be,...De,popperOptions:Ce,children:({TransitionProps:e})=>(0,V.jsx)(Oe,{timeout:O.transitions.duration.shorter,...e,...ke,children:(0,V.jsxs)(Ae,{...je,children:[T,r?(0,V.jsx)(Me,{...Ne}):null]})})})]})}),Jb=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Yb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Xb=e=>{let t=Yb(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zb=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},$b={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ex=(0,w.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,w.createElement)(`svg`,{ref:c,...$b,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Zb(`lucide`,i),...!a&&!Qb(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Q=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(ex,{ref:i,iconNode:t,className:Zb(`lucide-${Jb(Xb(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Xb(e),n},tx=Q(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),nx=Q(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),rx=Q(`code-xml`,[[`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`}]]),ix=Q(`git-commit-horizontal`,[[`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`}]]),ax=Q(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ox=Q(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),sx=Q(`square-terminal`,[[`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`}]]),cx=Q(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),lx=Q(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ux=Q(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),dx=Q(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),fx=Q(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),px=Q(`book-marked`,[[`path`,{d:`M10 2v8l3-3 3 3V2`,key:`sqw3rj`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),mx=Q(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),hx=Q(`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`}]]),gx=Q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),_x=Q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),vx=Q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),yx=Q(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),bx=Q(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),xx=Q(`clock-3`,[[`path`,{d:`M12 6v6h4`,key:`135r8i`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Sx=Q(`coins`,[[`circle`,{cx:`8`,cy:`8`,r:`6`,key:`3yglwk`}],[`path`,{d:`M18.09 10.37A6 6 0 1 1 10.34 18`,key:`t5s6rm`}],[`path`,{d:`M7 6h1v4`,key:`1obek4`}],[`path`,{d:`m16.71 13.88.7.71-2.82 2.82`,key:`1rbuyh`}]]),Cx=Q(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),wx=Q(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),Tx=Q(`file-code-2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),Ex=Q(`file-json`,[[`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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),Dx=Q(`file-terminal`,[[`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:`m8 16 2-2-2-2`,key:`10vzyd`}],[`path`,{d:`M12 18h4`,key:`1wd2n7`}]]),Ox=Q(`file-text`,[[`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`}]]),kx=Q(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Ax=Q(`folder-open`,[[`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`}]]),jx=Q(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Mx=Q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Nx=Q(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Px=Q(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),Fx=Q(`history`,[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Ix=Q(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Lx=Q(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Rx=Q(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),zx=Q(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Bx=Q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Vx=Q(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Hx=Q(`package-check`,[[`path`,{d:`m16 16 2 2 4-4`,key:`gfu2re`}],[`path`,{d:`M21 10V8a2 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 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),Ux=Q(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Wx=Q(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Gx=Q(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Kx=Q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),qx=Q(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Jx=Q(`rotate-ccw`,[[`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`}]]),Yx=Q(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Xx=Q(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Zx=Q(`scale`,[[`path`,{d:`m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`7g6ntu`}],[`path`,{d:`m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`ijws7r`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2`,key:`3gwbw2`}]]),Qx=Q(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),$x=Q(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),eS=Q(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),tS=Q(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),nS=Q(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),rS=Q(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),iS=Q(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),aS=Q(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),oS=Q(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),sS=Q(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),cS=Q(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),lS=Q(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),uS=Q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),dS=class extends Error{status;detail;constructor(e,t){super(t||`Request failed (${e})`),this.status=e,this.detail=t}};async function fS(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers);n!==void 0&&i.set(`Content-Type`,`application/json`);let a=await fetch(`/api${e}`,{...r,headers:i,body:n===void 0?r.body:JSON.stringify(n)});if(!a.ok){let e=`${a.status} ${a.statusText}`;try{let t=await a.json();e=typeof t?.detail==`string`&&t.detail||typeof t?.message==`string`&&t.message||JSON.stringify(t)}catch{}throw new dS(a.status,e)}if(a.status!==204)return await a.json()}var pS={preflight:()=>fS(`/preflight`),getSettings:()=>fS(`/settings`),saveSettings:e=>fS(`/settings`,{method:`POST`,json:e}),runtime:()=>fS(`/runtime`),costs:()=>fS(`/costs`),catalog:()=>fS(`/catalog`),listPresets:()=>fS(`/presets`),savePreset:(e,t)=>fS(`/presets`,{method:`POST`,json:{name:e,config:t}}),deletePreset:e=>fS(`/presets/${encodeURIComponent(e)}`,{method:`DELETE`}),listRuns:()=>fS(`/runs`),createRun:e=>fS(`/runs`,{method:`POST`,json:e}),getRun:e=>fS(`/runs/${encodeURIComponent(e)}`),listFiles:(e,t=``)=>fS(`/runs/${encodeURIComponent(e)}/files${t?`?path=${encodeURIComponent(t)}`:``}`),readFile:(e,t)=>fS(`/runs/${encodeURIComponent(e)}/file?path=${encodeURIComponent(t)}`),runTaskMatrix:e=>fS(`/runs/${encodeURIComponent(e)}/task-matrix`,{method:`POST`}),getTaskMatrix:e=>fS(`/runs/${encodeURIComponent(e)}/task-matrix`),select:(e,t)=>fS(`/runs/${encodeURIComponent(e)}/select`,{method:`POST`,json:{pick:t}}),qaGate:(e,t)=>fS(`/runs/${encodeURIComponent(e)}/qa-gate`,{method:`POST`,json:{decision:t}}),pause:e=>fS(`/runs/${encodeURIComponent(e)}/pause`,{method:`POST`}),resume:e=>fS(`/runs/${encodeURIComponent(e)}/resume`,{method:`POST`}),reopen:e=>fS(`/runs/${encodeURIComponent(e)}/reopen`,{method:`POST`}),retry:e=>fS(`/runs/${encodeURIComponent(e)}/retry`,{method:`POST`}),deleteRun:e=>fS(`/runs/${encodeURIComponent(e)}`,{method:`DELETE`}),agentOutput:e=>fS(`/runs/${encodeURIComponent(e)}/agent-output`)},mS=(0,w.createContext)({preflight:null,loading:!0,refresh:async()=>{}});function hS({children:e}){let[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)(!0),a=(0,w.useCallback)(async()=>{try{n(await pS.preflight())}catch{n({ready:!1,checks:[]})}finally{i(!1)}},[]);return(0,w.useEffect)(()=>{a()},[a]),(0,V.jsx)(mS.Provider,{value:{preflight:t,loading:r,refresh:a},children:e})}function gS(){return(0,w.useContext)(mS)}var _S=(0,w.createContext)({mode:`dark`,toggleMode:()=>void 0});function vS(){return(0,w.useContext)(_S)}function yS(e){let t=e===`dark`,n=t?{default:`#111111`,paper:`#181818`}:{default:`#f7f7f5`,paper:`#ffffff`},r=t?{primary:`#f2f2f2`,secondary:`#a6a6a6`}:{primary:`#171717`,secondary:`#666666`},i=t?`#343434`:`#dededb`;return jl({palette:{mode:e,primary:{main:t?`#f2f2f2`:`#171717`,contrastText:t?`#111111`:`#ffffff`},background:n,text:r,divider:i,success:{main:t?`#58c882`:`#197a45`},warning:{main:t?`#f0b84d`:`#8a5b00`},error:{main:t?`#ff7b72`:`#b42318`},info:{main:t?`#f2f2f2`:`#171717`}},shape:{borderRadius:0},typography:{fontFamily:`Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif`,h1:{fontSize:24,lineHeight:1.2,fontWeight:600},h2:{fontSize:18,lineHeight:1.3,fontWeight:600},h3:{fontSize:15,lineHeight:1.35,fontWeight:600},button:{fontSize:13,fontWeight:600,textTransform:`none`},body1:{fontSize:14},body2:{fontSize:13}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:n.default,color:r.primary},"::selection":{backgroundColor:t?`#3a3a3a`:`#dededb`}}},MuiPaper:{defaultProps:{elevation:0,square:!0},styleOverrides:{root:{backgroundImage:`none`}}},MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{minHeight:36,borderRadius:0,boxShadow:`none`,paddingInline:14,gap:8}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:0,backgroundColor:n.paper}}},MuiChip:{styleOverrides:{root:{borderRadius:0,height:26,fontSize:12}}},MuiDialog:{styleOverrides:{paper:{borderRadius:0,border:`1px solid ${i}`}}},MuiTooltip:{styleOverrides:{tooltip:{borderRadius:0,backgroundColor:t?`#f2f2f2`:`#171717`,color:t?`#171717`:`#ffffff`,fontSize:12},arrow:{color:t?`#f2f2f2`:`#171717`}}},MuiTab:{styleOverrides:{root:{minHeight:48,textTransform:`none`,fontSize:13}}}}})}var bS=`/assets/icon-CQvH6luI.png`,xS=[{to:`/`,label:`Runs`,icon:zx,end:!0},{to:`/costs`,label:`Costs`,icon:Sx,end:!1},{to:`/docs`,label:`Docs`,icon:mx,end:!1},{to:`/settings`,label:`Settings`,icon:$x,end:!1}];function SS({children:e}){let t=ot(),n=Il(),{mode:r,toggleMode:i}=vS(),{preflight:a}=gS(),o=a&&!a.ready;return(0,V.jsxs)(md,{className:`min-h-screen`,children:[(0,V.jsx)(ju,{position:`sticky`,color:`inherit`,elevation:0,sx:{borderBottom:1,borderColor:`divider`,bgcolor:`background.paper`},children:(0,V.jsx)(Fb,{disableGutters:!0,sx:{minHeight:`52px !important`,px:{xs:2,sm:4}},children:(0,V.jsxs)(md,{sx:{width:`100%`,maxWidth:1280,mx:`auto`,display:`flex`,alignItems:`stretch`,minHeight:52},children:[(0,V.jsxs)(md,{component:On,to:`/`,sx:{display:`flex`,alignItems:`center`,gap:1,pr:3,color:`text.primary`,textDecoration:`none`},children:[(0,V.jsx)(md,{component:`img`,src:bS,alt:``,"aria-hidden":!0,sx:{width:30,height:30,objectFit:`contain`}}),(0,V.jsx)(Qp,{component:`span`,sx:{fontSize:15,fontWeight:650,letterSpacing:`-0.01em`},children:`ProgramSmith`})]}),(0,V.jsx)(md,{component:`nav`,sx:{display:{xs:`none`,sm:`flex`},alignItems:`stretch`},children:xS.map(({to:e,label:t,icon:r,end:i})=>(0,V.jsxs)(kn,{to:e,end:i,style:({isActive:e})=>({display:`flex`,alignItems:`center`,gap:7,padding:`0 14px`,borderBottom:`2px solid ${e?n.palette.primary.main:`transparent`}`,color:e?n.palette.text.primary:n.palette.text.secondary,fontSize:13,fontWeight:e?600:500,textDecoration:`none`}),children:[(0,V.jsx)(r,{size:15}),t]},e))}),(0,V.jsxs)(md,{sx:{ml:`auto`,display:`flex`,alignItems:`center`,gap:2},children:[(0,V.jsx)(qb,{title:`Switch to ${r===`dark`?`light`:`dark`} mode`,children:(0,V.jsxs)(md,{sx:{display:`flex`,alignItems:`center`,gap:.5,color:`text.secondary`},children:[(0,V.jsx)(Vx,{size:14,"aria-hidden":`true`}),(0,V.jsx)(fb,{checked:r===`light`,onChange:i,size:`small`,slotProps:{input:{"aria-label":`Toggle light mode`}}}),(0,V.jsx)(rS,{size:14,"aria-hidden":`true`})]})}),o&&t.pathname!==`/settings`&&(0,V.jsx)(md,{component:On,to:`/settings`,sx:{border:1,borderColor:`warning.main`,color:`warning.main`,px:1.5,py:.75,fontSize:12,fontWeight:600,textDecoration:`none`},children:`Setup incomplete`})]})]})})}),(0,V.jsx)(md,{component:`main`,sx:{maxWidth:1280,mx:`auto`,px:{xs:2,sm:4},pt:4,pb:10},children:e})]})}function CS(e,t,n=[]){let[r,i]=(0,w.useState)(null),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(!1),[l,u]=(0,w.useState)(!0),d=(0,w.useRef)(!0),f=(0,w.useRef)(!1),p=(0,w.useRef)(e);p.current=e;let m=(0,w.useCallback)(async()=>{if(!f.current){f.current=!0,c(!0);try{let e=await p.current();if(!d.current)return;i(e),o(null)}catch(e){if(!d.current)return;o(e instanceof Error?e:Error(String(e)))}finally{f.current=!1,d.current&&(c(!1),u(!1))}}},[]);return(0,w.useEffect)(()=>{d.current=!0;let e=()=>document.visibilityState===`visible`&&document.hasFocus(),n=()=>{e()&&m()};if(n(),t>0){let r=window.setInterval(n,t),i=()=>{e()&&m()},a=()=>void m();return document.addEventListener(`visibilitychange`,i),window.addEventListener(`focus`,a),()=>{d.current=!1,window.clearInterval(r),document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`focus`,a)}}return()=>{d.current=!1}},[t,m,...n]),{data:r,error:a,loading:s,initialLoading:l,refresh:m}}function wS(...e){return U(e)}var TS=[{stage:`INGEST_LOCK`,label:`Ingest & Lock`,type:`gate`,blurb:`Clone, detect license/build, ProgramBench-overlap guard, pin the source SHA.`},{stage:`TASK_MATRIX`,label:`Task Matrix`,type:`cell`,blurb:`Propose candidate tasks and auto-pick the best fit.`},{stage:`ORACLE_GOLDEN`,label:`Oracle & Golden`,type:`cell`,blurb:`Build the sealed oracle pair + docs + Golden-I/O case suite.`},{stage:`CREATE`,label:`Create`,type:`cell`,blurb:`Assemble the ProgramBench-style task via the vendored generator.`},{stage:`SANITY`,label:`Sanity`,type:`gate`,blurb:`Oracle passes, nop fails.`},{stage:`STATIC_CI`,label:`Static CI`,type:`gate`,blurb:`The static check suite must be green.`},{stage:`DIFFICULTY_SWEEP`,label:`Smoke sweep`,type:`sweep`,blurb:`Cheap smoke-model trials — a coarse difficulty read before spending frontier trials.`},{stage:`CALIBRATE`,label:`Calibrate`,type:`decision`,blurb:`Smoke decision — proceed, harden, ease, or flag broken.`},{stage:`QA_PROBE`,label:`QA Probe`,type:`decision`,blurb:`Reward-hack / shortcut detection.`},{stage:`FULL_SWEEP`,label:`Frontier sweep`,type:`sweep`,blurb:`Frontier-model trials — the authoritative 1/3–2/3 difficulty band.`},{stage:`QA_GATE`,label:`Done`,type:`output`,blurb:`Final gate (automatic): accept exports the task; revise/reject loop back.`}],ES={stage:`SYNTHESIZE`,label:`Synthesize`,type:`cell`,blurb:`Surgical-patch cell (harden / ease / revise) — rejoin the forward chain after a fix.`},DS=Object.fromEntries([...TS,ES].map(e=>[e.stage,e])),OS=[{key:`gate`,label:`Code gate`,color:`var(--color-node-gate)`},{key:`cell`,label:`LLM cell`,color:`var(--color-node-cell)`},{key:`sweep`,label:`Sweep`,color:`var(--color-node-sweep)`},{key:`decision`,label:`Decision`,color:`var(--color-node-decision)`},{key:`output`,label:`Output`,color:`var(--color-node-output)`}];function kS(e){return OS.find(t=>t.key===e)?.color??`var(--color-accent)`}function AS(e){return{DONE:`Done`,DROPPED:`Dropped`,BLOCKED:`Blocked`,EASY_SHELF:`Easy shelf`}[e]??DS[e]?.label??e}var jS={neutral:`bg-surface-2 text-ink-2 border-line`,ok:`bg-ok-soft/40 text-ok border-ok/30`,warn:`bg-warn-soft/40 text-warn border-warn/30`,danger:`bg-danger-soft/40 text-danger border-danger/30`,info:`bg-accent-soft/40 text-info border-info/30`,accent:`bg-accent-soft/40 text-accent border-accent/30`,human:`bg-accent-soft/40 text-human border-human/30`};function MS({tone:e=`neutral`,className:t,children:n,...r}){return(0,V.jsx)(Mf,{size:`small`,variant:`outlined`,className:wS(jS[e],t),label:(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:n}),...r})}var NS={in_progress:`info`,draft:`ok`,done:`ok`,accepted:`ok`,dropped:`neutral`,blocked:`danger`,easy:`warn`};function PS({status:e,stage:t,active:n=!1,screenedOut:r=!1}){let i=e.replace(/_/g,` `),a=NS[e]??`neutral`;return r?(i=`screened out`,a=`neutral`):e===`in_progress`&&t?(i=AS(t),a=`info`):e===`done`?(i=`exported`,a=`ok`):e===`draft`?(i=`draft`,a=`ok`):e===`easy`&&(i=`easy shelf`,a=`warn`),(0,V.jsxs)(MS,{tone:a,className:`capitalize`,children:[e===`in_progress`&&n?(0,V.jsx)(sf,{color:`inherit`,size:11}):(0,V.jsx)(`span`,{className:wS(`size-1.5`,e===`in_progress`&&`animate-pulse`),style:{background:`currentColor`}}),i]})}function FS(e,t=10){return e?e.length>t?e.slice(0,t):e:`—`}function IS(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function LS(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return e;let n=Date.now()-t,r=Math.round(n/1e3);if(r<60)return`${r}s ago`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function RS(e){return e==null?`—`:e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}k`:`${(e/1e6).toFixed(1)}M`}function zS(e){if(e==null)return null;let t=Number(e);return!Number.isNaN(t)&&t>=0&&t<=1?t:null}function BS(e){let t=zS(e);return t===null?e??`—`:`${Math.round(t*100)}%`}function VS(e){if(typeof e.progress==`number`)return e.progress;if(e.status===`done`)return 1;let t=TS.findIndex(t=>t.stage===e.stage);return t<0?+!![`dropped`,`blocked`,`easy`].includes(e.status):(t+1)/TS.length}function HS({run:e}){let t=Il(),n=VS(e),r=zS(e.difficulty_pass_at_1),i=e.screened_out?`Source screened out`:e.status===`draft`?`Static CI passed`:AS(e.stage),a=e.screened_out?`No task was created`:e.status===`draft`?`Uncalibrated draft`:e.full_sweep_band?`Frontier ${e.full_sweep_band}`:r===null?`Not calibrated`:`pass@1 ${BS(e.difficulty_pass_at_1)}`,o=e.status===`blocked`?t.palette.error.main:e.status===`done`||e.status===`draft`?t.palette.success.main:`var(--color-node-gate)`;return(0,V.jsxs)(Eu,{component:On,to:`/run/${encodeURIComponent(e.key)}`,variant:`outlined`,square:!0,sx:{display:`block`,p:2,color:`text.primary`,textDecoration:`none`,transition:`border-color 120ms ease, background-color 120ms ease`,"&:hover":{borderColor:`text.secondary`,bgcolor:`action.hover`},"&:focus-visible":{outline:`2px solid ${t.palette.primary.main}`,outlineOffset:1}},children:[(0,V.jsxs)(md,{sx:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:2},children:[(0,V.jsxs)(md,{sx:{minWidth:0},children:[(0,V.jsxs)(md,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,V.jsx)(Qp,{variant:`h3`,noWrap:!0,children:e.slug??e.key}),e.paused&&(0,V.jsx)(Ux,{size:13,color:`#8a5b00`})]}),(0,V.jsxs)(Qp,{variant:`body2`,color:`text.secondary`,sx:{mt:.5,display:`flex`,alignItems:`center`,gap:.75,fontFamily:`monospace`,fontSize:11.5},children:[(0,V.jsx)(Nx,{size:12}),(0,V.jsx)(`span`,{className:`truncate`,children:e.key})]})]}),(0,V.jsx)(PS,{status:e.status,stage:e.stage,active:!!e.active_job||!!e.waiting,screenedOut:!!e.screened_out})]}),(0,V.jsxs)(md,{sx:{mt:2.25},children:[(0,V.jsxs)(md,{sx:{mb:.75,display:`flex`,justifyContent:`space-between`,gap:2},children:[(0,V.jsx)(Qp,{variant:`body2`,color:`text.secondary`,children:i}),(0,V.jsxs)(Qp,{variant:`body2`,color:`text.secondary`,sx:{fontVariantNumeric:`tabular-nums`},children:[Math.round(n*100),`%`]})]}),(0,V.jsx)(Vh,{variant:`determinate`,value:n*100,sx:{height:3,bgcolor:`divider`,"& .MuiLinearProgress-bar":{bgcolor:o}}})]}),(0,V.jsxs)(md,{sx:{mt:2,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:2},children:[(0,V.jsx)(Qp,{variant:`body2`,color:`text.secondary`,children:a}),(e.revise>0||e.harden>0||(e.ease??0)>0)&&(0,V.jsx)(Qp,{variant:`body2`,color:`text.secondary`,sx:{fontSize:11.5},children:e.revise>0?`${e.revise} revise`:e.harden>0?`${e.harden} harden`:`${e.ease} ease`})]})]})}var US=wf((0,V.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`);function WS({open:e,onClose:t,title:n,description:r,children:i,className:a,style:o}){return(0,V.jsxs)(Vp,{open:e,onClose:t,fullWidth:!0,maxWidth:`sm`,slotProps:{paper:{className:wS(a),style:o}},children:[(0,V.jsxs)(tm,{className:`flex items-start justify-between gap-4 border-b border-line px-6 py-5`,children:[(0,V.jsxs)(`span`,{className:`min-w-0`,children:[(0,V.jsx)(Qp,{component:`span`,variant:`h2`,className:`block`,children:n}),r&&(0,V.jsx)(Qp,{component:`span`,variant:`body2`,color:`text.secondary`,className:`mt-1 block`,children:r})]}),(0,V.jsx)(sh,{onClick:t,size:`small`,"aria-label":`Close`,children:(0,V.jsx)(US,{fontSize:`small`})})]}),(0,V.jsx)(qp,{className:`px-6 py-5`,children:i})]})}var GS={primary:{color:`primary`,variant:`contained`},secondary:{color:`inherit`,variant:`outlined`},outline:{color:`inherit`,variant:`outlined`},ghost:{color:`inherit`,variant:`text`},danger:{color:`error`,variant:`outlined`}},KS={sm:`small`,md:`medium`,lg:`large`},qS=(0,w.forwardRef)(({variant:e=`secondary`,size:t=`md`,loading:n,children:r,disabled:i,...a},o)=>(0,V.jsx)(yf,{ref:o,size:KS[t],disabled:i||n,startIcon:n?(0,V.jsx)(sf,{color:`inherit`,size:14}):void 0,...GS[e],...a,children:r}));qS.displayName=`Button`;function JS({label:e,hint:t,htmlFor:n,children:r}){return(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{htmlFor:n,className:`block text-[13px] font-medium text-ink-2`,children:e}),r,t&&(0,V.jsx)(`p`,{className:`text-[12px] leading-snug text-ink-4`,children:t})]})}var YS=(0,w.forwardRef)(({className:e,...t},n)=>(0,V.jsx)(`input`,{ref:n,className:wS(`h-10 w-full rounded-xl border border-line bg-bg-2/60 px-3.5 text-sm text-ink placeholder:text-ink-4 transition-colors focus-ring focus:border-accent/50`,e),...t}));YS.displayName=`Input`;var XS=(0,w.forwardRef)(({className:e,children:t,...n},r)=>(0,V.jsx)(`select`,{ref:r,className:wS(`h-10 w-full appearance-none rounded-xl border border-line bg-bg-2/60 px-3.5 text-sm text-ink transition-colors focus-ring focus:border-accent/50 bg-[length:16px] bg-[right_0.75rem_center] bg-no-repeat pr-9 bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E')]`,e),...n,children:t}));XS.displayName=`Select`;var ZS={anthropic:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.541Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`,openai:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,google:`M12 24A14.304 14.304 0 0 0 0 12 14.304 14.304 0 0 0 12 0a14.305 14.305 0 0 0 12 12 14.305 14.305 0 0 0-12 12`},QS={zai:`GLM`,miniswe:`mS`,terminus:`T2`};function $S(e){return(e||``).split(`/`)[0]||``}var eC={"claude-code":`anthropic`,codex:`openai`,"gemini-cli":`google`,"mini-swe":`miniswe`,"terminus-2":`terminus`};function tC({provider:e,size:t=16,className:n=``}){let r=ZS[e];if(r)return(0,V.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:n,"aria-hidden":!0,children:(0,V.jsx)(`path`,{d:r})});let i=QS[e];return i?(0,V.jsx)(`span`,{className:`inline-flex items-center justify-center rounded-[4px] border border-line bg-surface-2 font-mono font-semibold leading-none text-ink-2 ${n}`,style:{width:t+4,height:t+2,fontSize:t*.52},"aria-hidden":!0,children:i}):(0,V.jsx)(sx,{style:{width:t,height:t},className:n,"aria-hidden":!0})}var nC=e=>JSON.parse(JSON.stringify(e));function rC({open:e,onClose:t,onCreated:n}){let r=lt(),[i,a]=(0,w.useState)(``),[o,s]=(0,w.useState)(``),[c,l]=(0,w.useState)(``),[u,d]=(0,w.useState)(``),[f,p]=(0,w.useState)(`full`),[m,h]=(0,w.useState)(`claude-sonnet-5`),[g,_]=(0,w.useState)(!1),[v,y]=(0,w.useState)(null),[b,x]=(0,w.useState)(null),[S,C]=(0,w.useState)(null),[T,E]=(0,w.useState)(typeof window<`u`&&window.location.hash.includes(`adv`)),[D,O]=(0,w.useState)({}),[k,A]=(0,w.useState)(``);(0,w.useEffect)(()=>{e&&(pS.catalog().then(e=>{x(e),C(t=>t??nC(e.default_config))}),pS.listPresets().then(e=>O(e.presets)).catch(()=>{}))},[e]);function j(){a(``),s(``),l(``),d(``),p(`full`),h(`claude-sonnet-5`),y(null),_(!1),A(``),b&&C(nC(b.default_config))}function M(){j(),t()}async function N(){if(!i.trim()){y(`A source repository is required.`);return}_(!0),y(null);try{let e=await pS.createRun({repo:i.trim(),sha:o.trim()||void 0,slug:c.trim()||void 0,brief:u.trim()||void 0,config:S??void 0,mode:f,cell_model:m});n(),j(),t(),r(`/run/${encodeURIComponent(e.key)}`)}catch(e){e instanceof dS&&e.status===409?y(`A run with that name already exists. Choose a different name.`):y(e instanceof Error?e.message:String(e)),_(!1)}}async function P(){if(!(!k.trim()||!S))try{O((await pS.savePreset(k.trim(),S)).presets),A(``)}catch(e){y(e instanceof Error?e.message:String(e))}}return(0,V.jsx)(WS,{open:e,onClose:M,title:`New run`,style:{maxWidth:T?`62rem`:`34rem`,transition:`max-width 260ms cubic-bezier(0.4, 0, 0.2, 1)`},children:(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsx)(JS,{label:`Source repository`,htmlFor:`repo`,hint:`owner/name or a full GitHub URL.`,children:(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(Px,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-ink-4`}),(0,V.jsx)(YS,{id:`repo`,className:`pl-9`,autoFocus:!0,placeholder:`devkit/minpack`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===`Enter`&&!T&&void N()})]})}),(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(JS,{label:`Pinned SHA`,htmlFor:`sha`,hint:`Resolves HEAD if blank.`,children:(0,V.jsx)(YS,{id:`sha`,className:`font-mono`,placeholder:`(optional)`,value:o,onChange:e=>s(e.target.value)})}),(0,V.jsx)(JS,{label:`Run name`,htmlFor:`slug`,hint:`Defaults to the repo name.`,children:(0,V.jsx)(YS,{id:`slug`,placeholder:`(optional)`,value:c,onChange:e=>l(e.target.value)})})]}),(0,V.jsx)(JS,{label:`Task brief (optional)`,htmlFor:`brief`,children:(0,V.jsx)(`textarea`,{id:`brief`,rows:3,placeholder:`e.g. Scope the flag surface to the core subcommands; skip the network-dependent modes; prefer stdin-driven cases.`,value:u,onChange:e=>d(e.target.value),className:`w-full resize-y rounded-xl border border-line bg-bg-2/60 px-3.5 py-2.5 text-sm text-ink placeholder:text-ink-4 transition-colors focus-ring focus:border-accent/50`})}),(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(JS,{label:`Pipeline mode`,htmlFor:`pipeline_mode`,hint:`Draft exports immediately after Static CI.`,children:(0,V.jsxs)(XS,{id:`pipeline_mode`,value:f,onChange:e=>p(e.target.value),children:[(0,V.jsx)(`option`,{value:`full`,children:`Full — calibrate and evaluate`}),(0,V.jsx)(`option`,{value:`draft`,children:`Draft — stop after Static CI`})]})}),(0,V.jsx)(JS,{label:`Task-generation model`,htmlFor:`cell_model`,children:(0,V.jsxs)(XS,{id:`cell_model`,value:m,onChange:e=>h(e.target.value),children:[(0,V.jsx)(`option`,{value:`claude-sonnet-5`,children:`Sonnet 5`}),(0,V.jsx)(`option`,{value:`claude-opus-4-8`,children:`Opus 4.8`}),(0,V.jsx)(`option`,{value:`claude-sonnet-4-6`,children:`Sonnet 4.6`})]})})]}),(0,V.jsxs)(`div`,{className:`rounded-xl border border-line`,children:[(0,V.jsx)(`button`,{onClick:()=>E(e=>!e),className:`focus-ring flex w-full items-center justify-between gap-2 rounded-xl px-4 py-3 text-left`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] font-medium text-ink-2`,children:[(0,V.jsx)(vx,{className:`size-4 text-ink-4 transition-transform duration-200 ${T?`rotate-90`:``}`}),`Advanced options`]})}),(0,V.jsx)(zf,{in:T,timeout:260,unmountOnExit:!0,children:b&&S&&(0,V.jsxs)(`div`,{className:`space-y-5 border-t border-line p-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,V.jsx)(JS,{label:`Preset`,htmlFor:`preset`,children:(0,V.jsxs)(XS,{id:`preset`,value:``,onChange:e=>{let t=D[e.target.value];t&&C(nC(t))},children:[(0,V.jsx)(`option`,{value:``,children:`Load preset…`}),Object.keys(D).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(YS,{placeholder:`Save as…`,value:k,className:`w-36`,onChange:e=>A(e.target.value)}),(0,V.jsxs)(qS,{variant:`secondary`,onClick:()=>void P(),disabled:!k.trim(),children:[(0,V.jsx)(Xx,{className:`size-3.5`}),`Save`]})]})]}),(0,V.jsx)(iC,{title:`Smoke sweep`,hint:`Default: smoke model ×3, band 0–90% — with k=3 only 3/3 saturates.`,catalog:b,stage:S.difficulty,onChange:e=>C({...S,difficulty:e})}),(0,V.jsx)(iC,{title:`Frontier sweep`,hint:`Default: frontier model ×3, band 30–70% — the 1/3–2/3 target window.`,catalog:b,stage:S.full,onChange:e=>C({...S,full:e})})]})})]}),v&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,children:v}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2.5 pt-1`,children:[(0,V.jsx)(qS,{variant:`ghost`,onClick:M,children:`Cancel`}),(0,V.jsxs)(qS,{variant:`primary`,onClick:()=>void N(),loading:g,children:[(0,V.jsx)(ox,{className:`size-4`}),`Create run`]})]})]})})}function iC({title:e,hint:t,catalog:n,stage:r,onChange:i}){let a=Object.keys(n.harnesses),o=Object.keys(n.models),s=(e,t)=>i({...r,agents:r.agents.map((n,r)=>r===e?{...n,...t}:n)}),c=()=>i({...r,agents:[...r.agents,{harness:a[0],model:o[0],n_trials:3}]}),l=e=>i({...r,agents:r.agents.filter((t,n)=>n!==e)}),u=[`aggregate`,...Array.from(new Set(r.agents.map(e=>e.harness)))].includes(r.band.basis)?r.band.basis:`aggregate`,d=u===`aggregate`?Math.max(0,...r.agents.map(e=>e.n_trials)):r.agents.find(e=>e.harness===u)?.n_trials??0,f=e=>Math.round(e*100),p=r.band.combinator??`aggregate`,m=r.band.per_model??[],h=Array.from(new Set(r.agents.map(e=>e.harness))),g=h.length>0?h:a,_=e=>i({...r,band:{...r.band,...e}}),v=(e,t)=>_({per_model:m.map((n,r)=>r===e?{...n,...t}:n)}),y=()=>_({per_model:[...m,{basis:g[0],min_pass:0,max_pass:.7}]}),b=e=>_({per_model:m.filter((t,n)=>n!==e)});return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h4`,{className:`text-[13px] font-semibold text-ink`,children:e}),t&&(0,V.jsx)(`p`,{className:`mt-0.5 text-[11.5px] leading-snug text-ink-4`,children:t})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[r.agents.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-bg-2/40 px-2 py-1`,children:[(0,V.jsx)(tC,{provider:n.harnesses[e.harness]?.provider??``,className:`shrink-0 text-ink-3`}),(0,V.jsx)(XS,{value:e.harness,onChange:e=>s(t,{harness:e.target.value}),className:`h-8 border-0 bg-transparent px-1 text-[12.5px]`,children:a.map(e=>(0,V.jsxs)(`option`,{value:e,children:[n.harnesses[e].label,n.harnesses[e].recommended===!1?` — not recommended`:``]},e))})]}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-bg-2/40 px-2 py-1`,children:[(0,V.jsx)(tC,{provider:n.models[e.model]?.provider??``,className:`shrink-0 text-ink-3`}),(0,V.jsx)(XS,{value:e.model,onChange:e=>s(t,{model:e.target.value}),className:`h-8 border-0 bg-transparent px-1 text-[12.5px]`,children:o.map(e=>(0,V.jsx)(`option`,{value:e,children:n.models[e].label},e))})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(YS,{type:`number`,min:1,max:50,value:e.n_trials,onChange:e=>s(t,{n_trials:Math.max(1,Number(e.target.value)||1)}),className:`h-9 w-14 text-center`,title:`trials (k in pass@k)`}),(0,V.jsx)(`span`,{className:`text-[11px] text-ink-4`,children:`×`})]}),(0,V.jsx)(`button`,{onClick:()=>l(t),disabled:r.agents.length<=1,className:`focus-ring rounded-md p-1.5 text-ink-4 transition-colors hover:bg-surface-2 hover:text-danger disabled:opacity-30`,title:`Remove agent`,children:(0,V.jsx)(sS,{className:`size-3.5`})})]},t)),(0,V.jsxs)(`button`,{onClick:c,className:`focus-ring inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[12.5px] font-medium text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,children:[(0,V.jsx)(Kx,{className:`size-3.5`}),`Add agent`]})]}),(0,V.jsxs)(`div`,{className:`space-y-2.5 rounded-lg border border-line bg-bg-2/30 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-4 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{className:`block text-[11px] font-medium uppercase tracking-[0.06em] text-ink-4`,children:`Acceptance`}),(0,V.jsxs)(XS,{value:p,onChange:e=>_({combinator:e.target.value}),className:`h-8 w-52 text-[12.5px]`,children:[(0,V.jsx)(`option`,{value:`aggregate`,children:`Aggregate (best model)`}),(0,V.jsx)(`option`,{value:`any`,children:`Any model hard (sellable)`}),(0,V.jsx)(`option`,{value:`all`,children:`All models hard`})]})]}),p===`aggregate`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{className:`block text-[11px] font-medium uppercase tracking-[0.06em] text-ink-4`,children:`Band basis`}),(0,V.jsxs)(XS,{value:u,onChange:e=>_({basis:e.target.value}),className:`h-8 w-40 text-[12.5px]`,children:[(0,V.jsx)(`option`,{value:`aggregate`,children:`Aggregate (best agent)`}),Array.from(new Set(r.agents.map(e=>e.harness))).map(e=>(0,V.jsx)(`option`,{value:e,children:n.harnesses[e]?.label??e},e))]})]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`label`,{className:`block text-[11px] font-medium uppercase tracking-[0.06em] text-ink-4`,children:[`Target pass@`,d||`k`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12.5px]`,children:[(0,V.jsx)(YS,{type:`number`,min:0,max:100,value:f(r.band.min_pass),onChange:e=>_({min_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`–`}),(0,V.jsx)(YS,{type:`number`,min:0,max:100,value:f(r.band.max_pass),onChange:e=>_({max_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`%`})]})]})]})]}),(p===`any`||p===`all`)&&(0,V.jsxs)(`div`,{className:`space-y-2 border-t border-line pt-2.5`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[m.length===0&&(0,V.jsx)(`p`,{className:`text-[11.5px] text-ink-4`,children:`No models yet — add one to define per-model bands.`}),m.map((e,t)=>{let i=r.agents.find(t=>t.harness===e.basis)?.n_trials??0;return(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-bg-2/40 px-2 py-1`,children:[(0,V.jsx)(tC,{provider:n.harnesses[e.basis]?.provider??``,className:`shrink-0 text-ink-3`}),(0,V.jsx)(XS,{value:e.basis,onChange:e=>v(t,{basis:e.target.value}),className:`h-8 border-0 bg-transparent px-1 text-[12.5px]`,children:g.map(e=>(0,V.jsx)(`option`,{value:e,children:n.harnesses[e]?.label??e},e))})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12.5px]`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] text-ink-4`,children:[`pass@`,i||`k`]}),(0,V.jsx)(YS,{type:`number`,min:0,max:100,step:5,value:f(e.min_pass),onChange:e=>v(t,{min_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`–`}),(0,V.jsx)(YS,{type:`number`,min:0,max:100,step:5,value:f(e.max_pass),onChange:e=>v(t,{max_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`%`})]}),(0,V.jsx)(`button`,{onClick:()=>b(t),className:`focus-ring rounded-md p-1.5 text-ink-4 transition-colors hover:bg-surface-2 hover:text-danger`,title:`Remove model`,children:(0,V.jsx)(sS,{className:`size-3.5`})})]},t)})]}),(0,V.jsxs)(`button`,{onClick:y,className:`focus-ring inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[12.5px] font-medium text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,children:[(0,V.jsx)(Kx,{className:`size-3.5`}),`Add model`]}),(0,V.jsx)(`p`,{className:`text-[11.5px] leading-snug text-ink-4`,children:p===`any`?`any = keep if at least one model finds it hard (its pass ≤ its max).`:`all = keep only if every listed model finds it hard.`})]})]})]})}function aC({className:e}){return(0,V.jsx)($y,{animation:`wave`,className:e,variant:`rectangular`})}function oC({className:e,hover:t,...n}){return(0,V.jsx)(Eu,{component:`div`,square:!0,variant:`outlined`,className:wS(t&&`glass-hover`,e),...n})}function sC({className:e,...t}){return(0,V.jsx)(md,{component:`div`,className:wS(`flex items-center justify-between gap-3 border-b border-line px-5 py-4`,e),...t})}function cC({className:e,...t}){return(0,V.jsx)(md,{component:`h3`,className:wS(`m-0 flex items-center gap-2 text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-3`,e),...t})}function lC({className:e,...t}){return(0,V.jsx)(md,{component:`div`,className:wS(`p-5`,e),...t})}function uC({icon:e,title:t,body:n,action:r}){return(0,V.jsxs)(oC,{className:`flex flex-col items-center justify-center px-6 py-16 text-center`,children:[e&&(0,V.jsx)(`div`,{className:`mb-4 flex size-14 items-center justify-center rounded-2xl bg-surface-2 text-ink-3`,children:e}),(0,V.jsx)(`h3`,{className:`text-lg font-semibold text-ink`,children:t}),n&&(0,V.jsx)(`p`,{className:`mt-2 max-w-sm text-sm text-ink-3`,children:n}),r&&(0,V.jsx)(`div`,{className:`mt-6`,children:r})]})}function dC({title:e=`Something went wrong`,message:t,action:n}){return(0,V.jsxs)(oC,{className:`flex flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-danger-soft/40 text-danger`,children:(0,V.jsx)(cx,{className:`size-6`})}),(0,V.jsx)(`h3`,{className:`text-base font-semibold text-ink`,children:e}),t&&(0,V.jsx)(`p`,{className:`mt-2 max-w-md text-sm text-ink-3`,children:t}),n&&(0,V.jsx)(`div`,{className:`mt-5`,children:n})]})}function fC(e){return e.screened_out?`screened_out`:e.source_admitted?e.paused?`paused`:e.awaiting_human?`human`:e.status===`draft`?`draft`:e.status===`done`?`accepted`:e.status===`easy`?`easy`:e.status===`dropped`?`dropped`:e.waiting?`waiting`:e.blocked||e.status===`blocked`?`blocked`:`in_progress`:`screening`}var pC=[{key:`tasks`,label:`Tasks`},{key:`outputs`,label:`Outputs`},{key:`all`,label:`All`},{key:`in_progress`,label:`In progress`},{key:`draft`,label:`Drafts`},{key:`waiting`,label:`Waiting`},{key:`human`,label:`Needs review`},{key:`blocked`,label:`Blocked`},{key:`accepted`,label:`Exported`},{key:`easy`,label:`Easy shelf`},{key:`screening`,label:`Source screening`},{key:`screened_out`,label:`Rejected sources`},{key:`dropped`,label:`Dropped`},{key:`paused`,label:`Paused`}];function mC(){let[e,t]=(0,w.useState)(typeof window<`u`&&window.location.hash.startsWith(`#new`)),{data:n,error:r,initialLoading:i,refresh:a}=CS(()=>pS.listRuns(),4e3),o=n?.runs??[],[s,c]=(0,w.useState)(`tasks`),[l,u]=(0,w.useState)(``),d=(0,w.useMemo)(()=>{let e={};for(let t of o){let n=fC(t);e[n]=(e[n]??0)+1}return e},[o]),f=(0,w.useMemo)(()=>{let e=l.trim().toLowerCase();return o.filter(t=>(s===`all`||(s===`tasks`?!!t.source_admitted:s===`outputs`?t.status===`draft`||t.status===`done`:fC(t)===s))&&(!e||(t.slug??``).toLowerCase().includes(e)||t.key.toLowerCase().includes(e)))},[o,s,l]);return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,V.jsx)(Qp,{variant:`h1`,children:`Runs`}),(0,V.jsxs)(qS,{variant:`primary`,onClick:()=>t(!0),children:[(0,V.jsx)(Kx,{size:16}),`New run`]})]}),r&&!n?(0,V.jsx)(dC,{title:`Couldn't load runs`,message:r.message,action:(0,V.jsx)(qS,{onClick:()=>void a(),children:`Retry`})}):i?(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[0,1,2,3,4,5].map(e=>(0,V.jsx)(aC,{className:`h-[150px] w-full`},e))}):o.length===0?(0,V.jsx)(uC,{title:`No runs`,body:`Create a run to source and verify a new task.`,action:(0,V.jsxs)(qS,{variant:`primary`,onClick:()=>t(!0),children:[(0,V.jsx)(Kx,{size:16}),`New run`]})}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(jb,{exclusive:!0,size:`small`,value:s,onChange:(e,t)=>t&&c(t),"aria-label":`Run status`,sx:{flexWrap:`wrap`,gap:`1px`,"& .MuiToggleButtonGroup-grouped":{border:`1px solid`,borderColor:`divider`}},children:pC.filter(e=>e.key===`tasks`||e.key===`outputs`||e.key===`all`||(d[e.key]??0)>0).map(e=>(0,V.jsxs)(Tb,{value:e.key,sx:{px:1.25,py:.5,textTransform:`none`,fontSize:12},children:[e.label,`\xA0`,e.key===`all`?o.length:e.key===`tasks`?n?.counters.admitted??0:e.key===`outputs`?n?.counters.exported??0:d[e.key]??0]},e.key))}),(0,V.jsx)(_b,{value:l,onChange:e=>u(e.target.value),placeholder:`Search`,size:`small`,sx:{width:190,ml:{sm:`auto`}},slotProps:{input:{startAdornment:(0,V.jsx)(Sh,{position:`start`,children:(0,V.jsx)(Qx,{size:15})})}}})]}),f.length===0?(0,V.jsx)(`div`,{className:`border border-line bg-surface px-4 py-8 text-center text-[13px] text-ink-3`,children:`No matching runs.`}):(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:f.map(e=>(0,V.jsx)(HS,{run:e},e.key))})]}),(0,V.jsx)(rC,{open:e,onClose:()=>t(!1),onCreated:()=>void a()})]})}function hC({content:e,children:t,side:n=`top`,className:r}){return e?(0,V.jsx)(qb,{title:e,placement:n,arrow:!0,children:(0,V.jsx)(`span`,{className:r??`inline-flex`,children:t})}):(0,V.jsx)(V.Fragment,{children:t})}var gC=(0,w.createContext)({});function _C(e){let t=(0,w.useRef)(null);return t.current===null&&(t.current=e()),t.current}var vC=typeof window<`u`?w.useLayoutEffect:w.useEffect,yC=(0,w.createContext)(null);function bC(e,t){e.indexOf(t)===-1&&e.push(t)}function xC(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var SC=(e,t,n)=>n>t?t:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),TC=e=>typeof e==`object`&&!!e,EC=e=>/^0[^.\s]+$/u.test(e);function DC(e){let t;return()=>(t===void 0&&(t=e()),t)}var OC=e=>e,kC=(...e)=>e.reduce((e,t)=>n=>t(e(n))),AC=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},jC=class{constructor(){this.subscriptions=[]}add(e){return bC(this.subscriptions,e),()=>xC(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;ie*1e3,NC=e=>e/1e3,PC=(e,t)=>t?1e3/t*e:0,FC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,IC=1e-7,LC=12;function RC(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=FC(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>IC&&++sRC(t,0,1,e,n);return e=>e===0||e===1?e:FC(i(e),t,r)}var BC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,VC=e=>t=>1-e(1-t),HC=zC(.33,1.53,.69,.99),UC=VC(HC),WC=BC(UC),GC=e=>e>=1?1:(e*=2)<1?.5*UC(e):.5*(2-2**(-10*(e-1))),KC=e=>1-Math.sin(Math.acos(e)),qC=VC(KC),JC=BC(KC),YC=zC(.42,0,1,1),XC=zC(0,0,.58,1),ZC=zC(.42,0,.58,1),QC=e=>Array.isArray(e)&&typeof e[0]==`number`,$C=e=>Array.isArray(e)&&typeof e[0]!=`number`,ew={linear:OC,easeIn:YC,easeInOut:ZC,easeOut:XC,circIn:KC,circInOut:JC,circOut:qC,backIn:UC,backInOut:WC,backOut:HC,anticipate:GC},tw=e=>typeof e==`string`,nw=e=>{if(QC(e)){e.length;let[t,n,r,i]=e;return zC(t,n,r,i)}else if(tw(e))return ew[e],`${e}`,ew[e];return e},rw=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function iw(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var aw=40;function ow(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=rw.reduce((e,t)=>(e[t]=iw(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=CC.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,aw),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:rw.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t(dw===void 0&&pw.set(lw.isProcessing||CC.useManualTiming?lw.timestamp:performance.now()),dw),set:e=>{dw=e,queueMicrotask(fw)}},mw=e=>t=>typeof t==`string`&&t.startsWith(e),hw=mw(`--`),gw=mw(`var(--`),_w=e=>gw(e)?vw.test(e.split(`/*`)[0].trim()):!1,vw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yw(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var bw={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},xw={...bw,transform:e=>SC(0,1,e)},Sw={...bw,default:1},Cw=e=>Math.round(e*1e5)/1e5,ww=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Tw(e){return e==null}var Ew=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dw=(e,t)=>n=>!!(typeof n==`string`&&Ew.test(n)&&n.startsWith(e)||t&&!Tw(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ow=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ww);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},kw=e=>SC(0,255,e),Aw={...bw,transform:e=>Math.round(kw(e))},jw={test:Dw(`rgb`,`red`),parse:Ow(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Aw.transform(e)+`, `+Aw.transform(t)+`, `+Aw.transform(n)+`, `+Cw(xw.transform(r))+`)`};function Mw(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Nw={test:Dw(`#`),parse:Mw,transform:jw.transform},Pw=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fw=Pw(`deg`),Iw=Pw(`%`),$=Pw(`px`),Lw=Pw(`vh`),Rw=Pw(`vw`),zw={...Iw,parse:e=>Iw.parse(e)/100,transform:e=>Iw.transform(e*100)},Bw={test:Dw(`hsl`,`hue`),parse:Ow(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Iw.transform(Cw(t))+`, `+Iw.transform(Cw(n))+`, `+Cw(xw.transform(r))+`)`},Vw={test:e=>jw.test(e)||Nw.test(e)||Bw.test(e),parse:e=>jw.test(e)?jw.parse(e):Bw.test(e)?Bw.parse(e):Nw.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?jw.transform(e):Bw.transform(e),getAnimatableNone:e=>{let t=Vw.parse(e);return t.alpha=0,Vw.transform(t)}},Hw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Uw(e){return isNaN(e)&&typeof e==`string`&&(e.match(ww)?.length||0)+(e.match(Hw)?.length||0)>0}var Ww=`number`,Gw=`color`,Kw=`var`,qw=`var(`,Jw="${}",Yw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Xw(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Yw,e=>(Vw.test(e)?(r.color.push(a),i.push(Gw),n.push(Vw.parse(e))):e.startsWith(qw)?(r.var.push(a),i.push(Kw),n.push(e)):(r.number.push(a),i.push(Ww),n.push(parseFloat(e))),++a,Jw)).split(Jw),indexes:r,types:i}}function Zw(e){return Xw(e).values}function Qw({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;atypeof e==`number`?0:Vw.test(e)?Vw.getAnimatableNone(e):e,tT=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:eT(e);function nT(e){let t=Xw(e);return Qw(t)(t.values.map((e,n)=>tT(e,t.split[n])))}var rT={test:Uw,parse:Zw,createTransformer:$w,getAnimatableNone:nT};function iT(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function aT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=iT(s,r,e+1/3),a=iT(s,r,e),o=iT(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function oT(e,t){return n=>n>0?t:e}var sT=(e,t,n)=>e+(t-e)*n,cT=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},lT=[Nw,jw,Bw],uT=e=>lT.find(t=>t.test(e));function dT(e){let t=uT(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Bw&&(n=aT(n)),n}var fT=(e,t)=>{let n=dT(e),r=dT(t);if(!n||!r)return oT(e,t);let i={...n};return e=>(i.red=cT(n.red,r.red,e),i.green=cT(n.green,r.green,e),i.blue=cT(n.blue,r.blue,e),i.alpha=sT(n.alpha,r.alpha,e),jw.transform(i))},pT=new Set([`none`,`hidden`]);function mT(e,t){return pT.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function hT(e,t){return n=>sT(e,t,n)}function gT(e){return typeof e==`number`?hT:typeof e==`string`?_w(e)?oT:Vw.test(e)?fT:bT:Array.isArray(e)?_T:typeof e==`object`?Vw.test(e)?fT:vT:oT}function _T(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>gT(e)(e,t[n]));return e=>{for(let t=0;t{for(let t in r)n[t]=r[t](e);return n}}function yT(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i{let n=rT.createTransformer(t),r=Xw(e),i=Xw(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pT.has(e)&&!i.values.length||pT.has(t)&&!r.values.length?mT(e,t):kC(_T(yT(r,i),i.values),n):(`${e}${t}`,oT(e,t))};function xT(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?sT(e,t,n):gT(e)(e,t)}var ST=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>sw.update(t,e),stop:()=>cw(t),now:()=>lw.isProcessing?lw.timestamp:pw.now()}},CT=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t=2e4?1/0:t}function ET(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(TT(r),wT);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:NC(i)}}var DT={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function OT(e,t){return e*Math.sqrt(1-t*t)}var kT=12;function AT(e,t,n){let r=n;for(let n=1;n{let r=t*o,i=r*e,a=r-n,s=OT(t,o),c=Math.exp(-i);return jT-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=OT(t**2,o);return(-i(t)+jT>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=AT(i,a,s);if(e=MC(e),isNaN(c))return{stiffness:DT.stiffness,damping:DT.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var NT=[`duration`,`bounce`],PT=[`stiffness`,`damping`,`mass`];function FT(e,t){return t.some(t=>e[t]!==void 0)}function IT(e){let t={velocity:DT.velocity,stiffness:DT.stiffness,damping:DT.damping,mass:DT.mass,isResolvedFromDuration:!1,...e};if(!FT(e,PT)&&FT(e,NT))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*SC(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:DT.mass,stiffness:i,damping:a}}else{let n=MT({...e,velocity:0});t={...t,...n,mass:DT.mass},t.isResolvedFromDuration=!0}return t}function LT(e=DT.visualDuration,t=DT.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=IT({...n,velocity:-NC(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=NC(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?DT.restSpeed.granular:DT.restSpeed.default,i||=v?DT.restDelta.granular:DT.restDelta.default;let y,b,x,S,C,w;if(h<1)x=OT(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>MC(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=MC(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=MC(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(TT(T),wT),t=CT(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}LT.applyToOptions=e=>{let t=ET(e,100,LT);return e.ease=t.ease,e.duration=MC(t.duration),e.type=`keyframes`,e};var RT=5;function zT(e,t,n){let r=Math.max(t-RT,0);return PC(n-e(r),t-r)}function BT({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&ec,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=LT({keyframes:[f.value,m(f.value)],velocity:zT(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function VT(e,t,n){let r=[],i=n||CC.mix||xT,a=e.length-1;for(let n=0;nt[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=VT(t,r,i),c=s.length,l=n=>{if(o&&n1)for(;rl(SC(e[0],e[a-1],t)):l}function UT(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=AC(0,t,r);e.push(sT(n,1,i))}}function WT(e){let t=[0];return UT(t,e.length-1),t}function GT(e,t){return e.map(e=>e*t)}function KT(e,t){return e.map(()=>t||ZC).splice(0,e.length-1)}function qT({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=$C(r)?r.map(nw):nw(r),a={done:!1,value:t[0]},o=HT(GT(n&&n.length===t.length?n:WT(t),e),t,{ease:Array.isArray(i)?i:KT(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var JT=e=>e!==null;function YT(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(JT),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var XT={decay:BT,inertia:BT,tween:qT,keyframes:qT,spring:LT};function ZT(e){typeof e.type==`string`&&(e.type=XT[e.type])}var QT=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},$T=e=>e/100,eE=class extends QT{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==pw.now()&&this.tick(pw.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;ZT(e);let{type:t=qT,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||qT;s!==qT&&typeof o[0]!=`number`&&(this.mixKeyframes=kC($T,xT(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=TT(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=SC(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==BT&&(b.value=YT(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return NC(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+NC(e)}get time(){return NC(this.currentTime)}set time(e){e=MC(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return zT(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(pw.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=NC(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=ST,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(pw.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function tE(e){for(let t=1;te*180/Math.PI,rE=e=>aE(nE(Math.atan2(e[1],e[0]))),iE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:rE,rotateZ:rE,skewX:e=>nE(Math.atan(e[1])),skewY:e=>nE(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},aE=e=>(e%=360,e<0&&(e+=360),e),oE=rE,sE=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),cE=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),lE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:sE,scaleY:cE,scale:e=>(sE(e)+cE(e))/2,rotateX:e=>aE(nE(Math.atan2(e[6],e[5]))),rotateY:e=>aE(nE(Math.atan2(-e[2],e[0]))),rotateZ:oE,rotate:oE,skewX:e=>nE(Math.atan(e[4])),skewY:e=>nE(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function uE(e){return+!!e.includes(`scale`)}function dE(e,t){if(!e||e===`none`)return uE(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=lE,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=iE,i=t}if(!i)return uE(t);let a=r[t],o=i[1].split(`,`).map(pE);return typeof a==`function`?a(o):o[a]}var fE=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return dE(n,t)};function pE(e){return parseFloat(e.trim())}var mE=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],hE=new Set([...mE,`pathRotation`]),gE=e=>e===bw||e===$,_E=new Set([`x`,`y`,`z`]),vE=mE.filter(e=>!_E.has(e));function yE(e){let t=[];return vE.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var bE={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>dE(t,`x`),y:(e,{transform:t})=>dE(t,`y`)};bE.translateX=bE.x,bE.translateY=bE.y;var xE=new Set,SE=!1,CE=!1,wE=!1;function TE(){if(CE){let e=Array.from(xE).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=yE(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}CE=!1,SE=!1,xE.forEach(e=>e.complete(wE)),xE.clear()}function EE(){xE.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(CE=!0)})}function DE(){wE=!0,EE(),TE(),wE=!1}var OE=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(xE.add(this),SE||(SE=!0,sw.read(EE),sw.resolveKeyframes(TE))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}tE(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),xE.delete(this)}cancel(){this.state===`scheduled`&&(xE.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},kE=e=>e.startsWith(`--`);function AE(e,t,n){kE(t)?e.style.setProperty(t,n):e.style[t]=n}var jE={};function ME(e,t){let n=DC(e);return()=>jE[t]??n()}var NE=ME(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),PE=ME(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),FE=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,IE={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:FE([0,.65,.55,1]),circOut:FE([.55,0,1,.45]),backIn:FE([.31,.01,.66,-.59]),backOut:FE([.33,1.53,.69,.99])};function LE(e,t){if(e)return typeof e==`function`?PE()?CT(e,t):`ease-out`:QC(e)?FE(e):Array.isArray(e)?e.map(e=>LE(e,t)||IE.easeOut):IE[e]}function RE(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=LE(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function zE(e){return typeof e==`function`&&`applyToOptions`in e}function BE({type:e,...t}){return zE(e)&&PE()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var VE=class extends QT{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=BE(e);this.animation=RE(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=YT(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),AE(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return NC(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+NC(e)}get time(){return NC(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=MC(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&NE()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),OC):r(this)}},HE={anticipate:GC,backInOut:WC,circInOut:JC};function UE(e){return e in HE}function WE(e){typeof e.ease==`string`&&UE(e.ease)&&(e.ease=HE[e.ease])}var GE=10,KE=class extends VE{constructor(e){WE(e),ZT(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new eE({...a,autoplay:!1}),s=Math.max(GE,pw.now()-this.startTime),c=SC(0,GE,s-GE),l=o.sample(s).value,{name:u}=this.options;i&&u&&AE(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},qE=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(rT.test(e)||e===`0`)&&!e.startsWith(`url(`));function JE(e){let t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,`animate`));function nD(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return tD()&&n&&(ZE.has(n)||eD.has(n)&&$E(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var rD=40,iD=class extends QT{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pw.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||OE;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=pw.now();let u=!0;YE(e,i,a,o)||(u=!1,(CC.instantAnimations||!s)&&l?.(YT(e,n,t)),e[0]=e[e.length-1],XE(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>rD?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&nD(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new KE({...d,element:p})}catch{m=new eE(d)}else m=new eE(d);m.finished.then(()=>{this.notifyFinished()}).catch(OC),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),DE()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function aD(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function oD(e,t){let n=e?.[t]??e?.default??e;return n===e?n:aD(n,e)}var sD={type:`spring`,stiffness:500,damping:25,restSpeed:10},cD=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lD={type:`keyframes`,duration:.8},uD={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},dD=(e,{keyframes:t})=>t.length>2?lD:hE.has(e)?e.startsWith(`scale`)?cD(t[1]):sD:uD,fD=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function pD(e){for(let t in e)if(!fD.has(t))return!0;return!1}var mD=(e,t,n,r={},i,a)=>o=>{let s=oD(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=MC(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};pD(s)||Object.assign(u,dD(e,u)),u.duration&&=MC(u.duration),u.repeatDelay&&=MC(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(XE(u),u.delay===0&&(d=!0)),(CC.instantAnimations||CC.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,XE(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=YT(u.keyframes,s);if(e!==void 0){sw.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new eE(u):new iD(u)};function hD(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var gD=`data-`+hD(`framerAppearId`),{schedule:_D,cancel:vD}=ow(queueMicrotask,!1),yD={x:!1,y:!1};function bD(){return yD.x||yD.y}function xD(e){return e===`x`||e===`y`?yD[e]?null:(yD[e]=!0,()=>{yD[e]=!1}):yD.x||yD.y?null:(yD.x=yD.y=!0,()=>{yD.x=yD.y=!1})}function SD(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function CD(e,t){let n=SD(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function wD(e){return!(e.pointerType===`touch`||bD())}function TD(e,t,n={}){let[r,i,a]=CD(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!wD(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}function ED(e){return TC(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var DD=(e,t)=>t?e===t?!0:DD(e,t.parentElement):!1,OD=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,kD=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function AD(e){return kD.has(e.tagName)||e.isContentEditable===!0}var jD=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function MD(e){return jD.has(e.tagName)||e.isContentEditable===!0}var ND=new WeakSet;function PD(e){return t=>{t.key===`Enter`&&e(t)}}function FD(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ID=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=PD(()=>{if(ND.has(n))return;FD(n,`down`);let e=PD(()=>{FD(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>FD(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function LD(e){return OD(e)&&!bD()}var RD=new WeakSet;function zD(e,t,n={}){let[r,i,a]=CD(e,n),o=e=>{let r=e.currentTarget;if(!LD(e)||RD.has(e))return;ND.add(r),n.stopPropagation&&RD.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ND.has(r)&&ND.delete(r),LD(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||DD(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ED(e)&&(e.addEventListener(`focus`,e=>ID(e,i)),!AD(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function BD(e){return TC(e)&&`ownerSVGElement`in e}var VD=new WeakMap,HD,UD=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:BD(r)&&`getBBox`in r?r.getBBox()[t]:r[n],WD=UD(`inline`,`width`,`offsetWidth`),GD=UD(`block`,`height`,`offsetHeight`);function KD({target:e,borderBoxSize:t}){VD.get(e)?.forEach(n=>{n(e,{get width(){return WD(e,t)},get height(){return GD(e,t)}})})}function qD(e){e.forEach(KD)}function JD(){typeof ResizeObserver>`u`||(HD=new ResizeObserver(qD))}function YD(e,t){HD||JD();let n=SD(e);return n.forEach(e=>{let n=VD.get(e);n||(n=new Set,VD.set(e,n)),n.add(t),HD?.observe(e)}),()=>{n.forEach(e=>{let n=VD.get(e);n?.delete(t),n?.size||HD?.unobserve(e)})}}var XD=new Set,ZD;function QD(){ZD=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};XD.forEach(t=>t(e))},window.addEventListener(`resize`,ZD)}function $D(e){return XD.add(e),ZD||QD(),()=>{XD.delete(e),!XD.size&&typeof ZD==`function`&&(window.removeEventListener(`resize`,ZD),ZD=void 0)}}function eO(e,t){return typeof e==`function`?$D(e):YD(e,t)}var tO=e=>!!(e&&e.getVelocity);function nO(e){return!!(tO(e)&&e.add)}function rO(e,t){let n=e.getValue(`willChange`);if(nO(n))return n.add(t);if(!n&&CC.WillChange){let n=new CC.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var iO=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function aO({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function oO({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function sO(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function cO(e){return e===void 0||e===1}function lO({scale:e,scaleX:t,scaleY:n}){return!cO(e)||!cO(t)||!cO(n)}function uO(e){return lO(e)||dO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function dO(e){return fO(e.x)||fO(e.y)}function fO(e){return e&&e!==`0%`}function pO(e,t,n){return n+t*(e-n)}function mO(e,t,n,r,i){return i!==void 0&&(e=pO(e,i,r)),pO(e,n,r)+t}function hO(e,t=0,n=1,r,i){e.min=mO(e.min,t,n,r,i),e.max=mO(e.max,t,n,r,i)}function gO(e,{x:t,y:n}){hO(e.x,t.translate,t.scale,t.originPoint),hO(e.y,n.translate,n.scale,n.originPoint)}var _O=.999999999999,vO=1.0000000000001;function yO(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s_O&&(t.x=1),t.y_O&&(t.y=1)}function bO(e,t){e.min+=t,e.max+=t}function xO(e,t,n,r,i=.5){hO(e,t,n,sT(e.min,e.max,i),r)}function SO(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function CO(e,t,n){let r=n??e;xO(e.x,SO(t.x,r.x),t.scaleX,t.scale,t.originX),xO(e.y,SO(t.y,r.y),t.scaleY,t.scale,t.originY)}function wO(e,t){return aO(sO(e.getBoundingClientRect(),t))}function TO(e,t,n){let r=wO(e,n),{scroll:i}=t;return i&&(bO(r.x,i.offset.x),bO(r.y,i.offset.y)),r}var EO=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...mE]),DO={test:e=>e===`auto`,parse:e=>e},OO=e=>t=>t.test(e),kO=[bw,$,Iw,Fw,Rw,Lw,DO],AO=e=>kO.find(OO(e)),jO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function MO(e){let t=jO.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function NO(e,t,n=1){`${e}`;let[r,i]=MO(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return wC(e)?parseFloat(e):e}return _w(i)?NO(i,t,n+1):i}function PO(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||EC(e)}var FO=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function IO(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ww)||[];if(!r)return e;let i=n.replace(r,``),a=+!!FO.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var LO=/\b([a-z-]*)\(.*?\)/gu,RO={...rT,getAnimatableNone:e=>{let t=e.match(LO);return t?t.map(IO).join(` `):e}},zO={...rT,getAnimatableNone:e=>{let t=rT.parse(e);return rT.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},BO={...bw,transform:Math.round},VO={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:Fw,pathRotation:Fw,rotateX:Fw,rotateY:Fw,rotateZ:Fw,scale:Sw,scaleX:Sw,scaleY:Sw,scaleZ:Sw,skew:Fw,skewX:Fw,skewY:Fw,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:xw,originX:zw,originY:zw,originZ:$,zIndex:BO,fillOpacity:xw,strokeOpacity:xw,numOctaves:BO},HO={...VO,color:Vw,backgroundColor:Vw,outlineColor:Vw,fill:Vw,stroke:Vw,borderColor:Vw,borderTopColor:Vw,borderRightColor:Vw,borderBottomColor:Vw,borderLeftColor:Vw,filter:RO,WebkitFilter:RO,mask:zO,WebkitMask:zO},UO=e=>HO[e],WO=new Set([RO,zO]);function GO(e,t){let n=UO(e);return WO.has(n)||(n=rT),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var KO=new Set([`auto`,`none`,`0`]);function qO(e,t,n){let r=0,i;for(;r{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},YO=()=>({translate:0,scale:1,origin:0,originPoint:0}),XO=()=>({x:YO(),y:YO()}),ZO=()=>({min:0,max:0}),QO=()=>({x:ZO(),y:ZO()}),$O=30,ek=e=>!isNaN(parseFloat(e)),tk={current:void 0},nk=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=pw.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=pw.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ek(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new jC);let n=this.events[e].add(t);return e===`change`?()=>{n(),sw.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return tk.current&&tk.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=pw.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>$O)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,$O);return PC(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function rk(e,t){return new nk(e,t)}var ik=[...kO,Vw,rT],ak=e=>ik.find(OO(e)),ok=new WeakMap;function sk(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function ck(e){return typeof e==`string`||Array.isArray(e)}var lk=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],uk=[`initial`,...lk];function dk(e){return sk(e.animate)||uk.some(t=>ck(e[t]))}function fk(e){return!!(dk(e)||e.variants)}function pk(e,t,n){for(let r in t){let i=t[r],a=n[r];if(tO(i))e.addValue(r,i);else if(tO(a))e.addValue(r,rk(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,rk(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var mk={current:null},hk={current:!1},gk=typeof window<`u`;function _k(){if(hk.current=!0,gk)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>mk.current=e.matches;e.addEventListener(`change`,t),t()}else mk.current=!1}function vk(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function yk(e,t,n,r){if(typeof t==`function`){let[i,a]=vk(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=vk(r);t=t(n===void 0?e.custom:n,i,a)}return t}var bk=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],xk={};function Sk(e){xk=e}function Ck(){return xk}var wk=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=OE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=pw.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(hk.current||_k(),this.shouldReduceMotion=mk.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),cw(this.notifyUpdate),cw(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ZE.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new VE({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:MC(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=hE.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&sw.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in xk){let t=xk[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):QO()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=rk(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(wC(n)||EC(n))?n=parseFloat(n):!ak(n)&&rT.test(t)&&(n=GO(e,t)),this.setBaseTarget(e,tO(n)?n.get():n)),tO(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=yk(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!tO(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new jC),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){_D.render(this.render)}},Tk=class extends wk{constructor(){super(...arguments),this.KeyframeResolver=JO}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tO(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Ek=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Dk={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Ok=mE.length;function kk(e,t,n){let r=``,i=!0;for(let a=0;a{if(!t.target)return e;if(typeof e==`string`)if($.test(e))e=parseFloat(e);else return e;return`${Mk(e,t.target.x)}% ${Mk(e,t.target.y)}%`}},Pk={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=rT.parse(e);if(i.length>5)return r;let a=rT.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=sT(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Fk={borderRadius:{...Nk,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Nk,borderTopRightRadius:Nk,borderBottomLeftRadius:Nk,borderBottomRightRadius:Nk,boxShadow:Pk};function Ik(e,{layout:t,layoutId:n}){return hE.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Fk[e]||e===`opacity`)}function Lk(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(tO(r[t])||i&&tO(i[t])||Ik(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Rk(e){return window.getComputedStyle(e)}var zk=class extends Tk{constructor(){super(...arguments),this.type=`html`,this.renderInstance=jk}readValueFromInstance(e,t){if(hE.has(t))return this.projection?.isProjecting?uE(t):fE(e,t);{let n=Rk(e),r=(hw(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return wO(e,t)}build(e,t,n){Ak(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Lk(e,t,n)}},Bk={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Vk={offset:`strokeDashoffset`,array:`strokeDasharray`};function Hk(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Bk:Vk;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Uk=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Wk(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ak(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Uk)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Hk(d,i,a,o,!1)}var Gk=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Kk=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function qk(e,t,n,r){jk(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Gk.has(n)?n:hD(n),t.attrs[n])}function Jk(e,t,n){let r=Lk(e,t,n);for(let n in e)if(tO(e[n])||tO(t[n])){let t=mE.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Yk=class extends Tk{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=QO}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(hE.has(t)){let e=UO(t);return e&&e.default||0}return t=Gk.has(t)?t:hD(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Jk(e,t,n)}build(e,t,n){Wk(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){qk(e,t,n,r)}mount(e){this.isSVGTag=Kk(e.tagName),super.mount(e)}};function Xk(e,t,n){let r=e.getProps();return yk(r,t,n===void 0?r.custom:n,e)}var Zk=e=>Array.isArray(e);function Qk(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rk(n))}function $k(e){return Zk(e)?e[e.length-1]||0:e}function eA(e,t){let{transitionEnd:n={},transition:r={},...i}=Xk(e,t)||{};i={...i,...n};for(let t in i)Qk(e,t,$k(i[t]))}function tA(e){return e.props[gD]}function nA({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function rA(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?aD(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&nA(f,t))continue;let o={delay:n,...oD(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){sw.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=tA(e);if(n){let e=window.MotionHandoffAnimation(n,t,sw);e!==null&&(o.startTime=e,p=!0)}}rO(e,t);let m=l??e.shouldReduceMotion;r.start(mD(t,r,i,m&&EO.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>sw.update(()=>{o&&eA(e,o)});d.length?Promise.all(d).then(t):t()}return d}function iA(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function aA(e,t,n={}){let r=Xk(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(rA(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return oA(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function oA(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(aA(c,t,{...o,delay:n+(typeof r==`function`?0:r)+iA(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function sA(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>aA(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=aA(e,t,n);else{let i=typeof t==`function`?Xk(e,t,n.custom):t;r=Promise.all(rA(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var cA=uk.length;function lA(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&lA(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>sA(e,t,n)))}function mA(e){let t=pA(e),n=_A(),r=!0,i=!1,a=t=>(n,r)=>{let i=Xk(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=lA(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;tf&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Zk(t)&&Zk(n)?!uA(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Xk(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=iA(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Xk(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=_A(),i=!0}}}function hA(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!uA(t,e):!1}function gA(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _A(){return{animate:gA(!0),whileInView:gA(),whileHover:gA(),whileTap:gA(),whileDrag:gA(),whileFocus:gA(),exit:gA()}}var vA=.9999,yA=1.0001,bA=-.01,xA=.01;function SA(e){return e.max-e.min}function CA(e,t,n){return Math.abs(e-t)<=n}function wA(e,t,n,r=.5){e.origin=r,e.originPoint=sT(t.min,t.max,e.origin),e.scale=SA(n)/SA(t),e.translate=sT(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vA&&e.scale<=yA||isNaN(e.scale))&&(e.scale=1),(e.translate>=bA&&e.translate<=xA||isNaN(e.translate))&&(e.translate=0)}function TA(e,t,n,r){wA(e.x,t.x,n.x,r?r.originX:void 0),wA(e.y,t.y,n.y,r?r.originY:void 0)}function EA(e,t,n,r=0){e.min=(r?sT(n.min,n.max,r):n.min)+t.min,e.max=e.min+SA(t)}function DA(e,t,n,r){EA(e.x,t.x,n.x,r?.x),EA(e.y,t.y,n.y,r?.y)}function OA(e,t,n,r=0){let i=r?sT(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+SA(t)}function kA(e,t,n,r){OA(e.x,t.x,n.x,r?.x),OA(e.y,t.y,n.y,r?.y)}function AA(e){return[e(`x`),e(`y`)]}function jA(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function MA(e){return tO(e)?e.get():e}function NA(e,t,n){let r=tO(e)?e:rk(e);return r.start(mD(``,r,t,n)),r.animation}var PA={value:null,addProjectionMetrics:null};function FA(e,t){let n=pw.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(cw(r),e(a-t))};return sw.setup(r,!0),()=>cw(r)}function IA(e){return BD(e)&&e.tagName===`svg`}var LA=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],RA=LA.length,zA=e=>typeof e==`string`?parseFloat(e):e,BA=e=>typeof e==`number`||$.test(e);function VA(e,t,n,r,i,a){i?(e.opacity=sT(0,n.opacity??1,UA(r)),e.opacityExit=sT(t.opacity??1,0,WA(r))):a&&(e.opacity=sT(t.opacity??1,n.opacity??1,r));for(let i=0;irt?1:n(AC(e,t,r))}function KA(e,t){e.min=t.min,e.max=t.max}function qA(e,t){KA(e.x,t.x),KA(e.y,t.y)}function JA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function YA(e,t,n,r,i){return e-=t,e=pO(e,1/n,r),i!==void 0&&(e=pO(e,1/i,r)),e}function XA(e,t=0,n=1,r=.5,i,a=e,o=e){if(Iw.test(t)&&(t=parseFloat(t),t=sT(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=sT(a.min,a.max,r);e===a&&(s-=t),e.min=YA(e.min,t,n,s,i),e.max=YA(e.max,t,n,s,i)}function ZA(e,t,[n,r,i],a,o){XA(e,t[n],t[r],t[i],t.scale,a,o)}var QA=[`x`,`scaleX`,`originX`],$A=[`y`,`scaleY`,`originY`];function ej(e,t,n,r){ZA(e.x,t,QA,n?n.x:void 0,r?r.x:void 0),ZA(e.y,t,$A,n?n.y:void 0,r?r.y:void 0)}function tj(e){return e.translate===0&&e.scale===1}function nj(e){return tj(e.x)&&tj(e.y)}function rj(e,t){return e.min===t.min&&e.max===t.max}function ij(e,t){return rj(e.x,t.x)&&rj(e.y,t.y)}function aj(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oj(e,t){return aj(e.x,t.x)&&aj(e.y,t.y)}function sj(e){return SA(e.x)/SA(e.y)}function cj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var lj=class{constructor(){this.members=[]}add(e){bC(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(xC(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(xC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function uj(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var dj=(e,t)=>e.depth-t.depth,fj=class{constructor(){this.children=[],this.isDirty=!1}add(e){bC(this.children,e),this.isDirty=!0}remove(e){xC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(dj),this.isDirty=!1,this.children.forEach(e)}},pj={hasAnimatedSinceResize:!0,hasEverUpdated:!1},mj={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},hj=[``,`X`,`Y`,`Z`],gj=1e3,_j=0;function vj(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yj(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=tA(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,sw,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yj(r)}function bj({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=_j++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,PA.value&&(mj.nodes=mj.calculatedTargetDeltas=mj.calculatedProjections=0),this.nodes.forEach(Cj),this.nodes.forEach(Mj),this.nodes.forEach(Nj),this.nodes.forEach(wj),PA.addProjectionMetrics&&PA.addProjectionMetrics(mj)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;sw.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=FA(i,250),pj.hasAnimatedSinceResize&&(pj.hasAnimatedSinceResize=!1,this.nodes.forEach(jj)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Bj,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!oj(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...oD(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||jj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),cw(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Pj),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yj(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!SA(this.snapshot.measuredBox.x)&&!SA(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=sT(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=sT(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Ij(o.x,e.x,n),Ij(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kA(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Rj(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&ij(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=QO(),qA(f,this.relativeTarget)),c&&(this.animationValues=a,VA(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(cw(this.pendingAnimation),void 0),this.pendingAnimation=sw.update(()=>{pj.hasAnimatedSinceResize=!0,this.motionValue||=rk(0),this.motionValue.jump(0,!1),this.currentAnimation=NA(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(gj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Gj(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||QO();let t=SA(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=SA(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}qA(t,n),CO(t,i),TA(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new lj),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&vj(`z`,e,r,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(Ej),this.root.sharedNodes.clear()}}}function xj(e){e.updateLayout()}function Sj(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)AA(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=SA(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;KA(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Gj(i,t.layoutBox,n)&&AA(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=SA(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=XO();TA(o,n,t.layoutBox);let s=XO();a?TA(s,e.applyTransform(r,!0),t.measuredBox):TA(s,n,t.layoutBox);let c=!nj(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=QO();kA(s,t.layoutBox,i.layoutBox,o);let c=QO();kA(c,n,a.layoutBox,o),oj(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Cj(e){PA.value&&mj.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function wj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Tj(e){e.clearSnapshot()}function Ej(e){e.clearMeasurements()}function Dj(e){e.isLayoutDirty=!0,e.updateLayout()}function Oj(e){e.isLayoutDirty=!1}function kj(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Aj(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function jj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Mj(e){e.resolveTargetDelta()}function Nj(e){e.calcProjection()}function Pj(e){e.resetSkewAndRotation()}function Fj(e){e.removeLeadSnapshot()}function Ij(e,t,n){e.translate=sT(t.translate,0,n),e.scale=sT(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Lj(e,t,n,r){e.min=sT(t.min,n.min,r),e.max=sT(t.max,n.max,r)}function Rj(e,t,n,r){Lj(e.x,t.x,n.x,r),Lj(e.y,t.y,n.y,r)}function zj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Bj={duration:.45,ease:[.4,0,.1,1]},Vj=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hj=Vj(`applewebkit/`)&&!Vj(`chrome/`)?Math.round:OC;function Uj(e){e.min=Hj(e.min),e.max=Hj(e.max)}function Wj(e){Uj(e.x),Uj(e.y)}function Gj(e,t,n){return e===`position`||e===`preserve-aspect`&&!CA(sj(t),sj(n),.2)}function Kj(e){return e!==e.root&&e.scroll?.wasRoot}var qj=bj({attachResizeListener:(e,t)=>jA(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Jj={current:void 0},Yj=bj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Jj.current){let e=new qj({});e.mount(window),e.setOptions({layoutScroll:!0}),Jj.current=e}return Jj.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Xj=(0,w.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Zj(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Qj(...e){return t=>{let n=!1,r=e.map(e=>{let r=Zj(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(` + )`,content:`""`,position:`absolute`,transform:`translateX(-100%)`,bottom:0,left:0,right:0,top:0}}},{props:{animation:`wave`},style:Zy||{"&::after":{animation:`${Yy} 2s linear 0.5s infinite`}}},...i?[{props:{animation:`wave`},style:i}]:[]]}})),$y=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiSkeleton`}),{animation:r=`pulse`,className:i,component:a=`span`,height:o,style:s,variant:c=`text`,width:l,...u}=n,d={...n,animation:r,component:a,variant:c,hasChildren:!!u.children};return(0,V.jsx)(Qy,{as:a,ref:t,className:U(qy(d).root,i),ownerState:d,...u,style:{width:l,height:o,...s}})});function eb(e){return W(`PrivateSwitchBase`,e)}Z(`PrivateSwitchBase`,[`root`,`checked`,`disabled`,`input`,`edgeStart`,`edgeEnd`]);var tb=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e;return q({root:[`root`,n&&`checked`,r&&`disabled`,i&&`edge${K(i)}`],input:[`input`]},eb,t)},nb=J(qd,{name:`MuiSwitchBase`})({padding:9,borderRadius:`50%`,variants:[{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e===`start`&&t.size!==`small`,style:{marginLeft:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e===`end`&&t.size!==`small`,style:{marginRight:-12}}]}),rb=J(`input`,{name:`MuiSwitchBase`,shouldForwardProp:su})({cursor:`inherit`,position:`absolute`,opacity:0,width:`100%`,height:`100%`,top:0,left:0,margin:0,padding:0,zIndex:1}),ib=w.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:s=!1,edge:c=!1,icon:l,id:u,name:d,onBlur:f,onChange:p,onFocus:m,readOnly:h,required:g=!1,tabIndex:_,type:v,value:y,slots:b={},slotProps:x={},...S}=e,{nativeButton:C,...w}=S,[T,E]=gy({controlled:r,default:!!a,name:`SwitchBase`,state:`checked`}),D=lm(),O=e=>{m&&m(e),D&&D.onFocus&&D.onFocus(e)},k=e=>{f&&f(e),D&&D.onBlur&&D.onBlur(e)},A=e=>{if(e.nativeEvent.defaultPrevented||h)return;let t=e.target.checked;E(t),p&&p(e,t)},j=o;D&&j===void 0&&(j=D.disabled);let M=v===`checkbox`||v===`radio`,N={...e,checked:T,disabled:j,disableFocusRipple:s,edge:c},P=tb(N),F={slots:b,slotProps:x},[I,L]=Ru(`root`,{ref:t,elementType:nb,className:P.root,shouldForwardComponentProp:!0,externalForwardedProps:{...F,component:`span`,...w},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O(t)},onBlur:t=>{e.onBlur?.(t),k(t)}}),ownerState:N,additionalProps:{centerRipple:!0,focusRipple:!s,role:void 0,tabIndex:null}}),[ee,te]=Ru(`input`,{elementType:rb,className:P.input,externalForwardedProps:F,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),A(t)}}),ownerState:N,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:j,id:M?u:void 0,name:d,readOnly:h,required:g,tabIndex:_,type:v,...v===`checkbox`&&y===void 0?{}:{value:y}}});return(0,V.jsxs)(I,{...L,children:[(0,V.jsx)(ee,{...te}),T?i:l]})});function ab(e){return W(`MuiSwitch`,e)}var ob=Z(`MuiSwitch`,[`root`,`edgeStart`,`edgeEnd`,`switchBase`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`,`checked`,`disabled`,`input`,`thumb`,`track`]),sb=e=>{let{classes:t,edge:n,size:r,color:i,checked:a,disabled:o}=e,s=q({root:[`root`,n&&`edge${K(n)}`,`size${K(r)}`],switchBase:[`switchBase`,`color${K(i)}`,a&&`checked`,o&&`disabled`],thumb:[`thumb`],track:[`track`],input:[`input`]},ab,t);return{...t,...s}},cb=J(`span`,{name:`MuiSwitch`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.edge&&t[`edge${K(n.edge)}`],t[`size${K(n.size)}`]]}})({display:`inline-flex`,width:58,height:38,overflow:`hidden`,padding:12,boxSizing:`border-box`,position:`relative`,flexShrink:0,zIndex:0,verticalAlign:`middle`,"@media print":{colorAdjust:`exact`},variants:[{props:{edge:`start`},style:{marginLeft:-8}},{props:{edge:`end`},style:{marginRight:-8}},{props:{size:`small`},style:{width:40,height:24,padding:7,[`& .${ob.thumb}`]:{width:16,height:16},[`& .${ob.switchBase}`]:{padding:4,[`&.${ob.checked}`]:{transform:`translateX(16px)`}}}}]}),lb=J(ib,{name:`MuiSwitch`,slot:`SwitchBase`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.switchBase,{[`& .${ob.input}`]:t.input},n.color!=="default"&&t[`color${K(n.color)}`]]}})(Y(({theme:e})=>({position:`absolute`,top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode===`light`?e.palette.common.white:e.palette.grey[300]}`,...Cu(e,[`left`,`transform`],{duration:e.transitions.duration.shortest}),[`&.${ob.checked}`]:{transform:`translateX(20px)`},[`&.${ob.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode===`light`?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${ob.checked} + .${ob.track}`]:{opacity:.5},[`&.${ob.disabled} + .${ob.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode===`light`?.12:.2}`},[`& .${ob.input}`]:{left:`-100%`,width:`300%`}})),Y(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[...Object.entries(e.palette).filter(du([`light`])).map(([t])=>({props:{color:t},style:{[`&.${ob.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${ob.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${ob.checked} + .${ob.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),ub=J(`span`,{name:`MuiSwitch`,slot:`Track`})(Y(({theme:e})=>({height:`100%`,width:`100%`,borderRadius:14/2,zIndex:-1,...Cu(e,[`opacity`,`background-color`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{boxSizing:`border-box`,border:`1px solid ButtonBorder`},backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode===`light`?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode===`light`?.38:.3}`}))),db=J(`span`,{name:`MuiSwitch`,slot:`Thumb`})(Y(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:`currentColor`,boxSizing:`border-box`,border:`1px solid transparent`,width:20,height:20,borderRadius:`50%`}))),fb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiSwitch`}),{className:r,color:i=`primary`,edge:a=!1,size:o=`medium`,sx:s,slots:c={},slotProps:l={},...u}=n,d={...n,color:i,edge:a,size:o},f=sb(d),p=l.input,m={slots:c,slotProps:l},[h,g]=Ru(`root`,{className:U(f.root,r),elementType:cb,externalForwardedProps:m,ownerState:d,additionalProps:{sx:s}}),[_,v]=Ru(`thumb`,{className:f.thumb,elementType:db,externalForwardedProps:m,ownerState:d}),y=(0,V.jsx)(_,{...v}),[b,x]=Ru(`track`,{className:f.track,elementType:ub,externalForwardedProps:m,ownerState:d});return(0,V.jsxs)(h,{...g,children:[(0,V.jsx)(lb,{type:`checkbox`,icon:y,checkedIcon:y,ref:t,ownerState:d,...u,classes:{...f,root:f.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...l.switchBase&&{root:typeof l.switchBase==`function`?l.switchBase(d):l.switchBase},input:Jl(typeof p==`function`?p(d):p,{role:`switch`})}}),(0,V.jsx)(b,{...x})]})});function pb(e){return W(`MuiTextField`,e)}Z(`MuiTextField`,[`root`]);var mb={standard:hh,filled:Nm,outlined:Hg},hb=e=>{let{classes:t}=e;return q({root:[`root`]},pb,t)},gb=J(zm,{name:`MuiTextField`,slot:`Root`})({}),_b=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,fullWidth:d=!1,helperText:f,id:p,inputRef:m,label:h,maxRows:g,minRows:_,multiline:v=!1,name:y,onBlur:b,onChange:x,onFocus:S,placeholder:C,required:w=!1,rows:T,select:E=!1,slots:D={},slotProps:O={},type:k,value:A,variant:j=`outlined`,...M}=n,N={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:d,multiline:v,required:w,select:E,variant:j},P=hb(N),F=uc(p),I=f&&F?`${F}-helper-text`:void 0,L=h&&F?`${F}-label`:void 0,ee=mb[j],te={slots:D,slotProps:O},[ne,re]=Ru(`select`,{elementType:Gy,externalForwardedProps:te,ownerState:N}),R=E&&re.native,z={},ie=te.slotProps.inputLabel;j===`outlined`&&(ie&&ie.shrink!==void 0&&(z.notched=ie.shrink),z.label=h),E&&(R||(z.id=void 0),z[`aria-describedby`]=void 0);let[ae,oe]=Ru(`root`,{elementType:gb,shouldForwardComponentProp:!0,externalForwardedProps:{...te,...M},ownerState:N,className:U(P.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:d,required:w,color:s,variant:j}}),[se,ce]=Ru(`input`,{elementType:ee,externalForwardedProps:te,additionalProps:z,ownerState:N}),[le,B]=Ru(`inputLabel`,{elementType:Th,externalForwardedProps:te,ownerState:N}),[ue,de]=Ru(`htmlInput`,{elementType:`input`,externalForwardedProps:te,ownerState:N}),[fe,pe]=Ru(`formHelperText`,{elementType:Gm,externalForwardedProps:te,ownerState:N}),me=(0,V.jsx)(se,{"aria-describedby":I,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:d,multiline:v,name:y,rows:T,maxRows:g,minRows:_,type:k,value:A,id:F,inputRef:m,onBlur:b,onChange:x,onFocus:S,placeholder:C,inputProps:de,slots:{input:D.htmlInput?ue:void 0},...ce});return(0,V.jsxs)(ae,{...oe,children:[h!=null&&h!==``&&(0,V.jsx)(le,{htmlFor:E&&!R?void 0:F,id:L,...E&&!R&&{component:`div`},...B,children:h}),E?(0,V.jsx)(ne,{"aria-describedby":I,id:F,labelId:L,value:A,input:me,...re,children:a}):me,f&&(0,V.jsx)(fe,{id:I,...pe,children:f})]})});function vb(e){return W(`MuiToggleButton`,e)}var yb=Z(`MuiToggleButton`,[`root`,`disabled`,`selected`,`standard`,`primary`,`secondary`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`fullWidth`]),bb=w.createContext({}),xb=w.createContext(void 0);function Sb(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}var Cb=e=>{let{classes:t,fullWidth:n,selected:r,disabled:i,size:a,color:o}=e;return q({root:[`root`,r&&`selected`,i&&`disabled`,n&&`fullWidth`,`size${K(a)}`,o]},vb,t)},wb=J(qd,{name:`MuiToggleButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`size${K(n.size)}`]]}})(Y(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${yb.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:`none`,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[{props:{color:`standard`},style:{[`&.${yb.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(du()).map(([t])=>({props:{color:t},style:{[`&.${yb.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:`100%`}},{props:{size:`small`},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),Tb=w.forwardRef(function(e,t){let{value:n,...r}=w.useContext(bb),i=w.useContext(xb),a=X({props:tc({...r,selected:Sb(e.value,n)},e),name:`MuiToggleButton`}),{children:o,className:s,color:c=`standard`,disabled:l=!1,disableFocusRipple:u=!1,fullWidth:d=!1,onChange:f,onClick:p,selected:m,size:h=`medium`,value:g,..._}=a,v={...a,color:c,disabled:l,disableFocusRipple:u,fullWidth:d,size:h},y=Cb(v),b=e=>{p&&(p(e,g),e.defaultPrevented)||f&&f(e,g)},x=i||``;return(0,V.jsx)(wb,{className:U(r.className,y.root,s,x),internalNativeButton:!0,disabled:l,focusRipple:!u,ref:t,onClick:b,onChange:f,value:g,ownerState:v,"aria-pressed":m,..._,children:o})});function Eb(e){return w.Children.toArray(e).filter(e=>w.isValidElement(e))}function Db(e){return W(`MuiToggleButtonGroup`,e)}var Ob=Z(`MuiToggleButtonGroup`,[`root`,`selected`,`horizontal`,`vertical`,`disabled`,`grouped`,`fullWidth`,`firstButton`,`lastButton`,`middleButton`]),kb=e=>{let{classes:t,orientation:n,fullWidth:r,disabled:i}=e;return q({root:[`root`,n,r&&`fullWidth`],grouped:[`grouped`,i&&`disabled`],firstButton:[`firstButton`],lastButton:[`lastButton`],middleButton:[`middleButton`]},Db,t)},Ab=J(`div`,{name:`MuiToggleButtonGroup`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Ob.grouped}`]:t.grouped},{[`& .${Ob.firstButton}`]:t.firstButton},{[`& .${Ob.lastButton}`]:t.lastButton},{[`& .${Ob.middleButton}`]:t.middleButton},t.root,n.orientation===`vertical`&&t.vertical,n.fullWidth&&t.fullWidth]}})(Y(({theme:e})=>({display:`inline-flex`,borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:`vertical`},style:{flexDirection:`column`,[`& .${Ob.grouped}`]:{[`&.${Ob.selected} + .${Ob.grouped}.${Ob.selected}`]:{borderTop:0,marginTop:0}},[`& .${Ob.firstButton},& .${Ob.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Ob.lastButton},& .${Ob.middleButton}`]:{marginTop:-1,borderTop:`1px solid transparent`,borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Ob.lastButton}.${yb.disabled},& .${Ob.middleButton}.${yb.disabled}`]:{borderTop:`1px solid transparent`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{orientation:`horizontal`},style:{[`& .${Ob.grouped}`]:{[`&.${Ob.selected} + .${Ob.grouped}.${Ob.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Ob.firstButton},& .${Ob.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Ob.lastButton},& .${Ob.middleButton}`]:{marginLeft:-1,borderLeft:`1px solid transparent`,borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Ob.lastButton}.${yb.disabled},& .${Ob.middleButton}.${yb.disabled}`]:{borderLeft:`1px solid transparent`}}}]}))),jb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiToggleButtonGroup`}),{children:r,className:i,color:a=`standard`,disabled:o=!1,exclusive:s=!1,fullWidth:c=!1,onChange:l,orientation:u=`horizontal`,size:d=`medium`,value:f,...p}=n,m={...n,disabled:o,fullWidth:c,orientation:u,size:d},h=kb(m),g=w.useCallback((e,t)=>{if(!l)return;let n=f&&f.indexOf(t),r;f&&n>=0?(r=f.slice(),r.splice(n,1)):r=f?f.concat(t):[t],l(e,r)},[l,f]),_=w.useCallback((e,t)=>{l&&l(e,f===t?null:t)},[l,f]),v=w.useMemo(()=>({className:h.grouped,onChange:s?_:g,value:f,size:d,fullWidth:c,color:a,disabled:o}),[h.grouped,s,_,g,f,d,c,a,o]),y=Eb(r),b=y.length,x=e=>{let t=e===0,n=e===b-1;return t&&n?``:t?h.firstButton:n?h.lastButton:h.middleButton};return(0,V.jsx)(Ab,{role:`group`,className:U(h.root,i),ref:t,ownerState:m,...p,children:(0,V.jsx)(bb.Provider,{value:v,children:y.map((e,t)=>(0,V.jsx)(xb.Provider,{value:x(t),children:e},t))})})});function Mb(e){return W(`MuiToolbar`,e)}Z(`MuiToolbar`,[`root`,`gutters`,`regular`,`dense`]);var Nb=e=>{let{classes:t,disableGutters:n,variant:r}=e;return q({root:[`root`,!n&&`gutters`,r]},Mb,t)},Pb=J(`div`,{name:`MuiToolbar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Y(({theme:e})=>({position:`relative`,display:`flex`,alignItems:`center`,variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up(`sm`)]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:`dense`},style:{minHeight:48}},{props:{variant:`regular`},style:e.mixins.toolbar}]}))),Fb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiToolbar`}),{className:r,component:i=`div`,disableGutters:a=!1,variant:o=`regular`,...s}=n,c={...n,component:i,disableGutters:a,variant:o};return(0,V.jsx)(Pb,{as:i,className:U(Nb(c).root,r),ref:t,ownerState:c,...s})});function Ib(e){return W(`MuiTooltip`,e)}var Lb=Z(`MuiTooltip`,[`popper`,`popperInteractive`,`popperArrow`,`popperClose`,`tooltip`,`tooltipArrow`,`touch`,`tooltipPlacementLeft`,`tooltipPlacementRight`,`tooltipPlacementTop`,`tooltipPlacementBottom`,`arrow`]);function Rb(e){return Math.round(e*1e5)/1e5}var zb=e=>{let{classes:t,disableInteractive:n,arrow:r,touch:i,placement:a}=e;return q({popper:[`popper`,!n&&`popperInteractive`,r&&`popperArrow`],tooltip:[`tooltip`,r&&`tooltipArrow`,i&&`touch`,`tooltipPlacement${K(a.split(`-`)[0])}`],arrow:[`arrow`]},Ib,t)},Bb=J(ty,{name:`MuiTooltip`,slot:`Popper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(Y(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:`none`,variants:[{props:({ownerState:e,open:t})=>t&&!e.disableInteractive,style:{pointerEvents:`auto`}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Lb.arrow}`]:{top:0,marginTop:`-0.71em`,"&::before":{transformOrigin:`0 100%`}},[`&[data-popper-placement*="top"] .${Lb.arrow}`]:{bottom:0,marginBottom:`-0.71em`,"&::before":{transformOrigin:`100% 0`}},[`&[data-popper-placement*="right"] .${Lb.arrow}`]:{height:`1em`,width:`0.71em`,insetInlineStart:0,marginInlineStart:`-0.71em`,"&::before":{transformOrigin:`100% 100%`}},[`&[data-popper-placement*="left"] .${Lb.arrow}`]:{height:`1em`,width:`0.71em`,insetInlineEnd:0,marginInlineEnd:`-0.71em`,"&::before":{transformOrigin:`0 0`}}}}]}))),Vb=J(`div`,{name:`MuiTooltip`,slot:`Tooltip`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${K(n.placement.split(`-`)[0])}`]]}})(Y(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:`4px 8px`,fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:`break-word`,fontWeight:e.typography.fontWeightMedium,[`.${Lb.popper}[data-popper-placement*="left"] &`]:{transformOrigin:`right center`,marginInlineEnd:`14px`},[`.${Lb.popper}[data-popper-placement*="right"] &`]:{transformOrigin:`left center`,marginInlineStart:`14px`},[`.${Lb.popper}[data-popper-placement*="top"] &`]:{transformOrigin:`center bottom`,marginBottom:`14px`},[`.${Lb.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:`center top`,marginTop:`14px`},variants:[{props:({ownerState:e})=>e.arrow,style:{position:`relative`,marginBlock:0}},{props:({ownerState:e})=>e.touch,style:{padding:`8px 16px`,fontSize:e.typography.pxToRem(14),lineHeight:`${Rb(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>e.touch,style:{[`.${Lb.popper}[data-popper-placement*="left"] &`]:{marginInlineEnd:`24px`},[`.${Lb.popper}[data-popper-placement*="right"] &`]:{marginInlineStart:`24px`},[`.${Lb.popper}[data-popper-placement*="top"] &`]:{marginBottom:`24px`},[`.${Lb.popper}[data-popper-placement*="bottom"] &`]:{marginTop:`24px`}}}]}))),Hb=J(`span`,{name:`MuiTooltip`,slot:`Arrow`})(Y(({theme:e})=>({overflow:`hidden`,position:`absolute`,width:`1em`,height:`0.71em`,boxSizing:`border-box`,color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:`""`,margin:`auto`,display:`block`,width:`100%`,height:`100%`,backgroundColor:`currentColor`,transform:`rotate(45deg)`}}))),Ub=!1,Wb=new Ed,Gb={x:0,y:0};function Kb(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}var qb=w.forwardRef(function(e,t){let n=X({props:e,name:`MuiTooltip`}),{arrow:r=!1,children:i,classes:a,describeChild:o=!1,disableFocusListener:s=!1,disableHoverListener:c=!1,disableInteractive:l=!1,disableTouchListener:u=!1,enterDelay:d=100,enterNextDelay:f=0,enterTouchDelay:p=700,followCursor:m=!1,id:h,leaveDelay:g=0,leaveTouchDelay:_=1500,onClose:v,onOpen:y,open:b,placement:x=`bottom`,slotProps:S={},slots:C={},title:T,...E}=n,D=w.isValidElement(i)?i:(0,V.jsx)(`span`,{children:i}),O=Il(),[k,A]=w.useState(),[j,M]=w.useState(null),N=w.useRef(!1),P=l||m,F=Dd(),I=Dd(),L=Dd(),ee=Dd(),[te,ne]=gy({controlled:b,default:!1,name:`Tooltip`,state:`open`}),re=te,R=Wl(h),z=w.useRef(),ie=_d(()=>{z.current!==void 0&&(document.body.style.WebkitUserSelect=z.current,z.current=void 0),ee.clear()});w.useEffect(()=>ie,[ie]);let ae=e=>{Wb.clear(),Ub=!0,ne(!0),y&&!re&&y(e)},oe=_d(e=>{Wb.start(800+g,()=>{Ub=!1}),ne(!1),v&&re&&v(e),F.start(O.transitions.duration.shortest,()=>{N.current=!1})}),se=e=>{k?.disabled||N.current&&e.type!==`touchstart`||(k&&k.removeAttribute(`title`),I.clear(),L.clear(),d||Ub&&f?I.start(Ub?f:d,()=>{ae(e)}):ae(e))},ce=e=>{I.clear(),L.start(g,()=>{oe(e)})},[,le]=w.useState(!1),B=e=>{let t=e?.target??k;if(!t||t.disabled||!hd(t)){le(!1);let n=e??new Event(`blur`);!e&&t&&(Object.defineProperty(n,"target",{value:t}),Object.defineProperty(n,"currentTarget",{value:t})),ce(n)}},ue=e=>{if(k||A(e.currentTarget),hd(e.target)){let t=e=>{e.target.disabled&&B(e),e.target.removeEventListener(`blur`,t)};e.target.addEventListener(`blur`,t),le(!0),se(e)}},de=e=>{N.current=!0;let t=D.props;t.onTouchStart&&t.onTouchStart(e)},fe=e=>{de(e),L.clear(),F.clear(),ie(),z.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect=`none`,ee.start(p,()=>{document.body.style.WebkitUserSelect=z.current,se(e)})},pe=e=>{D.props.onTouchEnd&&D.props.onTouchEnd(e),ie(),L.start(_,()=>{oe(e)})};w.useEffect(()=>{if(!re)return;function e(e){e.key===`Escape`&&oe(e)}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[oe,re]);let me=Kl(zu(D),A,t);!T&&T!==0&&(re=!1);let he=w.useRef(),ge=e=>{let t=D.props;t.onMouseMove&&t.onMouseMove(e),Gb={x:e.clientX,y:e.clientY},he.current&&he.current.update()},_e={},ve=typeof T==`string`;o?(_e.title=!re&&ve&&!c?T:null,_e[`aria-describedby`]=re?R:null):(_e[`aria-label`]=ve?T:null,_e[`aria-labelledby`]=re&&!ve?R:null);let ye={..._e,...E,...D.props,className:U(E.className,D.props.className),onTouchStart:de,ref:me,...m?{onMouseMove:ge}:{}},be={};u||(ye.onTouchStart=fe,ye.onTouchEnd=pe),c||(ye.onMouseOver=Kb(se,ye.onMouseOver),ye.onMouseLeave=Kb(ce,ye.onMouseLeave),P||(be.onMouseOver=se,be.onMouseLeave=ce)),s||(ye.onFocus=Kb(ue,ye.onFocus),ye.onBlur=Kb(B,ye.onBlur),P||(be.onFocus=ue,be.onBlur=B));let xe={...n,arrow:r,disableInteractive:P,placement:x,touch:N.current},Se=typeof S.popper==`function`?S.popper(xe):S.popper,Ce=w.useMemo(()=>{let e=[{name:`arrow`,enabled:!!j,options:{element:j,padding:4}}];return Se?.popperOptions?.modifiers&&(e=e.concat(Se.popperOptions.modifiers)),{...Se?.popperOptions,modifiers:e}},[j,Se?.popperOptions]),we=zb(xe),Te={slots:C,slotProps:{arrow:S.arrow,popper:Se,tooltip:S.tooltip,transition:S.transition}},[Ee,De]=Ru(`popper`,{elementType:Bb,externalForwardedProps:Te,ownerState:xe,className:we.popper}),[Oe,ke]=Ru(`transition`,{elementType:th,externalForwardedProps:Te,ownerState:xe}),[Ae,je]=Ru(`tooltip`,{elementType:Vb,className:we.tooltip,externalForwardedProps:Te,ownerState:xe}),[Me,Ne]=Ru(`arrow`,{elementType:Hb,className:we.arrow,externalForwardedProps:Te,ownerState:xe,ref:M});return(0,V.jsxs)(w.Fragment,{children:[w.cloneElement(D,ye),(0,V.jsx)(Ee,{as:ty,placement:x,anchorEl:m?{getBoundingClientRect:()=>({top:Gb.y,left:Gb.x,right:Gb.x,bottom:Gb.y,width:0,height:0})}:k,popperRef:he,open:k?re:!1,id:R,transition:!0,...be,...De,popperOptions:Ce,children:({TransitionProps:e})=>(0,V.jsx)(Oe,{timeout:O.transitions.duration.shorter,...e,...ke,children:(0,V.jsxs)(Ae,{...je,children:[T,r?(0,V.jsx)(Me,{...Ne}):null]})})})]})}),Jb=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Yb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Xb=e=>{let t=Yb(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zb=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},$b={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ex=(0,w.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,w.createElement)(`svg`,{ref:c,...$b,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Zb(`lucide`,i),...!a&&!Qb(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Q=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(ex,{ref:i,iconNode:t,className:Zb(`lucide-${Jb(Xb(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Xb(e),n},tx=Q(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),nx=Q(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),rx=Q(`code-xml`,[[`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`}]]),ix=Q(`git-commit-horizontal`,[[`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`}]]),ax=Q(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ox=Q(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),sx=Q(`square-terminal`,[[`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`}]]),cx=Q(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),lx=Q(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ux=Q(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),dx=Q(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),fx=Q(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),px=Q(`book-marked`,[[`path`,{d:`M10 2v8l3-3 3 3V2`,key:`sqw3rj`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),mx=Q(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),hx=Q(`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`}]]),gx=Q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),_x=Q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),vx=Q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),yx=Q(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),bx=Q(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),xx=Q(`clock-3`,[[`path`,{d:`M12 6v6h4`,key:`135r8i`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Sx=Q(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Cx=Q(`coins`,[[`circle`,{cx:`8`,cy:`8`,r:`6`,key:`3yglwk`}],[`path`,{d:`M18.09 10.37A6 6 0 1 1 10.34 18`,key:`t5s6rm`}],[`path`,{d:`M7 6h1v4`,key:`1obek4`}],[`path`,{d:`m16.71 13.88.7.71-2.82 2.82`,key:`1rbuyh`}]]),wx=Q(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Tx=Q(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ex=Q(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Dx=Q(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),Ox=Q(`file-code-2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),kx=Q(`file-json`,[[`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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),Ax=Q(`file-terminal`,[[`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:`m8 16 2-2-2-2`,key:`10vzyd`}],[`path`,{d:`M12 18h4`,key:`1wd2n7`}]]),jx=Q(`file-text`,[[`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`}]]),Mx=Q(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Nx=Q(`folder-open`,[[`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`}]]),Px=Q(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Fx=Q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Ix=Q(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Lx=Q(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),Rx=Q(`history`,[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),zx=Q(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Bx=Q(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Vx=Q(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Hx=Q(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ux=Q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Wx=Q(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Gx=Q(`package-check`,[[`path`,{d:`m16 16 2 2 4-4`,key:`gfu2re`}],[`path`,{d:`M21 10V8a2 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 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),Kx=Q(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),qx=Q(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Jx=Q(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Yx=Q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Xx=Q(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Zx=Q(`rotate-ccw`,[[`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`}]]),Qx=Q(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),$x=Q(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),eS=Q(`scale`,[[`path`,{d:`m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`7g6ntu`}],[`path`,{d:`m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`ijws7r`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2`,key:`3gwbw2`}]]),tS=Q(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),nS=Q(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),rS=Q(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),iS=Q(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),aS=Q(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),oS=Q(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),sS=Q(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),cS=Q(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),lS=Q(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),uS=Q(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),dS=Q(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),fS=Q(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),pS=Q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),mS=class extends Error{status;detail;constructor(e,t){super(t||`Request failed (${e})`),this.status=e,this.detail=t}};async function hS(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers);n!==void 0&&i.set(`Content-Type`,`application/json`);let a=await fetch(`/api${e}`,{...r,headers:i,body:n===void 0?r.body:JSON.stringify(n)});if(!a.ok){let e=`${a.status} ${a.statusText}`;try{let t=await a.json();e=typeof t?.detail==`string`&&t.detail||typeof t?.message==`string`&&t.message||JSON.stringify(t)}catch{}throw new mS(a.status,e)}if(a.status!==204)return await a.json()}var gS={preflight:()=>hS(`/preflight`),getSettings:()=>hS(`/settings`),saveSettings:e=>hS(`/settings`,{method:`POST`,json:e}),runtime:()=>hS(`/runtime`),costs:()=>hS(`/costs`),catalog:()=>hS(`/catalog`),listPresets:()=>hS(`/presets`),savePreset:(e,t)=>hS(`/presets`,{method:`POST`,json:{name:e,config:t}}),deletePreset:e=>hS(`/presets/${encodeURIComponent(e)}`,{method:`DELETE`}),listRuns:()=>hS(`/runs`),createRun:e=>hS(`/runs`,{method:`POST`,json:e}),getRun:e=>hS(`/runs/${encodeURIComponent(e)}`),listFiles:(e,t=``)=>hS(`/runs/${encodeURIComponent(e)}/files${t?`?path=${encodeURIComponent(t)}`:``}`),readFile:(e,t)=>hS(`/runs/${encodeURIComponent(e)}/file?path=${encodeURIComponent(t)}`),runTaskMatrix:e=>hS(`/runs/${encodeURIComponent(e)}/task-matrix`,{method:`POST`}),getTaskMatrix:e=>hS(`/runs/${encodeURIComponent(e)}/task-matrix`),select:(e,t)=>hS(`/runs/${encodeURIComponent(e)}/select`,{method:`POST`,json:{pick:t}}),qaGate:(e,t)=>hS(`/runs/${encodeURIComponent(e)}/qa-gate`,{method:`POST`,json:{decision:t}}),pause:e=>hS(`/runs/${encodeURIComponent(e)}/pause`,{method:`POST`}),resume:e=>hS(`/runs/${encodeURIComponent(e)}/resume`,{method:`POST`}),reopen:e=>hS(`/runs/${encodeURIComponent(e)}/reopen`,{method:`POST`}),retry:e=>hS(`/runs/${encodeURIComponent(e)}/retry`,{method:`POST`}),deleteRun:e=>hS(`/runs/${encodeURIComponent(e)}`,{method:`DELETE`}),agentOutput:e=>hS(`/runs/${encodeURIComponent(e)}/agent-output`),oddishStatus:e=>hS(`/runs/${encodeURIComponent(e)}/oddish`),runOnOddish:(e,t={})=>hS(`/runs/${encodeURIComponent(e)}/oddish`,{method:`POST`,json:t}),oddishTrajectory:(e,t)=>hS(`/runs/${encodeURIComponent(e)}/oddish/trajectory${t?`?trial_id=${encodeURIComponent(t)}`:``}`)},_S=(0,w.createContext)({preflight:null,loading:!0,refresh:async()=>{}});function vS({children:e}){let[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)(!0),a=(0,w.useCallback)(async()=>{try{n(await gS.preflight())}catch{n({ready:!1,checks:[]})}finally{i(!1)}},[]);return(0,w.useEffect)(()=>{a()},[a]),(0,V.jsx)(_S.Provider,{value:{preflight:t,loading:r,refresh:a},children:e})}function yS(){return(0,w.useContext)(_S)}var bS=(0,w.createContext)({mode:`dark`,toggleMode:()=>void 0});function xS(){return(0,w.useContext)(bS)}function SS(e){let t=e===`dark`,n=t?{default:`#111111`,paper:`#181818`}:{default:`#f7f7f5`,paper:`#ffffff`},r=t?{primary:`#f2f2f2`,secondary:`#a6a6a6`}:{primary:`#171717`,secondary:`#666666`},i=t?`#343434`:`#dededb`;return jl({palette:{mode:e,primary:{main:t?`#f2f2f2`:`#171717`,contrastText:t?`#111111`:`#ffffff`},background:n,text:r,divider:i,success:{main:t?`#58c882`:`#197a45`},warning:{main:t?`#f0b84d`:`#8a5b00`},error:{main:t?`#ff7b72`:`#b42318`},info:{main:t?`#f2f2f2`:`#171717`}},shape:{borderRadius:0},typography:{fontFamily:`Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif`,h1:{fontSize:24,lineHeight:1.2,fontWeight:600},h2:{fontSize:18,lineHeight:1.3,fontWeight:600},h3:{fontSize:15,lineHeight:1.35,fontWeight:600},button:{fontSize:13,fontWeight:600,textTransform:`none`},body1:{fontSize:14},body2:{fontSize:13}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:n.default,color:r.primary},"::selection":{backgroundColor:t?`#3a3a3a`:`#dededb`}}},MuiPaper:{defaultProps:{elevation:0,square:!0},styleOverrides:{root:{backgroundImage:`none`}}},MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{minHeight:36,borderRadius:0,boxShadow:`none`,paddingInline:14,gap:8}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:0,backgroundColor:n.paper}}},MuiChip:{styleOverrides:{root:{borderRadius:0,height:26,fontSize:12}}},MuiDialog:{styleOverrides:{paper:{borderRadius:0,border:`1px solid ${i}`}}},MuiTooltip:{styleOverrides:{tooltip:{borderRadius:0,backgroundColor:t?`#f2f2f2`:`#171717`,color:t?`#171717`:`#ffffff`,fontSize:12},arrow:{color:t?`#f2f2f2`:`#171717`}}},MuiTab:{styleOverrides:{root:{minHeight:48,textTransform:`none`,fontSize:13}}}}})}var CS=`/assets/icon-CQvH6luI.png`,wS=[{to:`/`,label:`Runs`,icon:Hx,end:!0},{to:`/costs`,label:`Costs`,icon:Cx,end:!1},{to:`/docs`,label:`Docs`,icon:mx,end:!1},{to:`/settings`,label:`Settings`,icon:nS,end:!1}];function TS({children:e}){let t=ot(),n=Il(),{mode:r,toggleMode:i}=xS(),{preflight:a}=yS(),o=a&&!a.ready;return(0,V.jsxs)(md,{className:`min-h-screen`,children:[(0,V.jsx)(ju,{position:`sticky`,color:`inherit`,elevation:0,sx:{borderBottom:1,borderColor:`divider`,bgcolor:`background.paper`},children:(0,V.jsx)(Fb,{disableGutters:!0,sx:{minHeight:`52px !important`,px:{xs:2,sm:4}},children:(0,V.jsxs)(md,{sx:{width:`100%`,maxWidth:1280,mx:`auto`,display:`flex`,alignItems:`stretch`,minHeight:52},children:[(0,V.jsxs)(md,{component:On,to:`/`,sx:{display:`flex`,alignItems:`center`,gap:1,pr:3,color:`text.primary`,textDecoration:`none`},children:[(0,V.jsx)(md,{component:`img`,src:CS,alt:``,"aria-hidden":!0,sx:{width:30,height:30,objectFit:`contain`}}),(0,V.jsx)(Qp,{component:`span`,sx:{fontSize:15,fontWeight:650,letterSpacing:`-0.01em`},children:`ProgramSmith`})]}),(0,V.jsx)(md,{component:`nav`,sx:{display:{xs:`none`,sm:`flex`},alignItems:`stretch`},children:wS.map(({to:e,label:t,icon:r,end:i})=>(0,V.jsxs)(kn,{to:e,end:i,style:({isActive:e})=>({display:`flex`,alignItems:`center`,gap:7,padding:`0 14px`,borderBottom:`2px solid ${e?n.palette.primary.main:`transparent`}`,color:e?n.palette.text.primary:n.palette.text.secondary,fontSize:13,fontWeight:e?600:500,textDecoration:`none`}),children:[(0,V.jsx)(r,{size:15}),t]},e))}),(0,V.jsxs)(md,{sx:{ml:`auto`,display:`flex`,alignItems:`center`,gap:2},children:[(0,V.jsx)(qb,{title:`Switch to ${r===`dark`?`light`:`dark`} mode`,children:(0,V.jsxs)(md,{sx:{display:`flex`,alignItems:`center`,gap:.5,color:`text.secondary`},children:[(0,V.jsx)(Wx,{size:14,"aria-hidden":`true`}),(0,V.jsx)(fb,{checked:r===`light`,onChange:i,size:`small`,slotProps:{input:{"aria-label":`Toggle light mode`}}}),(0,V.jsx)(oS,{size:14,"aria-hidden":`true`})]})}),o&&t.pathname!==`/settings`&&(0,V.jsx)(md,{component:On,to:`/settings`,sx:{border:1,borderColor:`warning.main`,color:`warning.main`,px:1.5,py:.75,fontSize:12,fontWeight:600,textDecoration:`none`},children:`Setup incomplete`})]})]})})}),(0,V.jsx)(md,{component:`main`,sx:{maxWidth:1280,mx:`auto`,px:{xs:2,sm:4},pt:4,pb:10},children:e})]})}function ES(e,t,n=[]){let[r,i]=(0,w.useState)(null),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(!1),[l,u]=(0,w.useState)(!0),d=(0,w.useRef)(!0),f=(0,w.useRef)(!1),p=(0,w.useRef)(e);p.current=e;let m=(0,w.useCallback)(async()=>{if(!f.current){f.current=!0,c(!0);try{let e=await p.current();if(!d.current)return;i(e),o(null)}catch(e){if(!d.current)return;o(e instanceof Error?e:Error(String(e)))}finally{f.current=!1,d.current&&(c(!1),u(!1))}}},[]);return(0,w.useEffect)(()=>{d.current=!0;let e=()=>document.visibilityState===`visible`&&document.hasFocus(),n=()=>{e()&&m()};if(n(),t>0){let r=window.setInterval(n,t),i=()=>{e()&&m()},a=()=>void m();return document.addEventListener(`visibilitychange`,i),window.addEventListener(`focus`,a),()=>{d.current=!1,window.clearInterval(r),document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`focus`,a)}}return()=>{d.current=!1}},[t,m,...n]),{data:r,error:a,loading:s,initialLoading:l,refresh:m}}function DS(...e){return U(e)}var OS=[{stage:`INGEST_LOCK`,label:`Ingest & Lock`,type:`gate`,blurb:`Clone, detect license/build, ProgramBench-overlap guard, pin the source SHA.`},{stage:`TASK_MATRIX`,label:`Task Matrix`,type:`cell`,blurb:`Propose candidate tasks and auto-pick the best fit.`},{stage:`ORACLE_GOLDEN`,label:`Oracle & Golden`,type:`cell`,blurb:`Build the sealed oracle pair + docs + Golden-I/O case suite.`},{stage:`CREATE`,label:`Create`,type:`cell`,blurb:`Assemble the ProgramBench-style task via the vendored generator.`},{stage:`SANITY`,label:`Sanity`,type:`gate`,blurb:`Oracle passes, nop fails.`},{stage:`STATIC_CI`,label:`Static CI`,type:`gate`,blurb:`The static check suite must be green.`},{stage:`DIFFICULTY_SWEEP`,label:`Smoke sweep`,type:`sweep`,blurb:`Cheap smoke-model trials — a coarse difficulty read before spending frontier trials.`},{stage:`CALIBRATE`,label:`Calibrate`,type:`decision`,blurb:`Smoke decision — proceed, harden, ease, or flag broken.`},{stage:`QA_PROBE`,label:`QA Probe`,type:`decision`,blurb:`Reward-hack / shortcut detection.`},{stage:`FULL_SWEEP`,label:`Frontier sweep`,type:`sweep`,blurb:`Frontier-model trials — the authoritative 1/3–2/3 difficulty band.`},{stage:`QA_GATE`,label:`Done`,type:`output`,blurb:`Final gate (automatic): accept exports the task; revise/reject loop back.`}],kS={stage:`SYNTHESIZE`,label:`Synthesize`,type:`cell`,blurb:`Surgical-patch cell (harden / ease / revise) — rejoin the forward chain after a fix.`},AS=Object.fromEntries([...OS,kS].map(e=>[e.stage,e])),jS=[{key:`gate`,label:`Code gate`,color:`var(--color-node-gate)`},{key:`cell`,label:`LLM cell`,color:`var(--color-node-cell)`},{key:`sweep`,label:`Sweep`,color:`var(--color-node-sweep)`},{key:`decision`,label:`Decision`,color:`var(--color-node-decision)`},{key:`output`,label:`Output`,color:`var(--color-node-output)`}];function MS(e){return jS.find(t=>t.key===e)?.color??`var(--color-accent)`}function NS(e){return{DONE:`Done`,DROPPED:`Dropped`,BLOCKED:`Blocked`,EASY_SHELF:`Easy shelf`}[e]??AS[e]?.label??e}var PS={neutral:`bg-surface-2 text-ink-2 border-line`,ok:`bg-ok-soft/40 text-ok border-ok/30`,warn:`bg-warn-soft/40 text-warn border-warn/30`,danger:`bg-danger-soft/40 text-danger border-danger/30`,info:`bg-accent-soft/40 text-info border-info/30`,accent:`bg-accent-soft/40 text-accent border-accent/30`,human:`bg-accent-soft/40 text-human border-human/30`};function FS({tone:e=`neutral`,className:t,children:n,...r}){return(0,V.jsx)(Mf,{size:`small`,variant:`outlined`,className:DS(PS[e],t),label:(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:n}),...r})}var IS={in_progress:`info`,draft:`ok`,done:`ok`,accepted:`ok`,dropped:`neutral`,blocked:`danger`,easy:`warn`};function LS({status:e,stage:t,active:n=!1,screenedOut:r=!1}){let i=e.replace(/_/g,` `),a=IS[e]??`neutral`;return r?(i=`screened out`,a=`neutral`):e===`in_progress`&&t?(i=NS(t),a=`info`):e===`done`?(i=`exported`,a=`ok`):e===`draft`?(i=`draft`,a=`ok`):e===`easy`&&(i=`easy shelf`,a=`warn`),(0,V.jsxs)(FS,{tone:a,className:`capitalize`,children:[e===`in_progress`&&n?(0,V.jsx)(sf,{color:`inherit`,size:11}):(0,V.jsx)(`span`,{className:DS(`size-1.5`,e===`in_progress`&&`animate-pulse`),style:{background:`currentColor`}}),i]})}function RS(e,t=10){return e?e.length>t?e.slice(0,t):e:`—`}function zS(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function BS(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return e;let n=Date.now()-t,r=Math.round(n/1e3);if(r<60)return`${r}s ago`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function VS(e){return e==null?`—`:e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}k`:`${(e/1e6).toFixed(1)}M`}function HS(e){if(e==null)return null;let t=Number(e);return!Number.isNaN(t)&&t>=0&&t<=1?t:null}function US(e){let t=HS(e);return t===null?e??`—`:`${Math.round(t*100)}%`}function WS(e){if(typeof e.progress==`number`)return e.progress;if(e.status===`done`)return 1;let t=OS.findIndex(t=>t.stage===e.stage);return t<0?+!![`dropped`,`blocked`,`easy`].includes(e.status):(t+1)/OS.length}function GS({run:e}){let t=Il(),n=WS(e),r=HS(e.difficulty_pass_at_1),i=e.screened_out?`Source screened out`:e.status===`draft`?`Static CI passed`:NS(e.stage),a=e.screened_out?`No task was created`:e.status===`draft`?`Uncalibrated draft`:e.full_sweep_band?`Frontier ${e.full_sweep_band}`:r===null?`Not calibrated`:`pass@1 ${US(e.difficulty_pass_at_1)}`,o=e.status===`blocked`?t.palette.error.main:e.status===`done`||e.status===`draft`?t.palette.success.main:`var(--color-node-gate)`;return(0,V.jsxs)(Eu,{component:On,to:`/run/${encodeURIComponent(e.key)}`,variant:`outlined`,square:!0,sx:{display:`block`,p:2,color:`text.primary`,textDecoration:`none`,transition:`border-color 120ms ease, background-color 120ms ease`,"&:hover":{borderColor:`text.secondary`,bgcolor:`action.hover`},"&:focus-visible":{outline:`2px solid ${t.palette.primary.main}`,outlineOffset:1}},children:[(0,V.jsxs)(md,{sx:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:2},children:[(0,V.jsxs)(md,{sx:{minWidth:0},children:[(0,V.jsxs)(md,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,V.jsx)(Qp,{variant:`h3`,noWrap:!0,children:e.slug??e.key}),e.paused&&(0,V.jsx)(Kx,{size:13,color:`#8a5b00`})]}),(0,V.jsxs)(Qp,{variant:`body2`,color:`text.secondary`,sx:{mt:.5,display:`flex`,alignItems:`center`,gap:.75,fontFamily:`monospace`,fontSize:11.5},children:[(0,V.jsx)(Ix,{size:12}),(0,V.jsx)(`span`,{className:`truncate`,children:e.key})]})]}),(0,V.jsx)(LS,{status:e.status,stage:e.stage,active:!!e.active_job||!!e.waiting,screenedOut:!!e.screened_out})]}),(0,V.jsxs)(md,{sx:{mt:2.25},children:[(0,V.jsxs)(md,{sx:{mb:.75,display:`flex`,justifyContent:`space-between`,gap:2},children:[(0,V.jsx)(Qp,{variant:`body2`,color:`text.secondary`,children:i}),(0,V.jsxs)(Qp,{variant:`body2`,color:`text.secondary`,sx:{fontVariantNumeric:`tabular-nums`},children:[Math.round(n*100),`%`]})]}),(0,V.jsx)(Vh,{variant:`determinate`,value:n*100,sx:{height:3,bgcolor:`divider`,"& .MuiLinearProgress-bar":{bgcolor:o}}})]}),(0,V.jsxs)(md,{sx:{mt:2,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:2},children:[(0,V.jsx)(Qp,{variant:`body2`,color:`text.secondary`,children:a}),(e.revise>0||e.harden>0||(e.ease??0)>0)&&(0,V.jsx)(Qp,{variant:`body2`,color:`text.secondary`,sx:{fontSize:11.5},children:e.revise>0?`${e.revise} revise`:e.harden>0?`${e.harden} harden`:`${e.ease} ease`})]})]})}var KS=wf((0,V.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`);function qS({open:e,onClose:t,title:n,description:r,children:i,className:a,style:o}){return(0,V.jsxs)(Vp,{open:e,onClose:t,fullWidth:!0,maxWidth:`sm`,slotProps:{paper:{className:DS(a),style:o}},children:[(0,V.jsxs)(tm,{className:`flex items-start justify-between gap-4 border-b border-line px-6 py-5`,children:[(0,V.jsxs)(`span`,{className:`min-w-0`,children:[(0,V.jsx)(Qp,{component:`span`,variant:`h2`,className:`block`,children:n}),r&&(0,V.jsx)(Qp,{component:`span`,variant:`body2`,color:`text.secondary`,className:`mt-1 block`,children:r})]}),(0,V.jsx)(sh,{onClick:t,size:`small`,"aria-label":`Close`,children:(0,V.jsx)(KS,{fontSize:`small`})})]}),(0,V.jsx)(qp,{className:`px-6 py-5`,children:i})]})}var JS={primary:{color:`primary`,variant:`contained`},secondary:{color:`inherit`,variant:`outlined`},outline:{color:`inherit`,variant:`outlined`},ghost:{color:`inherit`,variant:`text`},danger:{color:`error`,variant:`outlined`}},YS={sm:`small`,md:`medium`,lg:`large`},XS=(0,w.forwardRef)(({variant:e=`secondary`,size:t=`md`,loading:n,children:r,disabled:i,...a},o)=>(0,V.jsx)(yf,{ref:o,size:YS[t],disabled:i||n,startIcon:n?(0,V.jsx)(sf,{color:`inherit`,size:14}):void 0,...JS[e],...a,children:r}));XS.displayName=`Button`;function ZS({label:e,hint:t,htmlFor:n,children:r}){return(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{htmlFor:n,className:`block text-[13px] font-medium text-ink-2`,children:e}),r,t&&(0,V.jsx)(`p`,{className:`text-[12px] leading-snug text-ink-4`,children:t})]})}var QS=(0,w.forwardRef)(({className:e,...t},n)=>(0,V.jsx)(`input`,{ref:n,className:DS(`h-10 w-full rounded-xl border border-line bg-bg-2/60 px-3.5 text-sm text-ink placeholder:text-ink-4 transition-colors focus-ring focus:border-accent/50`,e),...t}));QS.displayName=`Input`;var $S=(0,w.forwardRef)(({className:e,children:t,...n},r)=>(0,V.jsx)(`select`,{ref:r,className:DS(`h-10 w-full appearance-none rounded-xl border border-line bg-bg-2/60 px-3.5 text-sm text-ink transition-colors focus-ring focus:border-accent/50 bg-[length:16px] bg-[right_0.75rem_center] bg-no-repeat pr-9 bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E')]`,e),...n,children:t}));$S.displayName=`Select`;var eC={anthropic:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.541Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`,openai:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,google:`M12 24A14.304 14.304 0 0 0 0 12 14.304 14.304 0 0 0 12 0a14.305 14.305 0 0 0 12 12 14.305 14.305 0 0 0-12 12`},tC={zai:`GLM`,miniswe:`mS`,terminus:`T2`};function nC(e){return(e||``).split(`/`)[0]||``}var rC={"claude-code":`anthropic`,codex:`openai`,"gemini-cli":`google`,"mini-swe":`miniswe`,"terminus-2":`terminus`};function iC({provider:e,size:t=16,className:n=``}){let r=eC[e];if(r)return(0,V.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,className:n,"aria-hidden":!0,children:(0,V.jsx)(`path`,{d:r})});let i=tC[e];return i?(0,V.jsx)(`span`,{className:`inline-flex items-center justify-center rounded-[4px] border border-line bg-surface-2 font-mono font-semibold leading-none text-ink-2 ${n}`,style:{width:t+4,height:t+2,fontSize:t*.52},"aria-hidden":!0,children:i}):(0,V.jsx)(sx,{style:{width:t,height:t},className:n,"aria-hidden":!0})}var aC=e=>JSON.parse(JSON.stringify(e));function oC({open:e,onClose:t,onCreated:n}){let r=lt(),[i,a]=(0,w.useState)(``),[o,s]=(0,w.useState)(``),[c,l]=(0,w.useState)(``),[u,d]=(0,w.useState)(``),[f,p]=(0,w.useState)(`full`),[m,h]=(0,w.useState)(`claude-sonnet-5`),[g,_]=(0,w.useState)(!1),[v,y]=(0,w.useState)(null),[b,x]=(0,w.useState)(null),[S,C]=(0,w.useState)(null),[T,E]=(0,w.useState)(typeof window<`u`&&window.location.hash.includes(`adv`)),[D,O]=(0,w.useState)({}),[k,A]=(0,w.useState)(``);(0,w.useEffect)(()=>{e&&(gS.catalog().then(e=>{x(e),C(t=>t??aC(e.default_config))}),gS.listPresets().then(e=>O(e.presets)).catch(()=>{}))},[e]);function j(){a(``),s(``),l(``),d(``),p(`full`),h(`claude-sonnet-5`),y(null),_(!1),A(``),b&&C(aC(b.default_config))}function M(){j(),t()}async function N(){if(!i.trim()){y(`A source repository is required.`);return}_(!0),y(null);try{let e=await gS.createRun({repo:i.trim(),sha:o.trim()||void 0,slug:c.trim()||void 0,brief:u.trim()||void 0,config:S??void 0,mode:f,cell_model:m});n(),j(),t(),r(`/run/${encodeURIComponent(e.key)}`)}catch(e){e instanceof mS&&e.status===409?y(`A run with that name already exists. Choose a different name.`):y(e instanceof Error?e.message:String(e)),_(!1)}}async function P(){if(!(!k.trim()||!S))try{O((await gS.savePreset(k.trim(),S)).presets),A(``)}catch(e){y(e instanceof Error?e.message:String(e))}}return(0,V.jsx)(qS,{open:e,onClose:M,title:`New run`,style:{maxWidth:T?`62rem`:`34rem`,transition:`max-width 260ms cubic-bezier(0.4, 0, 0.2, 1)`},children:(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsx)(ZS,{label:`Source repository`,htmlFor:`repo`,hint:`owner/name or a full GitHub URL.`,children:(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(Lx,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-ink-4`}),(0,V.jsx)(QS,{id:`repo`,className:`pl-9`,autoFocus:!0,placeholder:`devkit/minpack`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===`Enter`&&!T&&void N()})]})}),(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(ZS,{label:`Pinned SHA`,htmlFor:`sha`,hint:`Resolves HEAD if blank.`,children:(0,V.jsx)(QS,{id:`sha`,className:`font-mono`,placeholder:`(optional)`,value:o,onChange:e=>s(e.target.value)})}),(0,V.jsx)(ZS,{label:`Run name`,htmlFor:`slug`,hint:`Defaults to the repo name.`,children:(0,V.jsx)(QS,{id:`slug`,placeholder:`(optional)`,value:c,onChange:e=>l(e.target.value)})})]}),(0,V.jsx)(ZS,{label:`Task brief (optional)`,htmlFor:`brief`,children:(0,V.jsx)(`textarea`,{id:`brief`,rows:3,placeholder:`e.g. Scope the flag surface to the core subcommands; skip the network-dependent modes; prefer stdin-driven cases.`,value:u,onChange:e=>d(e.target.value),className:`w-full resize-y rounded-xl border border-line bg-bg-2/60 px-3.5 py-2.5 text-sm text-ink placeholder:text-ink-4 transition-colors focus-ring focus:border-accent/50`})}),(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(ZS,{label:`Pipeline mode`,htmlFor:`pipeline_mode`,hint:`Draft exports immediately after Static CI.`,children:(0,V.jsxs)($S,{id:`pipeline_mode`,value:f,onChange:e=>p(e.target.value),children:[(0,V.jsx)(`option`,{value:`full`,children:`Full — calibrate and evaluate`}),(0,V.jsx)(`option`,{value:`draft`,children:`Draft — stop after Static CI`})]})}),(0,V.jsx)(ZS,{label:`Task-generation model`,htmlFor:`cell_model`,children:(0,V.jsxs)($S,{id:`cell_model`,value:m,onChange:e=>h(e.target.value),children:[(0,V.jsx)(`option`,{value:`claude-sonnet-5`,children:`Sonnet 5`}),(0,V.jsx)(`option`,{value:`claude-opus-4-8`,children:`Opus 4.8`}),(0,V.jsx)(`option`,{value:`claude-sonnet-4-6`,children:`Sonnet 4.6`})]})})]}),(0,V.jsxs)(`div`,{className:`rounded-xl border border-line`,children:[(0,V.jsx)(`button`,{onClick:()=>E(e=>!e),className:`focus-ring flex w-full items-center justify-between gap-2 rounded-xl px-4 py-3 text-left`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] font-medium text-ink-2`,children:[(0,V.jsx)(vx,{className:`size-4 text-ink-4 transition-transform duration-200 ${T?`rotate-90`:``}`}),`Advanced options`]})}),(0,V.jsx)(zf,{in:T,timeout:260,unmountOnExit:!0,children:b&&S&&(0,V.jsxs)(`div`,{className:`space-y-5 border-t border-line p-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,V.jsx)(ZS,{label:`Preset`,htmlFor:`preset`,children:(0,V.jsxs)($S,{id:`preset`,value:``,onChange:e=>{let t=D[e.target.value];t&&C(aC(t))},children:[(0,V.jsx)(`option`,{value:``,children:`Load preset…`}),Object.keys(D).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(QS,{placeholder:`Save as…`,value:k,className:`w-36`,onChange:e=>A(e.target.value)}),(0,V.jsxs)(XS,{variant:`secondary`,onClick:()=>void P(),disabled:!k.trim(),children:[(0,V.jsx)($x,{className:`size-3.5`}),`Save`]})]})]}),(0,V.jsx)(sC,{title:`Smoke sweep`,hint:`Default: smoke model ×3, band 0–90% — with k=3 only 3/3 saturates.`,catalog:b,stage:S.difficulty,onChange:e=>C({...S,difficulty:e})}),(0,V.jsx)(sC,{title:`Frontier sweep`,hint:`Default: frontier model ×3, band 30–70% — the 1/3–2/3 target window.`,catalog:b,stage:S.full,onChange:e=>C({...S,full:e})})]})})]}),v&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,children:v}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2.5 pt-1`,children:[(0,V.jsx)(XS,{variant:`ghost`,onClick:M,children:`Cancel`}),(0,V.jsxs)(XS,{variant:`primary`,onClick:()=>void N(),loading:g,children:[(0,V.jsx)(ox,{className:`size-4`}),`Create run`]})]})]})})}function sC({title:e,hint:t,catalog:n,stage:r,onChange:i}){let a=Object.keys(n.harnesses),o=Object.keys(n.models),s=(e,t)=>i({...r,agents:r.agents.map((n,r)=>r===e?{...n,...t}:n)}),c=()=>i({...r,agents:[...r.agents,{harness:a[0],model:o[0],n_trials:3}]}),l=e=>i({...r,agents:r.agents.filter((t,n)=>n!==e)}),u=[`aggregate`,...Array.from(new Set(r.agents.map(e=>e.harness)))].includes(r.band.basis)?r.band.basis:`aggregate`,d=u===`aggregate`?Math.max(0,...r.agents.map(e=>e.n_trials)):r.agents.find(e=>e.harness===u)?.n_trials??0,f=e=>Math.round(e*100),p=r.band.combinator??`aggregate`,m=r.band.per_model??[],h=Array.from(new Set(r.agents.map(e=>e.harness))),g=h.length>0?h:a,_=e=>i({...r,band:{...r.band,...e}}),v=(e,t)=>_({per_model:m.map((n,r)=>r===e?{...n,...t}:n)}),y=()=>_({per_model:[...m,{basis:g[0],min_pass:0,max_pass:.7}]}),b=e=>_({per_model:m.filter((t,n)=>n!==e)});return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h4`,{className:`text-[13px] font-semibold text-ink`,children:e}),t&&(0,V.jsx)(`p`,{className:`mt-0.5 text-[11.5px] leading-snug text-ink-4`,children:t})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[r.agents.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-bg-2/40 px-2 py-1`,children:[(0,V.jsx)(iC,{provider:n.harnesses[e.harness]?.provider??``,className:`shrink-0 text-ink-3`}),(0,V.jsx)($S,{value:e.harness,onChange:e=>s(t,{harness:e.target.value}),className:`h-8 border-0 bg-transparent px-1 text-[12.5px]`,children:a.map(e=>(0,V.jsxs)(`option`,{value:e,children:[n.harnesses[e].label,n.harnesses[e].recommended===!1?` — not recommended`:``]},e))})]}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-bg-2/40 px-2 py-1`,children:[(0,V.jsx)(iC,{provider:n.models[e.model]?.provider??``,className:`shrink-0 text-ink-3`}),(0,V.jsx)($S,{value:e.model,onChange:e=>s(t,{model:e.target.value}),className:`h-8 border-0 bg-transparent px-1 text-[12.5px]`,children:o.map(e=>(0,V.jsx)(`option`,{value:e,children:n.models[e].label},e))})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(QS,{type:`number`,min:1,max:50,value:e.n_trials,onChange:e=>s(t,{n_trials:Math.max(1,Number(e.target.value)||1)}),className:`h-9 w-14 text-center`,title:`trials (k in pass@k)`}),(0,V.jsx)(`span`,{className:`text-[11px] text-ink-4`,children:`×`})]}),(0,V.jsx)(`button`,{onClick:()=>l(t),disabled:r.agents.length<=1,className:`focus-ring rounded-md p-1.5 text-ink-4 transition-colors hover:bg-surface-2 hover:text-danger disabled:opacity-30`,title:`Remove agent`,children:(0,V.jsx)(uS,{className:`size-3.5`})})]},t)),(0,V.jsxs)(`button`,{onClick:c,className:`focus-ring inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[12.5px] font-medium text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,children:[(0,V.jsx)(Yx,{className:`size-3.5`}),`Add agent`]})]}),(0,V.jsxs)(`div`,{className:`space-y-2.5 rounded-lg border border-line bg-bg-2/30 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-4 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{className:`block text-[11px] font-medium uppercase tracking-[0.06em] text-ink-4`,children:`Acceptance`}),(0,V.jsxs)($S,{value:p,onChange:e=>_({combinator:e.target.value}),className:`h-8 w-52 text-[12.5px]`,children:[(0,V.jsx)(`option`,{value:`aggregate`,children:`Aggregate (best model)`}),(0,V.jsx)(`option`,{value:`any`,children:`Any model hard (sellable)`}),(0,V.jsx)(`option`,{value:`all`,children:`All models hard`})]})]}),p===`aggregate`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`label`,{className:`block text-[11px] font-medium uppercase tracking-[0.06em] text-ink-4`,children:`Band basis`}),(0,V.jsxs)($S,{value:u,onChange:e=>_({basis:e.target.value}),className:`h-8 w-40 text-[12.5px]`,children:[(0,V.jsx)(`option`,{value:`aggregate`,children:`Aggregate (best agent)`}),Array.from(new Set(r.agents.map(e=>e.harness))).map(e=>(0,V.jsx)(`option`,{value:e,children:n.harnesses[e]?.label??e},e))]})]}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`label`,{className:`block text-[11px] font-medium uppercase tracking-[0.06em] text-ink-4`,children:[`Target pass@`,d||`k`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12.5px]`,children:[(0,V.jsx)(QS,{type:`number`,min:0,max:100,value:f(r.band.min_pass),onChange:e=>_({min_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`–`}),(0,V.jsx)(QS,{type:`number`,min:0,max:100,value:f(r.band.max_pass),onChange:e=>_({max_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`%`})]})]})]})]}),(p===`any`||p===`all`)&&(0,V.jsxs)(`div`,{className:`space-y-2 border-t border-line pt-2.5`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[m.length===0&&(0,V.jsx)(`p`,{className:`text-[11.5px] text-ink-4`,children:`No models yet — add one to define per-model bands.`}),m.map((e,t)=>{let i=r.agents.find(t=>t.harness===e.basis)?.n_trials??0;return(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-bg-2/40 px-2 py-1`,children:[(0,V.jsx)(iC,{provider:n.harnesses[e.basis]?.provider??``,className:`shrink-0 text-ink-3`}),(0,V.jsx)($S,{value:e.basis,onChange:e=>v(t,{basis:e.target.value}),className:`h-8 border-0 bg-transparent px-1 text-[12.5px]`,children:g.map(e=>(0,V.jsx)(`option`,{value:e,children:n.harnesses[e]?.label??e},e))})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12.5px]`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] text-ink-4`,children:[`pass@`,i||`k`]}),(0,V.jsx)(QS,{type:`number`,min:0,max:100,step:5,value:f(e.min_pass),onChange:e=>v(t,{min_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`–`}),(0,V.jsx)(QS,{type:`number`,min:0,max:100,step:5,value:f(e.max_pass),onChange:e=>v(t,{max_pass:(Number(e.target.value)||0)/100}),className:`h-8 w-16 text-center`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`%`})]}),(0,V.jsx)(`button`,{onClick:()=>b(t),className:`focus-ring rounded-md p-1.5 text-ink-4 transition-colors hover:bg-surface-2 hover:text-danger`,title:`Remove model`,children:(0,V.jsx)(uS,{className:`size-3.5`})})]},t)})]}),(0,V.jsxs)(`button`,{onClick:y,className:`focus-ring inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[12.5px] font-medium text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,children:[(0,V.jsx)(Yx,{className:`size-3.5`}),`Add model`]}),(0,V.jsx)(`p`,{className:`text-[11.5px] leading-snug text-ink-4`,children:p===`any`?`any = keep if at least one model finds it hard (its pass ≤ its max).`:`all = keep only if every listed model finds it hard.`})]})]})]})}function cC({className:e}){return(0,V.jsx)($y,{animation:`wave`,className:e,variant:`rectangular`})}function lC({className:e,hover:t,...n}){return(0,V.jsx)(Eu,{component:`div`,square:!0,variant:`outlined`,className:DS(t&&`glass-hover`,e),...n})}function uC({className:e,...t}){return(0,V.jsx)(md,{component:`div`,className:DS(`flex items-center justify-between gap-3 border-b border-line px-5 py-4`,e),...t})}function dC({className:e,...t}){return(0,V.jsx)(md,{component:`h3`,className:DS(`m-0 flex items-center gap-2 text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-3`,e),...t})}function fC({className:e,...t}){return(0,V.jsx)(md,{component:`div`,className:DS(`p-5`,e),...t})}function pC({icon:e,title:t,body:n,action:r}){return(0,V.jsxs)(lC,{className:`flex flex-col items-center justify-center px-6 py-16 text-center`,children:[e&&(0,V.jsx)(`div`,{className:`mb-4 flex size-14 items-center justify-center rounded-2xl bg-surface-2 text-ink-3`,children:e}),(0,V.jsx)(`h3`,{className:`text-lg font-semibold text-ink`,children:t}),n&&(0,V.jsx)(`p`,{className:`mt-2 max-w-sm text-sm text-ink-3`,children:n}),r&&(0,V.jsx)(`div`,{className:`mt-6`,children:r})]})}function mC({title:e=`Something went wrong`,message:t,action:n}){return(0,V.jsxs)(lC,{className:`flex flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-danger-soft/40 text-danger`,children:(0,V.jsx)(cx,{className:`size-6`})}),(0,V.jsx)(`h3`,{className:`text-base font-semibold text-ink`,children:e}),t&&(0,V.jsx)(`p`,{className:`mt-2 max-w-md text-sm text-ink-3`,children:t}),n&&(0,V.jsx)(`div`,{className:`mt-5`,children:n})]})}function hC(e){return e.screened_out?`screened_out`:e.source_admitted?e.paused?`paused`:e.awaiting_human?`human`:e.status===`draft`?`draft`:e.status===`done`?`accepted`:e.status===`easy`?`easy`:e.status===`dropped`?`dropped`:e.waiting?`waiting`:e.blocked||e.status===`blocked`?`blocked`:`in_progress`:`screening`}var gC=[{key:`tasks`,label:`Tasks`},{key:`outputs`,label:`Outputs`},{key:`all`,label:`All`},{key:`in_progress`,label:`In progress`},{key:`draft`,label:`Drafts`},{key:`waiting`,label:`Waiting`},{key:`human`,label:`Needs review`},{key:`blocked`,label:`Blocked`},{key:`accepted`,label:`Exported`},{key:`easy`,label:`Easy shelf`},{key:`screening`,label:`Source screening`},{key:`screened_out`,label:`Rejected sources`},{key:`dropped`,label:`Dropped`},{key:`paused`,label:`Paused`}];function _C(){let[e,t]=(0,w.useState)(typeof window<`u`&&window.location.hash.startsWith(`#new`)),{data:n,error:r,initialLoading:i,refresh:a}=ES(()=>gS.listRuns(),4e3),o=n?.runs??[],[s,c]=(0,w.useState)(`tasks`),[l,u]=(0,w.useState)(``),d=(0,w.useMemo)(()=>{let e={};for(let t of o){let n=hC(t);e[n]=(e[n]??0)+1}return e},[o]),f=(0,w.useMemo)(()=>{let e=l.trim().toLowerCase();return o.filter(t=>(s===`all`||(s===`tasks`?!!t.source_admitted:s===`outputs`?t.status===`draft`||t.status===`done`:hC(t)===s))&&(!e||(t.slug??``).toLowerCase().includes(e)||t.key.toLowerCase().includes(e)))},[o,s,l]);return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,V.jsx)(Qp,{variant:`h1`,children:`Runs`}),(0,V.jsxs)(XS,{variant:`primary`,onClick:()=>t(!0),children:[(0,V.jsx)(Yx,{size:16}),`New run`]})]}),r&&!n?(0,V.jsx)(mC,{title:`Couldn't load runs`,message:r.message,action:(0,V.jsx)(XS,{onClick:()=>void a(),children:`Retry`})}):i?(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[0,1,2,3,4,5].map(e=>(0,V.jsx)(cC,{className:`h-[150px] w-full`},e))}):o.length===0?(0,V.jsx)(pC,{title:`No runs`,body:`Create a run to source and verify a new task.`,action:(0,V.jsxs)(XS,{variant:`primary`,onClick:()=>t(!0),children:[(0,V.jsx)(Yx,{size:16}),`New run`]})}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(jb,{exclusive:!0,size:`small`,value:s,onChange:(e,t)=>t&&c(t),"aria-label":`Run status`,sx:{flexWrap:`wrap`,gap:`1px`,"& .MuiToggleButtonGroup-grouped":{border:`1px solid`,borderColor:`divider`}},children:gC.filter(e=>e.key===`tasks`||e.key===`outputs`||e.key===`all`||(d[e.key]??0)>0).map(e=>(0,V.jsxs)(Tb,{value:e.key,sx:{px:1.25,py:.5,textTransform:`none`,fontSize:12},children:[e.label,`\xA0`,e.key===`all`?o.length:e.key===`tasks`?n?.counters.admitted??0:e.key===`outputs`?n?.counters.exported??0:d[e.key]??0]},e.key))}),(0,V.jsx)(_b,{value:l,onChange:e=>u(e.target.value),placeholder:`Search`,size:`small`,sx:{width:190,ml:{sm:`auto`}},slotProps:{input:{startAdornment:(0,V.jsx)(Sh,{position:`start`,children:(0,V.jsx)(tS,{size:15})})}}})]}),f.length===0?(0,V.jsx)(`div`,{className:`border border-line bg-surface px-4 py-8 text-center text-[13px] text-ink-3`,children:`No matching runs.`}):(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:f.map(e=>(0,V.jsx)(GS,{run:e},e.key))})]}),(0,V.jsx)(oC,{open:e,onClose:()=>t(!1),onCreated:()=>void a()})]})}function vC({content:e,children:t,side:n=`top`,className:r}){return e?(0,V.jsx)(qb,{title:e,placement:n,arrow:!0,children:(0,V.jsx)(`span`,{className:r??`inline-flex`,children:t})}):(0,V.jsx)(V.Fragment,{children:t})}var yC=(0,w.createContext)({});function bC(e){let t=(0,w.useRef)(null);return t.current===null&&(t.current=e()),t.current}var xC=typeof window<`u`?w.useLayoutEffect:w.useEffect,SC=(0,w.createContext)(null);function CC(e,t){e.indexOf(t)===-1&&e.push(t)}function wC(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var TC=(e,t,n)=>n>t?t:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),OC=e=>typeof e==`object`&&!!e,kC=e=>/^0[^.\s]+$/u.test(e);function AC(e){let t;return()=>(t===void 0&&(t=e()),t)}var jC=e=>e,MC=(...e)=>e.reduce((e,t)=>n=>t(e(n))),NC=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},PC=class{constructor(){this.subscriptions=[]}add(e){return CC(this.subscriptions,e),()=>wC(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;ie*1e3,IC=e=>e/1e3,LC=(e,t)=>t?1e3/t*e:0,RC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,zC=1e-7,BC=12;function VC(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=RC(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>zC&&++sVC(t,0,1,e,n);return e=>e===0||e===1?e:RC(i(e),t,r)}var UC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,WC=e=>t=>1-e(1-t),GC=HC(.33,1.53,.69,.99),KC=WC(GC),qC=UC(KC),JC=e=>e>=1?1:(e*=2)<1?.5*KC(e):.5*(2-2**(-10*(e-1))),YC=e=>1-Math.sin(Math.acos(e)),XC=WC(YC),ZC=UC(YC),QC=HC(.42,0,1,1),$C=HC(0,0,.58,1),ew=HC(.42,0,.58,1),tw=e=>Array.isArray(e)&&typeof e[0]==`number`,nw=e=>Array.isArray(e)&&typeof e[0]!=`number`,rw={linear:jC,easeIn:QC,easeInOut:ew,easeOut:$C,circIn:YC,circInOut:ZC,circOut:XC,backIn:KC,backInOut:qC,backOut:GC,anticipate:JC},iw=e=>typeof e==`string`,aw=e=>{if(tw(e)){e.length;let[t,n,r,i]=e;return HC(t,n,r,i)}else if(iw(e))return rw[e],`${e}`,rw[e];return e},ow=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function sw(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var cw=40;function lw(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ow.reduce((e,t)=>(e[t]=sw(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=EC.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,cw),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:ow.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t(mw===void 0&&gw.set(fw.isProcessing||EC.useManualTiming?fw.timestamp:performance.now()),mw),set:e=>{mw=e,queueMicrotask(hw)}},_w=e=>t=>typeof t==`string`&&t.startsWith(e),vw=_w(`--`),yw=_w(`var(--`),bw=e=>yw(e)?xw.test(e.split(`/*`)[0].trim()):!1,xw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sw(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var Cw={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ww={...Cw,transform:e=>TC(0,1,e)},Tw={...Cw,default:1},Ew=e=>Math.round(e*1e5)/1e5,Dw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ow(e){return e==null}var kw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Aw=(e,t)=>n=>!!(typeof n==`string`&&kw.test(n)&&n.startsWith(e)||t&&!Ow(n)&&Object.prototype.hasOwnProperty.call(n,t)),jw=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Dw);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Mw=e=>TC(0,255,e),Nw={...Cw,transform:e=>Math.round(Mw(e))},Pw={test:Aw(`rgb`,`red`),parse:jw(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Nw.transform(e)+`, `+Nw.transform(t)+`, `+Nw.transform(n)+`, `+Ew(ww.transform(r))+`)`};function Fw(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Iw={test:Aw(`#`),parse:Fw,transform:Pw.transform},Lw=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rw=Lw(`deg`),zw=Lw(`%`),$=Lw(`px`),Bw=Lw(`vh`),Vw=Lw(`vw`),Hw={...zw,parse:e=>zw.parse(e)/100,transform:e=>zw.transform(e*100)},Uw={test:Aw(`hsl`,`hue`),parse:jw(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+zw.transform(Ew(t))+`, `+zw.transform(Ew(n))+`, `+Ew(ww.transform(r))+`)`},Ww={test:e=>Pw.test(e)||Iw.test(e)||Uw.test(e),parse:e=>Pw.test(e)?Pw.parse(e):Uw.test(e)?Uw.parse(e):Iw.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Pw.transform(e):Uw.transform(e),getAnimatableNone:e=>{let t=Ww.parse(e);return t.alpha=0,Ww.transform(t)}},Gw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Kw(e){return isNaN(e)&&typeof e==`string`&&(e.match(Dw)?.length||0)+(e.match(Gw)?.length||0)>0}var qw=`number`,Jw=`color`,Yw=`var`,Xw=`var(`,Zw="${}",Qw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $w(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Qw,e=>(Ww.test(e)?(r.color.push(a),i.push(Jw),n.push(Ww.parse(e))):e.startsWith(Xw)?(r.var.push(a),i.push(Yw),n.push(e)):(r.number.push(a),i.push(qw),n.push(parseFloat(e))),++a,Zw)).split(Zw),indexes:r,types:i}}function eT(e){return $w(e).values}function tT({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;atypeof e==`number`?0:Ww.test(e)?Ww.getAnimatableNone(e):e,iT=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:rT(e);function aT(e){let t=$w(e);return tT(t)(t.values.map((e,n)=>iT(e,t.split[n])))}var oT={test:Kw,parse:eT,createTransformer:nT,getAnimatableNone:aT};function sT(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function cT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=sT(s,r,e+1/3),a=sT(s,r,e),o=sT(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function lT(e,t){return n=>n>0?t:e}var uT=(e,t,n)=>e+(t-e)*n,dT=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},fT=[Iw,Pw,Uw],pT=e=>fT.find(t=>t.test(e));function mT(e){let t=pT(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Uw&&(n=cT(n)),n}var hT=(e,t)=>{let n=mT(e),r=mT(t);if(!n||!r)return lT(e,t);let i={...n};return e=>(i.red=dT(n.red,r.red,e),i.green=dT(n.green,r.green,e),i.blue=dT(n.blue,r.blue,e),i.alpha=uT(n.alpha,r.alpha,e),Pw.transform(i))},gT=new Set([`none`,`hidden`]);function _T(e,t){return gT.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function vT(e,t){return n=>uT(e,t,n)}function yT(e){return typeof e==`number`?vT:typeof e==`string`?bw(e)?lT:Ww.test(e)?hT:CT:Array.isArray(e)?bT:typeof e==`object`?Ww.test(e)?hT:xT:lT}function bT(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>yT(e)(e,t[n]));return e=>{for(let t=0;t{for(let t in r)n[t]=r[t](e);return n}}function ST(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i{let n=oT.createTransformer(t),r=$w(e),i=$w(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?gT.has(e)&&!i.values.length||gT.has(t)&&!r.values.length?_T(e,t):MC(bT(ST(r,i),i.values),n):(`${e}${t}`,lT(e,t))};function wT(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?uT(e,t,n):yT(e)(e,t)}var TT=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>uw.update(t,e),stop:()=>dw(t),now:()=>fw.isProcessing?fw.timestamp:gw.now()}},ET=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t=2e4?1/0:t}function kT(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(OT(r),DT);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:IC(i)}}var AT={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function jT(e,t){return e*Math.sqrt(1-t*t)}var MT=12;function NT(e,t,n){let r=n;for(let n=1;n{let r=t*o,i=r*e,a=r-n,s=jT(t,o),c=Math.exp(-i);return PT-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=jT(t**2,o);return(-i(t)+PT>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=NT(i,a,s);if(e=FC(e),isNaN(c))return{stiffness:AT.stiffness,damping:AT.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var IT=[`duration`,`bounce`],LT=[`stiffness`,`damping`,`mass`];function RT(e,t){return t.some(t=>e[t]!==void 0)}function zT(e){let t={velocity:AT.velocity,stiffness:AT.stiffness,damping:AT.damping,mass:AT.mass,isResolvedFromDuration:!1,...e};if(!RT(e,LT)&&RT(e,IT))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*TC(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:AT.mass,stiffness:i,damping:a}}else{let n=FT({...e,velocity:0});t={...t,...n,mass:AT.mass},t.isResolvedFromDuration=!0}return t}function BT(e=AT.visualDuration,t=AT.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=zT({...n,velocity:-IC(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=IC(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?AT.restSpeed.granular:AT.restSpeed.default,i||=v?AT.restDelta.granular:AT.restDelta.default;let y,b,x,S,C,w;if(h<1)x=jT(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>FC(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=FC(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=FC(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(OT(T),DT),t=ET(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}BT.applyToOptions=e=>{let t=kT(e,100,BT);return e.ease=t.ease,e.duration=FC(t.duration),e.type=`keyframes`,e};var VT=5;function HT(e,t,n){let r=Math.max(t-VT,0);return LC(n-e(r),t-r)}function UT({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&ec,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=BT({keyframes:[f.value,m(f.value)],velocity:HT(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function WT(e,t,n){let r=[],i=n||EC.mix||wT,a=e.length-1;for(let n=0;nt[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=WT(t,r,i),c=s.length,l=n=>{if(o&&n1)for(;rl(TC(e[0],e[a-1],t)):l}function KT(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=NC(0,t,r);e.push(uT(n,1,i))}}function qT(e){let t=[0];return KT(t,e.length-1),t}function JT(e,t){return e.map(e=>e*t)}function YT(e,t){return e.map(()=>t||ew).splice(0,e.length-1)}function XT({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=nw(r)?r.map(aw):aw(r),a={done:!1,value:t[0]},o=GT(JT(n&&n.length===t.length?n:qT(t),e),t,{ease:Array.isArray(i)?i:YT(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var ZT=e=>e!==null;function QT(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(ZT),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var $T={decay:UT,inertia:UT,tween:XT,keyframes:XT,spring:BT};function eE(e){typeof e.type==`string`&&(e.type=$T[e.type])}var tE=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},nE=e=>e/100,rE=class extends tE{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==gw.now()&&this.tick(gw.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;eE(e);let{type:t=XT,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||XT;s!==XT&&typeof o[0]!=`number`&&(this.mixKeyframes=MC(nE,wT(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=OT(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=TC(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==UT&&(b.value=QT(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return IC(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+IC(e)}get time(){return IC(this.currentTime)}set time(e){e=FC(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return HT(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(gw.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=IC(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=TT,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(gw.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function iE(e){for(let t=1;te*180/Math.PI,oE=e=>cE(aE(Math.atan2(e[1],e[0]))),sE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:oE,rotateZ:oE,skewX:e=>aE(Math.atan(e[1])),skewY:e=>aE(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},cE=e=>(e%=360,e<0&&(e+=360),e),lE=oE,uE=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dE=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),fE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:uE,scaleY:dE,scale:e=>(uE(e)+dE(e))/2,rotateX:e=>cE(aE(Math.atan2(e[6],e[5]))),rotateY:e=>cE(aE(Math.atan2(-e[2],e[0]))),rotateZ:lE,rotate:lE,skewX:e=>aE(Math.atan(e[4])),skewY:e=>aE(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function pE(e){return+!!e.includes(`scale`)}function mE(e,t){if(!e||e===`none`)return pE(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=fE,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sE,i=t}if(!i)return pE(t);let a=r[t],o=i[1].split(`,`).map(gE);return typeof a==`function`?a(o):o[a]}var hE=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return mE(n,t)};function gE(e){return parseFloat(e.trim())}var _E=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],vE=new Set([..._E,`pathRotation`]),yE=e=>e===Cw||e===$,bE=new Set([`x`,`y`,`z`]),xE=_E.filter(e=>!bE.has(e));function SE(e){let t=[];return xE.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var CE={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>mE(t,`x`),y:(e,{transform:t})=>mE(t,`y`)};CE.translateX=CE.x,CE.translateY=CE.y;var wE=new Set,TE=!1,EE=!1,DE=!1;function OE(){if(EE){let e=Array.from(wE).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=SE(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}EE=!1,TE=!1,wE.forEach(e=>e.complete(DE)),wE.clear()}function kE(){wE.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(EE=!0)})}function AE(){DE=!0,kE(),OE(),DE=!1}var jE=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(wE.add(this),TE||(TE=!0,uw.read(kE),uw.resolveKeyframes(OE))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}iE(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),wE.delete(this)}cancel(){this.state===`scheduled`&&(wE.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},ME=e=>e.startsWith(`--`);function NE(e,t,n){ME(t)?e.style.setProperty(t,n):e.style[t]=n}var PE={};function FE(e,t){let n=AC(e);return()=>PE[t]??n()}var IE=FE(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),LE=FE(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),RE=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,zE={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:RE([0,.65,.55,1]),circOut:RE([.55,0,1,.45]),backIn:RE([.31,.01,.66,-.59]),backOut:RE([.33,1.53,.69,.99])};function BE(e,t){if(e)return typeof e==`function`?LE()?ET(e,t):`ease-out`:tw(e)?RE(e):Array.isArray(e)?e.map(e=>BE(e,t)||zE.easeOut):zE[e]}function VE(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=BE(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function HE(e){return typeof e==`function`&&`applyToOptions`in e}function UE({type:e,...t}){return HE(e)&&LE()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var WE=class extends tE{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=UE(e);this.animation=VE(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=QT(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),NE(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return IC(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+IC(e)}get time(){return IC(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=FC(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&IE()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),jC):r(this)}},GE={anticipate:JC,backInOut:qC,circInOut:ZC};function KE(e){return e in GE}function qE(e){typeof e.ease==`string`&&KE(e.ease)&&(e.ease=GE[e.ease])}var JE=10,YE=class extends WE{constructor(e){qE(e),eE(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new rE({...a,autoplay:!1}),s=Math.max(JE,gw.now()-this.startTime),c=TC(0,JE,s-JE),l=o.sample(s).value,{name:u}=this.options;i&&u&&NE(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},XE=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(oT.test(e)||e===`0`)&&!e.startsWith(`url(`));function ZE(e){let t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,`animate`));function aD(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return iD()&&n&&(eD.has(n)||rD.has(n)&&nD(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var oD=40,sD=class extends tE{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=gw.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||jE;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=gw.now();let u=!0;QE(e,i,a,o)||(u=!1,(EC.instantAnimations||!s)&&l?.(QT(e,n,t)),e[0]=e[e.length-1],$E(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>oD?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&aD(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new YE({...d,element:p})}catch{m=new rE(d)}else m=new rE(d);m.finished.then(()=>{this.notifyFinished()}).catch(jC),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),AE()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function cD(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function lD(e,t){let n=e?.[t]??e?.default??e;return n===e?n:cD(n,e)}var uD={type:`spring`,stiffness:500,damping:25,restSpeed:10},dD=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fD={type:`keyframes`,duration:.8},pD={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},mD=(e,{keyframes:t})=>t.length>2?fD:vE.has(e)?e.startsWith(`scale`)?dD(t[1]):uD:pD,hD=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function gD(e){for(let t in e)if(!hD.has(t))return!0;return!1}var _D=(e,t,n,r={},i,a)=>o=>{let s=lD(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=FC(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};gD(s)||Object.assign(u,mD(e,u)),u.duration&&=FC(u.duration),u.repeatDelay&&=FC(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&($E(u),u.delay===0&&(d=!0)),(EC.instantAnimations||EC.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,$E(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=QT(u.keyframes,s);if(e!==void 0){uw.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new rE(u):new sD(u)};function vD(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var yD=`data-`+vD(`framerAppearId`),{schedule:bD,cancel:xD}=lw(queueMicrotask,!1),SD={x:!1,y:!1};function CD(){return SD.x||SD.y}function wD(e){return e===`x`||e===`y`?SD[e]?null:(SD[e]=!0,()=>{SD[e]=!1}):SD.x||SD.y?null:(SD.x=SD.y=!0,()=>{SD.x=SD.y=!1})}function TD(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function ED(e,t){let n=TD(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function DD(e){return!(e.pointerType===`touch`||CD())}function OD(e,t,n={}){let[r,i,a]=ED(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!DD(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}function kD(e){return OC(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var AD=(e,t)=>t?e===t?!0:AD(e,t.parentElement):!1,jD=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,MD=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function ND(e){return MD.has(e.tagName)||e.isContentEditable===!0}var PD=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function FD(e){return PD.has(e.tagName)||e.isContentEditable===!0}var ID=new WeakSet;function LD(e){return t=>{t.key===`Enter`&&e(t)}}function RD(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var zD=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=LD(()=>{if(ID.has(n))return;RD(n,`down`);let e=LD(()=>{RD(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>RD(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function BD(e){return jD(e)&&!CD()}var VD=new WeakSet;function HD(e,t,n={}){let[r,i,a]=ED(e,n),o=e=>{let r=e.currentTarget;if(!BD(e)||VD.has(e))return;ID.add(r),n.stopPropagation&&VD.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ID.has(r)&&ID.delete(r),BD(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||AD(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),kD(e)&&(e.addEventListener(`focus`,e=>zD(e,i)),!ND(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function UD(e){return OC(e)&&`ownerSVGElement`in e}var WD=new WeakMap,GD,KD=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:UD(r)&&`getBBox`in r?r.getBBox()[t]:r[n],qD=KD(`inline`,`width`,`offsetWidth`),JD=KD(`block`,`height`,`offsetHeight`);function YD({target:e,borderBoxSize:t}){WD.get(e)?.forEach(n=>{n(e,{get width(){return qD(e,t)},get height(){return JD(e,t)}})})}function XD(e){e.forEach(YD)}function ZD(){typeof ResizeObserver>`u`||(GD=new ResizeObserver(XD))}function QD(e,t){GD||ZD();let n=TD(e);return n.forEach(e=>{let n=WD.get(e);n||(n=new Set,WD.set(e,n)),n.add(t),GD?.observe(e)}),()=>{n.forEach(e=>{let n=WD.get(e);n?.delete(t),n?.size||GD?.unobserve(e)})}}var $D=new Set,eO;function tO(){eO=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};$D.forEach(t=>t(e))},window.addEventListener(`resize`,eO)}function nO(e){return $D.add(e),eO||tO(),()=>{$D.delete(e),!$D.size&&typeof eO==`function`&&(window.removeEventListener(`resize`,eO),eO=void 0)}}function rO(e,t){return typeof e==`function`?nO(e):QD(e,t)}var iO=e=>!!(e&&e.getVelocity);function aO(e){return!!(iO(e)&&e.add)}function oO(e,t){let n=e.getValue(`willChange`);if(aO(n))return n.add(t);if(!n&&EC.WillChange){let n=new EC.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var sO=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function cO({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function lO({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function uO(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function dO(e){return e===void 0||e===1}function fO({scale:e,scaleX:t,scaleY:n}){return!dO(e)||!dO(t)||!dO(n)}function pO(e){return fO(e)||mO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mO(e){return hO(e.x)||hO(e.y)}function hO(e){return e&&e!==`0%`}function gO(e,t,n){return n+t*(e-n)}function _O(e,t,n,r,i){return i!==void 0&&(e=gO(e,i,r)),gO(e,n,r)+t}function vO(e,t=0,n=1,r,i){e.min=_O(e.min,t,n,r,i),e.max=_O(e.max,t,n,r,i)}function yO(e,{x:t,y:n}){vO(e.x,t.translate,t.scale,t.originPoint),vO(e.y,n.translate,n.scale,n.originPoint)}var bO=.999999999999,xO=1.0000000000001;function SO(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;sbO&&(t.x=1),t.ybO&&(t.y=1)}function CO(e,t){e.min+=t,e.max+=t}function wO(e,t,n,r,i=.5){vO(e,t,n,uT(e.min,e.max,i),r)}function TO(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function EO(e,t,n){let r=n??e;wO(e.x,TO(t.x,r.x),t.scaleX,t.scale,t.originX),wO(e.y,TO(t.y,r.y),t.scaleY,t.scale,t.originY)}function DO(e,t){return cO(uO(e.getBoundingClientRect(),t))}function OO(e,t,n){let r=DO(e,n),{scroll:i}=t;return i&&(CO(r.x,i.offset.x),CO(r.y,i.offset.y)),r}var kO=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,..._E]),AO={test:e=>e===`auto`,parse:e=>e},jO=e=>t=>t.test(e),MO=[Cw,$,zw,Rw,Vw,Bw,AO],NO=e=>MO.find(jO(e)),PO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FO(e){let t=PO.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function IO(e,t,n=1){`${e}`;let[r,i]=FO(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return DC(e)?parseFloat(e):e}return bw(i)?IO(i,t,n+1):i}function LO(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||kC(e)}var RO=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function zO(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Dw)||[];if(!r)return e;let i=n.replace(r,``),a=+!!RO.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var BO=/\b([a-z-]*)\(.*?\)/gu,VO={...oT,getAnimatableNone:e=>{let t=e.match(BO);return t?t.map(zO).join(` `):e}},HO={...oT,getAnimatableNone:e=>{let t=oT.parse(e);return oT.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},UO={...Cw,transform:Math.round},WO={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:Rw,pathRotation:Rw,rotateX:Rw,rotateY:Rw,rotateZ:Rw,scale:Tw,scaleX:Tw,scaleY:Tw,scaleZ:Tw,skew:Rw,skewX:Rw,skewY:Rw,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:ww,originX:Hw,originY:Hw,originZ:$,zIndex:UO,fillOpacity:ww,strokeOpacity:ww,numOctaves:UO},GO={...WO,color:Ww,backgroundColor:Ww,outlineColor:Ww,fill:Ww,stroke:Ww,borderColor:Ww,borderTopColor:Ww,borderRightColor:Ww,borderBottomColor:Ww,borderLeftColor:Ww,filter:VO,WebkitFilter:VO,mask:HO,WebkitMask:HO},KO=e=>GO[e],qO=new Set([VO,HO]);function JO(e,t){let n=KO(e);return qO.has(n)||(n=oT),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var YO=new Set([`auto`,`none`,`0`]);function XO(e,t,n){let r=0,i;for(;r{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},QO=()=>({translate:0,scale:1,origin:0,originPoint:0}),$O=()=>({x:QO(),y:QO()}),ek=()=>({min:0,max:0}),tk=()=>({x:ek(),y:ek()}),nk=30,rk=e=>!isNaN(parseFloat(e)),ik={current:void 0},ak=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=gw.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=gw.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=rk(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new PC);let n=this.events[e].add(t);return e===`change`?()=>{n(),uw.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ik.current&&ik.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=gw.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>nk)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,nk);return LC(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ok(e,t){return new ak(e,t)}var sk=[...MO,Ww,oT],ck=e=>sk.find(jO(e)),lk=new WeakMap;function uk(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function dk(e){return typeof e==`string`||Array.isArray(e)}var fk=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],pk=[`initial`,...fk];function mk(e){return uk(e.animate)||pk.some(t=>dk(e[t]))}function hk(e){return!!(mk(e)||e.variants)}function gk(e,t,n){for(let r in t){let i=t[r],a=n[r];if(iO(i))e.addValue(r,i);else if(iO(a))e.addValue(r,ok(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ok(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var _k={current:null},vk={current:!1},yk=typeof window<`u`;function bk(){if(vk.current=!0,yk)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>_k.current=e.matches;e.addEventListener(`change`,t),t()}else _k.current=!1}function xk(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Sk(e,t,n,r){if(typeof t==`function`){let[i,a]=xk(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=xk(r);t=t(n===void 0?e.custom:n,i,a)}return t}var Ck=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],wk={};function Tk(e){wk=e}function Ek(){return wk}var Dk=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=jE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=gw.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(vk.current||bk(),this.shouldReduceMotion=_k.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),dw(this.notifyUpdate),dw(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&eD.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new WE({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:FC(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=vE.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&uw.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in wk){let t=wk[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tk()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ok(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(DC(n)||kC(n))?n=parseFloat(n):!ck(n)&&oT.test(t)&&(n=JO(e,t)),this.setBaseTarget(e,iO(n)?n.get():n)),iO(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Sk(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!iO(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new PC),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){bD.render(this.render)}},Ok=class extends Dk{constructor(){super(...arguments),this.KeyframeResolver=ZO}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;iO(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},kk=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Ak={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},jk=_E.length;function Mk(e,t,n){let r=``,i=!0;for(let a=0;a{if(!t.target)return e;if(typeof e==`string`)if($.test(e))e=parseFloat(e);else return e;return`${Fk(e,t.target.x)}% ${Fk(e,t.target.y)}%`}},Lk={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=oT.parse(e);if(i.length>5)return r;let a=oT.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=uT(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Rk={borderRadius:{...Ik,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ik,borderTopRightRadius:Ik,borderBottomLeftRadius:Ik,borderBottomRightRadius:Ik,boxShadow:Lk};function zk(e,{layout:t,layoutId:n}){return vE.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Rk[e]||e===`opacity`)}function Bk(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(iO(r[t])||i&&iO(i[t])||zk(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Vk(e){return window.getComputedStyle(e)}var Hk=class extends Ok{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Pk}readValueFromInstance(e,t){if(vE.has(t))return this.projection?.isProjecting?pE(t):hE(e,t);{let n=Vk(e),r=(vw(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return DO(e,t)}build(e,t,n){Nk(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Bk(e,t,n)}},Uk={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Wk={offset:`strokeDashoffset`,array:`strokeDasharray`};function Gk(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Uk:Wk;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Kk=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function qk(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Nk(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Kk)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Gk(d,i,a,o,!1)}var Jk=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Yk=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Xk(e,t,n,r){Pk(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Jk.has(n)?n:vD(n),t.attrs[n])}function Zk(e,t,n){let r=Bk(e,t,n);for(let n in e)if(iO(e[n])||iO(t[n])){let t=_E.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Qk=class extends Ok{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=tk}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(vE.has(t)){let e=KO(t);return e&&e.default||0}return t=Jk.has(t)?t:vD(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Zk(e,t,n)}build(e,t,n){qk(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Xk(e,t,n,r)}mount(e){this.isSVGTag=Yk(e.tagName),super.mount(e)}};function $k(e,t,n){let r=e.getProps();return Sk(r,t,n===void 0?r.custom:n,e)}var eA=e=>Array.isArray(e);function tA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ok(n))}function nA(e){return eA(e)?e[e.length-1]||0:e}function rA(e,t){let{transitionEnd:n={},transition:r={},...i}=$k(e,t)||{};i={...i,...n};for(let t in i)tA(e,t,nA(i[t]))}function iA(e){return e.props[yD]}function aA({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oA(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?cD(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&aA(f,t))continue;let o={delay:n,...lD(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){uw.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=iA(e);if(n){let e=window.MotionHandoffAnimation(n,t,uw);e!==null&&(o.startTime=e,p=!0)}}oO(e,t);let m=l??e.shouldReduceMotion;r.start(_D(t,r,i,m&&kO.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>uw.update(()=>{o&&rA(e,o)});d.length?Promise.all(d).then(t):t()}return d}function sA(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function cA(e,t,n={}){let r=$k(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(oA(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return lA(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function lA(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(cA(c,t,{...o,delay:n+(typeof r==`function`?0:r)+sA(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function uA(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>cA(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=cA(e,t,n);else{let i=typeof t==`function`?$k(e,t,n.custom):t;r=Promise.all(oA(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var dA=pk.length;function fA(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&fA(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>uA(e,t,n)))}function _A(e){let t=gA(e),n=bA(),r=!0,i=!1,a=t=>(n,r)=>{let i=$k(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=fA(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;tf&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=eA(t)&&eA(n)?!pA(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=$k(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=sA(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=$k(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=bA(),i=!0}}}function vA(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!pA(t,e):!1}function yA(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bA(){return{animate:yA(!0),whileInView:yA(),whileHover:yA(),whileTap:yA(),whileDrag:yA(),whileFocus:yA(),exit:yA()}}var xA=.9999,SA=1.0001,CA=-.01,wA=.01;function TA(e){return e.max-e.min}function EA(e,t,n){return Math.abs(e-t)<=n}function DA(e,t,n,r=.5){e.origin=r,e.originPoint=uT(t.min,t.max,e.origin),e.scale=TA(n)/TA(t),e.translate=uT(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xA&&e.scale<=SA||isNaN(e.scale))&&(e.scale=1),(e.translate>=CA&&e.translate<=wA||isNaN(e.translate))&&(e.translate=0)}function OA(e,t,n,r){DA(e.x,t.x,n.x,r?r.originX:void 0),DA(e.y,t.y,n.y,r?r.originY:void 0)}function kA(e,t,n,r=0){e.min=(r?uT(n.min,n.max,r):n.min)+t.min,e.max=e.min+TA(t)}function AA(e,t,n,r){kA(e.x,t.x,n.x,r?.x),kA(e.y,t.y,n.y,r?.y)}function jA(e,t,n,r=0){let i=r?uT(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+TA(t)}function MA(e,t,n,r){jA(e.x,t.x,n.x,r?.x),jA(e.y,t.y,n.y,r?.y)}function NA(e){return[e(`x`),e(`y`)]}function PA(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function FA(e){return iO(e)?e.get():e}function IA(e,t,n){let r=iO(e)?e:ok(e);return r.start(_D(``,r,t,n)),r.animation}var LA={value:null,addProjectionMetrics:null};function RA(e,t){let n=gw.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(dw(r),e(a-t))};return uw.setup(r,!0),()=>dw(r)}function zA(e){return UD(e)&&e.tagName===`svg`}var BA=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],VA=BA.length,HA=e=>typeof e==`string`?parseFloat(e):e,UA=e=>typeof e==`number`||$.test(e);function WA(e,t,n,r,i,a){i?(e.opacity=uT(0,n.opacity??1,KA(r)),e.opacityExit=uT(t.opacity??1,0,qA(r))):a&&(e.opacity=uT(t.opacity??1,n.opacity??1,r));for(let i=0;irt?1:n(NC(e,t,r))}function YA(e,t){e.min=t.min,e.max=t.max}function XA(e,t){YA(e.x,t.x),YA(e.y,t.y)}function ZA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function QA(e,t,n,r,i){return e-=t,e=gO(e,1/n,r),i!==void 0&&(e=gO(e,1/i,r)),e}function $A(e,t=0,n=1,r=.5,i,a=e,o=e){if(zw.test(t)&&(t=parseFloat(t),t=uT(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=uT(a.min,a.max,r);e===a&&(s-=t),e.min=QA(e.min,t,n,s,i),e.max=QA(e.max,t,n,s,i)}function ej(e,t,[n,r,i],a,o){$A(e,t[n],t[r],t[i],t.scale,a,o)}var tj=[`x`,`scaleX`,`originX`],nj=[`y`,`scaleY`,`originY`];function rj(e,t,n,r){ej(e.x,t,tj,n?n.x:void 0,r?r.x:void 0),ej(e.y,t,nj,n?n.y:void 0,r?r.y:void 0)}function ij(e){return e.translate===0&&e.scale===1}function aj(e){return ij(e.x)&&ij(e.y)}function oj(e,t){return e.min===t.min&&e.max===t.max}function sj(e,t){return oj(e.x,t.x)&&oj(e.y,t.y)}function cj(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function lj(e,t){return cj(e.x,t.x)&&cj(e.y,t.y)}function uj(e){return TA(e.x)/TA(e.y)}function dj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var fj=class{constructor(){this.members=[]}add(e){CC(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(wC(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(wC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function pj(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var mj=(e,t)=>e.depth-t.depth,hj=class{constructor(){this.children=[],this.isDirty=!1}add(e){CC(this.children,e),this.isDirty=!0}remove(e){wC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mj),this.isDirty=!1,this.children.forEach(e)}},gj={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_j={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},vj=[``,`X`,`Y`,`Z`],yj=1e3,bj=0;function xj(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sj(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=iA(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,uw,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sj(r)}function Cj({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=bj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,LA.value&&(_j.nodes=_j.calculatedTargetDeltas=_j.calculatedProjections=0),this.nodes.forEach(Ej),this.nodes.forEach(Fj),this.nodes.forEach(Ij),this.nodes.forEach(Dj),LA.addProjectionMetrics&&LA.addProjectionMetrics(_j)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;uw.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=RA(i,250),gj.hasAnimatedSinceResize&&(gj.hasAnimatedSinceResize=!1,this.nodes.forEach(Pj)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Uj,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!lj(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...lD(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Pj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dw(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Lj),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sj(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!TA(this.snapshot.measuredBox.x)&&!TA(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=uT(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=uT(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(zj(o.x,e.x,n),zj(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(MA(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Vj(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&sj(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=tk(),XA(f,this.relativeTarget)),c&&(this.animationValues=a,WA(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(dw(this.pendingAnimation),void 0),this.pendingAnimation=uw.update(()=>{gj.hasAnimatedSinceResize=!0,this.motionValue||=ok(0),this.motionValue.jump(0,!1),this.currentAnimation=IA(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Jj(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||tk();let t=TA(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=TA(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}XA(t,n),EO(t,i),OA(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new fj),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&xj(`z`,e,r,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(kj),this.root.sharedNodes.clear()}}}function wj(e){e.updateLayout()}function Tj(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)NA(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=TA(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;YA(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Jj(i,t.layoutBox,n)&&NA(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=TA(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=$O();OA(o,n,t.layoutBox);let s=$O();a?OA(s,e.applyTransform(r,!0),t.measuredBox):OA(s,n,t.layoutBox);let c=!aj(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=tk();MA(s,t.layoutBox,i.layoutBox,o);let c=tk();MA(c,n,a.layoutBox,o),lj(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ej(e){LA.value&&_j.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Dj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Oj(e){e.clearSnapshot()}function kj(e){e.clearMeasurements()}function Aj(e){e.isLayoutDirty=!0,e.updateLayout()}function jj(e){e.isLayoutDirty=!1}function Mj(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Nj(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Pj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Fj(e){e.resolveTargetDelta()}function Ij(e){e.calcProjection()}function Lj(e){e.resetSkewAndRotation()}function Rj(e){e.removeLeadSnapshot()}function zj(e,t,n){e.translate=uT(t.translate,0,n),e.scale=uT(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Bj(e,t,n,r){e.min=uT(t.min,n.min,r),e.max=uT(t.max,n.max,r)}function Vj(e,t,n,r){Bj(e.x,t.x,n.x,r),Bj(e.y,t.y,n.y,r)}function Hj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Uj={duration:.45,ease:[.4,0,.1,1]},Wj=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gj=Wj(`applewebkit/`)&&!Wj(`chrome/`)?Math.round:jC;function Kj(e){e.min=Gj(e.min),e.max=Gj(e.max)}function qj(e){Kj(e.x),Kj(e.y)}function Jj(e,t,n){return e===`position`||e===`preserve-aspect`&&!EA(uj(t),uj(n),.2)}function Yj(e){return e!==e.root&&e.scroll?.wasRoot}var Xj=Cj({attachResizeListener:(e,t)=>PA(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Zj={current:void 0},Qj=Cj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zj.current){let e=new Xj({});e.mount(window),e.setOptions({layoutScroll:!0}),Zj.current=e}return Zj.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),$j=(0,w.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function eM(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function tM(...e){return t=>{let n=!1,r=e.map(e=>{let r=eM(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(` [data-motion-pop-id="${o}"] { position: absolute !important; width: ${e}px !important; @@ -264,11 +264,12 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann ${_}px !important; ${v}px !important; } - `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,V.jsx)(eM,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:w.cloneElement(e,{ref:u})})}var nM=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=_C(rM),d=(0,w.useId)(),f=(0,w.useRef)(n),p=(0,w.useRef)(r);vC(()=>{f.current=n,p.current=r});let m=!0,h=(0,w.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,w.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),w.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(tM,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,V.jsx)(yC.Provider,{value:h,children:e})};function rM(){return new Map}function iM(e=!0){let t=(0,w.useContext)(yC);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,w.useId)();(0,w.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,w.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var aM=e=>e.key||``;function oM(e){let t=[];return w.Children.forEach(e,e=>{(0,w.isValidElement)(e)&&t.push(e)}),t}var sM=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=iM(o),f=(0,w.useMemo)(()=>oM(e),[e]),p=o&&!u?[]:f.map(aM),m=(0,w.useRef)(!0),h=(0,w.useRef)(f),g=_C(()=>new Map),_=(0,w.useRef)(new Set),[v,y]=(0,w.useState)(f),[b,x]=(0,w.useState)(f);vC(()=>{m.current=!1,h.current=f;for(let e=0;e{let v=aM(e),y=o&&!u?!1:f===b||p.includes(v);return(0,V.jsx)(nM,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},cM=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function lM(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(cM.indexOf(e)>-1||/[A-Z]/u.test(e))}var uM=(e,t)=>t.isSVG??lM(e)?new Yk(t):new zk(t,{allowProjection:e!==w.Fragment}),dM=(0,w.createContext)({strict:!1}),fM=(0,w.createContext)({});function pM(e,t){if(dk(e)){let{initial:t,animate:n}=e;return{initial:t===!1||ck(t)?t:void 0,animate:ck(n)?n:void 0}}return e.inherit===!1?{}:t}function mM(e){let{initial:t,animate:n}=pM(e,(0,w.useContext)(fM));return(0,w.useMemo)(()=>({initial:t,animate:n}),[hM(t),hM(n)])}function hM(e){return Array.isArray(e)?e.join(` `):e}var gM=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _M(e,t,n){for(let r in t)!tO(t[r])&&!Ik(r,n)&&(e[r]=t[r])}function vM({transformTemplate:e},t){return(0,w.useMemo)(()=>{let n=gM();return Ak(n,t,e),Object.assign({},n.vars,n.style)},[t])}function yM(e,t){let n=e.style||{},r={};return _M(r,n,e),Object.assign(r,vM(e,t)),r}function bM(e,t){let n={},r=yM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var xM=()=>({...gM(),attrs:{}});function SM(e,t,n,r){let i=(0,w.useMemo)(()=>{let n=xM();return Wk(n,t,Kk(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};_M(t,e.style,e),i.style={...t,...i.style}}return i}var CM=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function wM(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||CM.has(e)}var TM=e=>!wM(e);function EM(e){typeof e==`function`&&(TM=t=>t.startsWith(`on`)?!wM(t):e(t))}try{EM((Ba(),d(La)).default)}catch{}function DM(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||tO(e[i])||(TM(i)||n===!0&&wM(i)||!t&&!wM(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function OM(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??lM(e)?SM:bM)(t,r,i,e),c=DM(t,typeof e==`string`,a),l=e===w.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,w.useMemo)(()=>tO(u)?u.get():u,[u]);return(0,w.createElement)(e,{...l,children:d})}function kM({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:AM(n,r,i,e),renderState:t()}}function AM(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=MA(a[e]);let{initial:o,animate:s}=e,c=dk(e),l=fk(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!sk(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{let r=(0,w.useContext)(fM),i=(0,w.useContext)(yC),a=()=>kM(e,t,r,i);return n?a():_C(a)},MM=jM({scrapeMotionValuesFromProps:Lk,createRenderState:gM}),NM=jM({scrapeMotionValuesFromProps:Jk,createRenderState:xM}),PM={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},FM=!1;function IM(){if(FM)return;let e={};for(let t in PM)e[t]={isEnabled:e=>PM[t].some(t=>!!e[t])};Sk(e),FM=!0}function LM(){return IM(),Ck()}function RM(e){let t=LM();for(let n in e)t[n]={...t[n],...e[n]};Sk(t)}var zM=Symbol.for(`motionComponentSymbol`);function BM(e,t,n){let r=(0,w.useRef)(n);(0,w.useInsertionEffect)(()=>{r.current=n});let i=(0,w.useRef)(null);return(0,w.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var VM=(0,w.createContext)({});function HM(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function UM(e,t,n,r,i,a){let{visualElement:o}=(0,w.useContext)(fM),s=(0,w.useContext)(dM),c=(0,w.useContext)(yC),l=(0,w.useContext)(Xj),u=l.reducedMotion,d=l.skipAnimations,f=(0,w.useRef)(null),p=(0,w.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,w.useContext)(VM);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&WM(f.current,n,i,h);let g=(0,w.useRef)(!1);(0,w.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[gD],v=(0,w.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return vC(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,w.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function WM(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:GM(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&HM(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function GM(e){if(e)return e.options.allowProjection===!1?GM(e.parent):e.projection}function KM(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&RM(r);let a=n?n===`svg`:lM(e),o=a?NM:MM;function s(n,s){let c,l={...(0,w.useContext)(Xj),...n,layoutId:qM(n)},{isStatic:u}=l,d=mM(n),f=o(n,u);if(!u&&typeof window<`u`){JM(l,r);let t=YM(l);c=t.MeasureLayout,d.visualElement=UM(e,f,l,i,t.ProjectionNode,a)}return(0,V.jsxs)(fM.Provider,{value:d,children:[c&&d.visualElement?(0,V.jsx)(c,{visualElement:d.visualElement,...l}):null,OM(e,n,BM(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,w.forwardRef)(s);return c[zM]=e,c}function qM({layoutId:e}){let t=(0,w.useContext)(gC).id;return t&&e!==void 0?t+`-`+e:e}function JM(e,t){(0,w.useContext)(dM).strict}function YM(e){let{drag:t,layout:n}=LM();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function XM(e,t){if(typeof Proxy>`u`)return KM;let n=new Map,r=(n,r)=>KM(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,KM(a,void 0,e,t)),n.get(a))})}var ZM=class extends iO{constructor(e){super(e),e.animationState||=mA(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();sk(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},QM=0,$M={animation:{Feature:ZM},exit:{Feature:class extends iO{constructor(){super(...arguments),this.id=QM++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Xk(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function eN(e){return{point:{x:e.pageX,y:e.pageY}}}var tN=e=>t=>OD(t)&&e(t,eN(t));function nN(e,t,n,r){return jA(e,t,tN(n),r)}var rN=({current:e})=>e?e.ownerDocument.defaultView:null,iN=(e,t)=>Math.abs(e-t);function aN(e,t){let n=iN(e.x,t.x),r=iN(e.y,t.y);return Math.sqrt(n**2+r**2)}var oN=new Set([`auto`,`scroll`]),sN=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=cN(this.lastRawMoveEventInfo,this.transformPagePoint));let e=uN(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=aN(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=lw;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=cN(t,this.transformPagePoint),sw.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=uN(e.type===`pointercancel`?this.lastMoveEventInfo:cN(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!OD(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=cN(eN(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=lw;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,uN(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=kC(nN(this.contextWindow,`pointermove`,this.handlePointerMove,d),nN(this.contextWindow,`pointerup`,this.handlePointerUp,d),nN(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(oN.has(e.overflowX)||oN.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),sw.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),cw(this.updatePoint)}};function cN(e,t){return t?{point:t(e.point)}:e}function lN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uN({point:e},t){return{point:e,delta:lN(e,fN(t)),offset:lN(e,dN(t)),velocity:pN(t,.1)}}function dN(e){return e[0]}function fN(e){return e[e.length-1]}function pN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=fN(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>MC(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>MC(t)*2&&(r=e[1]);let a=NC(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mN(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?sT(n,e,r.max):Math.min(e,n)),e}function hN(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function gN(e,{top:t,left:n,bottom:r,right:i}){return{x:hN(e.x,n,i),y:hN(e.y,t,r)}}function _N(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=AC(t.min,t.max-r,e.min):r>i&&(n=AC(e.min,e.max-i,t.min)),SC(0,1,n)}function bN(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var xN=.35;function SN(e=xN){return e===!1?e=0:e===!0&&(e=xN),{x:CN(e,`left`,`right`),y:CN(e,`top`,`bottom`)}}function CN(e,t,n){return{min:wN(e,t),max:wN(e,n)}}function wN(e,t){return typeof e==`number`?e:e[t]||0}var TN=new WeakMap,EN=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=QO(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(eN(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xD(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),AA(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Iw.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=SA(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&sw.update(()=>i(e,t),!1,!0),rO(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=AN(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&sw.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new sN(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:rN(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&sw.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!kN(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=mN(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&HM(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=gN(n.layoutBox,e):this.constraints=!1,this.elastic=SN(t),r!==this.constraints&&!HM(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&AA(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=bN(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!HM(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=TO(n,r.root,this.visualElement.getTransformPagePoint()),a=vN(r.layout.layoutBox,i);if(t){let e=t(oO(a));this.hasMutatedConstraints=!!e,e&&(a=aO(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=AA(o=>{if(!kN(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return rO(this.visualElement,e),n.start(mD(e,n,0,t,this.visualElement,!1))}stopAnimation(){AA(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){AA(t=>{let{drag:n}=this.getProps();if(!kN(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-sT(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!HM(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};AA(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=yN({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),AA(t=>{if(!kN(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(sT(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;TN.set(this.visualElement,this);let e=this.visualElement.current,t=nN(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&MD(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();HM(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=ON(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),sw.read(r);let o=jA(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(AA(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=xN,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function DN(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function ON(e,t,n){let r=eO(e,DN(n)),i=eO(t,DN(n));return()=>{r(),i()}}function kN(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function AN(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var jN=class extends iO{constructor(e){super(e),this.removeGroupControls=OC,this.removeListeners=OC,this.controls=new EN(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||OC}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},MN=e=>(t,n)=>{e&&sw.update(()=>e(t,n),!1,!0)},NN=class extends iO{constructor(){super(...arguments),this.removePointerDownListener=OC}onPointerDown(e){this.session=new sN(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rN(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:MN(e),onStart:MN(t),onMove:MN(n),onEnd:(e,t)=>{delete this.session,r&&sw.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=nN(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},PN=!1,FN=class extends w.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),PN&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),pj.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),PN=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||sw.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),_D.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;PN=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function IN(e){let[t,n]=iM(),r=(0,w.useContext)(gC);return(0,V.jsx)(FN,{...e,layoutGroup:r,switchLayoutGroup:(0,w.useContext)(VM),isPresent:t,safeToRemove:n})}var LN={pan:{Feature:NN},drag:{Feature:jN,ProjectionNode:Yj,MeasureLayout:IN}};function RN(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&sw.postRender(()=>i(t,eN(t)))}var zN=class extends iO{mount(){let{current:e}=this.node;e&&(this.unmount=TD(e,(e,t)=>(RN(this.node,t,`Start`),e=>RN(this.node,e,`End`))))}unmount(){}},BN=class extends iO{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=kC(jA(this.node.current,`focus`,()=>this.onFocus()),jA(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function VN(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&sw.postRender(()=>i(t,eN(t)))}var HN=class extends iO{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=zD(e,(e,t)=>(VN(this.node,t,`Start`),(e,{success:t})=>VN(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},UN=new WeakMap,WN=new WeakMap,GN=e=>{let t=UN.get(e.target);t&&t(e)},KN=e=>{e.forEach(GN)};function qN({root:e,...t}){let n=e||document;WN.has(n)||WN.set(n,{});let r=WN.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(KN,{root:e,...t})),r[i]}function JN(e,t,n){let r=qN(t);return UN.set(e,n),r.observe(e),()=>{UN.delete(e),r.unobserve(e)}}var YN={some:0,all:1},XN=class extends iO{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:YN[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=JN(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(ZN(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function ZN({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var QN={inView:{Feature:XN},tap:{Feature:HN},focus:{Feature:BN},hover:{Feature:zN}},$N={layout:{ProjectionNode:Yj,MeasureLayout:IN}},eP=XM({...$M,...QN,...LN,...$N},uM),tP=4,nP=172,rP=50,iP=24,aP=12,oP=232,sP=108,cP=916;function lP(e,t){return{x:e,y:t,cx:e+nP/2,cy:t+rP/2}}function uP(e){let t=Math.floor(e/tP),n=e%tP;return t%2==1&&(n=tP-1-n),lP(iP+n*oP,iP+t*sP)}var dP=Object.fromEntries(TS.map((e,t)=>[e.stage,t])),fP=184,pP=lP(140,346),mP=pP.y+rP+iP,hP=[`CALIBRATE`,`QA_PROBE`,`FULL_SWEEP`];function gP(e,t){return e[t]??`pending`}function _P({statuses:e,onSelectStage:t,selected:n}){let r=pP,i=r.y,a=(e,t)=>r.x+fP*(e+1)/(t+1),o=gP(e,`SYNTHESIZE`)===`current`;return(0,V.jsxs)(`div`,{className:`w-full overflow-x-auto`,children:[(0,V.jsxs)(`svg`,{viewBox:`0 0 ${cP} ${mP}`,className:`h-auto w-full min-w-[720px]`,role:`img`,"aria-label":`Pipeline DAG`,children:[(0,V.jsx)(`defs`,{children:(0,V.jsx)(`marker`,{id:`dag-arrow`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,markerUnits:`userSpaceOnUse`,children:(0,V.jsx)(`path`,{d:`M1,1 L9,5 L1,9 Z`,fill:`context-stroke`})})}),TS.slice(0,-1).map((t,n)=>{let r=gP(e,TS[n].stage),i=gP(e,TS[n+1].stage),a=r===`done`&&i===`current`?`active`:r===`done`&&i===`done`?`done`:`muted`;return(0,V.jsx)(bP,{a:uP(n),b:uP(n+1),state:a},`e-${n}`)}),hP.map((e,t)=>(0,V.jsx)(xP,{from:uP(dP[e]),tx:a(t,hP.length),ty:i,active:o},`h-${e}`)),(0,V.jsx)(SP,{from:r,to:uP(dP.STATIC_CI),active:o}),(0,V.jsx)(CP,{x:r.cx-34,y:i-12,text:`harden / ease`,active:o}),TS.map((r,i)=>(0,V.jsx)(wP,{meta:r,p:uP(i),status:gP(e,r.stage),step:i+1,onSelect:t,isSelected:n===r.stage},r.stage)),(0,V.jsx)(wP,{meta:ES,p:r,status:gP(e,`SYNTHESIZE`),dashed:!0,w:fP,onSelect:t,isSelected:n===`SYNTHESIZE`})]}),(0,V.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-1`,children:OS.map(e=>(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[12px] text-ink-4`,children:[(0,V.jsx)(`span`,{className:`size-2.5`,style:{background:e.color}}),e.label]},e.key))})]})}var vP=`var(--color-line)`,yP=`var(--color-accent)`;function bP({a:e,b:t,state:n}){let r=Math.abs(e.y-t.y)<1,i;if(r){let n=e.xn?1:-1,s=Math.min(aP,Math.abs(a-n)/2,(e-r)/2,(o-e)/2);i=[`M ${n} ${r}`,`L ${n} ${e-s}`,`Q ${n} ${e} ${n+t*s} ${e}`,`L ${a-t*s} ${e}`,`Q ${a} ${e} ${a} ${e+s}`,`L ${a} ${o}`].join(` `)}}if(n===`active`)return(0,V.jsx)(eP.path,{d:i,fill:`none`,stroke:yP,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,strokeDasharray:`4 5`,markerEnd:`url(#dag-arrow)`,animate:{strokeDashoffset:[0,-18]},transition:{duration:.9,repeat:1/0,ease:`linear`}});let a=n===`done`;return(0,V.jsx)(`path`,{d:i,fill:`none`,stroke:a?yP:vP,strokeWidth:a?1.75:1.25,strokeLinecap:`round`,strokeLinejoin:`round`,markerEnd:`url(#dag-arrow)`,opacity:a?.9:.5})}function xP({from:e,tx:t,ty:n,active:r}){let i=e.cx,a=e.y+rP,o=n-a;return(0,V.jsx)(`path`,{d:`M ${i} ${a} C ${i} ${a+o*.5} ${t} ${n-o*.4} ${t} ${n}`,fill:`none`,stroke:r?yP:vP,strokeWidth:r?1.75:1,strokeDasharray:`4 5`,strokeLinecap:`round`,markerEnd:`url(#dag-arrow)`,opacity:r?.9:.28})}function SP({from:e,to:t,active:n}){let r=e.cx+30,i=e.y,a=t.cx,o=t.y+rP,s=i-o;return(0,V.jsx)(`path`,{d:`M ${r} ${i} C ${r} ${i-s*.45} ${a} ${o+s*.45} ${a} ${o}`,fill:`none`,stroke:n?yP:vP,strokeWidth:n?1.75:1,strokeDasharray:`4 5`,strokeLinecap:`round`,markerEnd:`url(#dag-arrow)`,opacity:n?.9:.28})}function CP({x:e,y:t,text:n,active:r}){return(0,V.jsx)(`text`,{x:e,y:t,fontSize:`10.5`,fontWeight:500,fill:r?yP:`var(--color-ink-4)`,opacity:r?.95:.6,children:n})}function wP({meta:e,p:t,status:n,step:r,dashed:i,w:a=nP,onSelect:o,isSelected:s}){let c=kS(e.type),l=n===`current`,u=n===`done`,d=n===`pending`,f=l?.16:u?.09:.04,p=s?`var(--color-accent)`:l||u?c:`var(--color-line)`;return(0,V.jsxs)(`g`,{transform:`translate(${t.x}, ${t.y})`,className:wS(o?`cursor-pointer`:`cursor-default`),onClick:o?()=>o(e.stage):void 0,children:[(0,V.jsx)(`title`,{children:`${e.label} — ${e.blurb}${o?` (click to inspect)`:``}`}),(0,V.jsx)(`rect`,{width:a,height:rP,rx:0,fill:`var(--color-surface-2)`,stroke:p,strokeWidth:s||l?2:1.25,strokeDasharray:i?`5 4`:void 0}),(0,V.jsx)(`rect`,{width:a,height:rP,rx:0,fill:c,fillOpacity:f}),(0,V.jsx)(`g`,{transform:`translate(${a-24}, 11)`,children:u?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{r:8,cx:5,cy:5,fill:c,fillOpacity:.9}),(0,V.jsx)(gx,{x:0,y:0,width:10,height:10,stroke:`var(--color-surface)`,strokeWidth:2.4})]}):l?(0,V.jsx)(eP.circle,{r:4.5,cx:5,cy:5,fill:c,animate:{opacity:[1,.35,1]},transition:{duration:1.5,repeat:1/0}}):(0,V.jsx)(`circle`,{r:4,cx:5,cy:5,fill:`none`,stroke:`var(--color-line-2)`,strokeWidth:1.5})}),r!==void 0&&(0,V.jsx)(`text`,{x:14,y:19,fontSize:`10.5`,fontWeight:600,fill:`var(--color-ink-4)`,children:String(r).padStart(2,`0`)}),(0,V.jsx)(`text`,{x:14,y:r===void 0?30:37,fontSize:`13`,fontWeight:600,fill:d?`var(--color-ink-3)`:`var(--color-ink)`,children:e.label})]})}var TP={permissive:`ok`,"weak-copyleft":`warn`,"strong-copyleft":`danger`,unknown:`neutral`},EP={difficulty:`Smoke`,full:`Frontier`,calibrate:`Calibrate`,qa:`QA`};function DP(e){return EP[e]??e.charAt(0).toUpperCase()+e.slice(1).replace(/[-_]/g,` `)}function OP({context:e}){let t=e.source??null,n=e.dimensions??null,r=e.oracle??null,i=e.sweeps??{},a=Object.entries(i).filter(([,e])=>e&&typeof e==`object`);return(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(hx,{className:`size-4 text-accent`}),`Run Context`]})}),(0,V.jsxs)(lC,{className:`space-y-6`,children:[(0,V.jsx)(MP,{title:`Source`,icon:(0,V.jsx)(ix,{className:`size-3.5`}),children:t?(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsx)(NP,{label:`Repository`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink`,children:t.repo})}),(0,V.jsx)(NP,{label:`Pinned SHA`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:FS(t.pinned_sha,12)})}),(0,V.jsx)(NP,{label:`Language`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ink-2`,children:[(0,V.jsx)(Tx,{className:`size-3.5 text-ink-4`}),t.primary_language??`—`]})}),(0,V.jsx)(NP,{label:`License`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-ink-2`,children:t.license??`unknown`}),(0,V.jsxs)(MS,{tone:TP[t.license_class]??`neutral`,children:[(0,V.jsx)(Zx,{className:`size-3`}),t.license_class]})]})}),(t.size_loc!=null||t.size_files!=null)&&(0,V.jsx)(NP,{label:`Size`,children:(0,V.jsxs)(`span`,{className:`text-ink-2`,children:[RS(t.size_loc),` LOC · `,RS(t.size_files),` `,`files`]})}),(t.build_systems.length>0||t.test_frameworks.length>0)&&(0,V.jsx)(NP,{label:`Toolchain`,children:(0,V.jsxs)(`span`,{className:`flex flex-wrap justify-end gap-1.5`,children:[t.build_systems.map(e=>(0,V.jsx)(MS,{tone:`neutral`,children:e},e)),t.test_frameworks.map(e=>(0,V.jsxs)(MS,{tone:`info`,children:[(0,V.jsx)(oS,{className:`size-3`}),e]},e))]})})]}):(0,V.jsx)(PP,{children:`Source not yet ingested.`})}),n&&(n.tool_name||n.target_language||n.scope_unit||n.verifier_mechanism||n.objective)&&(0,V.jsxs)(MP,{title:`Dimensions`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[n.tool_name&&(0,V.jsx)(MS,{tone:`accent`,children:n.tool_name}),n.binary_name&&n.binary_name!==n.tool_name&&(0,V.jsxs)(MS,{tone:`neutral`,children:[`bin: `,n.binary_name]}),n.upstream_language&&(0,V.jsx)(MS,{tone:`info`,children:n.upstream_language}),n.target_language&&(0,V.jsx)(MS,{tone:`accent`,children:n.target_language}),n.scope_unit&&(0,V.jsx)(MS,{tone:`neutral`,children:IS(n.scope_unit)}),n.verifier_mechanism&&(0,V.jsx)(MS,{tone:`info`,children:IS(n.verifier_mechanism)}),n.objective&&(0,V.jsx)(MS,{tone:`neutral`,children:n.objective.replace(/\+/g,` + `)})]}),n.flag_surface&&(0,V.jsx)(`p`,{className:`mt-2 text-[12.5px] leading-relaxed text-ink-3`,children:n.flag_surface})]}),r&&(0,V.jsx)(MP,{title:`Oracle`,children:(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[r.approach&&(0,V.jsx)(NP,{label:`Approach`,children:(0,V.jsx)(`span`,{className:`text-ink-2`,children:IS(String(r.approach).replace(/-/g,` `))})}),r.n_cases!=null&&(0,V.jsx)(NP,{label:`Golden cases`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:String(r.n_cases)})}),r.text_distinct!=null&&(0,V.jsx)(NP,{label:`Oracle pair`,children:(0,V.jsx)(`span`,{className:r.text_distinct?`text-ok`:`text-danger`,children:r.text_distinct?`byte-distinct`:`NOT distinct`})}),r.epsilon!=null&&(typeof r.epsilon==`object`?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5 text-[13px] text-ink-3`,children:`Epsilon (ε), per field`}),(0,V.jsx)(`div`,{className:`space-y-1 rounded-lg bg-bg-2 px-3 py-2`,children:Object.entries(r.epsilon).map(([e,t])=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`font-mono text-ink-4`,children:e}),(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:FP(t)})]},e))})]}):(0,V.jsx)(NP,{label:`Epsilon (ε)`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:String(r.epsilon)})}))]})}),e.task_brief&&(0,V.jsx)(MP,{title:`Brief`,children:(0,V.jsx)(`p`,{className:`whitespace-pre-wrap rounded-lg border border-line bg-bg-2/40 px-3 py-2 text-[13px] leading-relaxed text-ink-2`,children:e.task_brief})}),e.run_config&&(0,V.jsx)(MP,{title:`Sweep config`,children:(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(AP,{label:`Smoke`,stage:e.run_config.difficulty}),(0,V.jsx)(AP,{label:`Frontier`,stage:e.run_config.full})]})}),e.harden_history&&e.harden_history.length>0&&(0,V.jsx)(MP,{title:`Harden trajectory`,children:(0,V.jsx)(`div`,{className:`space-y-1.5`,children:e.harden_history.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-bg-2/40 px-3 py-1.5 text-[12.5px]`,children:[(0,V.jsxs)(`span`,{className:`text-ink-3`,children:[`gen `,e.generation??t,` · `,e.stage??`—`]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`font-mono text-ink-2`,children:[`pass@1 `,typeof e.pass_at_1==`number`?e.pass_at_1.toFixed(2):`—`]}),(0,V.jsx)(MS,{tone:e.verdict===`drop`?`danger`:`warn`,children:e.verdict??`harden`})]})]},t))})}),a.length>0&&(0,V.jsx)(MP,{title:`Sweeps`,icon:(0,V.jsx)(lx,{className:`size-3.5`}),children:(0,V.jsx)(`div`,{className:`space-y-3`,children:a.map(([e,t])=>(0,V.jsx)(jP,{label:DP(e),sweep:t},e))})})]})]})}function kP(e){return typeof e==`number`?`${Math.round(e*100)}%`:String(e)}function AP({label:e,stage:t}){return(0,V.jsxs)(`div`,{className:`rounded-lg border border-line bg-bg-2/40 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-[12.5px] font-medium text-ink`,children:e}),(0,V.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:[t.band.basis===`aggregate`?`agg`:t.band.basis,` `,Math.round((t.band.min_pass??0)*100),`–`,Math.round((t.band.max_pass??0)*100),`%`]})]}),(0,V.jsx)(`div`,{className:`space-y-1`,children:t.agents.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-ink-2`,children:[(0,V.jsx)(tC,{provider:eC[e.harness]??``,size:13,className:`text-ink-3`}),(0,V.jsx)(`span`,{children:e.harness}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`·`}),(0,V.jsx)(tC,{provider:$S(e.model),size:13,className:`text-ink-3`}),(0,V.jsx)(`span`,{className:`text-ink-3`,children:e.model.split(`/`).pop()}),(0,V.jsxs)(`span`,{className:`ml-auto font-mono text-ink-4`,children:[`×`,e.n_trials]})]},t))})]})}function jP({label:e,sweep:t}){let n=[],r=(e,t,r=String)=>{t!=null&&n.push([e,r(t)])};r(`pass@1`,t.pass_at_1??t.claude_code_pass_at_1,kP);let i=t.families??null;if(i&&Object.keys(i).length>0)for(let[e,t]of Object.entries(i).sort(([e],[t])=>e.localeCompare(t)))r(e,t,kP);else r(`claude-code`,t.claude_code,kP),r(`codex`,t.codex,kP);r(`aggregate (best family)`,t.aggregate,kP),r(`fairness gap`,t.fairness_gap,kP),r(`auditor`,t.auditor_verdict),r(`blocker findings`,t.blocker_findings),r(`suspicious passes`,t.suspicious_passes?.length),r(`oracle reward`,t.oracle_reward),r(`nop reward`,t.nop_reward),r(`errored trials`,t.n_errored),t.verdict&&r(`verdict`,t.verdict),!n.length&&t.status&&r(`status`,t.status);let a=t.status===`running`?`info`:t.verdict===`harden`||t.status===`errored`?`warn`:null;return(0,V.jsxs)(`div`,{className:`rounded-lg border border-line bg-bg-2/40 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] font-medium text-ink`,children:[e,` sweep`,a&&(0,V.jsx)(MS,{tone:a,children:t.status??t.verdict})]}),t.experiment?(0,V.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-3`,title:`Sweep handle`,children:String(t.experiment)}):(0,V.jsx)(`span`,{className:`text-[12px] italic text-ink-4`,children:`no sweep yet`})]}),n.length>0&&(0,V.jsx)(`div`,{className:`mt-2 space-y-1.5`,children:n.map(([e,t])=>(0,V.jsx)(NP,{label:e,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:t})},e))})]})}function MP({title:e,icon:t,children:n}){return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`mb-2.5 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-ink-4`,children:[t,e]}),n]})}function NP({label:e,children:t}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-[13px]`,children:[(0,V.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,V.jsx)(`span`,{className:`text-right`,children:t})]})}function PP({children:e}){return(0,V.jsx)(`p`,{className:`text-[13px] italic text-ink-4`,children:e})}function FP(e){if(e==null)return`—`;if(typeof e!=`object`)return String(e);let t=e;if(t.exact)return`exact`;let n=[];return t.rel!=null&&n.push(`rel ${t.rel}`),t.abs!=null&&n.push(`abs ${t.abs}`),n.join(` / `)||`—`}var IP={pass:`ok`,selected:`ok`,proceed:`ok`,clean:`ok`,accept:`ok`,done:`info`,harden:`warn`,revise:`warn`,fail:`danger`,reject:`danger`,flag_broken:`danger`,none_selected:`neutral`};function LP(e){let t=[],n=(n,r)=>{let i=e.match(n);i&&t.push(r(i))};return n(/pass@1\s*=?\s*([0-9.]+)/i,e=>`pass@1 ${e[1]}`),n(/\bcc=([0-9.]+)/i,e=>`cc ${e[1]}`),n(/\bcx=([0-9.]+)/i,e=>`cx ${e[1]}`),n(/gap\s*=?\s*([0-9.]+)/i,e=>`gap ${e[1]}`),n(/([0-9]+)\s*blocker/i,e=>`${e[1]} blocker(s)`),n(/\b(SOLVABLE_AS_WRITTEN|SOLVABLE_ONLY_BY_GUESSING|UNSOLVABLE)\b/,e=>e[1]),n(/([0-9]+)\s*suspicious/i,e=>`${e[1]} suspicious`),t}function RP(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function zP({history:e}){let t=(0,w.useMemo)(()=>[...e].reverse(),[e]),[n,r]=(0,w.useState)(new Set),[i,a]=(0,w.useState)(!1),o=e=>i||n.has(e),s=e=>r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,V.jsxs)(oC,{children:[(0,V.jsxs)(sC,{children:[(0,V.jsxs)(cC,{children:[(0,V.jsx)(Fx,{className:`size-4 text-accent`}),`History`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(`span`,{className:`text-[12px] text-ink-4`,children:[e.length,` events`]}),t.length>0&&(0,V.jsx)(`button`,{onClick:()=>{a(e=>!e),r(new Set)},className:`focus-ring rounded-md px-2 py-1 text-[12px] font-medium text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,children:i?`Collapse all`:`Expand all`})]})]}),(0,V.jsx)(lC,{children:t.length===0?(0,V.jsx)(`p`,{className:`py-4 text-center text-[13px] italic text-ink-4`,children:`No transitions recorded yet.`}):(0,V.jsx)(`ol`,{className:`relative max-h-[28rem] space-y-0 overflow-y-auto pr-1`,children:t.map((e,n)=>{let r=o(n),i=LP(e.reason||``);return(0,V.jsxs)(eP.li,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{delay:Math.min(n,12)*.025},className:`relative flex gap-3.5 pb-5 last:pb-0`,children:[(0,V.jsxs)(`div`,{className:`relative flex flex-col items-center`,children:[(0,V.jsx)(`span`,{className:wS(`z-10 mt-1 size-2.5 rounded-full ring-4 ring-bg`,n===0?`bg-accent`:`bg-line-2`)}),ns(n),className:`focus-ring flex w-full flex-wrap items-center gap-2 rounded-md text-left`,children:[r?(0,V.jsx)(_x,{className:`size-3.5 shrink-0 text-ink-4`}):(0,V.jsx)(vx,{className:`size-3.5 shrink-0 text-ink-4`}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-ink`,children:AS(e.stage)}),(0,V.jsx)(MS,{tone:IP[e.verdict]??`neutral`,children:IS(e.verdict)}),(0,V.jsx)(fx,{className:`size-3.5 text-ink-4`}),(0,V.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:AS(e.next)}),e.ts&&(0,V.jsx)(`span`,{className:`ml-auto text-[12px] text-ink-4`,children:LS(e.ts)})]}),e.reason&&(r?(0,V.jsxs)(`div`,{className:`mt-1.5 space-y-2 pl-5`,children:[i.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map((e,t)=>(0,V.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-ink-2`,children:e},t))}),(0,V.jsx)(`p`,{className:`whitespace-pre-wrap break-words rounded-lg bg-bg-2 px-3 py-2 font-mono text-[12px] leading-relaxed text-ink-2`,children:e.reason}),e.ts&&(0,V.jsx)(`p`,{className:`text-[11px] text-ink-4`,children:RP(e.ts)})]}):(0,V.jsx)(`p`,{className:`mt-1 line-clamp-1 pl-5 text-[13px] text-ink-3`,children:e.reason}))]})]},`${e.stage}-${n}`)})})})]})}var BP=new Set([`python`,`rust`,`typescript`,`tsx`,`javascript`,`jsx`,`go`,`c`,`cpp`,`java`,`ruby`,`bash`,`toml`,`yaml`,`json`,`html`,`css`,`scss`,`sql`,`dockerfile`,`makefile`,`ini`,`diff`]);function VP(e){let t=e.lang??``;return e.name.endsWith(`.md`)?Ox:t===`json`?Ex:t===`bash`||t===`dockerfile`||t===`makefile`?Dx:/\.(png|jpe?g|gif|webp|bmp|ico|svg|avif)$/i.test(e.name)?Ix:BP.has(t)?Tx:rx}function HP({node:e,depth:t,selected:n,expanded:r,onToggle:i,onSelect:a}){let o=e.type===`dir`,s=r.has(e.path),c=o?s?Ax:jx:VP(e);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{onClick:()=>o?i(e.path):a(e),className:wS(`focus-ring flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-[13px] transition-colors`,n===e.path?`bg-accent-soft/30 text-ink`:`text-ink-2 hover:bg-surface-2`),style:{paddingLeft:`${t*12+6}px`},children:[o?s?(0,V.jsx)(_x,{className:`size-3.5 shrink-0 text-ink-4`}):(0,V.jsx)(vx,{className:`size-3.5 shrink-0 text-ink-4`}):(0,V.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,V.jsx)(c,{className:wS(`size-3.5 shrink-0`,o?`text-accent`:`text-ink-4`)}),(0,V.jsx)(`span`,{className:`truncate`,children:e.name}),!o&&e.size!=null&&(0,V.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[10.5px] text-ink-4`,children:[RS(e.size),`b`]})]}),o&&s&&e.children&&(0,V.jsxs)(`div`,{children:[e.children.map(e=>(0,V.jsx)(HP,{node:e,depth:t+1,selected:n,expanded:r,onToggle:i,onSelect:a},e.path)),e.truncated&&(0,V.jsx)(`div`,{className:`py-1 text-[11px] italic text-ink-4`,style:{paddingLeft:`${(t+1)*12+24}px`},children:`… truncated`})]})]})}function UP({content:e}){return(0,V.jsx)(`div`,{className:`overflow-auto rounded-lg border border-line bg-bg-2`,children:(0,V.jsx)(`pre`,{className:`min-w-full text-[12.5px] leading-[1.6]`,children:(0,V.jsx)(`code`,{className:`grid grid-cols-[auto_1fr] font-mono`,children:e.replace(/\n$/,``).split(` -`).map((e,t)=>(0,V.jsxs)(`div`,{className:`contents`,children:[(0,V.jsx)(`span`,{className:`select-none border-r border-line/60 px-3 text-right text-ink-4`,children:t+1}),(0,V.jsx)(`span`,{className:`whitespace-pre px-3 text-ink-2`,children:e||` `})]},t))})})})}function WP({file:e}){let[t,n]=(0,w.useState)(!1),r=e.lang===`markdown`;if((0,w.useEffect)(()=>n(!1),[e.path]),e.kind===`image`)return(0,V.jsx)(`div`,{className:`flex justify-center rounded-lg border border-line bg-bg-2 p-4`,children:(0,V.jsx)(`img`,{src:e.data_uri,alt:e.name,className:`max-h-[70vh] max-w-full rounded`})});if(e.kind===`binary`)return(0,V.jsx)(GP,{label:`Binary file · ${RS(e.size)} bytes — no preview`});if(e.kind===`too_large`)return(0,V.jsx)(GP,{label:`File too large to preview · ${RS(e.size)} bytes`});let i=e.content??``;return(0,V.jsxs)(`div`,{className:`space-y-2`,children:[r&&(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsx)(`div`,{className:`inline-flex rounded-lg border border-line bg-surface p-0.5 text-[12px]`,children:[`rendered`,`raw`].map(e=>(0,V.jsx)(`button`,{onClick:()=>n(e===`raw`),className:wS(`rounded-md px-2.5 py-1 font-medium capitalize transition-colors`,e===`raw`===t?`bg-surface-3 text-ink`:`text-ink-3 hover:text-ink`),children:e},e))})}),r&&!t?(0,V.jsx)(qP,{source:i}):(0,V.jsx)(UP,{content:i})]})}function GP({label:e}){return(0,V.jsx)(`div`,{className:`flex h-40 items-center justify-center rounded-lg border border-dashed border-line text-[13px] text-ink-4`,children:e})}function KP(e,t){let n=[],r=/(`[^`]+`)|(\[[^\]]+\]\([^)]+\))|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(_[^_]+_)/g,i=0,a,o=0;for(;a=r.exec(e);){a.index>i&&n.push(e.slice(i,a.index));let r=a[0],s=`${t}-${o++}`;if(r.startsWith("`"))n.push((0,V.jsx)(`code`,{className:`rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.9em] text-accent`,children:r.slice(1,-1)},s));else if(r.startsWith(`[`)){let e=/\[([^\]]+)\]\(([^)]+)\)/.exec(r);n.push((0,V.jsx)(`a`,{href:e[2],target:`_blank`,rel:`noreferrer`,className:`text-accent hover:underline`,children:e[1]},s))}else r.startsWith(`**`)?n.push((0,V.jsx)(`strong`,{className:`font-semibold text-ink`,children:r.slice(2,-2)},s)):n.push((0,V.jsx)(`em`,{children:r.slice(1,-1)},s));i=a.index+r.length}return i(0,V.jsx)(`li`,{children:KP(e,`li${i}-${t}`)},t))},i++));continue}if(/^\s*\d+\.\s+/.test(e)){let e=[];for(;r(0,V.jsx)(`li`,{children:KP(e,`ol${i}-${t}`)},t))},i++));continue}if(/^\s*>\s?/.test(e)){t.push((0,V.jsx)(`blockquote`,{className:`border-l-2 border-line pl-3 text-[13px] italic text-ink-3`,children:KP(e.replace(/^\s*>\s?/,``),`bq${i}`)},i++)),r++;continue}if(/^\s*(-{3,}|\*{3,})\s*$/.test(e)){t.push((0,V.jsx)(`hr`,{className:`border-line`},i++)),r++;continue}if(e.trim()===``){r++;continue}let o=[];for(;r\s?/.test(n[r]);)o.push(n[r++]);t.push((0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:KP(o.join(` `),`p${i}`)},i++))}return(0,V.jsx)(`div`,{className:`space-y-2.5 rounded-lg border border-line bg-bg-2 px-4 py-3`,children:t})}function JP(e){let t=new Set([e.path]),n=e.children?.find(e=>e.name===`task`&&e.type===`dir`);return n&&(t.add(n.path),n.children?.length===1&&n.children[0].type===`dir`&&t.add(n.children[0].path)),t}function YP(e){if(e.type===`file`)return e;for(let t of e.children??[]){let e=YP(t);if(e)return e}return null}function XP(e,t){if(e.path===t)return e.type===`file`?e:null;for(let n of e.children??[]){let e=XP(n,t);if(e)return e}return null}function ZP(e,t){let n=new Set(e),r=t.split(`/`);for(let e=1;e{if(!t)return;let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),document.body.style.overflow=``}},[t,n]),(0,w.useEffect)(()=>{if(!t)return;let n=!1;return p(!0),_(null),pS.listFiles(e).then(e=>{if(n)return;let t=r?XP(e.tree,r):null,i=JP(e.tree);t&&(i=ZP(i,t.path)),a(e.tree),s(i);let o=e.tree.children?.find(e=>e.name===`task`),c=o&&$P(o,`instruction.md`),l=t??c??YP(e.tree);l&&v(l)}).catch(e=>!n&&_(String(e?.message??e))).finally(()=>!n&&p(!1)),()=>{n=!0}},[t,e,r]);let v=async t=>{l(t.path),h(!0);try{d(await pS.readFile(e,t.path))}catch(e){d(null),_(String(e?.message??e))}finally{h(!1)}};return(0,V.jsx)(sM,{children:t&&(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50`,children:[(0,V.jsx)(eP.div,{className:`absolute inset-0 bg-bg-2/70 backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n}),(0,V.jsxs)(eP.aside,{className:`glass absolute inset-y-0 right-0 flex w-full max-w-[1040px] flex-col border-l border-line`,initial:{x:`100%`},animate:{x:0},exit:{x:`100%`},transition:{type:`spring`,stiffness:320,damping:34},children:[(0,V.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-line px-5 py-3.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-semibold uppercase tracking-[0.08em] text-ink-3`,children:[(0,V.jsx)(Ax,{className:`size-4 text-accent`}),`Files · `,(0,V.jsx)(`span`,{className:`font-mono normal-case text-ink-2`,children:e})]}),(0,V.jsx)(`button`,{onClick:n,className:`focus-ring rounded-lg p-1.5 text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,"aria-label":`Close`,children:(0,V.jsx)(uS,{className:`size-5`})})]}),(0,V.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[280px_1fr]`,children:[(0,V.jsx)(`div`,{className:`min-h-0 overflow-y-auto border-r border-line p-2`,children:f?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-[13px] text-ink-4`,children:[(0,V.jsx)(ax,{className:`size-4 animate-spin`}),` Loading tree…`]}):i?(0,V.jsx)(HP,{node:i,depth:0,selected:c,expanded:o,onToggle:e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:e=>void v(e)}):(0,V.jsx)(`p`,{className:`p-3 text-[13px] text-ink-4`,children:g??`No files.`})}),(0,V.jsxs)(`div`,{className:`min-h-0 overflow-y-auto p-4`,children:[c&&(0,V.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`truncate font-mono text-ink-2`,children:c}),u?.lang&&(0,V.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 py-0.5 text-[11px] text-ink-3`,children:u.lang})]}),m?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-[13px] text-ink-4`,children:[(0,V.jsx)(ax,{className:`size-4 animate-spin`}),` Loading…`]}):u?(0,V.jsx)(WP,{file:u}):(0,V.jsx)(GP,{label:`Select a file to preview.`})]})]})]})]})})}function $P(e,t){if(e.type===`file`)return e.name===t?e:null;for(let n of e.children??[]){let e=$P(n,t);if(e)return e}return null}function eF(e,t){let n=t??{};if(e===`Bash`&&typeof n.command==`string`)return n.command.split(` -`)[0];for(let e of[`file_path`,`path`,`pattern`,`url`,`query`,`command`])if(typeof n[e]==`string`)return n[e];let r=JSON.stringify(n);return r===`{}`?``:r.length>160?r.slice(0,160)+`…`:r}function tF(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e&&typeof e==`object`&&`text`in e?String(e.text??``):``).join(``):``}function nF(e){let t=[];for(let n of e.split(` -`)){let e=n.trim();if(!e)continue;if(e.startsWith(`=====`)){t.push({kind:`divider`,text:e.replace(/=+/g,``).trim()});continue}let r;try{r=JSON.parse(e)}catch{t.push({kind:`raw`,text:e});continue}if(!r||typeof r!=`object`)continue;let i=r.message;switch(r.type){case`lh`:t.push({kind:`lh`,event:String(r.event??``),ok:r.ok,detail:r.detail,n:r.n,of:r.of,label:r.label});break;case`system`:r.subtype===`init`&&t.push({kind:`system`,text:`session started${r.model?` · ${r.model}`:``}`});break;case`assistant`:for(let e of i?.content??[])e.type===`text`&&typeof e.text==`string`&&e.text.trim()?t.push({kind:`text`,text:e.text.trim()}):e.type===`thinking`&&typeof e.thinking==`string`&&e.thinking.trim()?t.push({kind:`thinking`,text:e.thinking.trim()}):e.type===`tool_use`&&t.push({kind:`tool`,name:String(e.name??`tool`),summary:eF(String(e.name),e.input)});break;case`user`:for(let e of i?.content??[])if(e.type===`tool_result`){let n=tF(e.content).trim();n&&t.push({kind:`tool_result`,text:n,isError:!!e.is_error})}break;case`result`:{let e=[r.duration_ms?`${Math.round(Number(r.duration_ms)/1e3)}s`:null,r.num_turns?`${r.num_turns} turns`:null,r.total_cost_usd==null?null:`$${Number(r.total_cost_usd).toFixed(2)}`].filter(Boolean).join(` · `);t.push({kind:`final`,text:String(r.result??(r.is_error?`errored`:`done`)),meta:e,isError:!!r.is_error});break}}}return t}var rF=8;function iF(e,t){let n=e.split(` + `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,V.jsx)(rM,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:w.cloneElement(e,{ref:u})})}var aM=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=bC(oM),d=(0,w.useId)(),f=(0,w.useRef)(n),p=(0,w.useRef)(r);xC(()=>{f.current=n,p.current=r});let m=!0,h=(0,w.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,w.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),w.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(iM,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,V.jsx)(SC.Provider,{value:h,children:e})};function oM(){return new Map}function sM(e=!0){let t=(0,w.useContext)(SC);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,w.useId)();(0,w.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,w.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var cM=e=>e.key||``;function lM(e){let t=[];return w.Children.forEach(e,e=>{(0,w.isValidElement)(e)&&t.push(e)}),t}var uM=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=sM(o),f=(0,w.useMemo)(()=>lM(e),[e]),p=o&&!u?[]:f.map(cM),m=(0,w.useRef)(!0),h=(0,w.useRef)(f),g=bC(()=>new Map),_=(0,w.useRef)(new Set),[v,y]=(0,w.useState)(f),[b,x]=(0,w.useState)(f);xC(()=>{m.current=!1,h.current=f;for(let e=0;e{let v=cM(e),y=o&&!u?!1:f===b||p.includes(v);return(0,V.jsx)(aM,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},dM=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function fM(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(dM.indexOf(e)>-1||/[A-Z]/u.test(e))}var pM=(e,t)=>t.isSVG??fM(e)?new Qk(t):new Hk(t,{allowProjection:e!==w.Fragment}),mM=(0,w.createContext)({strict:!1}),hM=(0,w.createContext)({});function gM(e,t){if(mk(e)){let{initial:t,animate:n}=e;return{initial:t===!1||dk(t)?t:void 0,animate:dk(n)?n:void 0}}return e.inherit===!1?{}:t}function _M(e){let{initial:t,animate:n}=gM(e,(0,w.useContext)(hM));return(0,w.useMemo)(()=>({initial:t,animate:n}),[vM(t),vM(n)])}function vM(e){return Array.isArray(e)?e.join(` `):e}var yM=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bM(e,t,n){for(let r in t)!iO(t[r])&&!zk(r,n)&&(e[r]=t[r])}function xM({transformTemplate:e},t){return(0,w.useMemo)(()=>{let n=yM();return Nk(n,t,e),Object.assign({},n.vars,n.style)},[t])}function SM(e,t){let n=e.style||{},r={};return bM(r,n,e),Object.assign(r,xM(e,t)),r}function CM(e,t){let n={},r=SM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var wM=()=>({...yM(),attrs:{}});function TM(e,t,n,r){let i=(0,w.useMemo)(()=>{let n=wM();return qk(n,t,Yk(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};bM(t,e.style,e),i.style={...t,...i.style}}return i}var EM=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function DM(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||EM.has(e)}var OM=e=>!DM(e);function kM(e){typeof e==`function`&&(OM=t=>t.startsWith(`on`)?!DM(t):e(t))}try{kM((Ba(),d(La)).default)}catch{}function AM(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||iO(e[i])||(OM(i)||n===!0&&DM(i)||!t&&!DM(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function jM(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??fM(e)?TM:CM)(t,r,i,e),c=AM(t,typeof e==`string`,a),l=e===w.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,w.useMemo)(()=>iO(u)?u.get():u,[u]);return(0,w.createElement)(e,{...l,children:d})}function MM({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:NM(n,r,i,e),renderState:t()}}function NM(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=FA(a[e]);let{initial:o,animate:s}=e,c=mk(e),l=hk(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!uk(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{let r=(0,w.useContext)(hM),i=(0,w.useContext)(SC),a=()=>MM(e,t,r,i);return n?a():bC(a)},FM=PM({scrapeMotionValuesFromProps:Bk,createRenderState:yM}),IM=PM({scrapeMotionValuesFromProps:Zk,createRenderState:wM}),LM={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},RM=!1;function zM(){if(RM)return;let e={};for(let t in LM)e[t]={isEnabled:e=>LM[t].some(t=>!!e[t])};Tk(e),RM=!0}function BM(){return zM(),Ek()}function VM(e){let t=BM();for(let n in e)t[n]={...t[n],...e[n]};Tk(t)}var HM=Symbol.for(`motionComponentSymbol`);function UM(e,t,n){let r=(0,w.useRef)(n);(0,w.useInsertionEffect)(()=>{r.current=n});let i=(0,w.useRef)(null);return(0,w.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var WM=(0,w.createContext)({});function GM(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function KM(e,t,n,r,i,a){let{visualElement:o}=(0,w.useContext)(hM),s=(0,w.useContext)(mM),c=(0,w.useContext)(SC),l=(0,w.useContext)($j),u=l.reducedMotion,d=l.skipAnimations,f=(0,w.useRef)(null),p=(0,w.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,w.useContext)(WM);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&qM(f.current,n,i,h);let g=(0,w.useRef)(!1);(0,w.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[yD],v=(0,w.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return xC(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,w.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function qM(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:JM(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&GM(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function JM(e){if(e)return e.options.allowProjection===!1?JM(e.parent):e.projection}function YM(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&VM(r);let a=n?n===`svg`:fM(e),o=a?IM:FM;function s(n,s){let c,l={...(0,w.useContext)($j),...n,layoutId:XM(n)},{isStatic:u}=l,d=_M(n),f=o(n,u);if(!u&&typeof window<`u`){ZM(l,r);let t=QM(l);c=t.MeasureLayout,d.visualElement=KM(e,f,l,i,t.ProjectionNode,a)}return(0,V.jsxs)(hM.Provider,{value:d,children:[c&&d.visualElement?(0,V.jsx)(c,{visualElement:d.visualElement,...l}):null,jM(e,n,UM(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,w.forwardRef)(s);return c[HM]=e,c}function XM({layoutId:e}){let t=(0,w.useContext)(yC).id;return t&&e!==void 0?t+`-`+e:e}function ZM(e,t){(0,w.useContext)(mM).strict}function QM(e){let{drag:t,layout:n}=BM();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function $M(e,t){if(typeof Proxy>`u`)return YM;let n=new Map,r=(n,r)=>YM(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,YM(a,void 0,e,t)),n.get(a))})}var eN=class extends sO{constructor(e){super(e),e.animationState||=_A(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();uk(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},tN=0,nN={animation:{Feature:eN},exit:{Feature:class extends sO{constructor(){super(...arguments),this.id=tN++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=$k(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function rN(e){return{point:{x:e.pageX,y:e.pageY}}}var iN=e=>t=>jD(t)&&e(t,rN(t));function aN(e,t,n,r){return PA(e,t,iN(n),r)}var oN=({current:e})=>e?e.ownerDocument.defaultView:null,sN=(e,t)=>Math.abs(e-t);function cN(e,t){let n=sN(e.x,t.x),r=sN(e.y,t.y);return Math.sqrt(n**2+r**2)}var lN=new Set([`auto`,`scroll`]),uN=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=dN(this.lastRawMoveEventInfo,this.transformPagePoint));let e=pN(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=cN(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=fw;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=dN(t,this.transformPagePoint),uw.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=pN(e.type===`pointercancel`?this.lastMoveEventInfo:dN(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!jD(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=dN(rN(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=fw;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,pN(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=MC(aN(this.contextWindow,`pointermove`,this.handlePointerMove,d),aN(this.contextWindow,`pointerup`,this.handlePointerUp,d),aN(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(lN.has(e.overflowX)||lN.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),uw.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),dw(this.updatePoint)}};function dN(e,t){return t?{point:t(e.point)}:e}function fN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function pN({point:e},t){return{point:e,delta:fN(e,hN(t)),offset:fN(e,mN(t)),velocity:gN(t,.1)}}function mN(e){return e[0]}function hN(e){return e[e.length-1]}function gN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=hN(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>FC(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>FC(t)*2&&(r=e[1]);let a=IC(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _N(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?uT(n,e,r.max):Math.min(e,n)),e}function vN(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function yN(e,{top:t,left:n,bottom:r,right:i}){return{x:vN(e.x,n,i),y:vN(e.y,t,r)}}function bN(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=NC(t.min,t.max-r,e.min):r>i&&(n=NC(e.min,e.max-i,t.min)),TC(0,1,n)}function CN(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var wN=.35;function TN(e=wN){return e===!1?e=0:e===!0&&(e=wN),{x:EN(e,`left`,`right`),y:EN(e,`top`,`bottom`)}}function EN(e,t,n){return{min:DN(e,t),max:DN(e,n)}}function DN(e,t){return typeof e==`number`?e:e[t]||0}var ON=new WeakMap,kN=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=tk(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(rN(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wD(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),NA(e=>{let t=this.getAxisMotionValue(e).get()||0;if(zw.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=TA(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&uw.update(()=>i(e,t),!1,!0),oO(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=NN(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&uw.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new uN(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:oN(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&uw.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!MN(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=_N(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&GM(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=yN(n.layoutBox,e):this.constraints=!1,this.elastic=TN(t),r!==this.constraints&&!GM(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&NA(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=CN(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!GM(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=OO(n,r.root,this.visualElement.getTransformPagePoint()),a=xN(r.layout.layoutBox,i);if(t){let e=t(lO(a));this.hasMutatedConstraints=!!e,e&&(a=cO(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=NA(o=>{if(!MN(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return oO(this.visualElement,e),n.start(_D(e,n,0,t,this.visualElement,!1))}stopAnimation(){NA(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){NA(t=>{let{drag:n}=this.getProps();if(!MN(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-uT(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!GM(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};NA(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=SN({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),NA(t=>{if(!MN(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(uT(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ON.set(this.visualElement,this);let e=this.visualElement.current,t=aN(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&FD(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();GM(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=jN(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),uw.read(r);let o=PA(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(NA(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=wN,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function AN(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function jN(e,t,n){let r=rO(e,AN(n)),i=rO(t,AN(n));return()=>{r(),i()}}function MN(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function NN(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var PN=class extends sO{constructor(e){super(e),this.removeGroupControls=jC,this.removeListeners=jC,this.controls=new kN(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jC}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},FN=e=>(t,n)=>{e&&uw.update(()=>e(t,n),!1,!0)},IN=class extends sO{constructor(){super(...arguments),this.removePointerDownListener=jC}onPointerDown(e){this.session=new uN(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oN(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:FN(e),onStart:FN(t),onMove:FN(n),onEnd:(e,t)=>{delete this.session,r&&uw.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=aN(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},LN=!1,RN=class extends w.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),LN&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),gj.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),LN=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||uw.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),bD.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;LN=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function zN(e){let[t,n]=sM(),r=(0,w.useContext)(yC);return(0,V.jsx)(RN,{...e,layoutGroup:r,switchLayoutGroup:(0,w.useContext)(WM),isPresent:t,safeToRemove:n})}var BN={pan:{Feature:IN},drag:{Feature:PN,ProjectionNode:Qj,MeasureLayout:zN}};function VN(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&uw.postRender(()=>i(t,rN(t)))}var HN=class extends sO{mount(){let{current:e}=this.node;e&&(this.unmount=OD(e,(e,t)=>(VN(this.node,t,`Start`),e=>VN(this.node,e,`End`))))}unmount(){}},UN=class extends sO{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=MC(PA(this.node.current,`focus`,()=>this.onFocus()),PA(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function WN(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&uw.postRender(()=>i(t,rN(t)))}var GN=class extends sO{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=HD(e,(e,t)=>(WN(this.node,t,`Start`),(e,{success:t})=>WN(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},KN=new WeakMap,qN=new WeakMap,JN=e=>{let t=KN.get(e.target);t&&t(e)},YN=e=>{e.forEach(JN)};function XN({root:e,...t}){let n=e||document;qN.has(n)||qN.set(n,{});let r=qN.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(YN,{root:e,...t})),r[i]}function ZN(e,t,n){let r=XN(t);return KN.set(e,n),r.observe(e),()=>{KN.delete(e),r.unobserve(e)}}var QN={some:0,all:1},$N=class extends sO{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:QN[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=ZN(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(eP(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function eP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var tP={inView:{Feature:$N},tap:{Feature:GN},focus:{Feature:UN},hover:{Feature:HN}},nP={layout:{ProjectionNode:Qj,MeasureLayout:zN}},rP=$M({...nN,...tP,...BN,...nP},pM),iP=4,aP=172,oP=50,sP=24,cP=12,lP=232,uP=108,dP=916;function fP(e,t){return{x:e,y:t,cx:e+aP/2,cy:t+oP/2}}function pP(e){let t=Math.floor(e/iP),n=e%iP;return t%2==1&&(n=iP-1-n),fP(sP+n*lP,sP+t*uP)}var mP=Object.fromEntries(OS.map((e,t)=>[e.stage,t])),hP=184,gP=fP(140,346),_P=gP.y+oP+sP,vP=[`CALIBRATE`,`QA_PROBE`,`FULL_SWEEP`];function yP(e,t){return e[t]??`pending`}function bP({statuses:e,onSelectStage:t,selected:n}){let r=gP,i=r.y,a=(e,t)=>r.x+hP*(e+1)/(t+1),o=yP(e,`SYNTHESIZE`)===`current`;return(0,V.jsxs)(`div`,{className:`w-full overflow-x-auto`,children:[(0,V.jsxs)(`svg`,{viewBox:`0 0 ${dP} ${_P}`,className:`h-auto w-full min-w-[720px]`,role:`img`,"aria-label":`Pipeline DAG`,children:[(0,V.jsx)(`defs`,{children:(0,V.jsx)(`marker`,{id:`dag-arrow`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`,markerUnits:`userSpaceOnUse`,children:(0,V.jsx)(`path`,{d:`M1,1 L9,5 L1,9 Z`,fill:`context-stroke`})})}),OS.slice(0,-1).map((t,n)=>{let r=yP(e,OS[n].stage),i=yP(e,OS[n+1].stage),a=r===`done`&&i===`current`?`active`:r===`done`&&i===`done`?`done`:`muted`;return(0,V.jsx)(CP,{a:pP(n),b:pP(n+1),state:a},`e-${n}`)}),vP.map((e,t)=>(0,V.jsx)(wP,{from:pP(mP[e]),tx:a(t,vP.length),ty:i,active:o},`h-${e}`)),(0,V.jsx)(TP,{from:r,to:pP(mP.STATIC_CI),active:o}),(0,V.jsx)(EP,{x:r.cx-34,y:i-12,text:`harden / ease`,active:o}),OS.map((r,i)=>(0,V.jsx)(DP,{meta:r,p:pP(i),status:yP(e,r.stage),step:i+1,onSelect:t,isSelected:n===r.stage},r.stage)),(0,V.jsx)(DP,{meta:kS,p:r,status:yP(e,`SYNTHESIZE`),dashed:!0,w:hP,onSelect:t,isSelected:n===`SYNTHESIZE`})]}),(0,V.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-1`,children:jS.map(e=>(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[12px] text-ink-4`,children:[(0,V.jsx)(`span`,{className:`size-2.5`,style:{background:e.color}}),e.label]},e.key))})]})}var xP=`var(--color-line)`,SP=`var(--color-accent)`;function CP({a:e,b:t,state:n}){let r=Math.abs(e.y-t.y)<1,i;if(r){let n=e.xn?1:-1,s=Math.min(cP,Math.abs(a-n)/2,(e-r)/2,(o-e)/2);i=[`M ${n} ${r}`,`L ${n} ${e-s}`,`Q ${n} ${e} ${n+t*s} ${e}`,`L ${a-t*s} ${e}`,`Q ${a} ${e} ${a} ${e+s}`,`L ${a} ${o}`].join(` `)}}if(n===`active`)return(0,V.jsx)(rP.path,{d:i,fill:`none`,stroke:SP,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,strokeDasharray:`4 5`,markerEnd:`url(#dag-arrow)`,animate:{strokeDashoffset:[0,-18]},transition:{duration:.9,repeat:1/0,ease:`linear`}});let a=n===`done`;return(0,V.jsx)(`path`,{d:i,fill:`none`,stroke:a?SP:xP,strokeWidth:a?1.75:1.25,strokeLinecap:`round`,strokeLinejoin:`round`,markerEnd:`url(#dag-arrow)`,opacity:a?.9:.5})}function wP({from:e,tx:t,ty:n,active:r}){let i=e.cx,a=e.y+oP,o=n-a;return(0,V.jsx)(`path`,{d:`M ${i} ${a} C ${i} ${a+o*.5} ${t} ${n-o*.4} ${t} ${n}`,fill:`none`,stroke:r?SP:xP,strokeWidth:r?1.75:1,strokeDasharray:`4 5`,strokeLinecap:`round`,markerEnd:`url(#dag-arrow)`,opacity:r?.9:.28})}function TP({from:e,to:t,active:n}){let r=e.cx+30,i=e.y,a=t.cx,o=t.y+oP,s=i-o;return(0,V.jsx)(`path`,{d:`M ${r} ${i} C ${r} ${i-s*.45} ${a} ${o+s*.45} ${a} ${o}`,fill:`none`,stroke:n?SP:xP,strokeWidth:n?1.75:1,strokeDasharray:`4 5`,strokeLinecap:`round`,markerEnd:`url(#dag-arrow)`,opacity:n?.9:.28})}function EP({x:e,y:t,text:n,active:r}){return(0,V.jsx)(`text`,{x:e,y:t,fontSize:`10.5`,fontWeight:500,fill:r?SP:`var(--color-ink-4)`,opacity:r?.95:.6,children:n})}function DP({meta:e,p:t,status:n,step:r,dashed:i,w:a=aP,onSelect:o,isSelected:s}){let c=MS(e.type),l=n===`current`,u=n===`done`,d=n===`pending`,f=l?.16:u?.09:.04,p=s?`var(--color-accent)`:l||u?c:`var(--color-line)`;return(0,V.jsxs)(`g`,{transform:`translate(${t.x}, ${t.y})`,className:DS(o?`cursor-pointer`:`cursor-default`),onClick:o?()=>o(e.stage):void 0,children:[(0,V.jsx)(`title`,{children:`${e.label} — ${e.blurb}${o?` (click to inspect)`:``}`}),(0,V.jsx)(`rect`,{width:a,height:oP,rx:0,fill:`var(--color-surface-2)`,stroke:p,strokeWidth:s||l?2:1.25,strokeDasharray:i?`5 4`:void 0}),(0,V.jsx)(`rect`,{width:a,height:oP,rx:0,fill:c,fillOpacity:f}),(0,V.jsx)(`g`,{transform:`translate(${a-24}, 11)`,children:u?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`circle`,{r:8,cx:5,cy:5,fill:c,fillOpacity:.9}),(0,V.jsx)(gx,{x:0,y:0,width:10,height:10,stroke:`var(--color-surface)`,strokeWidth:2.4})]}):l?(0,V.jsx)(rP.circle,{r:4.5,cx:5,cy:5,fill:c,animate:{opacity:[1,.35,1]},transition:{duration:1.5,repeat:1/0}}):(0,V.jsx)(`circle`,{r:4,cx:5,cy:5,fill:`none`,stroke:`var(--color-line-2)`,strokeWidth:1.5})}),r!==void 0&&(0,V.jsx)(`text`,{x:14,y:19,fontSize:`10.5`,fontWeight:600,fill:`var(--color-ink-4)`,children:String(r).padStart(2,`0`)}),(0,V.jsx)(`text`,{x:14,y:r===void 0?30:37,fontSize:`13`,fontWeight:600,fill:d?`var(--color-ink-3)`:`var(--color-ink)`,children:e.label})]})}var OP={permissive:`ok`,"weak-copyleft":`warn`,"strong-copyleft":`danger`,unknown:`neutral`},kP={difficulty:`Smoke`,full:`Frontier`,calibrate:`Calibrate`,qa:`QA`};function AP(e){return kP[e]??e.charAt(0).toUpperCase()+e.slice(1).replace(/[-_]/g,` `)}function jP({context:e}){let t=e.source??null,n=e.dimensions??null,r=e.oracle??null,i=e.sweeps??{},a=Object.entries(i).filter(([,e])=>e&&typeof e==`object`);return(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(hx,{className:`size-4 text-accent`}),`Run Context`]})}),(0,V.jsxs)(fC,{className:`space-y-6`,children:[(0,V.jsx)(FP,{title:`Source`,icon:(0,V.jsx)(ix,{className:`size-3.5`}),children:t?(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsx)(IP,{label:`Repository`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink`,children:t.repo})}),(0,V.jsx)(IP,{label:`Pinned SHA`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:RS(t.pinned_sha,12)})}),(0,V.jsx)(IP,{label:`Language`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ink-2`,children:[(0,V.jsx)(Ox,{className:`size-3.5 text-ink-4`}),t.primary_language??`—`]})}),(0,V.jsx)(IP,{label:`License`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-ink-2`,children:t.license??`unknown`}),(0,V.jsxs)(FS,{tone:OP[t.license_class]??`neutral`,children:[(0,V.jsx)(eS,{className:`size-3`}),t.license_class]})]})}),(t.size_loc!=null||t.size_files!=null)&&(0,V.jsx)(IP,{label:`Size`,children:(0,V.jsxs)(`span`,{className:`text-ink-2`,children:[VS(t.size_loc),` LOC · `,VS(t.size_files),` `,`files`]})}),(t.build_systems.length>0||t.test_frameworks.length>0)&&(0,V.jsx)(IP,{label:`Toolchain`,children:(0,V.jsxs)(`span`,{className:`flex flex-wrap justify-end gap-1.5`,children:[t.build_systems.map(e=>(0,V.jsx)(FS,{tone:`neutral`,children:e},e)),t.test_frameworks.map(e=>(0,V.jsxs)(FS,{tone:`info`,children:[(0,V.jsx)(lS,{className:`size-3`}),e]},e))]})})]}):(0,V.jsx)(LP,{children:`Source not yet ingested.`})}),n&&(n.tool_name||n.target_language||n.scope_unit||n.verifier_mechanism||n.objective)&&(0,V.jsxs)(FP,{title:`Dimensions`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[n.tool_name&&(0,V.jsx)(FS,{tone:`accent`,children:n.tool_name}),n.binary_name&&n.binary_name!==n.tool_name&&(0,V.jsxs)(FS,{tone:`neutral`,children:[`bin: `,n.binary_name]}),n.upstream_language&&(0,V.jsx)(FS,{tone:`info`,children:n.upstream_language}),n.target_language&&(0,V.jsx)(FS,{tone:`accent`,children:n.target_language}),n.scope_unit&&(0,V.jsx)(FS,{tone:`neutral`,children:zS(n.scope_unit)}),n.verifier_mechanism&&(0,V.jsx)(FS,{tone:`info`,children:zS(n.verifier_mechanism)}),n.objective&&(0,V.jsx)(FS,{tone:`neutral`,children:n.objective.replace(/\+/g,` + `)})]}),n.flag_surface&&(0,V.jsx)(`p`,{className:`mt-2 text-[12.5px] leading-relaxed text-ink-3`,children:n.flag_surface})]}),r&&(0,V.jsx)(FP,{title:`Oracle`,children:(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[r.approach&&(0,V.jsx)(IP,{label:`Approach`,children:(0,V.jsx)(`span`,{className:`text-ink-2`,children:zS(String(r.approach).replace(/-/g,` `))})}),r.n_cases!=null&&(0,V.jsx)(IP,{label:`Golden cases`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:String(r.n_cases)})}),r.text_distinct!=null&&(0,V.jsx)(IP,{label:`Oracle pair`,children:(0,V.jsx)(`span`,{className:r.text_distinct?`text-ok`:`text-danger`,children:r.text_distinct?`byte-distinct`:`NOT distinct`})}),r.epsilon!=null&&(typeof r.epsilon==`object`?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5 text-[13px] text-ink-3`,children:`Epsilon (ε), per field`}),(0,V.jsx)(`div`,{className:`space-y-1 rounded-lg bg-bg-2 px-3 py-2`,children:Object.entries(r.epsilon).map(([e,t])=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`font-mono text-ink-4`,children:e}),(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:RP(t)})]},e))})]}):(0,V.jsx)(IP,{label:`Epsilon (ε)`,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:String(r.epsilon)})}))]})}),e.task_brief&&(0,V.jsx)(FP,{title:`Brief`,children:(0,V.jsx)(`p`,{className:`whitespace-pre-wrap rounded-lg border border-line bg-bg-2/40 px-3 py-2 text-[13px] leading-relaxed text-ink-2`,children:e.task_brief})}),e.run_config&&(0,V.jsx)(FP,{title:`Sweep config`,children:(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(NP,{label:`Smoke`,stage:e.run_config.difficulty}),(0,V.jsx)(NP,{label:`Frontier`,stage:e.run_config.full})]})}),e.harden_history&&e.harden_history.length>0&&(0,V.jsx)(FP,{title:`Harden trajectory`,children:(0,V.jsx)(`div`,{className:`space-y-1.5`,children:e.harden_history.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-bg-2/40 px-3 py-1.5 text-[12.5px]`,children:[(0,V.jsxs)(`span`,{className:`text-ink-3`,children:[`gen `,e.generation??t,` · `,e.stage??`—`]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`font-mono text-ink-2`,children:[`pass@1 `,typeof e.pass_at_1==`number`?e.pass_at_1.toFixed(2):`—`]}),(0,V.jsx)(FS,{tone:e.verdict===`drop`?`danger`:`warn`,children:e.verdict??`harden`})]})]},t))})}),a.length>0&&(0,V.jsx)(FP,{title:`Sweeps`,icon:(0,V.jsx)(lx,{className:`size-3.5`}),children:(0,V.jsx)(`div`,{className:`space-y-3`,children:a.map(([e,t])=>(0,V.jsx)(PP,{label:AP(e),sweep:t},e))})})]})]})}function MP(e){return typeof e==`number`?`${Math.round(e*100)}%`:String(e)}function NP({label:e,stage:t}){return(0,V.jsxs)(`div`,{className:`rounded-lg border border-line bg-bg-2/40 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`text-[12.5px] font-medium text-ink`,children:e}),(0,V.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:[t.band.basis===`aggregate`?`agg`:t.band.basis,` `,Math.round((t.band.min_pass??0)*100),`–`,Math.round((t.band.max_pass??0)*100),`%`]})]}),(0,V.jsx)(`div`,{className:`space-y-1`,children:t.agents.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-ink-2`,children:[(0,V.jsx)(iC,{provider:rC[e.harness]??``,size:13,className:`text-ink-3`}),(0,V.jsx)(`span`,{children:e.harness}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:`·`}),(0,V.jsx)(iC,{provider:nC(e.model),size:13,className:`text-ink-3`}),(0,V.jsx)(`span`,{className:`text-ink-3`,children:e.model.split(`/`).pop()}),(0,V.jsxs)(`span`,{className:`ml-auto font-mono text-ink-4`,children:[`×`,e.n_trials]})]},t))})]})}function PP({label:e,sweep:t}){let n=[],r=(e,t,r=String)=>{t!=null&&n.push([e,r(t)])};r(`pass@1`,t.pass_at_1??t.claude_code_pass_at_1,MP);let i=t.families??null;if(i&&Object.keys(i).length>0)for(let[e,t]of Object.entries(i).sort(([e],[t])=>e.localeCompare(t)))r(e,t,MP);else r(`claude-code`,t.claude_code,MP),r(`codex`,t.codex,MP);r(`aggregate (best family)`,t.aggregate,MP),r(`fairness gap`,t.fairness_gap,MP),r(`auditor`,t.auditor_verdict),r(`blocker findings`,t.blocker_findings),r(`suspicious passes`,t.suspicious_passes?.length),r(`oracle reward`,t.oracle_reward),r(`nop reward`,t.nop_reward),r(`errored trials`,t.n_errored),t.verdict&&r(`verdict`,t.verdict),!n.length&&t.status&&r(`status`,t.status);let a=t.status===`running`?`info`:t.verdict===`harden`||t.status===`errored`?`warn`:null;return(0,V.jsxs)(`div`,{className:`rounded-lg border border-line bg-bg-2/40 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] font-medium text-ink`,children:[e,` sweep`,a&&(0,V.jsx)(FS,{tone:a,children:t.status??t.verdict})]}),t.experiment?(0,V.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-3`,title:`Sweep handle`,children:String(t.experiment)}):(0,V.jsx)(`span`,{className:`text-[12px] italic text-ink-4`,children:`no sweep yet`})]}),n.length>0&&(0,V.jsx)(`div`,{className:`mt-2 space-y-1.5`,children:n.map(([e,t])=>(0,V.jsx)(IP,{label:e,children:(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:t})},e))})]})}function FP({title:e,icon:t,children:n}){return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`mb-2.5 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-ink-4`,children:[t,e]}),n]})}function IP({label:e,children:t}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-[13px]`,children:[(0,V.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,V.jsx)(`span`,{className:`text-right`,children:t})]})}function LP({children:e}){return(0,V.jsx)(`p`,{className:`text-[13px] italic text-ink-4`,children:e})}function RP(e){if(e==null)return`—`;if(typeof e!=`object`)return String(e);let t=e;if(t.exact)return`exact`;let n=[];return t.rel!=null&&n.push(`rel ${t.rel}`),t.abs!=null&&n.push(`abs ${t.abs}`),n.join(` / `)||`—`}var zP={pass:`ok`,selected:`ok`,proceed:`ok`,clean:`ok`,accept:`ok`,done:`info`,harden:`warn`,revise:`warn`,fail:`danger`,reject:`danger`,flag_broken:`danger`,none_selected:`neutral`};function BP(e){let t=[],n=(n,r)=>{let i=e.match(n);i&&t.push(r(i))};return n(/pass@1\s*=?\s*([0-9.]+)/i,e=>`pass@1 ${e[1]}`),n(/\bcc=([0-9.]+)/i,e=>`cc ${e[1]}`),n(/\bcx=([0-9.]+)/i,e=>`cx ${e[1]}`),n(/gap\s*=?\s*([0-9.]+)/i,e=>`gap ${e[1]}`),n(/([0-9]+)\s*blocker/i,e=>`${e[1]} blocker(s)`),n(/\b(SOLVABLE_AS_WRITTEN|SOLVABLE_ONLY_BY_GUESSING|UNSOLVABLE)\b/,e=>e[1]),n(/([0-9]+)\s*suspicious/i,e=>`${e[1]} suspicious`),t}function VP(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function HP({history:e}){let t=(0,w.useMemo)(()=>[...e].reverse(),[e]),[n,r]=(0,w.useState)(new Set),[i,a]=(0,w.useState)(!1),o=e=>i||n.has(e),s=e=>r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,V.jsxs)(lC,{children:[(0,V.jsxs)(uC,{children:[(0,V.jsxs)(dC,{children:[(0,V.jsx)(Rx,{className:`size-4 text-accent`}),`History`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(`span`,{className:`text-[12px] text-ink-4`,children:[e.length,` events`]}),t.length>0&&(0,V.jsx)(`button`,{onClick:()=>{a(e=>!e),r(new Set)},className:`focus-ring rounded-md px-2 py-1 text-[12px] font-medium text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,children:i?`Collapse all`:`Expand all`})]})]}),(0,V.jsx)(fC,{children:t.length===0?(0,V.jsx)(`p`,{className:`py-4 text-center text-[13px] italic text-ink-4`,children:`No transitions recorded yet.`}):(0,V.jsx)(`ol`,{className:`relative max-h-[28rem] space-y-0 overflow-y-auto pr-1`,children:t.map((e,n)=>{let r=o(n),i=BP(e.reason||``);return(0,V.jsxs)(rP.li,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{delay:Math.min(n,12)*.025},className:`relative flex gap-3.5 pb-5 last:pb-0`,children:[(0,V.jsxs)(`div`,{className:`relative flex flex-col items-center`,children:[(0,V.jsx)(`span`,{className:DS(`z-10 mt-1 size-2.5 rounded-full ring-4 ring-bg`,n===0?`bg-accent`:`bg-line-2`)}),ns(n),className:`focus-ring flex w-full flex-wrap items-center gap-2 rounded-md text-left`,children:[r?(0,V.jsx)(_x,{className:`size-3.5 shrink-0 text-ink-4`}):(0,V.jsx)(vx,{className:`size-3.5 shrink-0 text-ink-4`}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-ink`,children:NS(e.stage)}),(0,V.jsx)(FS,{tone:zP[e.verdict]??`neutral`,children:zS(e.verdict)}),(0,V.jsx)(fx,{className:`size-3.5 text-ink-4`}),(0,V.jsx)(`span`,{className:`text-[13px] text-ink-2`,children:NS(e.next)}),e.ts&&(0,V.jsx)(`span`,{className:`ml-auto text-[12px] text-ink-4`,children:BS(e.ts)})]}),e.reason&&(r?(0,V.jsxs)(`div`,{className:`mt-1.5 space-y-2 pl-5`,children:[i.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map((e,t)=>(0,V.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-ink-2`,children:e},t))}),(0,V.jsx)(`p`,{className:`whitespace-pre-wrap break-words rounded-lg bg-bg-2 px-3 py-2 font-mono text-[12px] leading-relaxed text-ink-2`,children:e.reason}),e.ts&&(0,V.jsx)(`p`,{className:`text-[11px] text-ink-4`,children:VP(e.ts)})]}):(0,V.jsx)(`p`,{className:`mt-1 line-clamp-1 pl-5 text-[13px] text-ink-3`,children:e.reason}))]})]},`${e.stage}-${n}`)})})})]})}var UP=new Set([`python`,`rust`,`typescript`,`tsx`,`javascript`,`jsx`,`go`,`c`,`cpp`,`java`,`ruby`,`bash`,`toml`,`yaml`,`json`,`html`,`css`,`scss`,`sql`,`dockerfile`,`makefile`,`ini`,`diff`]);function WP(e){let t=e.lang??``;return e.name.endsWith(`.md`)?jx:t===`json`?kx:t===`bash`||t===`dockerfile`||t===`makefile`?Ax:/\.(png|jpe?g|gif|webp|bmp|ico|svg|avif)$/i.test(e.name)?zx:UP.has(t)?Ox:rx}function GP({node:e,depth:t,selected:n,expanded:r,onToggle:i,onSelect:a}){let o=e.type===`dir`,s=r.has(e.path),c=o?s?Nx:Px:WP(e);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{onClick:()=>o?i(e.path):a(e),className:DS(`focus-ring flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-[13px] transition-colors`,n===e.path?`bg-accent-soft/30 text-ink`:`text-ink-2 hover:bg-surface-2`),style:{paddingLeft:`${t*12+6}px`},children:[o?s?(0,V.jsx)(_x,{className:`size-3.5 shrink-0 text-ink-4`}):(0,V.jsx)(vx,{className:`size-3.5 shrink-0 text-ink-4`}):(0,V.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,V.jsx)(c,{className:DS(`size-3.5 shrink-0`,o?`text-accent`:`text-ink-4`)}),(0,V.jsx)(`span`,{className:`truncate`,children:e.name}),!o&&e.size!=null&&(0,V.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[10.5px] text-ink-4`,children:[VS(e.size),`b`]})]}),o&&s&&e.children&&(0,V.jsxs)(`div`,{children:[e.children.map(e=>(0,V.jsx)(GP,{node:e,depth:t+1,selected:n,expanded:r,onToggle:i,onSelect:a},e.path)),e.truncated&&(0,V.jsx)(`div`,{className:`py-1 text-[11px] italic text-ink-4`,style:{paddingLeft:`${(t+1)*12+24}px`},children:`… truncated`})]})]})}function KP({content:e}){return(0,V.jsx)(`div`,{className:`overflow-auto rounded-lg border border-line bg-bg-2`,children:(0,V.jsx)(`pre`,{className:`min-w-full text-[12.5px] leading-[1.6]`,children:(0,V.jsx)(`code`,{className:`grid grid-cols-[auto_1fr] font-mono`,children:e.replace(/\n$/,``).split(` +`).map((e,t)=>(0,V.jsxs)(`div`,{className:`contents`,children:[(0,V.jsx)(`span`,{className:`select-none border-r border-line/60 px-3 text-right text-ink-4`,children:t+1}),(0,V.jsx)(`span`,{className:`whitespace-pre px-3 text-ink-2`,children:e||` `})]},t))})})})}function qP({file:e}){let[t,n]=(0,w.useState)(!1),r=e.lang===`markdown`;if((0,w.useEffect)(()=>n(!1),[e.path]),e.kind===`image`)return(0,V.jsx)(`div`,{className:`flex justify-center rounded-lg border border-line bg-bg-2 p-4`,children:(0,V.jsx)(`img`,{src:e.data_uri,alt:e.name,className:`max-h-[70vh] max-w-full rounded`})});if(e.kind===`binary`)return(0,V.jsx)(JP,{label:`Binary file · ${VS(e.size)} bytes — no preview`});if(e.kind===`too_large`)return(0,V.jsx)(JP,{label:`File too large to preview · ${VS(e.size)} bytes`});let i=e.content??``;return(0,V.jsxs)(`div`,{className:`space-y-2`,children:[r&&(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsx)(`div`,{className:`inline-flex rounded-lg border border-line bg-surface p-0.5 text-[12px]`,children:[`rendered`,`raw`].map(e=>(0,V.jsx)(`button`,{onClick:()=>n(e===`raw`),className:DS(`rounded-md px-2.5 py-1 font-medium capitalize transition-colors`,e===`raw`===t?`bg-surface-3 text-ink`:`text-ink-3 hover:text-ink`),children:e},e))})}),r&&!t?(0,V.jsx)(XP,{source:i}):(0,V.jsx)(KP,{content:i})]})}function JP({label:e}){return(0,V.jsx)(`div`,{className:`flex h-40 items-center justify-center rounded-lg border border-dashed border-line text-[13px] text-ink-4`,children:e})}function YP(e,t){let n=[],r=/(`[^`]+`)|(\[[^\]]+\]\([^)]+\))|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(_[^_]+_)/g,i=0,a,o=0;for(;a=r.exec(e);){a.index>i&&n.push(e.slice(i,a.index));let r=a[0],s=`${t}-${o++}`;if(r.startsWith("`"))n.push((0,V.jsx)(`code`,{className:`rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.9em] text-accent`,children:r.slice(1,-1)},s));else if(r.startsWith(`[`)){let e=/\[([^\]]+)\]\(([^)]+)\)/.exec(r);n.push((0,V.jsx)(`a`,{href:e[2],target:`_blank`,rel:`noreferrer`,className:`text-accent hover:underline`,children:e[1]},s))}else r.startsWith(`**`)?n.push((0,V.jsx)(`strong`,{className:`font-semibold text-ink`,children:r.slice(2,-2)},s)):n.push((0,V.jsx)(`em`,{children:r.slice(1,-1)},s));i=a.index+r.length}return i(0,V.jsx)(`li`,{children:YP(e,`li${i}-${t}`)},t))},i++));continue}if(/^\s*\d+\.\s+/.test(e)){let e=[];for(;r(0,V.jsx)(`li`,{children:YP(e,`ol${i}-${t}`)},t))},i++));continue}if(/^\s*>\s?/.test(e)){t.push((0,V.jsx)(`blockquote`,{className:`border-l-2 border-line pl-3 text-[13px] italic text-ink-3`,children:YP(e.replace(/^\s*>\s?/,``),`bq${i}`)},i++)),r++;continue}if(/^\s*(-{3,}|\*{3,})\s*$/.test(e)){t.push((0,V.jsx)(`hr`,{className:`border-line`},i++)),r++;continue}if(e.trim()===``){r++;continue}let o=[];for(;r\s?/.test(n[r]);)o.push(n[r++]);t.push((0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:YP(o.join(` `),`p${i}`)},i++))}return(0,V.jsx)(`div`,{className:`space-y-2.5 rounded-lg border border-line bg-bg-2 px-4 py-3`,children:t})}function ZP(e){let t=new Set([e.path]),n=e.children?.find(e=>e.name===`task`&&e.type===`dir`);return n&&(t.add(n.path),n.children?.length===1&&n.children[0].type===`dir`&&t.add(n.children[0].path)),t}function QP(e){if(e.type===`file`)return e;for(let t of e.children??[]){let e=QP(t);if(e)return e}return null}function $P(e,t){if(e.path===t)return e.type===`file`?e:null;for(let n of e.children??[]){let e=$P(n,t);if(e)return e}return null}function eF(e,t){let n=new Set(e),r=t.split(`/`);for(let e=1;e{if(!t)return;let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),document.body.style.overflow=``}},[t,n]),(0,w.useEffect)(()=>{if(!t)return;let n=!1;return p(!0),_(null),gS.listFiles(e).then(e=>{if(n)return;let t=r?$P(e.tree,r):null,i=ZP(e.tree);t&&(i=eF(i,t.path)),a(e.tree),s(i);let o=e.tree.children?.find(e=>e.name===`task`),c=o&&nF(o,`instruction.md`),l=t??c??QP(e.tree);l&&v(l)}).catch(e=>!n&&_(String(e?.message??e))).finally(()=>!n&&p(!1)),()=>{n=!0}},[t,e,r]);let v=async t=>{l(t.path),h(!0);try{d(await gS.readFile(e,t.path))}catch(e){d(null),_(String(e?.message??e))}finally{h(!1)}};return(0,V.jsx)(uM,{children:t&&(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50`,children:[(0,V.jsx)(rP.div,{className:`absolute inset-0 bg-bg-2/70 backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n}),(0,V.jsxs)(rP.aside,{className:`glass absolute inset-y-0 right-0 flex w-full max-w-[1040px] flex-col border-l border-line`,initial:{x:`100%`},animate:{x:0},exit:{x:`100%`},transition:{type:`spring`,stiffness:320,damping:34},children:[(0,V.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-line px-5 py-3.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-semibold uppercase tracking-[0.08em] text-ink-3`,children:[(0,V.jsx)(Nx,{className:`size-4 text-accent`}),`Files · `,(0,V.jsx)(`span`,{className:`font-mono normal-case text-ink-2`,children:e})]}),(0,V.jsx)(`button`,{onClick:n,className:`focus-ring rounded-lg p-1.5 text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink`,"aria-label":`Close`,children:(0,V.jsx)(pS,{className:`size-5`})})]}),(0,V.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[280px_1fr]`,children:[(0,V.jsx)(`div`,{className:`min-h-0 overflow-y-auto border-r border-line p-2`,children:f?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-[13px] text-ink-4`,children:[(0,V.jsx)(ax,{className:`size-4 animate-spin`}),` Loading tree…`]}):i?(0,V.jsx)(GP,{node:i,depth:0,selected:c,expanded:o,onToggle:e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:e=>void v(e)}):(0,V.jsx)(`p`,{className:`p-3 text-[13px] text-ink-4`,children:g??`No files.`})}),(0,V.jsxs)(`div`,{className:`min-h-0 overflow-y-auto p-4`,children:[c&&(0,V.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`truncate font-mono text-ink-2`,children:c}),u?.lang&&(0,V.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 py-0.5 text-[11px] text-ink-3`,children:u.lang})]}),m?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-[13px] text-ink-4`,children:[(0,V.jsx)(ax,{className:`size-4 animate-spin`}),` Loading…`]}):u?(0,V.jsx)(qP,{file:u}):(0,V.jsx)(JP,{label:`Select a file to preview.`})]})]})]})]})})}function nF(e,t){if(e.type===`file`)return e.name===t?e:null;for(let n of e.children??[]){let e=nF(n,t);if(e)return e}return null}function rF(e,t){let n=t??{};if(e===`Bash`&&typeof n.command==`string`)return n.command.split(` +`)[0];for(let e of[`file_path`,`path`,`pattern`,`url`,`query`,`command`])if(typeof n[e]==`string`)return n[e];let r=JSON.stringify(n);return r===`{}`?``:r.length>160?r.slice(0,160)+`…`:r}function iF(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e&&typeof e==`object`&&`text`in e?String(e.text??``):``).join(``):``}function aF(e){let t=[];for(let n of e.split(` +`)){let e=n.trim();if(!e)continue;if(e.startsWith(`=====`)){t.push({kind:`divider`,text:e.replace(/=+/g,``).trim()});continue}let r;try{r=JSON.parse(e)}catch{t.push({kind:`raw`,text:e});continue}if(!r||typeof r!=`object`)continue;let i=r.message;switch(r.type){case`lh`:t.push({kind:`lh`,event:String(r.event??``),ok:r.ok,detail:r.detail,n:r.n,of:r.of,label:r.label});break;case`system`:r.subtype===`init`&&t.push({kind:`system`,text:`session started${r.model?` · ${r.model}`:``}`});break;case`assistant`:for(let e of i?.content??[])e.type===`text`&&typeof e.text==`string`&&e.text.trim()?t.push({kind:`text`,text:e.text.trim()}):e.type===`thinking`&&typeof e.thinking==`string`&&e.thinking.trim()?t.push({kind:`thinking`,text:e.thinking.trim()}):e.type===`tool_use`&&t.push({kind:`tool`,name:String(e.name??`tool`),summary:rF(String(e.name),e.input)});break;case`user`:for(let e of i?.content??[])if(e.type===`tool_result`){let n=iF(e.content).trim();n&&t.push({kind:`tool_result`,text:n,isError:!!e.is_error})}break;case`result`:{let e=[r.duration_ms?`${Math.round(Number(r.duration_ms)/1e3)}s`:null,r.num_turns?`${r.num_turns} turns`:null,r.total_cost_usd==null?null:`$${Number(r.total_cost_usd).toFixed(2)}`].filter(Boolean).join(` · `);t.push({kind:`final`,text:String(r.result??(r.is_error?`errored`:`done`)),meta:e,isError:!!r.is_error});break}}}return t}var oF=8;function sF(e,t){let n=e.split(` `);return n.length<=t?{text:e,clamped:!1}:{text:n.slice(0,t).join(` -`),clamped:!0}}function aF({e}){switch(e.kind){case`divider`:return(0,V.jsxs)(`div`,{className:`my-2 flex items-center gap-2 text-[11px] uppercase tracking-wider text-ink-3`,children:[(0,V.jsx)(`span`,{className:`h-px flex-1 bg-line-2`}),e.text||`session`,(0,V.jsx)(`span`,{className:`h-px flex-1 bg-line-2`})]});case`system`:return(0,V.jsxs)(`div`,{className:`text-[12.5px] text-ink-3`,children:[`● `,e.text]});case`lh`:{let t=e.event===`iteration`,n=t?`▶`:e.ok?`✓`:`✗`,r=t?`text-accent`:e.ok?`text-ok`:`text-warn`,i=t?`iteration ${e.n}${e.of?`/${e.of}`:``}${e.label?` · ${e.label}`:``}`:e.event===`validated`?e.ok?`validated · ${e.detail??`oracle=1/nop=0`}`:`iteration ${e.n} didn't validate · ${e.detail??``}`:e.detail??e.event;return(0,V.jsxs)(`div`,{className:wS(`flex gap-2 text-[12.5px] font-medium`,r),children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:n}),(0,V.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:i})]})}case`thinking`:return(0,V.jsxs)(`div`,{className:`flex gap-2 text-[12.5px] italic text-ink-3`,children:[(0,V.jsx)(`span`,{className:`shrink-0 not-italic`,children:`💭`}),(0,V.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.text})]});case`tool`:return(0,V.jsxs)(`div`,{className:`flex gap-2 font-mono text-[12.5px] text-ink-2`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-ink-3`,children:`$`}),(0,V.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[(0,V.jsx)(`span`,{className:`font-semibold text-info`,children:e.name}),e.summary?` ${e.summary}`:``]})]});case`tool_result`:{let{text:t,clamped:n}=iF(e.text,rF);return(0,V.jsxs)(`div`,{className:wS(`flex gap-2 font-mono text-[12.5px]`,e.isError?`text-danger`:`text-ink-3`),children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:`↳`}),(0,V.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[t,n&&(0,V.jsx)(`span`,{className:`text-ink-4`,children:` …`})]})]})}case`final`:return(0,V.jsxs)(`div`,{className:wS(`flex gap-2 text-[12.5px] font-medium`,e.isError?`text-danger`:`text-ok`),children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:e.isError?`✗`:`✓`}),(0,V.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[e.text,e.meta&&(0,V.jsxs)(`span`,{className:`ml-1 font-normal text-ink-4`,children:[`(`,e.meta,`)`]})]})]});case`text`:return(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-[13px] leading-relaxed text-ink`,children:e.text});case`raw`:return(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words font-mono text-[12px] text-ink-3`,children:e.text})}}function oF({runKey:e}){let[t,n]=(0,w.useState)(!0),[r,i]=(0,w.useState)(2e3),{data:a}=CS(()=>pS.agentOutput(e),r,[e,r]),o=(0,w.useRef)(null);(0,w.useEffect)(()=>{a&&i(a.running?2e3:8e3)},[a?.running]);let s=(0,w.useMemo)(()=>a?.tail?nF(a.tail):[],[a?.tail]);return(0,w.useEffect)(()=>{t&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[s.length,t]),!a||!a.exists&&!a.running?null:(0,V.jsxs)(oC,{children:[(0,V.jsxs)(sC,{className:`cursor-pointer select-none`,onClick:()=>n(e=>!e),children:[(0,V.jsxs)(cC,{children:[(0,V.jsx)(aS,{className:`size-4 text-accent`}),`Agent output`,a.running&&(0,V.jsxs)(`span`,{className:wS(`ml-1 inline-flex items-center gap-1.5 normal-case tracking-normal text-[12px] font-medium`,a.slow?`text-warn`:`text-accent`),children:[(0,V.jsx)(`span`,{className:wS(`inline-block size-1.5 animate-pulse rounded-full`,a.slow?`bg-warn`:`bg-accent`)}),a.active_job??`running`,a.elapsed_sec!=null&&` · ${sF(a.elapsed_sec)}`]})]}),t?(0,V.jsx)(_x,{className:`size-4 text-ink-4`}):(0,V.jsx)(vx,{className:`size-4 text-ink-4`})]}),t&&(0,V.jsxs)(lC,{className:`space-y-3`,children:[a.slow&&(0,V.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-warn/30 bg-warn/5 px-3 py-2 text-[12.5px] text-warn`,children:[(0,V.jsx)(Mx,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsxs)(`span`,{children:[`Running slowly (`,sF(a.elapsed_sec??0),`) — the provider may be`,` `,(0,V.jsx)(`span`,{className:`font-medium`,children:`rate-limiting`}),` this agent.`]})]}),s.length>0?(0,V.jsxs)(`div`,{ref:o,className:`max-h-[460px] space-y-2 overflow-auto rounded-lg border border-line/70 bg-bg-2 p-4`,children:[s.map((e,t)=>(0,V.jsx)(aF,{e},t)),a.running&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 text-[12px] text-ink-4`,children:[(0,V.jsx)(`span`,{className:`inline-block size-1.5 animate-pulse rounded-full bg-accent`}),`working…`]})]}):(0,V.jsx)(`p`,{className:`text-[13px] text-ink-4`,children:a.running?`Agent starting…`:`No agent output captured yet.`})]})]})}function sF(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n?`${t}m ${n}s`:`${t}m`}var cF={draft:{Icon:Hx,title:`Draft exported after Static CI`,tone:`ok`},dropped:{Icon:bx,title:`Run dropped`,tone:`warn`},blocked:{Icon:Bx,title:`Run blocked`,tone:`warn`},done:{Icon:Hx,title:`Exported to outbox`,tone:`ok`},easy:{Icon:ux,title:`Easy shelf`,tone:`warn`}};function lF({runKey:e,status:t,reason:n,canReopen:r,hardenHistory:i,onReopened:a,screenedOut:o=!1}){let[s,c]=(0,w.useState)(!1),l=cF[t]??cF.blocked,{Icon:u,title:d,tone:f}=o?{Icon:bx,title:`Source screened out`,tone:`warn`}:l,p=async()=>{c(!0);try{await pS.reopen(e),await a()}finally{c(!1)}};return(0,V.jsxs)(oC,{className:f===`ok`?`border-ok/30`:`border-warn/30`,children:[(0,V.jsxs)(sC,{children:[(0,V.jsxs)(cC,{className:f===`ok`?`text-ok`:`text-warn`,children:[(0,V.jsx)(u,{className:`size-4`}),d]}),r&&(0,V.jsxs)(qS,{variant:`secondary`,size:`sm`,onClick:()=>void p(),disabled:s,children:[(0,V.jsx)(Yx,{className:`size-3.5 ${s?`animate-spin`:``}`}),s?`Re-opening…`:`Re-open & harden`]})]}),(0,V.jsxs)(lC,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-[13.5px] leading-relaxed text-ink-2`,children:n}),i.length>0&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`h4`,{className:`text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-4`,children:`Hardening review`}),(0,V.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line`,children:i.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-line px-3 py-2 text-[12.5px] last:border-b-0`,children:[(0,V.jsxs)(`span`,{className:`text-ink-3`,children:[e.stage??`harden`,` · gen `,e.generation??t]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-3 font-mono`,children:[(0,V.jsxs)(`span`,{className:`text-ink-2`,children:[`pass@1 `,e.pass_at_1==null?`—`:`${Math.round(e.pass_at_1*100)}%`]}),(0,V.jsx)(`span`,{className:e.verdict===`drop`?`text-warn`:`text-ink-3`,children:e.verdict??`—`})]})]},t))})]}),r&&(0,V.jsx)(`p`,{className:`text-[12px] text-ink-4`,children:`Re-opening grants a fresh tuning budget. If the task is fundamentally too easy (the model still solves it), it will honestly land back on the easy shelf — that's a scope problem, not a harden one.`})]})]})}var uF={trivial:`text-ink-3`,moderate:`text-info`,hard:`text-warn`,frontier:`text-danger`},dF={recommended:`ok`,viable:`info`,marginal:`warn`};function fF({runKey:e,jobs:t,manual:n=!0,onAdvanced:r}){let[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(null),[c,l]=(0,w.useState)(null),[u,d]=(0,w.useState)(null),[f,p]=(0,w.useState)(!1),m=t?.task_matrix,h=m?.status===`running`||f,g=m?.status===`error`?m.detail??`TASK MATRIX failed.`:null,_=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!(m?.status===`done`||m===void 0&&i===null))return;let t=`${e}:${m?.status??`init`}`;if(_.current===t)return;_.current=t;let n=!0;return pS.getTaskMatrix(e).then(e=>n&&a(e)).catch(e=>{e instanceof dS&&e.status}),()=>{n=!1}},[e,m?.status,i]),(0,w.useEffect)(()=>{m?.status===`running`&&p(!1)},[m?.status]);async function v(){l(null),a(null),p(!0),_.current=null;try{await pS.runTaskMatrix(e),r()}catch(e){p(!1),l(e instanceof Error?e.message:String(e))}}async function y(t){s(t===null?`drop`:t),l(null);try{await pS.select(e,t),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(null)}}return(0,V.jsxs)(oC,{children:[(0,V.jsxs)(sC,{children:[(0,V.jsxs)(cC,{children:[(0,V.jsx)(kx,{className:`size-4 text-ink-3`}),`Task Matrix`]}),(0,V.jsxs)(MS,{tone:n?`neutral`:`info`,children:[(0,V.jsx)(yx,{className:`size-3`}),n?`Awaiting selection`:`Auto-select`]})]}),(0,V.jsx)(lC,{className:`space-y-5`,children:i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsxs)(`p`,{className:`text-[13px] text-ink-3`,children:[(0,V.jsx)(`span`,{className:`text-ink-2`,children:i.candidates.length}),` `,`candidate`,i.candidates.length===1?``:`s`,` for`,` `,(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:i.source_ref})]}),n&&(0,V.jsx)(qS,{size:`sm`,variant:`ghost`,onClick:()=>void v(),loading:h,children:`Regenerate`})]}),(0,V.jsx)(`div`,{className:`grid gap-3`,children:i.candidates.map((e,t)=>(0,V.jsx)(mF,{candidate:e,index:t,selected:u===t,onSelect:()=>d(t)},t))}),!!i.source_evidence?.length&&(0,V.jsxs)(`div`,{className:`border border-line bg-surface-2 px-3 py-2.5`,children:[(0,V.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-ink-4`,children:`Source evidence`}),(0,V.jsx)(`ul`,{className:`mt-2 space-y-1 text-[12.5px] text-ink-2`,children:i.source_evidence.map(e=>(0,V.jsxs)(`li`,{children:[`• `,e]},e))})]}),c&&(0,V.jsx)(pF,{children:c}),n?(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-line pt-4`,children:[(0,V.jsxs)(qS,{variant:`danger`,onClick:()=>void y(null),loading:o===`drop`,children:[(0,V.jsx)(nx,{className:`size-4`}),`Drop (none)`]}),(0,V.jsxs)(qS,{variant:`primary`,disabled:u===null,onClick:()=>u!==null&&void y(u),loading:typeof o==`number`,children:[(0,V.jsx)(gx,{className:`size-4`}),`Select candidate`,u===null?``:` #${u+1}`]})]}):(0,V.jsx)(`p`,{className:`border-t border-line pt-4 text-[13px] text-ink-3`,children:`The driver selects the best candidate automatically — nothing to do here.`})]}):h?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsxs)(`div`,{className:`relative mb-5 flex size-16 items-center justify-center`,children:[(0,V.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-ink/5 animate-pulse-ring`}),(0,V.jsx)(ax,{className:`size-8 animate-spin text-ink-3`})]}),(0,V.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`Running TASK MATRIX…`}),(0,V.jsx)(`p`,{className:`mt-1.5 max-w-sm text-[13px] text-ink-3`,children:`Scoring candidate tasks against the rubric. This continues if you leave the page.`})]}):g?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-danger/15 text-danger`,children:(0,V.jsx)(nx,{className:`size-6`})}),(0,V.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`TASK MATRIX failed`}),(0,V.jsx)(pF,{className:`mt-3 max-w-md text-left`,children:g}),(0,V.jsxs)(qS,{variant:`primary`,className:`mt-5`,onClick:()=>void v(),children:[(0,V.jsx)(Jx,{className:`size-4`}),`Retry`]})]}):n?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-surface-2 text-ink-3`,children:(0,V.jsx)(kx,{className:`size-6`})}),(0,V.jsx)(`p`,{className:`max-w-md text-sm text-ink-2`,children:`Generate candidate tasks for this source, then select one to advance or drop the run.`}),(0,V.jsxs)(qS,{variant:`primary`,className:`mt-5`,onClick:()=>void v(),children:[(0,V.jsx)(Gx,{className:`size-4`}),`Run TASK MATRIX`]}),c&&(0,V.jsx)(pF,{className:`mt-4 w-full`,children:c})]}):(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-surface-2 text-ink-3`,children:(0,V.jsx)(kx,{className:`size-6`})}),(0,V.jsx)(`p`,{className:`max-w-md text-sm text-ink-2`,children:`Auto-selecting the best candidate…`})]})})]})}function pF({children:e,className:t}){return(0,V.jsx)(`div`,{className:wS(`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,t),children:e})}function mF({candidate:e,index:t,selected:n,onSelect:r}){let i=!!e.tool_name,a=e.tool_name??e.target_language??`candidate`,o=i?(e.upstream_language??``).toUpperCase()||null:e.scope_unit?IS(e.scope_unit):null,s=e.flag_surface??e.scope_detail;return(0,V.jsxs)(eP.button,{type:`button`,onClick:r,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:t*.04},className:wS(`focus-ring group relative w-full rounded-2xl border p-4 text-left transition-all`,n?`border-accent/60 bg-accent-soft/15 ring-1 ring-accent/40`:`border-line bg-bg-2/40 hover:border-line-2 hover:bg-surface-2/50`),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:wS(`flex size-6 items-center justify-center rounded-full text-[12px] font-semibold`,n?`bg-accent text-accent-fg`:`bg-surface-2 text-ink-3`),children:n?(0,V.jsx)(gx,{className:`size-3.5`}):t+1}),(0,V.jsx)(`span`,{className:`text-[15px] font-semibold text-ink`,children:a}),e.binary_name&&e.binary_name!==e.tool_name&&(0,V.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-4`,children:[`(`,e.binary_name,`)`]}),o&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-ink-4`,children:`·`}),(0,V.jsx)(`span`,{className:`text-sm text-ink-2`,children:o})]})]}),(0,V.jsx)(MS,{tone:dF[e.recommendation]??`neutral`,children:e.recommendation})]}),s&&(0,V.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-2`,children:s}),(0,V.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-3`,children:e.rationale}),(0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px]`,children:[i?(0,V.jsxs)(V.Fragment,{children:[e.case_families&&e.case_families.length>0&&(0,V.jsx)(hF,{icon:iS,label:`Families`,value:String(e.case_families.length)}),e.est_kloc!=null&&(0,V.jsx)(hF,{icon:Mx,label:`Size`,value:`${e.est_kloc} kLOC`}),e.expert_hours!=null&&(0,V.jsx)(hF,{icon:Mx,label:`Expert`,value:`${e.expert_hours}h`}),e.needs_files_dir&&(0,V.jsx)(MS,{tone:`info`,children:`files_dir`}),e.deterministic_output===!1&&(0,V.jsx)(MS,{tone:`danger`,children:`non-deterministic output`})]}):(0,V.jsxs)(V.Fragment,{children:[e.verifier_mechanism&&(0,V.jsx)(hF,{icon:iS,label:`Verifier`,value:IS(e.verifier_mechanism)}),e.objective&&(0,V.jsx)(hF,{icon:Mx,label:`Objective`,value:e.objective.replace(/\+/g,` + `)})]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ink-3`,children:[(0,V.jsx)(`span`,{className:`text-ink-4`,children:`Difficulty`}),(0,V.jsx)(`span`,{className:wS(`font-medium capitalize`,uF[e.expected_difficulty]??`text-ink-2`),children:e.expected_difficulty})]}),e.license_ok===!1&&(0,V.jsx)(MS,{tone:`danger`,children:`copyleft: clean-room required`}),(0,V.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 text-ink-4`,children:[(0,V.jsx)(px,{className:`size-3`}),(0,V.jsx)(`span`,{className:`font-mono`,children:e.basis_ref})]})]})]})}function hF({icon:e,label:t,value:n}){return(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ink-3`,children:[(0,V.jsx)(e,{className:`size-3 text-ink-4`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:t}),(0,V.jsx)(`span`,{className:`font-medium text-ink-2`,children:n})]})}function gF({runKey:e,context:t,onDecided:n}){let r=t.sweeps??{},i=r.full??r.full_sweep??null,[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(null),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=!0;return pS.getSettings().then(t=>e&&o(t.qa_gate_mode===`auto`?`auto`:`human`)).catch(()=>e&&o(`human`)),()=>{e=!1}},[]);let p=async t=>{c(t),u(null);try{let r=await pS.qaGate(e,t);f(`${t} → ${r.stage} (${r.status})`),n?.()}catch(e){u(e instanceof dS?e.detail:`${t} failed`)}finally{c(null)}},m=i?.pass_at_1??i?.claude_code??null,h=[{label:`Band verdict`,value:String(i?.band_verdict??`pending`)},{label:`Frontier pass@1`,value:typeof m==`number`?`${Math.round(m*100)}%`:String(m??`—`)},{label:`Hard keep`,value:i?.hard_keep?`yes — capability headroom`:`—`}],g=a===`human`;return(0,V.jsxs)(oC,{children:[(0,V.jsxs)(sC,{children:[(0,V.jsxs)(cC,{children:[(0,V.jsx)(tS,{className:`size-4 text-node-decision`}),`Final Gate`]}),a===`auto`?(0,V.jsxs)(MS,{tone:`info`,children:[(0,V.jsx)(Cx,{className:`size-3`}),`Auto gate`]}):(0,V.jsx)(MS,{tone:`human`,children:`Final accept`})]}),(0,V.jsxs)(lC,{className:`space-y-5`,children:[(0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:g?`Review the frontier evidence before deciding. Accept exports the task bundle to the outbox; revise re-runs the frontier sweep through SYNTHESIZE; reject drops the run.`:`This gate decides automatically from the recorded evidence (band verdict, integrity, probe, analysis labels) — no action needed. Set qa_gate_mode to “human” in Settings to review manually.`}),(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:h.map(e=>(0,V.jsx)(_F,{label:e.label,value:e.value},e.label))}),g&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5 border-t border-line pt-4`,children:[(0,V.jsx)(vF,{icon:tx,label:`Accept`,tone:`ok`,loading:s===`accept`,disabled:s!==null,onClick:()=>void p(`accept`)}),(0,V.jsx)(vF,{icon:Jx,label:`Revise`,tone:`info`,loading:s===`revise`,disabled:s!==null,onClick:()=>void p(`revise`)}),(0,V.jsx)(vF,{icon:nx,label:`Reject`,tone:`danger`,loading:s===`reject`,disabled:s!==null,onClick:()=>void p(`reject`)}),d&&(0,V.jsx)(`span`,{className:`ml-auto text-[12px] font-medium text-ok`,children:d}),l&&(0,V.jsx)(`span`,{className:`ml-auto text-[12px] font-medium text-danger`,children:l})]})]})]})}function _F({label:e,value:t}){return(0,V.jsxs)(`div`,{className:`rounded-xl border border-line bg-bg-2/40 px-3.5 py-3`,children:[(0,V.jsx)(`div`,{className:`text-[11px] uppercase tracking-[0.06em] text-ink-4`,children:e}),(0,V.jsx)(`div`,{className:`mt-1 truncate font-mono text-sm text-ink-2`,children:t})]})}function vF({icon:e,label:t,tone:n,loading:r,disabled:i,onClick:a}){let o={ok:`border-ok/30 text-ok hover:bg-ok-soft/20`,info:`border-info/30 text-info hover:bg-info/10`,danger:`border-danger/30 text-danger hover:bg-danger-soft/20`}[n];return(0,V.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,className:wS(`inline-flex h-10 items-center gap-2 rounded-xl border bg-transparent px-4 text-sm font-medium transition-colors`,`disabled:cursor-not-allowed disabled:opacity-50`,o),children:[(0,V.jsx)(e,{className:wS(`size-4`,r&&`animate-pulse`)}),r?`Submitting…`:t]})}function yF(){let{key:e=``}=dt(),t=lt(),[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(null),{data:c,error:l,initialLoading:u,refresh:d}=CS(()=>pS.getRun(e),3e3,[e]),f=(0,w.useCallback)(async()=>{c&&(c.summary.paused?await pS.resume(e):await pS.pause(e),await d())},[c,e,d]),[p,m]=(0,w.useState)(!1),h=(0,w.useCallback)(async()=>{m(!0);try{await pS.retry(e),await d()}finally{m(!1)}},[e,d]),[g,_]=(0,w.useState)(!1),v=(0,w.useCallback)(async()=>{if(window.confirm(`Delete run "${e}" permanently? This removes its state and task files and cannot be undone.`)){_(!0);try{await pS.deleteRun(e),t(`/`)}catch{_(!1)}}},[e,t]);if(u)return(0,V.jsx)(wF,{});if(l&&!c)return(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsx)(CF,{}),(0,V.jsx)(dC,{title:`Run not found`,message:l.message,action:(0,V.jsx)(On,{to:`/`,children:(0,V.jsx)(qS,{variant:`secondary`,children:`Back to fleet`})})})]});if(!c)return(0,V.jsx)(wF,{});let{summary:y,node_statuses:b,history:x,context:S}=c,C=S.source;return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(CF,{}),(0,V.jsx)(oC,{children:(0,V.jsxs)(lC,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:y.slug??y.key}),(0,V.jsx)(PS,{status:y.status,stage:y.stage,screenedOut:!!y.screened_out}),y.paused&&(0,V.jsxs)(MS,{tone:`warn`,children:[(0,V.jsx)(Ux,{className:`size-3`}),`Paused`]})]}),(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[13px] text-ink-3`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono`,children:[(0,V.jsx)(Nx,{className:`size-3.5 text-ink-4`}),y.key]}),C&&(0,V.jsxs)(`span`,{className:`font-mono text-ink-4`,children:[C.repo,`@`,FS(C.pinned_sha)]}),y.harden>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-warn`,children:[(0,V.jsx)(eS,{className:`size-3.5`}),`harden `,y.harden]}),(y.ease??0)>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-info`,children:[(0,V.jsx)(wx,{className:`size-3.5`}),`ease `,y.ease]}),y.revise>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-info`,children:[(0,V.jsx)(Jx,{className:`size-3.5`}),`revise `,y.revise]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,V.jsx)(hC,{content:`Browse the run's task files, source, and artifacts`,side:`bottom`,children:(0,V.jsxs)(qS,{variant:`outline`,size:`sm`,onClick:()=>r(!0),children:[(0,V.jsx)(Ax,{className:`size-3.5`}),`Files`]})}),c.drive?.halted===`blocked`&&(0,V.jsx)(hC,{content:`Retry — clear the errored job(s) so the driver re-runs this blocked stage fresh (use after fixing the cause)`,side:`bottom`,children:(0,V.jsxs)(qS,{variant:`secondary`,onClick:()=>void h(),disabled:p,children:[(0,V.jsx)(Jx,{className:`size-4`}),`Retry`]})}),y.status!==`draft`&&(0,V.jsx)(hC,{content:y.paused?`Resume — allow the run to advance`:`Pause — halt at the next inter-stage checkpoint`,side:`bottom`,children:(0,V.jsx)(qS,{variant:y.paused?`primary`:`secondary`,onClick:()=>void f(),children:y.paused?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Gx,{className:`size-4`}),`Resume`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ux,{className:`size-4`}),`Pause`]})})})]})]})}),(c.waiting?.kind===`terminal`||c.waiting?.kind===`draft`)&&y.status!==`done`&&(0,V.jsx)(lF,{runKey:e,status:y.status,reason:c.waiting.reason,canReopen:!!c.waiting.can_reopen,hardenHistory:S.harden_history??[],screenedOut:!!y.screened_out,onReopened:()=>void d()}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(cS,{className:`size-4 text-accent`}),`Pipeline`]})}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(_P,{statuses:b,selected:o,onSelectStage:e=>s(t=>t===e?null:e)}),o&&(0,V.jsx)(SF,{stage:o,status:b[o],history:x,onClose:()=>s(null),onViewPrompt:e=>{a(e),r(!0)}})]})]}),y.status===`in_progress`&&y.stage===`TASK_MATRIX`&&(0,V.jsx)(fF,{runKey:e,jobs:c.jobs,manual:y.awaiting_human,onAdvanced:()=>void d()}),y.status===`in_progress`&&y.stage===`QA_GATE`&&(0,V.jsx)(gF,{runKey:e,context:S,onDecided:()=>void d()}),(0,V.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-2`,children:[(0,V.jsx)(OP,{context:S}),(0,V.jsx)(zP,{history:x})]}),(0,V.jsx)(oF,{runKey:e}),(0,V.jsx)(QP,{runKey:e,open:n,initialPath:i,onClose:()=>{r(!1),a(null)}}),(0,V.jsx)(`div`,{className:`flex justify-end border-t border-line/60 pt-5`,children:(0,V.jsxs)(qS,{variant:`ghost`,className:`text-ink-4 hover:text-danger`,onClick:()=>void v(),disabled:g,children:[(0,V.jsx)(sS,{className:`size-4`}),`Delete run`]})})]})}var bF={TASK_MATRIX:`prompts/TASK_MATRIX.md`,SYNTHESIZE:`prompts/SYNTHESIZE.md`};function xF(e){let t=TS.find(t=>t.stage===e);return t?{label:t.label,blurb:t.blurb}:e===`SYNTHESIZE`?{label:ES.label,blurb:ES.blurb}:{label:e}}function SF({stage:e,status:t,history:n,onClose:r,onViewPrompt:i}){let a=xF(e),o=n.filter(t=>t.stage===e),s=bF[e];return(0,V.jsxs)(`div`,{className:`mt-4 rounded-xl border border-accent/40 bg-surface-2 p-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[14px] font-semibold text-ink`,children:a.label}),(0,V.jsx)(MS,{tone:`neutral`,children:t??`pending`})]}),a.blurb&&(0,V.jsx)(`p`,{className:`mt-1 text-[12.5px] leading-snug text-ink-3`,children:a.blurb})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s&&(0,V.jsxs)(qS,{size:`sm`,variant:`outline`,onClick:()=>i(s),children:[(0,V.jsx)(Ox,{className:`size-3.5`}),`View prompt`]}),(0,V.jsx)(`button`,{onClick:r,className:`rounded-md p-1 text-ink-4 transition-colors hover:text-ink`,title:`Close`,children:(0,V.jsx)(uS,{className:`size-4`})})]})]}),(0,V.jsx)(`div`,{className:`mt-3 border-t border-line pt-3`,children:o.length>0?(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:o.slice(-6).map((e,t)=>(0,V.jsxs)(`li`,{className:`flex items-start gap-2 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`shrink-0 rounded bg-bg-2 px-1.5 py-0.5 font-mono text-[11px] text-ink-3`,children:e.verdict??`—`}),(0,V.jsx)(`span`,{className:`text-ink-2`,children:e.reason})]},t))}):(0,V.jsxs)(`p`,{className:`text-[12.5px] text-ink-4`,children:[`No recorded events for this stage yet`,s?` — the prompt appears here once the cell runs.`:`.`]})})]})}function CF(){return(0,V.jsxs)(On,{to:`/`,className:`inline-flex items-center gap-1.5 text-[13px] font-medium text-ink-3 transition-colors hover:text-ink`,children:[(0,V.jsx)(dx,{className:`size-4`}),`Runs`]})}function wF(){return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(aC,{className:`h-5 w-16`}),(0,V.jsx)(aC,{className:`h-24 w-full`}),(0,V.jsx)(aC,{className:`h-[360px] w-full`}),(0,V.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,V.jsx)(aC,{className:`h-80 w-full`}),(0,V.jsx)(aC,{className:`h-80 w-full`})]})]})}var TF=[{id:`cli`,label:`CLI reference`,icon:sx}];function EF(){let[e,t]=(0,w.useState)(`cli`);return(0,w.useEffect)(()=>{let e=()=>{let e=TF[0].id;for(let t of TF){let n=document.getElementById(t.id);n&&n.getBoundingClientRect().top<=140&&(e=t.id)}t(e)};return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(`div`,{children:(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`Documentation`})}),(0,V.jsxs)(`div`,{className:`grid gap-8 lg:grid-cols-[180px_1fr]`,children:[(0,V.jsx)(`nav`,{className:`top-24 hidden h-max lg:sticky lg:block`,children:(0,V.jsx)(`ul`,{className:`space-y-0.5`,children:TF.map(t=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`a`,{href:`#${t.id}`,className:wS(`flex items-center gap-2 rounded-lg px-3 py-2 text-[13px] font-medium transition-colors`,e===t.id?`bg-surface-2 text-ink`:`text-ink-3 hover:bg-surface-2/60 hover:text-ink-2`),children:[(0,V.jsx)(t.icon,{className:`size-4`}),t.label]})},t.id))})}),(0,V.jsx)(`div`,{className:`min-w-0 space-y-10`,children:(0,V.jsx)(kF,{})})]})]})}function DF({id:e,icon:t,title:n,children:r}){return(0,V.jsxs)(`section`,{id:e,className:`scroll-mt-24 space-y-4`,children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold tracking-tight text-ink`,children:[(0,V.jsx)(t,{className:`size-5 text-ink-3`}),n]}),r]})}var OF=[{title:`Create & farm`,rows:[[`programsmith create --repo owner/name [--sha] [--slug]`,`One repo → one calibrated task (resolves HEAD if no --sha).`],[`programsmith farm --repos-file repos.txt`,`Start and drive many runs from a file (one spec per line).`]]},{title:`Runs & status`,rows:[[`programsmith fleet [--json]`,`List every run with stage, status, progress, and pass@1.`],[`programsmith status [--json]`,`Full run detail: stage, sweeps, history.`]]},{title:`Gates & recovery`,rows:[[`programsmith pick --index N | --none`,`Record the TASK MATRIX selection (human-gate mode only).`],[`programsmith qa-gate --decision accept|revise|reject`,`Record the final-gate decision (human-gate mode only).`],[`programsmith retry `,`Clear errored jobs so a blocked stage relaunches fresh.`],[`programsmith reopen `,`Re-open a terminal run for another harden attempt.`]]},{title:`Serve & doctor`,rows:[[`programsmith serve`,`Start this dashboard in the background. Autodrive task generation is on; solver sweeps stay parked unless you pass --spend.`],[`programsmith stop`,`Stop the background dashboard explicitly.`],[`programsmith doctor`,`Preflight: Docker, credentials, disk, Claude Code CLI.`]]}];function kF(){let[e,t]=(0,w.useState)(null);return(0,V.jsx)(DF,{id:`cli`,icon:sx,title:`CLI reference`,children:OF.map(n=>(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`h3`,{className:`text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-4`,children:n.title}),(0,V.jsx)(oC,{children:(0,V.jsx)(lC,{className:`divide-y divide-line/70 p-0`,children:n.rows.map(([n,r])=>(0,V.jsxs)(`div`,{className:`grid gap-1 px-4 py-2.5 sm:grid-cols-[minmax(0,0.9fr)_1fr] sm:gap-4`,children:[(0,V.jsx)(`button`,{onClick:()=>{navigator.clipboard?.writeText(n),t(n),window.setTimeout(()=>t(e=>e===n?null:e),1200)},className:`focus-ring text-left font-mono text-[12.5px] text-ink hover:text-ink-2`,title:`Copy`,children:e===n?`copied ✓`:n}),(0,V.jsx)(`span`,{className:`text-[12.5px] text-ink-3`,children:r})]},n))})})]},n.title))})}var AF={github:`GitHub access`,claude_oauth:`Claude credentials`,docker:`Docker`,anthropic_cred:`Anthropic`,claude_cli:`Claude Code CLI`,disk:`Disk`},jF=e=>e.name.endsWith(`_optional`);function MF(e){if(!e.ok)return e.detail;if(e.name===`docker`)return`Running`;if(e.name===`anthropic_cred`){let t=e.detail.toLowerCase();if(t.includes(`keychain`))return`Claude CLI keychain`;if(t.includes(`oauth`))return`OAuth token`;if(t.includes(`api key`))return`API key`}return e.detail}function NF({preflight:e,loading:t}){if(t&&!e)return(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[0,1,2].map(e=>(0,V.jsx)(aC,{className:`h-12 w-full`},e))});let n=(e?.checks??[]).filter(e=>!jF(e));return n.length===0?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-line bg-surface-2 px-4 py-3 text-sm text-ink-3`,children:[(0,V.jsx)(qx,{className:`size-4`}),`No preflight data available.`]}):(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:n.map((e,t)=>(0,V.jsxs)(eP.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:t*.05},className:wS(`flex min-w-0 items-center gap-2.5 rounded-lg border px-3 py-2.5`,e.ok?`border-ok/20 bg-ok-soft/15`:`border-danger/25 bg-danger-soft/15`),children:[(0,V.jsx)(`span`,{className:wS(`flex size-5 shrink-0 items-center justify-center rounded-full`,e.ok?`bg-ok/20 text-ok`:`bg-danger/20 text-danger`),children:e.ok?(0,V.jsx)(gx,{className:`size-3.5`}):(0,V.jsx)(uS,{className:`size-3.5`})}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-[12.5px] font-medium leading-tight text-ink`,children:AF[e.name]??e.name}),e.detail&&(0,V.jsx)(`div`,{className:`mt-1 truncate text-[11.5px] leading-tight text-ink-3`,title:e.detail,children:MF(e)})]})]},e.name))})}var PF=[{value:`claude-sonnet-5`,label:`Sonnet 5`},{value:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{value:`claude-opus-4-8`,label:`Opus 4.8`},{value:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`}];function FF(){let e=ot().state?.firstRun,{preflight:t,loading:n,refresh:r}=gS(),[i,a]=(0,w.useState)(!0),[o,s]=(0,w.useState)(null),[c,l]=(0,w.useState)(`idle`),[u,d]=(0,w.useState)({}),[f,p]=(0,w.useState)({}),[m,h]=(0,w.useState)(null),[g,_]=(0,w.useState)(``),[v,y]=(0,w.useState)(``),[b,x]=(0,w.useState)(``),[S,C]=(0,w.useState)(``),[T,E]=(0,w.useState)(``),[D,O]=(0,w.useState)(``),[k,A]=(0,w.useState)(``),[j,M]=(0,w.useState)(``),[N,P]=(0,w.useState)(``),[F,I]=(0,w.useState)(``),[L,ee]=(0,w.useState)(``),[te,ne]=(0,w.useState)(``);function re(e){_(e.default_cell_model??``),y(e.cell_model_light??``),x(e.cell_model_analysis??``),C(e.runs_dir??``),E(e.ci_repo_root??``),O(e.harden_drop_after==null?``:String(e.harden_drop_after)),A(e.harden_min_improvement==null?``:String(e.harden_min_improvement)),M(e.agentic_concurrency==null?``:String(e.agentic_concurrency)),P(e.outbox_dir??``),I(e.author_name??``),ee(e.author_email??``),ne(e.author_organization??``),d({claude_code_oauth_token:e.claude_code_oauth_token,anthropic_api_key:e.anthropic_api_key,openai_api_key:e.openai_api_key,gemini_api_key:e.gemini_api_key,zai_api_key:e.zai_api_key})}async function R(e,t=!1){let n=t?``:(f[e]??``).trim();if(!(!t&&!n)){h(e),s(null);try{re(await pS.saveSettings({[e]:n})),p(t=>({...t,[e]:``})),r()}catch(e){s(e instanceof Error?e.message:String(e))}finally{h(null)}}}(0,w.useEffect)(()=>{let e=!0;return pS.getSettings().then(t=>e&&re(t)).catch(t=>e&&s(t.message)).finally(()=>e&&a(!1)),()=>{e=!1}},[]);async function z(){l(`saving`),s(null);let e=e=>e.trim()===``?void 0:Number(e);try{let t={default_cell_model:g||void 0,cell_model_light:v||void 0,cell_model_analysis:b||void 0,runs_dir:S||void 0,ci_repo_root:T||void 0,harden_drop_after:e(D),harden_min_improvement:e(k),agentic_concurrency:e(j),outbox_dir:N||void 0,author_name:F||void 0,author_email:L||void 0,author_organization:te||void 0};re(await pS.saveSettings(t)),l(`ok`),r(),window.setTimeout(()=>l(`idle`),2200)}catch(e){s(e instanceof Error?e.message:String(e)),l(`error`)}}return(0,V.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-7`,children:[(0,V.jsx)(`div`,{children:(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:e?`Welcome — let's get set up`:`Settings`})}),(0,V.jsxs)(oC,{children:[(0,V.jsxs)(sC,{children:[(0,V.jsxs)(cC,{children:[(0,V.jsx)(tS,{className:`size-4 text-ink-3`}),`Preflight`]}),(0,V.jsxs)(qS,{size:`sm`,variant:`ghost`,onClick:()=>void r(),children:[(0,V.jsx)(qx,{className:`size-3.5`}),`Recheck`]})]}),(0,V.jsxs)(lC,{className:`space-y-4`,children:[t&&!t.ready&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-warn-soft/25 px-4 py-2.5 text-sm font-medium text-warn`,children:[(0,V.jsx)(Lx,{className:`size-4`}),`Setup incomplete — resolve the flagged checks below.`]}),(0,V.jsx)(NF,{preflight:t,loading:n})]})]}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(Rx,{className:`size-4 text-ink-3`}),`Credentials`]})}),(0,V.jsxs)(lC,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:`Claude CLI login works automatically. Saved keys are local and masked; environment variables take precedence.`}),(0,V.jsxs)(`div`,{className:`divide-y divide-line rounded-xl border border-line`,children:[(0,V.jsx)(IF,{label:`Claude OAuth token`,hint:(0,V.jsxs)(V.Fragment,{children:[`run `,(0,V.jsx)(`code`,{children:`claude setup-token`})]}),field:`claude_code_oauth_token`,required:!0,mask:u.claude_code_oauth_token,value:f.claude_code_oauth_token??``,busy:m===`claude_code_oauth_token`,onChange:e=>p(t=>({...t,claude_code_oauth_token:e})),onSave:e=>void R(`claude_code_oauth_token`,e)}),(0,V.jsx)(IF,{label:`Anthropic API key`,field:`anthropic_api_key`,required:!0,mask:u.anthropic_api_key,value:f.anthropic_api_key??``,busy:m===`anthropic_api_key`,onChange:e=>p(t=>({...t,anthropic_api_key:e})),onSave:e=>void R(`anthropic_api_key`,e)}),(0,V.jsx)(IF,{label:`OpenAI API key`,field:`openai_api_key`,mask:u.openai_api_key,value:f.openai_api_key??``,busy:m===`openai_api_key`,onChange:e=>p(t=>({...t,openai_api_key:e})),onSave:e=>void R(`openai_api_key`,e)}),(0,V.jsx)(IF,{label:`Gemini API key`,field:`gemini_api_key`,mask:u.gemini_api_key,value:f.gemini_api_key??``,busy:m===`gemini_api_key`,onChange:e=>p(t=>({...t,gemini_api_key:e})),onSave:e=>void R(`gemini_api_key`,e)}),(0,V.jsx)(IF,{label:`Z.ai API key`,field:`zai_api_key`,mask:u.zai_api_key,value:f.zai_api_key??``,busy:m===`zai_api_key`,onChange:e=>p(t=>({...t,zai_api_key:e})),onSave:e=>void R(`zai_api_key`,e)})]})]})]}),i?(0,V.jsx)(oC,{children:(0,V.jsx)(lC,{className:`space-y-4`,children:[0,1,2].map(e=>(0,V.jsx)(aC,{className:`h-16 w-full`},e))})}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(tS,{className:`size-4 text-ink-3`}),`Output`]})}),(0,V.jsx)(lC,{className:`space-y-5`,children:(0,V.jsx)(JS,{label:`Outbox directory`,htmlFor:`outbox_dir`,hint:`Exports are sorted into tasks/, drafts/, and easy/.`,children:(0,V.jsx)(YS,{id:`outbox_dir`,placeholder:`out`,value:N,onChange:e=>P(e.target.value)})})})]}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(lS,{className:`size-4 text-ink-3`}),`Execution`]})}),(0,V.jsxs)(lC,{className:`space-y-5`,children:[(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(JS,{label:`Generation model`,htmlFor:`model`,hint:`Oracle, task creation, and revisions.`,children:(0,V.jsx)(LF,{id:`model`,value:g,onChange:_})}),(0,V.jsx)(JS,{label:`Matrix model`,htmlFor:`model_light`,hint:`Candidate selection.`,children:(0,V.jsx)(LF,{id:`model_light`,value:v,onChange:y})}),(0,V.jsx)(JS,{label:`Analysis model`,htmlFor:`model_analysis`,hint:`Failure audits.`,children:(0,V.jsx)(LF,{id:`model_analysis`,value:b,onChange:x})})]}),(0,V.jsx)(JS,{label:`Runs directory`,htmlFor:`runs_dir`,children:(0,V.jsx)(YS,{id:`runs_dir`,placeholder:`/path/to/runs`,value:S,onChange:e=>C(e.target.value)})}),(0,V.jsx)(JS,{label:`Static checks override`,htmlFor:`ci_repo`,children:(0,V.jsx)(YS,{id:`ci_repo`,placeholder:`Bundled checks (default)`,value:T,onChange:e=>E(e.target.value)})})]})]}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(Wx,{className:`size-4 text-ink-3`}),`Task authorship`]})}),(0,V.jsx)(lC,{className:`space-y-5`,children:(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-3`,children:[(0,V.jsx)(JS,{label:`Author name`,htmlFor:`author_name`,children:(0,V.jsx)(YS,{id:`author_name`,placeholder:`Your name`,value:F,onChange:e=>I(e.target.value)})}),(0,V.jsx)(JS,{label:`Author email`,htmlFor:`author_email`,children:(0,V.jsx)(YS,{id:`author_email`,placeholder:`you@example.com`,value:L,onChange:e=>ee(e.target.value)})}),(0,V.jsx)(JS,{label:`Organization`,htmlFor:`author_org`,children:(0,V.jsx)(YS,{id:`author_org`,placeholder:`(optional)`,value:te,onChange:e=>ne(e.target.value)})})]})})]}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsxs)(cC,{children:[(0,V.jsx)(nS,{className:`size-4 text-ink-3`}),`Pipeline tuning`]})}),(0,V.jsx)(lC,{className:`space-y-5`,children:(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(JS,{label:`Harden attempts`,htmlFor:`drop_after`,hint:`Drop after this many revisions without enough improvement.`,children:(0,V.jsx)(YS,{id:`drop_after`,type:`number`,min:1,placeholder:`2`,value:D,onChange:e=>O(e.target.value)})}),(0,V.jsx)(JS,{label:`Minimum improvement`,htmlFor:`min_improve`,hint:`Required pass@1 reduction per revision (0–1).`,children:(0,V.jsx)(YS,{id:`min_improve`,type:`number`,step:`0.01`,min:0,max:1,placeholder:`0.10`,value:k,onChange:e=>A(e.target.value)})}),(0,V.jsx)(JS,{label:`Concurrent agents`,htmlFor:`agentic_conc`,children:(0,V.jsx)(YS,{id:`agentic_conc`,type:`number`,min:1,placeholder:`1`,value:j,onChange:e=>M(e.target.value)})})]})})]}),o&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,children:o}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(qS,{variant:`primary`,onClick:()=>void z(),loading:c===`saving`,children:`Save settings`}),c===`ok`&&(0,V.jsxs)(eP.span,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},className:`flex items-center gap-1.5 text-sm font-medium text-ok`,children:[(0,V.jsx)(gx,{className:`size-4`}),`Saved`]})]})]})]})}function IF({label:e,hint:t,field:n,required:r=!1,mask:i,value:a,busy:o,onChange:s,onSave:c}){return(0,V.jsxs)(`div`,{className:`space-y-2 p-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:n,className:`text-[13px] font-medium text-ink`,children:e}),t&&(0,V.jsx)(`p`,{className:`text-[11.5px] text-ink-4`,children:t})]}),(0,V.jsx)(`span`,{className:i?`text-[11.5px] font-mono text-ok`:`text-[11.5px] text-ink-4`,children:i?`configured ${i}`:r?`required (one of two)`:`not configured`})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(YS,{id:n,type:`password`,autoComplete:`off`,placeholder:i?`Enter a new value to replace`:`Paste credential`,value:a,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&a.trim()&&c(!1)}),(0,V.jsx)(qS,{variant:`secondary`,onClick:()=>c(!1),loading:o,disabled:!a.trim(),children:`Save`}),i&&(0,V.jsx)(qS,{variant:`ghost`,onClick:()=>c(!0),disabled:o,children:`Clear`})]})]})}function LF({id:e,value:t,onChange:n}){return(0,V.jsxs)(XS,{id:e,value:t,onChange:e=>n(e.target.value),children:[!t&&(0,V.jsx)(`option`,{value:``,children:`Select a model…`}),t&&!PF.some(e=>e.value===t)&&(0,V.jsx)(`option`,{value:t,children:t}),PF.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))]})}var RF=e=>e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`,zF=e=>new Intl.NumberFormat(void 0,{notation:e>=1e5?`compact`:`standard`}).format(e),BF=e=>e?`${(e/36e5).toFixed(1)}h`:`—`;function VF(){let[e,t]=(0,w.useState)(null),[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(!0),o=()=>{a(!0),pS.costs().then(t).catch(e=>r(e.message)).finally(()=>a(!1))};return(0,w.useEffect)(o,[]),(0,V.jsxs)(`div`,{className:`space-y-7`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`Costs`}),(0,V.jsx)(`p`,{className:`mt-1 text-[13px] text-ink-3`,children:`Provider-reported model usage for local task generation and evaluation.`})]}),(0,V.jsxs)(qS,{size:`sm`,variant:`ghost`,onClick:o,children:[(0,V.jsx)(qx,{className:`size-3.5`}),`Refresh`]})]}),n&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,children:n}),i&&!e?(0,V.jsx)(aC,{className:`h-40 w-full`}):e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,V.jsx)(HF,{icon:Sx,label:`Model cost`,value:RF(e.totals.usd)}),(0,V.jsx)(HF,{icon:ox,label:`Sessions`,value:zF(e.totals.sessions)}),(0,V.jsx)(HF,{icon:xx,label:`Agent time`,value:BF(e.totals.duration_ms)})]}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsx)(cC,{children:`By run`})}),(0,V.jsx)(lC,{className:`p-0`,children:e.by_run.length===0?(0,V.jsx)(`p`,{className:`p-6 text-sm text-ink-3`,children:`No model sessions recorded yet. New runs appear here automatically.`}):(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`min-w-full text-left text-[13px]`,children:[(0,V.jsx)(`thead`,{className:`border-b border-line text-[11px] uppercase tracking-wider text-ink-4`,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Run`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Cost`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Sessions`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Input`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Output`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Time`})]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-line`,children:e.by_run.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`px-5 py-3 font-medium text-ink`,children:(0,V.jsx)(On,{className:`hover:underline`,to:`/run/${encodeURIComponent(e.run)}`,children:e.run})}),(0,V.jsx)(`td`,{className:`px-5 py-3 font-mono text-ink-2`,children:RF(e.usd)}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:e.sessions}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:zF(e.input_tokens)}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:zF(e.output_tokens)}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:BF(e.duration_ms)})]},e.run))})]})})})]}),(0,V.jsxs)(oC,{children:[(0,V.jsx)(sC,{children:(0,V.jsx)(cC,{children:`Recent sessions`})}),(0,V.jsx)(lC,{className:`space-y-0 p-0`,children:e.recent.slice(0,15).map(e=>(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-line px-5 py-3 last:border-b-0`,children:[(0,V.jsx)(`span`,{className:`w-40 truncate font-medium text-ink`,children:e.run}),(0,V.jsx)(`span`,{className:`w-32 truncate font-mono text-[11.5px] text-ink-3`,children:e.stage}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-4`,children:e.model||`model`}),(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:RF(e.usd)})]},`${e.run}-${e.id}`))})]})]})]})}function HF({icon:e,label:t,value:n}){return(0,V.jsx)(oC,{children:(0,V.jsxs)(lC,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`rounded-lg bg-surface-2 p-2.5`,children:(0,V.jsx)(e,{className:`size-4 text-ink-3`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-[11px] uppercase tracking-wider text-ink-4`,children:t}),(0,V.jsx)(`p`,{className:`mt-0.5 text-lg font-semibold text-ink`,children:n})]})]})})}function UF(){let e=ot(),t=lt(),{preflight:n,loading:r}=gS();return(0,w.useEffect)(()=>{r||!n||!n.ready&&e.pathname===`/`&&t(`/settings`,{replace:!0,state:{firstRun:!0}})},[r,n?.ready]),(0,V.jsx)(SS,{children:(0,V.jsxs)(Rt,{children:[(0,V.jsx)(It,{path:`/`,element:(0,V.jsx)(mC,{})}),(0,V.jsx)(It,{path:`/run/:key`,element:(0,V.jsx)(yF,{})}),(0,V.jsx)(It,{path:`/costs`,element:(0,V.jsx)(VF,{})}),(0,V.jsx)(It,{path:`/docs`,element:(0,V.jsx)(EF,{})}),(0,V.jsx)(It,{path:`/settings`,element:(0,V.jsx)(FF,{})}),(0,V.jsx)(It,{path:`*`,element:(0,V.jsx)(Ft,{to:`/`,replace:!0})})]})})}var WF=class extends w.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`UI render error:`,e,t)}render(){return this.state.error?(0,V.jsxs)(`div`,{className:`mx-auto mt-16 max-w-lg rounded-xl border border-line bg-surface-2 p-6 text-center`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-ink`,children:`Something broke rendering this view`}),(0,V.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-3`,children:this.state.error.message}),(0,V.jsxs)(`div`,{className:`mt-4 flex justify-center gap-3`,children:[(0,V.jsx)(`button`,{className:`rounded-lg bg-accent px-4 py-2 text-[13px] font-medium text-white`,onClick:()=>this.setState({error:null}),children:`Retry`}),(0,V.jsx)(`a`,{href:`/`,className:`rounded-lg border border-line px-4 py-2 text-[13px] font-medium text-ink-2`,children:`Back to fleet`})]})]}):this.props.children}};function GF(){let[e,t]=(0,w.useState)(()=>{let e=window.localStorage.getItem(`programsmith-color-mode`)===`light`?`light`:`dark`;return document.documentElement.dataset.theme=e,e});(0,w.useEffect)(()=>{document.documentElement.dataset.theme=e,window.localStorage.setItem(`programsmith-color-mode`,e)},[e]);let n=(0,w.useMemo)(()=>yS(e),[e]),r=(0,w.useMemo)(()=>({mode:e,toggleMode:()=>t(e=>e===`dark`?`light`:`dark`)}),[e]);return(0,V.jsx)(_S.Provider,{value:r,children:(0,V.jsxs)(Ul,{theme:n,children:[(0,V.jsx)(qf,{}),(0,V.jsx)(WF,{children:(0,V.jsx)(En,{children:(0,V.jsx)(hS,{children:(0,V.jsx)(UF,{})})})})]})})}(0,Ws.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(w.StrictMode,{children:(0,V.jsx)(GF,{})})); \ No newline at end of file +`),clamped:!0}}function cF({e}){switch(e.kind){case`divider`:return(0,V.jsxs)(`div`,{className:`my-2 flex items-center gap-2 text-[11px] uppercase tracking-wider text-ink-3`,children:[(0,V.jsx)(`span`,{className:`h-px flex-1 bg-line-2`}),e.text||`session`,(0,V.jsx)(`span`,{className:`h-px flex-1 bg-line-2`})]});case`system`:return(0,V.jsxs)(`div`,{className:`text-[12.5px] text-ink-3`,children:[`● `,e.text]});case`lh`:{let t=e.event===`iteration`,n=t?`▶`:e.ok?`✓`:`✗`,r=t?`text-accent`:e.ok?`text-ok`:`text-warn`,i=t?`iteration ${e.n}${e.of?`/${e.of}`:``}${e.label?` · ${e.label}`:``}`:e.event===`validated`?e.ok?`validated · ${e.detail??`oracle=1/nop=0`}`:`iteration ${e.n} didn't validate · ${e.detail??``}`:e.detail??e.event;return(0,V.jsxs)(`div`,{className:DS(`flex gap-2 text-[12.5px] font-medium`,r),children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:n}),(0,V.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:i})]})}case`thinking`:return(0,V.jsxs)(`div`,{className:`flex gap-2 text-[12.5px] italic text-ink-3`,children:[(0,V.jsx)(`span`,{className:`shrink-0 not-italic`,children:`💭`}),(0,V.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.text})]});case`tool`:return(0,V.jsxs)(`div`,{className:`flex gap-2 font-mono text-[12.5px] text-ink-2`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-ink-3`,children:`$`}),(0,V.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[(0,V.jsx)(`span`,{className:`font-semibold text-info`,children:e.name}),e.summary?` ${e.summary}`:``]})]});case`tool_result`:{let{text:t,clamped:n}=sF(e.text,oF);return(0,V.jsxs)(`div`,{className:DS(`flex gap-2 font-mono text-[12.5px]`,e.isError?`text-danger`:`text-ink-3`),children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:`↳`}),(0,V.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[t,n&&(0,V.jsx)(`span`,{className:`text-ink-4`,children:` …`})]})]})}case`final`:return(0,V.jsxs)(`div`,{className:DS(`flex gap-2 text-[12.5px] font-medium`,e.isError?`text-danger`:`text-ok`),children:[(0,V.jsx)(`span`,{className:`shrink-0`,children:e.isError?`✗`:`✓`}),(0,V.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[e.text,e.meta&&(0,V.jsxs)(`span`,{className:`ml-1 font-normal text-ink-4`,children:[`(`,e.meta,`)`]})]})]});case`text`:return(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-[13px] leading-relaxed text-ink`,children:e.text});case`raw`:return(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words font-mono text-[12px] text-ink-3`,children:e.text})}}function lF({runKey:e}){let[t,n]=(0,w.useState)(!0),[r,i]=(0,w.useState)(2e3),{data:a}=ES(()=>gS.agentOutput(e),r,[e,r]),o=(0,w.useRef)(null);(0,w.useEffect)(()=>{a&&i(a.running?2e3:8e3)},[a?.running]);let s=(0,w.useMemo)(()=>a?.tail?aF(a.tail):[],[a?.tail]);return(0,w.useEffect)(()=>{t&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[s.length,t]),!a||!a.exists&&!a.running?null:(0,V.jsxs)(lC,{children:[(0,V.jsxs)(uC,{className:`cursor-pointer select-none`,onClick:()=>n(e=>!e),children:[(0,V.jsxs)(dC,{children:[(0,V.jsx)(cS,{className:`size-4 text-accent`}),`Agent output`,a.running&&(0,V.jsxs)(`span`,{className:DS(`ml-1 inline-flex items-center gap-1.5 normal-case tracking-normal text-[12px] font-medium`,a.slow?`text-warn`:`text-accent`),children:[(0,V.jsx)(`span`,{className:DS(`inline-block size-1.5 animate-pulse rounded-full`,a.slow?`bg-warn`:`bg-accent`)}),a.active_job??`running`,a.elapsed_sec!=null&&` · ${uF(a.elapsed_sec)}`]})]}),t?(0,V.jsx)(_x,{className:`size-4 text-ink-4`}):(0,V.jsx)(vx,{className:`size-4 text-ink-4`})]}),t&&(0,V.jsxs)(fC,{className:`space-y-3`,children:[a.slow&&(0,V.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-warn/30 bg-warn/5 px-3 py-2 text-[12.5px] text-warn`,children:[(0,V.jsx)(Fx,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsxs)(`span`,{children:[`Running slowly (`,uF(a.elapsed_sec??0),`) — the provider may be`,` `,(0,V.jsx)(`span`,{className:`font-medium`,children:`rate-limiting`}),` this agent.`]})]}),s.length>0?(0,V.jsxs)(`div`,{ref:o,className:`max-h-[460px] space-y-2 overflow-auto rounded-lg border border-line/70 bg-bg-2 p-4`,children:[s.map((e,t)=>(0,V.jsx)(cF,{e},t)),a.running&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 text-[12px] text-ink-4`,children:[(0,V.jsx)(`span`,{className:`inline-block size-1.5 animate-pulse rounded-full bg-accent`}),`working…`]})]}):(0,V.jsx)(`p`,{className:`text-[13px] text-ink-4`,children:a.running?`Agent starting…`:`No agent output captured yet.`})]})]})}function uF(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n?`${t}m ${n}s`:`${t}m`}function dF(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function fF(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function pF(e){let t=[e,dF(e)?e.steps:void 0,dF(e)?e.events:void 0,dF(e)&&dF(e.trajectory)?e.trajectory.steps:void 0,dF(e)&&dF(e.trajectory)?e.trajectory.events:void 0].find(Array.isArray);return t?t.slice(-80).map((e,t)=>{if(!dF(e))return{label:`Step ${t+1}`,detail:String(e),raw:e};let n=fF(e.role),r=fF(e.source),i=fF(e.type)??fF(e.kind)??fF(e.event),a=fF(e.tool_name)??fF(e.tool),o=(Array.isArray(e.tool_calls)?e.tool_calls.filter(dF):[]).map(e=>fF(e.function_name)??fF(e.name)).filter(e=>!!e),s=dF(e.observation)&&Array.isArray(e.observation.results)?e.observation.results.filter(dF).map(e=>fF(e.content)).filter(e=>!!e):[];return{label:a?`Tool · ${a}`:o.length?`Tool · ${o.join(`, `)}`:r??n??(i?i.replaceAll(`_`,` `):`Step ${t+1}`),detail:fF(e.reasoning_content)??fF(e.content)??fF(e.message)??fF(e.text)??fF(e.command)??(s.length?s.join(` +`):void 0)??(dF(e.function)?fF(e.function.name):void 0),raw:e}}):[]}function mF(e){return[`complete`,`completed`,`success`,`passed`].includes(e)?`ok`:[`failed`,`error`,`cancelled`].includes(e)?`danger`:[`queued`,`submitting`,`running`,`pending`].includes(e)?`info`:`neutral`}function hF({runKey:e,artifact:t}){let[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)(!1),[u,d]=(0,w.useState)(null),f=(0,w.useCallback)(async()=>{try{let t=await gS.oddishStatus(e);r(t),d(t.error??t.refresh_error??null)}catch(e){e instanceof mS&&e.status===404||d(e instanceof Error?e.message:`Could not load Oddish status`)}},[e]);(0,w.useEffect)(()=>{f()},[f]),(0,w.useEffect)(()=>{if(!n||![`submitting`,`queued`,`running`,`pending`].includes(n.status))return;let e=window.setInterval(()=>void f(),4e3);return()=>window.clearInterval(e)},[n,f]);let p=n?.trials?.[0],m=!!n&&[`submitting`,`queued`,`running`,`pending`].includes(n.status),h=(0,w.useMemo)(()=>pF(i),[i]),g=(0,w.useCallback)(async()=>{s(!0),d(null);try{r(await gS.runOnOddish(e))}catch(e){d(e instanceof Error?e.message:`Could not start the Oddish run`)}finally{s(!1)}},[e]),_=(0,w.useCallback)(async()=>{l(!0),d(null);try{a(await gS.oddishTrajectory(e,p?.id??void 0))}catch(e){d(e instanceof Error?e.message:`Could not load the trajectory`)}finally{l(!1)}},[e,p?.id]);return(0,V.jsxs)(lC,{children:[(0,V.jsxs)(uC,{children:[(0,V.jsxs)(dC,{children:[(0,V.jsx)(Sx,{className:`size-4 text-accent`}),`Task`]}),n&&n.status!==`idle`&&(0,V.jsxs)(FS,{tone:mF(n.status),className:`capitalize`,children:[m&&(0,V.jsx)(`span`,{className:`size-1.5 animate-pulse bg-current`}),n.status]})]}),(0,V.jsxs)(fC,{className:`space-y-5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`max-w-xl`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-ink`,children:t?.available?`Your task is ready`:`Building your task`}),(0,V.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-ink-3`,children:t?.available?`Download the portable task, or use your Oddish free-plan quota for one agent trial and a public result.`:`Download and cloud execution become available after Static CI passes.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[t?.available&&(0,V.jsxs)(XS,{component:`a`,href:t.download_url,variant:`outline`,children:[(0,V.jsx)(Tx,{className:`size-4`}),`Download task`]}),(0,V.jsxs)(XS,{variant:`primary`,onClick:()=>void g(),loading:o,disabled:!t?.available||m||n?.status===`complete`,children:[(0,V.jsx)(Jx,{className:`size-4`}),m?`Running on Oddish`:n?.status===`complete`?`Run complete`:`Run on Oddish`]})]})]}),t?.available&&!t.calibrated&&(0,V.jsx)(`p`,{className:`border-l-2 border-warn pl-3 text-xs leading-relaxed text-ink-3`,children:`This is a draft task: Static CI passed, but model difficulty has not been calibrated.`}),u&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border border-danger/40 bg-danger-soft/20 px-4 py-3 text-sm text-danger`,children:[(0,V.jsx)(`span`,{children:u}),u.toLowerCase().includes(`key`)&&(0,V.jsx)(On,{to:`/settings`,children:(0,V.jsxs)(XS,{variant:`outline`,size:`sm`,children:[(0,V.jsx)(nS,{className:`size-3.5`}),`Add Oddish key`]})})]}),n&&n.status!==`idle`&&(0,V.jsxs)(`div`,{className:`border-t border-line pt-5`,children:[(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,V.jsx)(gF,{label:`Agent`,value:p?.agent??n.agent??`—`}),(0,V.jsx)(gF,{label:`Model`,value:p?.model??n.model??`—`}),(0,V.jsx)(gF,{label:`Reward`,value:p?.reward==null?`—`:p.reward.toFixed(2)}),(0,V.jsx)(gF,{label:`Duration`,value:p?.duration_seconds==null?`—`:`${Math.round(p.duration_seconds)}s`})]}),(0,V.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-2.5`,children:[p?.id&&(0,V.jsxs)(XS,{variant:`outline`,size:`sm`,onClick:()=>void _(),loading:c,children:[(0,V.jsx)(sx,{className:`size-3.5`}),i?`Refresh trajectory`:`View trajectory`]}),n.public_url&&(0,V.jsxs)(XS,{component:`a`,href:n.public_url,target:`_blank`,rel:`noreferrer`,variant:`outline`,size:`sm`,children:[(0,V.jsx)(Ex,{className:`size-3.5`}),`Public experiment`]})]})]}),i!==null&&(0,V.jsxs)(`div`,{className:`border-t border-line pt-5`,children:[(0,V.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-ink`,children:`Agent trajectory`}),(0,V.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:[h.length,` events`]})]}),h.length?(0,V.jsx)(`ol`,{className:`max-h-[440px] divide-y divide-line overflow-y-auto border border-line`,children:h.map((e,t)=>(0,V.jsxs)(`li`,{className:`grid grid-cols-[22px_minmax(0,1fr)] gap-3 px-4 py-3`,children:[(0,V.jsx)(`span`,{className:`mt-0.5 flex size-5 items-center justify-center border border-line font-mono text-[10px] text-ink-4`,children:t+1}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-xs font-semibold capitalize text-ink`,children:e.label}),e.detail&&(0,V.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-ink-3`,children:e.detail.length>900?`${e.detail.slice(0,900)}…`:e.detail}),!e.detail&&e.raw!==void 0&&(0,V.jsxs)(`details`,{className:`mt-1 text-[11px] text-ink-4`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-1`,children:[`Raw event `,(0,V.jsx)(_x,{className:`size-3`})]}),(0,V.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap font-mono`,children:JSON.stringify(e.raw,null,2)})]})]})]},t))}):(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border border-line px-4 py-3 text-sm text-ink-3`,children:[(0,V.jsx)(gx,{className:`size-4 text-ok`}),`The trajectory is available in the public Oddish experiment.`]})]})]})]})}function gF({label:e,value:t}){return(0,V.jsxs)(`div`,{className:`border-l border-line pl-3`,children:[(0,V.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4`,children:e}),(0,V.jsx)(`p`,{className:`mt-1 truncate text-sm text-ink`,title:t,children:t})]})}var _F={draft:{Icon:Gx,title:`Draft exported after Static CI`,tone:`ok`},dropped:{Icon:bx,title:`Run dropped`,tone:`warn`},blocked:{Icon:Ux,title:`Run blocked`,tone:`warn`},done:{Icon:Gx,title:`Exported to outbox`,tone:`ok`},easy:{Icon:ux,title:`Easy shelf`,tone:`warn`}};function vF({runKey:e,status:t,reason:n,canReopen:r,hardenHistory:i,onReopened:a,screenedOut:o=!1}){let[s,c]=(0,w.useState)(!1),l=_F[t]??_F.blocked,{Icon:u,title:d,tone:f}=o?{Icon:bx,title:`Source screened out`,tone:`warn`}:l,p=async()=>{c(!0);try{await gS.reopen(e),await a()}finally{c(!1)}};return(0,V.jsxs)(lC,{className:f===`ok`?`border-ok/30`:`border-warn/30`,children:[(0,V.jsxs)(uC,{children:[(0,V.jsxs)(dC,{className:f===`ok`?`text-ok`:`text-warn`,children:[(0,V.jsx)(u,{className:`size-4`}),d]}),r&&(0,V.jsxs)(XS,{variant:`secondary`,size:`sm`,onClick:()=>void p(),disabled:s,children:[(0,V.jsx)(Qx,{className:`size-3.5 ${s?`animate-spin`:``}`}),s?`Re-opening…`:`Re-open & harden`]})]}),(0,V.jsxs)(fC,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-[13.5px] leading-relaxed text-ink-2`,children:n}),i.length>0&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`h4`,{className:`text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-4`,children:`Hardening review`}),(0,V.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line`,children:i.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-line px-3 py-2 text-[12.5px] last:border-b-0`,children:[(0,V.jsxs)(`span`,{className:`text-ink-3`,children:[e.stage??`harden`,` · gen `,e.generation??t]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-3 font-mono`,children:[(0,V.jsxs)(`span`,{className:`text-ink-2`,children:[`pass@1 `,e.pass_at_1==null?`—`:`${Math.round(e.pass_at_1*100)}%`]}),(0,V.jsx)(`span`,{className:e.verdict===`drop`?`text-warn`:`text-ink-3`,children:e.verdict??`—`})]})]},t))})]}),r&&(0,V.jsx)(`p`,{className:`text-[12px] text-ink-4`,children:`Re-opening grants a fresh tuning budget. If the task is fundamentally too easy (the model still solves it), it will honestly land back on the easy shelf — that's a scope problem, not a harden one.`})]})]})}var yF={trivial:`text-ink-3`,moderate:`text-info`,hard:`text-warn`,frontier:`text-danger`},bF={recommended:`ok`,viable:`info`,marginal:`warn`};function xF({runKey:e,jobs:t,manual:n=!0,onAdvanced:r}){let[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(null),[c,l]=(0,w.useState)(null),[u,d]=(0,w.useState)(null),[f,p]=(0,w.useState)(!1),m=t?.task_matrix,h=m?.status===`running`||f,g=m?.status===`error`?m.detail??`TASK MATRIX failed.`:null,_=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!(m?.status===`done`||m===void 0&&i===null))return;let t=`${e}:${m?.status??`init`}`;if(_.current===t)return;_.current=t;let n=!0;return gS.getTaskMatrix(e).then(e=>n&&a(e)).catch(e=>{e instanceof mS&&e.status}),()=>{n=!1}},[e,m?.status,i]),(0,w.useEffect)(()=>{m?.status===`running`&&p(!1)},[m?.status]);async function v(){l(null),a(null),p(!0),_.current=null;try{await gS.runTaskMatrix(e),r()}catch(e){p(!1),l(e instanceof Error?e.message:String(e))}}async function y(t){s(t===null?`drop`:t),l(null);try{await gS.select(e,t),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(null)}}return(0,V.jsxs)(lC,{children:[(0,V.jsxs)(uC,{children:[(0,V.jsxs)(dC,{children:[(0,V.jsx)(Mx,{className:`size-4 text-ink-3`}),`Task Matrix`]}),(0,V.jsxs)(FS,{tone:n?`neutral`:`info`,children:[(0,V.jsx)(yx,{className:`size-3`}),n?`Awaiting selection`:`Auto-select`]})]}),(0,V.jsx)(fC,{className:`space-y-5`,children:i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsxs)(`p`,{className:`text-[13px] text-ink-3`,children:[(0,V.jsx)(`span`,{className:`text-ink-2`,children:i.candidates.length}),` `,`candidate`,i.candidates.length===1?``:`s`,` for`,` `,(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:i.source_ref})]}),n&&(0,V.jsx)(XS,{size:`sm`,variant:`ghost`,onClick:()=>void v(),loading:h,children:`Regenerate`})]}),(0,V.jsx)(`div`,{className:`grid gap-3`,children:i.candidates.map((e,t)=>(0,V.jsx)(CF,{candidate:e,index:t,selected:u===t,onSelect:()=>d(t)},t))}),!!i.source_evidence?.length&&(0,V.jsxs)(`div`,{className:`border border-line bg-surface-2 px-3 py-2.5`,children:[(0,V.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-ink-4`,children:`Source evidence`}),(0,V.jsx)(`ul`,{className:`mt-2 space-y-1 text-[12.5px] text-ink-2`,children:i.source_evidence.map(e=>(0,V.jsxs)(`li`,{children:[`• `,e]},e))})]}),c&&(0,V.jsx)(SF,{children:c}),n?(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-line pt-4`,children:[(0,V.jsxs)(XS,{variant:`danger`,onClick:()=>void y(null),loading:o===`drop`,children:[(0,V.jsx)(nx,{className:`size-4`}),`Drop (none)`]}),(0,V.jsxs)(XS,{variant:`primary`,disabled:u===null,onClick:()=>u!==null&&void y(u),loading:typeof o==`number`,children:[(0,V.jsx)(gx,{className:`size-4`}),`Select candidate`,u===null?``:` #${u+1}`]})]}):(0,V.jsx)(`p`,{className:`border-t border-line pt-4 text-[13px] text-ink-3`,children:`The driver selects the best candidate automatically — nothing to do here.`})]}):h?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsxs)(`div`,{className:`relative mb-5 flex size-16 items-center justify-center`,children:[(0,V.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-ink/5 animate-pulse-ring`}),(0,V.jsx)(ax,{className:`size-8 animate-spin text-ink-3`})]}),(0,V.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`Running TASK MATRIX…`}),(0,V.jsx)(`p`,{className:`mt-1.5 max-w-sm text-[13px] text-ink-3`,children:`Scoring candidate tasks against the rubric. This continues if you leave the page.`})]}):g?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-danger/15 text-danger`,children:(0,V.jsx)(nx,{className:`size-6`})}),(0,V.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`TASK MATRIX failed`}),(0,V.jsx)(SF,{className:`mt-3 max-w-md text-left`,children:g}),(0,V.jsxs)(XS,{variant:`primary`,className:`mt-5`,onClick:()=>void v(),children:[(0,V.jsx)(Zx,{className:`size-4`}),`Retry`]})]}):n?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-surface-2 text-ink-3`,children:(0,V.jsx)(Mx,{className:`size-6`})}),(0,V.jsx)(`p`,{className:`max-w-md text-sm text-ink-2`,children:`Generate candidate tasks for this source, then select one to advance or drop the run.`}),(0,V.jsxs)(XS,{variant:`primary`,className:`mt-5`,onClick:()=>void v(),children:[(0,V.jsx)(Jx,{className:`size-4`}),`Run TASK MATRIX`]}),c&&(0,V.jsx)(SF,{className:`mt-4 w-full`,children:c})]}):(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-surface-2 text-ink-3`,children:(0,V.jsx)(Mx,{className:`size-6`})}),(0,V.jsx)(`p`,{className:`max-w-md text-sm text-ink-2`,children:`Auto-selecting the best candidate…`})]})})]})}function SF({children:e,className:t}){return(0,V.jsx)(`div`,{className:DS(`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,t),children:e})}function CF({candidate:e,index:t,selected:n,onSelect:r}){let i=!!e.tool_name,a=e.tool_name??e.target_language??`candidate`,o=i?(e.upstream_language??``).toUpperCase()||null:e.scope_unit?zS(e.scope_unit):null,s=e.flag_surface??e.scope_detail;return(0,V.jsxs)(rP.button,{type:`button`,onClick:r,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:t*.04},className:DS(`focus-ring group relative w-full rounded-2xl border p-4 text-left transition-all`,n?`border-accent/60 bg-accent-soft/15 ring-1 ring-accent/40`:`border-line bg-bg-2/40 hover:border-line-2 hover:bg-surface-2/50`),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:DS(`flex size-6 items-center justify-center rounded-full text-[12px] font-semibold`,n?`bg-accent text-accent-fg`:`bg-surface-2 text-ink-3`),children:n?(0,V.jsx)(gx,{className:`size-3.5`}):t+1}),(0,V.jsx)(`span`,{className:`text-[15px] font-semibold text-ink`,children:a}),e.binary_name&&e.binary_name!==e.tool_name&&(0,V.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-4`,children:[`(`,e.binary_name,`)`]}),o&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-ink-4`,children:`·`}),(0,V.jsx)(`span`,{className:`text-sm text-ink-2`,children:o})]})]}),(0,V.jsx)(FS,{tone:bF[e.recommendation]??`neutral`,children:e.recommendation})]}),s&&(0,V.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-2`,children:s}),(0,V.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-3`,children:e.rationale}),(0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px]`,children:[i?(0,V.jsxs)(V.Fragment,{children:[e.case_families&&e.case_families.length>0&&(0,V.jsx)(wF,{icon:sS,label:`Families`,value:String(e.case_families.length)}),e.est_kloc!=null&&(0,V.jsx)(wF,{icon:Fx,label:`Size`,value:`${e.est_kloc} kLOC`}),e.expert_hours!=null&&(0,V.jsx)(wF,{icon:Fx,label:`Expert`,value:`${e.expert_hours}h`}),e.needs_files_dir&&(0,V.jsx)(FS,{tone:`info`,children:`files_dir`}),e.deterministic_output===!1&&(0,V.jsx)(FS,{tone:`danger`,children:`non-deterministic output`})]}):(0,V.jsxs)(V.Fragment,{children:[e.verifier_mechanism&&(0,V.jsx)(wF,{icon:sS,label:`Verifier`,value:zS(e.verifier_mechanism)}),e.objective&&(0,V.jsx)(wF,{icon:Fx,label:`Objective`,value:e.objective.replace(/\+/g,` + `)})]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ink-3`,children:[(0,V.jsx)(`span`,{className:`text-ink-4`,children:`Difficulty`}),(0,V.jsx)(`span`,{className:DS(`font-medium capitalize`,yF[e.expected_difficulty]??`text-ink-2`),children:e.expected_difficulty})]}),e.license_ok===!1&&(0,V.jsx)(FS,{tone:`danger`,children:`copyleft: clean-room required`}),(0,V.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 text-ink-4`,children:[(0,V.jsx)(px,{className:`size-3`}),(0,V.jsx)(`span`,{className:`font-mono`,children:e.basis_ref})]})]})]})}function wF({icon:e,label:t,value:n}){return(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ink-3`,children:[(0,V.jsx)(e,{className:`size-3 text-ink-4`}),(0,V.jsx)(`span`,{className:`text-ink-4`,children:t}),(0,V.jsx)(`span`,{className:`font-medium text-ink-2`,children:n})]})}function TF({runKey:e,context:t,onDecided:n}){let r=t.sweeps??{},i=r.full??r.full_sweep??null,[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(null),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=!0;return gS.getSettings().then(t=>e&&o(t.qa_gate_mode===`auto`?`auto`:`human`)).catch(()=>e&&o(`human`)),()=>{e=!1}},[]);let p=async t=>{c(t),u(null);try{let r=await gS.qaGate(e,t);f(`${t} → ${r.stage} (${r.status})`),n?.()}catch(e){u(e instanceof mS?e.detail:`${t} failed`)}finally{c(null)}},m=i?.pass_at_1??i?.claude_code??null,h=[{label:`Band verdict`,value:String(i?.band_verdict??`pending`)},{label:`Frontier pass@1`,value:typeof m==`number`?`${Math.round(m*100)}%`:String(m??`—`)},{label:`Hard keep`,value:i?.hard_keep?`yes — capability headroom`:`—`}],g=a===`human`;return(0,V.jsxs)(lC,{children:[(0,V.jsxs)(uC,{children:[(0,V.jsxs)(dC,{children:[(0,V.jsx)(iS,{className:`size-4 text-node-decision`}),`Final Gate`]}),a===`auto`?(0,V.jsxs)(FS,{tone:`info`,children:[(0,V.jsx)(wx,{className:`size-3`}),`Auto gate`]}):(0,V.jsx)(FS,{tone:`human`,children:`Final accept`})]}),(0,V.jsxs)(fC,{className:`space-y-5`,children:[(0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:g?`Review the frontier evidence before deciding. Accept exports the task bundle to the outbox; revise re-runs the frontier sweep through SYNTHESIZE; reject drops the run.`:`This gate decides automatically from the recorded evidence (band verdict, integrity, probe, analysis labels) — no action needed. Set qa_gate_mode to “human” in Settings to review manually.`}),(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:h.map(e=>(0,V.jsx)(EF,{label:e.label,value:e.value},e.label))}),g&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5 border-t border-line pt-4`,children:[(0,V.jsx)(DF,{icon:tx,label:`Accept`,tone:`ok`,loading:s===`accept`,disabled:s!==null,onClick:()=>void p(`accept`)}),(0,V.jsx)(DF,{icon:Zx,label:`Revise`,tone:`info`,loading:s===`revise`,disabled:s!==null,onClick:()=>void p(`revise`)}),(0,V.jsx)(DF,{icon:nx,label:`Reject`,tone:`danger`,loading:s===`reject`,disabled:s!==null,onClick:()=>void p(`reject`)}),d&&(0,V.jsx)(`span`,{className:`ml-auto text-[12px] font-medium text-ok`,children:d}),l&&(0,V.jsx)(`span`,{className:`ml-auto text-[12px] font-medium text-danger`,children:l})]})]})]})}function EF({label:e,value:t}){return(0,V.jsxs)(`div`,{className:`rounded-xl border border-line bg-bg-2/40 px-3.5 py-3`,children:[(0,V.jsx)(`div`,{className:`text-[11px] uppercase tracking-[0.06em] text-ink-4`,children:e}),(0,V.jsx)(`div`,{className:`mt-1 truncate font-mono text-sm text-ink-2`,children:t})]})}function DF({icon:e,label:t,tone:n,loading:r,disabled:i,onClick:a}){let o={ok:`border-ok/30 text-ok hover:bg-ok-soft/20`,info:`border-info/30 text-info hover:bg-info/10`,danger:`border-danger/30 text-danger hover:bg-danger-soft/20`}[n];return(0,V.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,className:DS(`inline-flex h-10 items-center gap-2 rounded-xl border bg-transparent px-4 text-sm font-medium transition-colors`,`disabled:cursor-not-allowed disabled:opacity-50`,o),children:[(0,V.jsx)(e,{className:DS(`size-4`,r&&`animate-pulse`)}),r?`Submitting…`:t]})}function OF(){let{key:e=``}=dt(),t=lt(),[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(null),{data:c,error:l,initialLoading:u,refresh:d}=ES(()=>gS.getRun(e),3e3,[e]),f=(0,w.useCallback)(async()=>{c&&(c.summary.paused?await gS.resume(e):await gS.pause(e),await d())},[c,e,d]),[p,m]=(0,w.useState)(!1),h=(0,w.useCallback)(async()=>{m(!0);try{await gS.retry(e),await d()}finally{m(!1)}},[e,d]),[g,_]=(0,w.useState)(!1),v=(0,w.useCallback)(async()=>{if(window.confirm(`Delete run "${e}" permanently? This removes its state and task files and cannot be undone.`)){_(!0);try{await gS.deleteRun(e),t(`/`)}catch{_(!1)}}},[e,t]);if(u)return(0,V.jsx)(NF,{});if(l&&!c)return(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsx)(MF,{}),(0,V.jsx)(mC,{title:`Run not found`,message:l.message,action:(0,V.jsx)(On,{to:`/`,children:(0,V.jsx)(XS,{variant:`secondary`,children:`Back to fleet`})})})]});if(!c)return(0,V.jsx)(NF,{});let{summary:y,node_statuses:b,history:x,context:S}=c,C=S.source;return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(MF,{}),(0,V.jsx)(lC,{children:(0,V.jsxs)(fC,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:y.slug??y.key}),(0,V.jsx)(LS,{status:y.status,stage:y.stage,screenedOut:!!y.screened_out}),y.paused&&(0,V.jsxs)(FS,{tone:`warn`,children:[(0,V.jsx)(Kx,{className:`size-3`}),`Paused`]})]}),(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[13px] text-ink-3`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono`,children:[(0,V.jsx)(Ix,{className:`size-3.5 text-ink-4`}),y.key]}),C&&(0,V.jsxs)(`span`,{className:`font-mono text-ink-4`,children:[C.repo,`@`,RS(C.pinned_sha)]}),y.harden>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-warn`,children:[(0,V.jsx)(rS,{className:`size-3.5`}),`harden `,y.harden]}),(y.ease??0)>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-info`,children:[(0,V.jsx)(Dx,{className:`size-3.5`}),`ease `,y.ease]}),y.revise>0&&(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-info`,children:[(0,V.jsx)(Zx,{className:`size-3.5`}),`revise `,y.revise]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,V.jsx)(vC,{content:`Browse the run's task files, source, and artifacts`,side:`bottom`,children:(0,V.jsxs)(XS,{variant:`outline`,size:`sm`,onClick:()=>r(!0),children:[(0,V.jsx)(Nx,{className:`size-3.5`}),`Files`]})}),c.drive?.halted===`blocked`&&(0,V.jsx)(vC,{content:`Retry — clear the errored job(s) so the driver re-runs this blocked stage fresh (use after fixing the cause)`,side:`bottom`,children:(0,V.jsxs)(XS,{variant:`secondary`,onClick:()=>void h(),disabled:p,children:[(0,V.jsx)(Zx,{className:`size-4`}),`Retry`]})}),y.status!==`draft`&&(0,V.jsx)(vC,{content:y.paused?`Resume — allow the run to advance`:`Pause — halt at the next inter-stage checkpoint`,side:`bottom`,children:(0,V.jsx)(XS,{variant:y.paused?`primary`:`secondary`,onClick:()=>void f(),children:y.paused?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Jx,{className:`size-4`}),`Resume`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Kx,{className:`size-4`}),`Pause`]})})})]})]})}),(0,V.jsx)(hF,{runKey:e,artifact:c.artifact}),c.waiting?.kind===`terminal`&&y.status!==`done`&&y.status!==`draft`&&(0,V.jsx)(vF,{runKey:e,status:y.status,reason:c.waiting.reason,canReopen:!!c.waiting.can_reopen,hardenHistory:S.harden_history??[],screenedOut:!!y.screened_out,onReopened:()=>void d()}),(0,V.jsxs)(`details`,{className:`group border border-line bg-surface-1`,open:!c.artifact?.available,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-4 px-5 py-4 [&::-webkit-details-marker]:hidden`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-3`,children:[(0,V.jsx)(dS,{className:`size-4 text-accent`}),`Build details`]}),(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4`,children:y.status===`draft`?`Static CI passed`:`${y.stage.replaceAll(`_`,` `)} · ${Math.round(y.progress*100)}%`})]}),(0,V.jsxs)(`div`,{className:`border-t border-line p-5`,children:[(0,V.jsx)(bP,{statuses:b,selected:o,onSelectStage:e=>s(t=>t===e?null:e)}),o&&(0,V.jsx)(jF,{stage:o,status:b[o],history:x,onClose:()=>s(null),onViewPrompt:e=>{a(e),r(!0)}})]})]}),y.status===`in_progress`&&y.stage===`TASK_MATRIX`&&(0,V.jsx)(xF,{runKey:e,jobs:c.jobs,manual:y.awaiting_human,onAdvanced:()=>void d()}),y.status===`in_progress`&&y.stage===`QA_GATE`&&(0,V.jsx)(TF,{runKey:e,context:S,onDecided:()=>void d()}),(0,V.jsxs)(`details`,{className:`group border border-line bg-surface-1`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-medium text-ink [&::-webkit-details-marker]:hidden`,children:[`Diagnostics`,(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4 group-open:hidden`,children:`Show`}),(0,V.jsx)(`span`,{className:`hidden font-mono text-[11px] text-ink-4 group-open:inline`,children:`Hide`})]}),(0,V.jsxs)(`div`,{className:`space-y-6 border-t border-line p-5`,children:[(0,V.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-2`,children:[(0,V.jsx)(jP,{context:S}),(0,V.jsx)(HP,{history:x})]}),(0,V.jsx)(lF,{runKey:e})]})]}),(0,V.jsx)(tF,{runKey:e,open:n,initialPath:i,onClose:()=>{r(!1),a(null)}}),(0,V.jsx)(`div`,{className:`flex justify-end border-t border-line/60 pt-5`,children:(0,V.jsxs)(XS,{variant:`ghost`,className:`text-ink-4 hover:text-danger`,onClick:()=>void v(),disabled:g,children:[(0,V.jsx)(uS,{className:`size-4`}),`Delete run`]})})]})}var kF={TASK_MATRIX:`prompts/TASK_MATRIX.md`,SYNTHESIZE:`prompts/SYNTHESIZE.md`};function AF(e){let t=OS.find(t=>t.stage===e);return t?{label:t.label,blurb:t.blurb}:e===`SYNTHESIZE`?{label:kS.label,blurb:kS.blurb}:{label:e}}function jF({stage:e,status:t,history:n,onClose:r,onViewPrompt:i}){let a=AF(e),o=n.filter(t=>t.stage===e),s=kF[e];return(0,V.jsxs)(`div`,{className:`mt-4 rounded-xl border border-accent/40 bg-surface-2 p-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[14px] font-semibold text-ink`,children:a.label}),(0,V.jsx)(FS,{tone:`neutral`,children:t??`pending`})]}),a.blurb&&(0,V.jsx)(`p`,{className:`mt-1 text-[12.5px] leading-snug text-ink-3`,children:a.blurb})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s&&(0,V.jsxs)(XS,{size:`sm`,variant:`outline`,onClick:()=>i(s),children:[(0,V.jsx)(jx,{className:`size-3.5`}),`View prompt`]}),(0,V.jsx)(`button`,{onClick:r,className:`rounded-md p-1 text-ink-4 transition-colors hover:text-ink`,title:`Close`,children:(0,V.jsx)(pS,{className:`size-4`})})]})]}),(0,V.jsx)(`div`,{className:`mt-3 border-t border-line pt-3`,children:o.length>0?(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:o.slice(-6).map((e,t)=>(0,V.jsxs)(`li`,{className:`flex items-start gap-2 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`shrink-0 rounded bg-bg-2 px-1.5 py-0.5 font-mono text-[11px] text-ink-3`,children:e.verdict??`—`}),(0,V.jsx)(`span`,{className:`text-ink-2`,children:e.reason})]},t))}):(0,V.jsxs)(`p`,{className:`text-[12.5px] text-ink-4`,children:[`No recorded events for this stage yet`,s?` — the prompt appears here once the cell runs.`:`.`]})})]})}function MF(){return(0,V.jsxs)(On,{to:`/`,className:`inline-flex items-center gap-1.5 text-[13px] font-medium text-ink-3 transition-colors hover:text-ink`,children:[(0,V.jsx)(dx,{className:`size-4`}),`Runs`]})}function NF(){return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(cC,{className:`h-5 w-16`}),(0,V.jsx)(cC,{className:`h-24 w-full`}),(0,V.jsx)(cC,{className:`h-[360px] w-full`}),(0,V.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,V.jsx)(cC,{className:`h-80 w-full`}),(0,V.jsx)(cC,{className:`h-80 w-full`})]})]})}var PF=[{id:`cli`,label:`CLI reference`,icon:sx}];function FF(){let[e,t]=(0,w.useState)(`cli`);return(0,w.useEffect)(()=>{let e=()=>{let e=PF[0].id;for(let t of PF){let n=document.getElementById(t.id);n&&n.getBoundingClientRect().top<=140&&(e=t.id)}t(e)};return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(`div`,{children:(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`Documentation`})}),(0,V.jsxs)(`div`,{className:`grid gap-8 lg:grid-cols-[180px_1fr]`,children:[(0,V.jsx)(`nav`,{className:`top-24 hidden h-max lg:sticky lg:block`,children:(0,V.jsx)(`ul`,{className:`space-y-0.5`,children:PF.map(t=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`a`,{href:`#${t.id}`,className:DS(`flex items-center gap-2 rounded-lg px-3 py-2 text-[13px] font-medium transition-colors`,e===t.id?`bg-surface-2 text-ink`:`text-ink-3 hover:bg-surface-2/60 hover:text-ink-2`),children:[(0,V.jsx)(t.icon,{className:`size-4`}),t.label]})},t.id))})}),(0,V.jsx)(`div`,{className:`min-w-0 space-y-10`,children:(0,V.jsx)(RF,{})})]})]})}function IF({id:e,icon:t,title:n,children:r}){return(0,V.jsxs)(`section`,{id:e,className:`scroll-mt-24 space-y-4`,children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold tracking-tight text-ink`,children:[(0,V.jsx)(t,{className:`size-5 text-ink-3`}),n]}),r]})}var LF=[{title:`Create & farm`,rows:[[`programsmith create --repo owner/name [--sha] [--slug]`,`One repo → one calibrated task; starts and opens its local dashboard.`],[`programsmith create --repo owner/name --draft`,`Export after Static CI with no model sweeps or calibration.`],[`programsmith farm --repos-file repos.txt`,`Start and drive many runs from a file (one spec per line).`]]},{title:`Runs & status`,rows:[[`programsmith fleet [--json]`,`List every run with stage, status, progress, and pass@1.`],[`programsmith status [--json]`,`Full run detail: stage, sweeps, history.`]]},{title:`Gates & recovery`,rows:[[`programsmith pick --index N | --none`,`Record the TASK MATRIX selection (human-gate mode only).`],[`programsmith qa-gate --decision accept|revise|reject`,`Record the final-gate decision (human-gate mode only).`],[`programsmith retry `,`Clear errored jobs so a blocked stage relaunches fresh.`],[`programsmith reopen `,`Re-open a terminal run for another harden attempt.`]]},{title:`Serve & doctor`,rows:[[`programsmith serve`,`Start this dashboard in the background. Autodrive task generation is on; solver sweeps stay parked unless you pass --spend.`],[`programsmith stop`,`Stop the background dashboard explicitly.`],[`programsmith doctor`,`Preflight: Docker, credentials, disk, Claude Code CLI.`]]}];function RF(){let[e,t]=(0,w.useState)(null);return(0,V.jsx)(IF,{id:`cli`,icon:sx,title:`CLI reference`,children:LF.map(n=>(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`h3`,{className:`text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-4`,children:n.title}),(0,V.jsx)(lC,{children:(0,V.jsx)(fC,{className:`divide-y divide-line/70 p-0`,children:n.rows.map(([n,r])=>(0,V.jsxs)(`div`,{className:`grid gap-1 px-4 py-2.5 sm:grid-cols-[minmax(0,0.9fr)_1fr] sm:gap-4`,children:[(0,V.jsx)(`button`,{onClick:()=>{navigator.clipboard?.writeText(n),t(n),window.setTimeout(()=>t(e=>e===n?null:e),1200)},className:`focus-ring text-left font-mono text-[12.5px] text-ink hover:text-ink-2`,title:`Copy`,children:e===n?`copied ✓`:n}),(0,V.jsx)(`span`,{className:`text-[12.5px] text-ink-3`,children:r})]},n))})})]},n.title))})}var zF={github:`GitHub access`,claude_oauth:`Claude credentials`,docker:`Docker`,anthropic_cred:`Anthropic`,claude_cli:`Claude Code CLI`,disk:`Disk`},BF=e=>e.name.endsWith(`_optional`);function VF(e){if(!e.ok)return e.detail;if(e.name===`docker`)return`Running`;if(e.name===`anthropic_cred`){let t=e.detail.toLowerCase();if(t.includes(`keychain`))return`Claude CLI keychain`;if(t.includes(`oauth`))return`OAuth token`;if(t.includes(`api key`))return`API key`}return e.detail}function HF({preflight:e,loading:t}){if(t&&!e)return(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[0,1,2].map(e=>(0,V.jsx)(cC,{className:`h-12 w-full`},e))});let n=(e?.checks??[]).filter(e=>!BF(e));return n.length===0?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-line bg-surface-2 px-4 py-3 text-sm text-ink-3`,children:[(0,V.jsx)(Xx,{className:`size-4`}),`No preflight data available.`]}):(0,V.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:n.map((e,t)=>(0,V.jsxs)(rP.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:t*.05},className:DS(`flex min-w-0 items-center gap-2.5 rounded-lg border px-3 py-2.5`,e.ok?`border-ok/20 bg-ok-soft/15`:`border-danger/25 bg-danger-soft/15`),children:[(0,V.jsx)(`span`,{className:DS(`flex size-5 shrink-0 items-center justify-center rounded-full`,e.ok?`bg-ok/20 text-ok`:`bg-danger/20 text-danger`),children:e.ok?(0,V.jsx)(gx,{className:`size-3.5`}):(0,V.jsx)(pS,{className:`size-3.5`})}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-[12.5px] font-medium leading-tight text-ink`,children:zF[e.name]??e.name}),e.detail&&(0,V.jsx)(`div`,{className:`mt-1 truncate text-[11.5px] leading-tight text-ink-3`,title:e.detail,children:VF(e)})]})]},e.name))})}var UF=[{value:`claude-sonnet-5`,label:`Sonnet 5`},{value:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{value:`claude-opus-4-8`,label:`Opus 4.8`},{value:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`}];function WF(){let e=ot().state?.firstRun,{preflight:t,loading:n,refresh:r}=yS(),[i,a]=(0,w.useState)(!0),[o,s]=(0,w.useState)(null),[c,l]=(0,w.useState)(`idle`),[u,d]=(0,w.useState)({}),[f,p]=(0,w.useState)({}),[m,h]=(0,w.useState)(null),[g,_]=(0,w.useState)(``),[v,y]=(0,w.useState)(``),[b,x]=(0,w.useState)(``),[S,C]=(0,w.useState)(``),[T,E]=(0,w.useState)(``),[D,O]=(0,w.useState)(``),[k,A]=(0,w.useState)(``),[j,M]=(0,w.useState)(``),[N,P]=(0,w.useState)(``),[F,I]=(0,w.useState)(``),[L,ee]=(0,w.useState)(``),[te,ne]=(0,w.useState)(``),[re,R]=(0,w.useState)(``),[z,ie]=(0,w.useState)(``),[ae,oe]=(0,w.useState)(``),[se,ce]=(0,w.useState)(``);function le(e){_(e.default_cell_model??``),y(e.cell_model_light??``),x(e.cell_model_analysis??``),C(e.runs_dir??``),E(e.ci_repo_root??``),O(e.harden_drop_after==null?``:String(e.harden_drop_after)),A(e.harden_min_improvement==null?``:String(e.harden_min_improvement)),M(e.agentic_concurrency==null?``:String(e.agentic_concurrency)),P(e.outbox_dir??``),I(e.author_name??``),ee(e.author_email??``),ne(e.author_organization??``),R(e.oddish_api_url??``),ie(e.oddish_dashboard_url??``),oe(e.oddish_agent??``),ce(e.oddish_model??``),d({claude_code_oauth_token:e.claude_code_oauth_token,anthropic_api_key:e.anthropic_api_key,openai_api_key:e.openai_api_key,gemini_api_key:e.gemini_api_key,zai_api_key:e.zai_api_key,oddish_api_key:e.oddish_api_key})}async function B(e,t=!1){let n=t?``:(f[e]??``).trim();if(!(!t&&!n)){h(e),s(null);try{le(await gS.saveSettings({[e]:n})),p(t=>({...t,[e]:``})),r()}catch(e){s(e instanceof Error?e.message:String(e))}finally{h(null)}}}(0,w.useEffect)(()=>{let e=!0;return gS.getSettings().then(t=>e&&le(t)).catch(t=>e&&s(t.message)).finally(()=>e&&a(!1)),()=>{e=!1}},[]);async function ue(){l(`saving`),s(null);let e=e=>e.trim()===``?void 0:Number(e);try{let t={default_cell_model:g||void 0,cell_model_light:v||void 0,cell_model_analysis:b||void 0,runs_dir:S||void 0,ci_repo_root:T||void 0,harden_drop_after:e(D),harden_min_improvement:e(k),agentic_concurrency:e(j),outbox_dir:N||void 0,author_name:F||void 0,author_email:L||void 0,author_organization:te||void 0,oddish_api_url:re||void 0,oddish_dashboard_url:z||void 0,oddish_agent:ae||void 0,oddish_model:se||void 0};le(await gS.saveSettings(t)),l(`ok`),r(),window.setTimeout(()=>l(`idle`),2200)}catch(e){s(e instanceof Error?e.message:String(e)),l(`error`)}}return(0,V.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-7`,children:[(0,V.jsx)(`div`,{children:(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:e?`Welcome — let's get set up`:`Settings`})}),(0,V.jsxs)(lC,{children:[(0,V.jsxs)(uC,{children:[(0,V.jsxs)(dC,{children:[(0,V.jsx)(iS,{className:`size-4 text-ink-3`}),`Preflight`]}),(0,V.jsxs)(XS,{size:`sm`,variant:`ghost`,onClick:()=>void r(),children:[(0,V.jsx)(Xx,{className:`size-3.5`}),`Recheck`]})]}),(0,V.jsxs)(fC,{className:`space-y-4`,children:[t&&!t.ready&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-warn-soft/25 px-4 py-2.5 text-sm font-medium text-warn`,children:[(0,V.jsx)(Bx,{className:`size-4`}),`Setup incomplete — resolve the flagged checks below.`]}),(0,V.jsx)(HF,{preflight:t,loading:n})]})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(Vx,{className:`size-4 text-ink-3`}),`Credentials`]})}),(0,V.jsxs)(fC,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:`Claude CLI login works automatically. Saved keys are local and masked; environment variables take precedence.`}),(0,V.jsxs)(`div`,{className:`divide-y divide-line rounded-xl border border-line`,children:[(0,V.jsx)(GF,{label:`Claude OAuth token`,hint:(0,V.jsxs)(V.Fragment,{children:[`run `,(0,V.jsx)(`code`,{children:`claude setup-token`})]}),field:`claude_code_oauth_token`,required:!0,mask:u.claude_code_oauth_token,value:f.claude_code_oauth_token??``,busy:m===`claude_code_oauth_token`,onChange:e=>p(t=>({...t,claude_code_oauth_token:e})),onSave:e=>void B(`claude_code_oauth_token`,e)}),(0,V.jsx)(GF,{label:`Anthropic API key`,field:`anthropic_api_key`,required:!0,mask:u.anthropic_api_key,value:f.anthropic_api_key??``,busy:m===`anthropic_api_key`,onChange:e=>p(t=>({...t,anthropic_api_key:e})),onSave:e=>void B(`anthropic_api_key`,e)}),(0,V.jsx)(GF,{label:`Oddish API key`,hint:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`a`,{className:`underline underline-offset-2`,href:`https://www.oddish.app/settings`,target:`_blank`,rel:`noreferrer`,children:`Create a full-scope key`}),` for one-click hosted runs.`]}),field:`oddish_api_key`,mask:u.oddish_api_key,value:f.oddish_api_key??``,busy:m===`oddish_api_key`,onChange:e=>p(t=>({...t,oddish_api_key:e})),onSave:e=>void B(`oddish_api_key`,e)}),(0,V.jsxs)(`details`,{className:`group border-t border-line`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between px-4 py-3 text-[13px] font-medium text-ink-2 [&::-webkit-details-marker]:hidden`,children:[`Other model providers`,(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4 group-open:hidden`,children:`Optional`}),(0,V.jsx)(`span`,{className:`hidden font-mono text-[11px] text-ink-4 group-open:inline`,children:`Hide`})]}),(0,V.jsxs)(`div`,{className:`divide-y divide-line border-t border-line`,children:[(0,V.jsx)(GF,{label:`OpenAI API key`,field:`openai_api_key`,mask:u.openai_api_key,value:f.openai_api_key??``,busy:m===`openai_api_key`,onChange:e=>p(t=>({...t,openai_api_key:e})),onSave:e=>void B(`openai_api_key`,e)}),(0,V.jsx)(GF,{label:`Gemini API key`,field:`gemini_api_key`,mask:u.gemini_api_key,value:f.gemini_api_key??``,busy:m===`gemini_api_key`,onChange:e=>p(t=>({...t,gemini_api_key:e})),onSave:e=>void B(`gemini_api_key`,e)}),(0,V.jsx)(GF,{label:`Z.ai API key`,field:`zai_api_key`,mask:u.zai_api_key,value:f.zai_api_key??``,busy:m===`zai_api_key`,onChange:e=>p(t=>({...t,zai_api_key:e})),onSave:e=>void B(`zai_api_key`,e)})]})]})]})]})]}),i?(0,V.jsx)(lC,{children:(0,V.jsx)(fC,{className:`space-y-4`,children:[0,1,2].map(e=>(0,V.jsx)(cC,{className:`h-16 w-full`},e))})}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(iS,{className:`size-4 text-ink-3`}),`Output`]})}),(0,V.jsx)(fC,{className:`space-y-5`,children:(0,V.jsx)(ZS,{label:`Outbox directory`,htmlFor:`outbox_dir`,hint:`Exports are sorted into tasks/, drafts/, and easy/.`,children:(0,V.jsx)(QS,{id:`outbox_dir`,placeholder:`out`,value:N,onChange:e=>P(e.target.value)})})})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(fS,{className:`size-4 text-ink-3`}),`Execution`]})}),(0,V.jsxs)(fC,{className:`space-y-5`,children:[(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(ZS,{label:`Generation model`,htmlFor:`model`,hint:`Oracle, task creation, and revisions.`,children:(0,V.jsx)(KF,{id:`model`,value:g,onChange:_})}),(0,V.jsx)(ZS,{label:`Matrix model`,htmlFor:`model_light`,hint:`Candidate selection.`,children:(0,V.jsx)(KF,{id:`model_light`,value:v,onChange:y})}),(0,V.jsx)(ZS,{label:`Analysis model`,htmlFor:`model_analysis`,hint:`Failure audits.`,children:(0,V.jsx)(KF,{id:`model_analysis`,value:b,onChange:x})})]}),(0,V.jsx)(ZS,{label:`Runs directory`,htmlFor:`runs_dir`,children:(0,V.jsx)(QS,{id:`runs_dir`,placeholder:`/path/to/runs`,value:S,onChange:e=>C(e.target.value)})}),(0,V.jsx)(ZS,{label:`Static checks override`,htmlFor:`ci_repo`,children:(0,V.jsx)(QS,{id:`ci_repo`,placeholder:`Bundled checks (default)`,value:T,onChange:e=>E(e.target.value)})})]})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(fS,{className:`size-4 text-ink-3`}),`Oddish`]})}),(0,V.jsxs)(fC,{className:`space-y-5`,children:[(0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:`The run button uploads an exported task, launches one hosted trial, and creates a public experiment link. Oddish free-plan limits apply.`}),(0,V.jsxs)(`details`,{className:`group border border-line`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between px-4 py-3 text-[13px] font-medium text-ink-2 [&::-webkit-details-marker]:hidden`,children:[`Advanced Oddish settings`,(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-ink-4 group-open:hidden`,children:`Defaults`}),(0,V.jsx)(`span`,{className:`hidden font-mono text-[11px] text-ink-4 group-open:inline`,children:`Hide`})]}),(0,V.jsxs)(`div`,{className:`grid gap-5 border-t border-line p-4 sm:grid-cols-2`,children:[(0,V.jsx)(ZS,{label:`Agent`,htmlFor:`oddish_agent`,children:(0,V.jsx)(QS,{id:`oddish_agent`,value:ae,onChange:e=>oe(e.target.value)})}),(0,V.jsx)(ZS,{label:`Model`,htmlFor:`oddish_model`,children:(0,V.jsx)(QS,{id:`oddish_model`,value:se,onChange:e=>ce(e.target.value)})}),(0,V.jsx)(ZS,{label:`API URL`,htmlFor:`oddish_api_url`,children:(0,V.jsx)(QS,{id:`oddish_api_url`,value:re,onChange:e=>R(e.target.value)})}),(0,V.jsx)(ZS,{label:`Dashboard URL`,htmlFor:`oddish_dashboard_url`,children:(0,V.jsx)(QS,{id:`oddish_dashboard_url`,value:z,onChange:e=>ie(e.target.value)})})]})]})]})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(qx,{className:`size-4 text-ink-3`}),`Task authorship`]})}),(0,V.jsx)(fC,{className:`space-y-5`,children:(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-3`,children:[(0,V.jsx)(ZS,{label:`Author name`,htmlFor:`author_name`,children:(0,V.jsx)(QS,{id:`author_name`,placeholder:`Your name`,value:F,onChange:e=>I(e.target.value)})}),(0,V.jsx)(ZS,{label:`Author email`,htmlFor:`author_email`,children:(0,V.jsx)(QS,{id:`author_email`,placeholder:`you@example.com`,value:L,onChange:e=>ee(e.target.value)})}),(0,V.jsx)(ZS,{label:`Organization`,htmlFor:`author_org`,children:(0,V.jsx)(QS,{id:`author_org`,placeholder:`(optional)`,value:te,onChange:e=>ne(e.target.value)})})]})})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsxs)(dC,{children:[(0,V.jsx)(aS,{className:`size-4 text-ink-3`}),`Pipeline tuning`]})}),(0,V.jsx)(fC,{className:`space-y-5`,children:(0,V.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,V.jsx)(ZS,{label:`Harden attempts`,htmlFor:`drop_after`,hint:`Drop after this many revisions without enough improvement.`,children:(0,V.jsx)(QS,{id:`drop_after`,type:`number`,min:1,placeholder:`2`,value:D,onChange:e=>O(e.target.value)})}),(0,V.jsx)(ZS,{label:`Minimum improvement`,htmlFor:`min_improve`,hint:`Required pass@1 reduction per revision (0–1).`,children:(0,V.jsx)(QS,{id:`min_improve`,type:`number`,step:`0.01`,min:0,max:1,placeholder:`0.10`,value:k,onChange:e=>A(e.target.value)})}),(0,V.jsx)(ZS,{label:`Concurrent agents`,htmlFor:`agentic_conc`,children:(0,V.jsx)(QS,{id:`agentic_conc`,type:`number`,min:1,placeholder:`1`,value:j,onChange:e=>M(e.target.value)})})]})})]}),o&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,children:o}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(XS,{variant:`primary`,onClick:()=>void ue(),loading:c===`saving`,children:`Save settings`}),c===`ok`&&(0,V.jsxs)(rP.span,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},className:`flex items-center gap-1.5 text-sm font-medium text-ok`,children:[(0,V.jsx)(gx,{className:`size-4`}),`Saved`]})]})]})]})}function GF({label:e,hint:t,field:n,required:r=!1,mask:i,value:a,busy:o,onChange:s,onSave:c}){return(0,V.jsxs)(`div`,{className:`space-y-2 p-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:n,className:`text-[13px] font-medium text-ink`,children:e}),t&&(0,V.jsx)(`p`,{className:`text-[11.5px] text-ink-4`,children:t})]}),(0,V.jsx)(`span`,{className:i?`text-[11.5px] font-mono text-ok`:`text-[11.5px] text-ink-4`,children:i?`configured ${i}`:r?`required (one of two)`:`not configured`})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(QS,{id:n,type:`password`,autoComplete:`off`,placeholder:i?`Enter a new value to replace`:`Paste credential`,value:a,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&a.trim()&&c(!1)}),(0,V.jsx)(XS,{variant:`secondary`,onClick:()=>c(!1),loading:o,disabled:!a.trim(),children:`Save`}),i&&(0,V.jsx)(XS,{variant:`ghost`,onClick:()=>c(!0),disabled:o,children:`Clear`})]})]})}function KF({id:e,value:t,onChange:n}){return(0,V.jsxs)($S,{id:e,value:t,onChange:e=>n(e.target.value),children:[!t&&(0,V.jsx)(`option`,{value:``,children:`Select a model…`}),t&&!UF.some(e=>e.value===t)&&(0,V.jsx)(`option`,{value:t,children:t}),UF.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))]})}var qF=e=>e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`,JF=e=>new Intl.NumberFormat(void 0,{notation:e>=1e5?`compact`:`standard`}).format(e),YF=e=>e?`${(e/36e5).toFixed(1)}h`:`—`;function XF(){let[e,t]=(0,w.useState)(null),[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(!0),o=()=>{a(!0),gS.costs().then(t).catch(e=>r(e.message)).finally(()=>a(!1))};return(0,w.useEffect)(o,[]),(0,V.jsxs)(`div`,{className:`space-y-7`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`Costs`}),(0,V.jsx)(`p`,{className:`mt-1 text-[13px] text-ink-3`,children:`Provider-reported model usage for local task generation and evaluation.`})]}),(0,V.jsxs)(XS,{size:`sm`,variant:`ghost`,onClick:o,children:[(0,V.jsx)(Xx,{className:`size-3.5`}),`Refresh`]})]}),n&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/30 bg-danger-soft/20 px-4 py-2.5 text-sm text-danger`,children:n}),i&&!e?(0,V.jsx)(cC,{className:`h-40 w-full`}):e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,V.jsx)(ZF,{icon:Cx,label:`Model cost`,value:qF(e.totals.usd)}),(0,V.jsx)(ZF,{icon:ox,label:`Sessions`,value:JF(e.totals.sessions)}),(0,V.jsx)(ZF,{icon:xx,label:`Agent time`,value:YF(e.totals.duration_ms)})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsx)(dC,{children:`By run`})}),(0,V.jsx)(fC,{className:`p-0`,children:e.by_run.length===0?(0,V.jsx)(`p`,{className:`p-6 text-sm text-ink-3`,children:`No model sessions recorded yet. New runs appear here automatically.`}):(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`min-w-full text-left text-[13px]`,children:[(0,V.jsx)(`thead`,{className:`border-b border-line text-[11px] uppercase tracking-wider text-ink-4`,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Run`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Cost`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Sessions`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Input`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Output`}),(0,V.jsx)(`th`,{className:`px-5 py-3`,children:`Time`})]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-line`,children:e.by_run.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`px-5 py-3 font-medium text-ink`,children:(0,V.jsx)(On,{className:`hover:underline`,to:`/run/${encodeURIComponent(e.run)}`,children:e.run})}),(0,V.jsx)(`td`,{className:`px-5 py-3 font-mono text-ink-2`,children:qF(e.usd)}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:e.sessions}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:JF(e.input_tokens)}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:JF(e.output_tokens)}),(0,V.jsx)(`td`,{className:`px-5 py-3 text-ink-3`,children:YF(e.duration_ms)})]},e.run))})]})})})]}),(0,V.jsxs)(lC,{children:[(0,V.jsx)(uC,{children:(0,V.jsx)(dC,{children:`Recent sessions`})}),(0,V.jsx)(fC,{className:`space-y-0 p-0`,children:e.recent.slice(0,15).map(e=>(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-line px-5 py-3 last:border-b-0`,children:[(0,V.jsx)(`span`,{className:`w-40 truncate font-medium text-ink`,children:e.run}),(0,V.jsx)(`span`,{className:`w-32 truncate font-mono text-[11.5px] text-ink-3`,children:e.stage}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-4`,children:e.model||`model`}),(0,V.jsx)(`span`,{className:`font-mono text-ink-2`,children:qF(e.usd)})]},`${e.run}-${e.id}`))})]})]})]})}function ZF({icon:e,label:t,value:n}){return(0,V.jsx)(lC,{children:(0,V.jsxs)(fC,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`rounded-lg bg-surface-2 p-2.5`,children:(0,V.jsx)(e,{className:`size-4 text-ink-3`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-[11px] uppercase tracking-wider text-ink-4`,children:t}),(0,V.jsx)(`p`,{className:`mt-0.5 text-lg font-semibold text-ink`,children:n})]})]})})}function QF(){let e=ot(),t=lt(),{preflight:n,loading:r}=yS();return(0,w.useEffect)(()=>{r||!n||!n.ready&&e.pathname===`/`&&t(`/settings`,{replace:!0,state:{firstRun:!0}})},[r,n?.ready]),(0,V.jsx)(TS,{children:(0,V.jsxs)(Rt,{children:[(0,V.jsx)(It,{path:`/`,element:(0,V.jsx)(_C,{})}),(0,V.jsx)(It,{path:`/run/:key`,element:(0,V.jsx)(OF,{})}),(0,V.jsx)(It,{path:`/costs`,element:(0,V.jsx)(XF,{})}),(0,V.jsx)(It,{path:`/docs`,element:(0,V.jsx)(FF,{})}),(0,V.jsx)(It,{path:`/settings`,element:(0,V.jsx)(WF,{})}),(0,V.jsx)(It,{path:`*`,element:(0,V.jsx)(Ft,{to:`/`,replace:!0})})]})})}var $F=class extends w.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`UI render error:`,e,t)}render(){return this.state.error?(0,V.jsxs)(`div`,{className:`mx-auto mt-16 max-w-lg rounded-xl border border-line bg-surface-2 p-6 text-center`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-ink`,children:`Something broke rendering this view`}),(0,V.jsx)(`p`,{className:`mt-2 text-[13px] text-ink-3`,children:this.state.error.message}),(0,V.jsxs)(`div`,{className:`mt-4 flex justify-center gap-3`,children:[(0,V.jsx)(`button`,{className:`rounded-lg bg-accent px-4 py-2 text-[13px] font-medium text-white`,onClick:()=>this.setState({error:null}),children:`Retry`}),(0,V.jsx)(`a`,{href:`/`,className:`rounded-lg border border-line px-4 py-2 text-[13px] font-medium text-ink-2`,children:`Back to fleet`})]})]}):this.props.children}};function eI(){let[e,t]=(0,w.useState)(()=>{let e=window.localStorage.getItem(`programsmith-color-mode`)===`light`?`light`:`dark`;return document.documentElement.dataset.theme=e,e});(0,w.useEffect)(()=>{document.documentElement.dataset.theme=e,window.localStorage.setItem(`programsmith-color-mode`,e)},[e]);let n=(0,w.useMemo)(()=>SS(e),[e]),r=(0,w.useMemo)(()=>({mode:e,toggleMode:()=>t(e=>e===`dark`?`light`:`dark`)}),[e]);return(0,V.jsx)(bS.Provider,{value:r,children:(0,V.jsxs)(Ul,{theme:n,children:[(0,V.jsx)(qf,{}),(0,V.jsx)($F,{children:(0,V.jsx)(En,{children:(0,V.jsx)(vS,{children:(0,V.jsx)(QF,{})})})})]})})}(0,Ws.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(w.StrictMode,{children:(0,V.jsx)(eI,{})})); \ No newline at end of file diff --git a/src/programsmith/ui/frontend/dist/assets/index-CMnqPtxE.css b/src/programsmith/ui/frontend/dist/assets/index-CMnqPtxE.css deleted file mode 100644 index f88ed8c..0000000 --- a/src/programsmith/ui/frontend/dist/assets/index-CMnqPtxE.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--font-mono:ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-3xl:48rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#f7f7f5;--color-bg-2:#f0f0ed;--color-surface:#fff;--color-surface-2:#f7f7f5;--color-surface-3:#eeeeeb;--color-line:#dededb;--color-line-2:#bdbdb8;--color-ink:#171717;--color-ink-2:#3f3f3f;--color-ink-3:#666;--color-ink-4:#8a8a86;--color-accent:#171717;--color-accent-soft:#dededb;--color-accent-fg:#fff;--color-node-gate:#1f5eff;--color-node-cell:#6941c6;--color-node-sweep:#087e8b;--color-node-decision:#666;--color-node-output:#197a45;--color-ok:#197a45;--color-ok-soft:#e3f3e9;--color-warn:#8a5b00;--color-warn-soft:#fff3d6;--color-danger:#b42318;--color-danger-soft:#fee9e7;--color-info:#171717;--color-human:#6941c6;--animate-shimmer:shimmer 2.2s linear infinite;--animate-pulse-ring:pulse-ring 2s ease-out infinite}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--color-line,currentColor)}::file-selector-button{border-color:var(--color-line,currentColor)}html{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;scrollbar-gutter:stable;-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;overflow-y:scroll}html[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}body{background-color:var(--color-bg);min-height:100vh;color:var(--color-ink);font-family:var(--font-sans);margin:0}::selection{background:var(--color-accent-soft)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-line);background-clip:padding-box;border:2px solid #0000;border-radius:0}::-webkit-scrollbar-thumb:hover{background:var(--color-line-2);background-clip:padding-box}}@layer components{.glass{background:var(--color-surface);border:1px solid var(--color-line)}.glass-hover{transition:border-color .15s,background-color .15s}.glass-hover:hover{border-color:var(--color-line-2);background:var(--color-surface-2)}.shimmer{background:linear-gradient(90deg, var(--color-surface) 0%, var(--color-surface-2) 50%, var(--color-surface) 100%);animation:var(--animate-shimmer);background-size:480px 100%}.focus-ring{outline:none}.focus-ring:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}}@layer utilities{.\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-1\/2{top:50%}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-24{top:calc(var(--spacing) * 24)}.right-0{right:0}.left-3{left:calc(var(--spacing) * 3)}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1{margin-left:var(--spacing)}.ml-5{margin-left:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-40{height:calc(var(--spacing) * 40)}.h-80{height:calc(var(--spacing) * 80)}.h-\[150px\]{height:150px}.h-\[360px\]{height:360px}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.h-px{height:1px}.max-h-\[28rem\]{max-height:28rem}.max-h-\[70vh\]{max-height:70vh}.max-h-\[460px\]{max-height:460px}.min-h-0{min-height:0}.min-h-screen{min-height:100vh}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[1040px\]{max-width:1040px}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-\[720px\]{min-width:720px}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink\!{flex-shrink:1!important}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.transform\!{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.animate-pulse{animation:var(--animate-pulse)}.animate-pulse-ring{animation:var(--animate-pulse-ring)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-y{resize:vertical}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block:0}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 10) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--color-line)}:where(.divide-line\/70>:not(:last-child)){border-color:#dededbb3}@supports (color:color-mix(in lab, red, red)){:where(.divide-line\/70>:not(:last-child)){border-color:color-mix(in oklab, var(--color-line) 70%, transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/30{border-color:#1717174d}@supports (color:color-mix(in lab, red, red)){.border-accent\/30{border-color:color-mix(in oklab, var(--color-accent) 30%, transparent)}}.border-accent\/40{border-color:#17171766}@supports (color:color-mix(in lab, red, red)){.border-accent\/40{border-color:color-mix(in oklab, var(--color-accent) 40%, transparent)}}.border-accent\/60{border-color:#17171799}@supports (color:color-mix(in lab, red, red)){.border-accent\/60{border-color:color-mix(in oklab, var(--color-accent) 60%, transparent)}}.border-danger\/25{border-color:#b4231840}@supports (color:color-mix(in lab, red, red)){.border-danger\/25{border-color:color-mix(in oklab, var(--color-danger) 25%, transparent)}}.border-danger\/30{border-color:#b423184d}@supports (color:color-mix(in lab, red, red)){.border-danger\/30{border-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.border-human\/30{border-color:#6941c64d}@supports (color:color-mix(in lab, red, red)){.border-human\/30{border-color:color-mix(in oklab, var(--color-human) 30%, transparent)}}.border-info\/30{border-color:#1717174d}@supports (color:color-mix(in lab, red, red)){.border-info\/30{border-color:color-mix(in oklab, var(--color-info) 30%, transparent)}}.border-line{border-color:var(--color-line)}.border-line\/60{border-color:#dededb99}@supports (color:color-mix(in lab, red, red)){.border-line\/60{border-color:color-mix(in oklab, var(--color-line) 60%, transparent)}}.border-line\/70{border-color:#dededbb3}@supports (color:color-mix(in lab, red, red)){.border-line\/70{border-color:color-mix(in oklab, var(--color-line) 70%, transparent)}}.border-ok\/20{border-color:#197a4533}@supports (color:color-mix(in lab, red, red)){.border-ok\/20{border-color:color-mix(in oklab, var(--color-ok) 20%, transparent)}}.border-ok\/30{border-color:#197a454d}@supports (color:color-mix(in lab, red, red)){.border-ok\/30{border-color:color-mix(in oklab, var(--color-ok) 30%, transparent)}}.border-warn\/30{border-color:#8a5b004d}@supports (color:color-mix(in lab, red, red)){.border-warn\/30{border-color:color-mix(in oklab, var(--color-warn) 30%, transparent)}}.bg-accent{background-color:var(--color-accent)}.bg-accent-soft\/15{background-color:#dededb26}@supports (color:color-mix(in lab, red, red)){.bg-accent-soft\/15{background-color:color-mix(in oklab, var(--color-accent-soft) 15%, transparent)}}.bg-accent-soft\/30{background-color:#dededb4d}@supports (color:color-mix(in lab, red, red)){.bg-accent-soft\/30{background-color:color-mix(in oklab, var(--color-accent-soft) 30%, transparent)}}.bg-accent-soft\/40{background-color:#dededb66}@supports (color:color-mix(in lab, red, red)){.bg-accent-soft\/40{background-color:color-mix(in oklab, var(--color-accent-soft) 40%, transparent)}}.bg-bg-2{background-color:var(--color-bg-2)}.bg-bg-2\/30{background-color:#f0f0ed4d}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/30{background-color:color-mix(in oklab, var(--color-bg-2) 30%, transparent)}}.bg-bg-2\/40{background-color:#f0f0ed66}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/40{background-color:color-mix(in oklab, var(--color-bg-2) 40%, transparent)}}.bg-bg-2\/60{background-color:#f0f0ed99}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/60{background-color:color-mix(in oklab, var(--color-bg-2) 60%, transparent)}}.bg-bg-2\/70{background-color:#f0f0edb3}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/70{background-color:color-mix(in oklab, var(--color-bg-2) 70%, transparent)}}.bg-danger-soft\/15{background-color:#fee9e726}@supports (color:color-mix(in lab, red, red)){.bg-danger-soft\/15{background-color:color-mix(in oklab, var(--color-danger-soft) 15%, transparent)}}.bg-danger-soft\/20{background-color:#fee9e733}@supports (color:color-mix(in lab, red, red)){.bg-danger-soft\/20{background-color:color-mix(in oklab, var(--color-danger-soft) 20%, transparent)}}.bg-danger-soft\/40{background-color:#fee9e766}@supports (color:color-mix(in lab, red, red)){.bg-danger-soft\/40{background-color:color-mix(in oklab, var(--color-danger-soft) 40%, transparent)}}.bg-danger\/15{background-color:#b4231826}@supports (color:color-mix(in lab, red, red)){.bg-danger\/15{background-color:color-mix(in oklab, var(--color-danger) 15%, transparent)}}.bg-danger\/20{background-color:#b4231833}@supports (color:color-mix(in lab, red, red)){.bg-danger\/20{background-color:color-mix(in oklab, var(--color-danger) 20%, transparent)}}.bg-ink\/5{background-color:#1717170d}@supports (color:color-mix(in lab, red, red)){.bg-ink\/5{background-color:color-mix(in oklab, var(--color-ink) 5%, transparent)}}.bg-line{background-color:var(--color-line)}.bg-line-2{background-color:var(--color-line-2)}.bg-ok-soft\/15{background-color:#e3f3e926}@supports (color:color-mix(in lab, red, red)){.bg-ok-soft\/15{background-color:color-mix(in oklab, var(--color-ok-soft) 15%, transparent)}}.bg-ok-soft\/40{background-color:#e3f3e966}@supports (color:color-mix(in lab, red, red)){.bg-ok-soft\/40{background-color:color-mix(in oklab, var(--color-ok-soft) 40%, transparent)}}.bg-ok\/20{background-color:#197a4533}@supports (color:color-mix(in lab, red, red)){.bg-ok\/20{background-color:color-mix(in oklab, var(--color-ok) 20%, transparent)}}.bg-surface{background-color:var(--color-surface)}.bg-surface-2{background-color:var(--color-surface-2)}.bg-surface-3{background-color:var(--color-surface-3)}.bg-transparent{background-color:#0000}.bg-warn{background-color:var(--color-warn)}.bg-warn-soft\/25{background-color:#fff3d640}@supports (color:color-mix(in lab, red, red)){.bg-warn-soft\/25{background-color:color-mix(in oklab, var(--color-warn-soft) 25%, transparent)}}.bg-warn-soft\/40{background-color:#fff3d666}@supports (color:color-mix(in lab, red, red)){.bg-warn-soft\/40{background-color:color-mix(in oklab, var(--color-warn-soft) 40%, transparent)}}.bg-warn\/5{background-color:#8a5b000d}@supports (color:color-mix(in lab, red, red)){.bg-warn\/5{background-color:color-mix(in oklab, var(--color-warn) 5%, transparent)}}.bg-\[url\(\'data\:image\/svg\+xml\;charset\=utf-8\,\%3Csvg\%20xmlns\%3D\%22http\%3A\%2F\%2Fwww\.w3\.org\%2F2000\%2Fsvg\%22\%20width\%3D\%2224\%22\%20height\%3D\%2224\%22\%20viewBox\%3D\%220\%200\%2024\%2024\%22\%20fill\%3D\%22none\%22\%20stroke\%3D\%22\%23888\%22\%20stroke-width\%3D\%222\%22\%20stroke-linecap\%3D\%22round\%22\%20stroke-linejoin\%3D\%22round\%22\%3E\%3Cpath\%20d\%3D\%22m6\%209\%206\%206\%206-6\%22\%2F\%3E\%3C\%2Fsvg\%3E\'\)\]{background-image:url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E)}.bg-\[length\:16px\]{background-size:16px}.bg-\[right_0\.75rem_center\]{background-position:right .75rem center}.bg-no-repeat{background-repeat:no-repeat}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:var(--spacing)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[0\.9em\]{font-size:.9em}.text-\[10\.5px\]{font-size:10.5px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--color-accent)}.text-accent-fg{color:var(--color-accent-fg)}.text-danger{color:var(--color-danger)}.text-human{color:var(--color-human)}.text-info{color:var(--color-info)}.text-ink{color:var(--color-ink)}.text-ink-2{color:var(--color-ink-2)}.text-ink-3{color:var(--color-ink-3)}.text-ink-4{color:var(--color-ink-4)}.text-node-decision{color:var(--color-node-decision)}.text-ok{color:var(--color-ok)}.text-warn{color:var(--color-warn)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-accent\/40{--tw-ring-color:#17171766}@supports (color:color-mix(in lab, red, red)){.ring-accent\/40{--tw-ring-color:color-mix(in oklab, var(--color-accent) 40%, transparent)}}.ring-bg{--tw-ring-color:var(--color-bg)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}.placeholder\:text-ink-4::placeholder{color:var(--color-ink-4)}.first\:mt-0:first-child{margin-top:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:pb-0:last-child{padding-bottom:0}@media (hover:hover){.hover\:border-line-2:hover{border-color:var(--color-line-2)}.hover\:bg-danger-soft\/20:hover{background-color:#fee9e733}@supports (color:color-mix(in lab, red, red)){.hover\:bg-danger-soft\/20:hover{background-color:color-mix(in oklab, var(--color-danger-soft) 20%, transparent)}}.hover\:bg-info\/10:hover{background-color:#1717171a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-info\/10:hover{background-color:color-mix(in oklab, var(--color-info) 10%, transparent)}}.hover\:bg-ok-soft\/20:hover{background-color:#e3f3e933}@supports (color:color-mix(in lab, red, red)){.hover\:bg-ok-soft\/20:hover{background-color:color-mix(in oklab, var(--color-ok-soft) 20%, transparent)}}.hover\:bg-surface-2:hover{background-color:var(--color-surface-2)}.hover\:bg-surface-2\/50:hover{background-color:#f7f7f580}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-2\/50:hover{background-color:color-mix(in oklab, var(--color-surface-2) 50%, transparent)}}.hover\:bg-surface-2\/60:hover{background-color:#f7f7f599}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-2\/60:hover{background-color:color-mix(in oklab, var(--color-surface-2) 60%, transparent)}}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-ink:hover{color:var(--color-ink)}.hover\:text-ink-2:hover{color:var(--color-ink-2)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-accent\/50:focus{border-color:#17171780}@supports (color:color-mix(in lab, red, red)){.focus\:border-accent\/50:focus{border-color:color-mix(in oklab, var(--color-accent) 50%, transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,0\.9fr\)_1fr\]{grid-template-columns:minmax(0,.9fr) 1fr}.sm\:gap-4{gap:calc(var(--spacing) * 4)}}@media (width>=64rem){.lg\:sticky{position:sticky}.lg\:block{display:block}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[180px_1fr\]{grid-template-columns:180px 1fr}}}:root,html[data-theme=dark]{--color-bg:#111;--color-bg-2:#141414;--color-surface:#181818;--color-surface-2:#202020;--color-surface-3:#282828;--color-line:#343434;--color-line-2:#505050;--color-ink:#f2f2f2;--color-ink-2:#d6d6d6;--color-ink-3:#a6a6a6;--color-ink-4:#777;--color-accent:#f2f2f2;--color-accent-2:#fff;--color-accent-soft:#3a3a3a;--color-accent-fg:#111;--color-node-gate:#7093ff;--color-node-cell:#a98cff;--color-node-sweep:#42bdc9;--color-node-decision:#a6a6a6;--color-node-output:#58c882;--color-ok:#58c882;--color-ok-soft:#153824;--color-warn:#f0b84d;--color-warn-soft:#44310d;--color-danger:#ff7b72;--color-danger-soft:#4b1f1c;--color-info:#f2f2f2;--color-human:#b897ff}html[data-theme=light]{--color-bg:#f7f7f5;--color-bg-2:#f0f0ed;--color-surface:#fff;--color-surface-2:#f7f7f5;--color-surface-3:#eeeeeb;--color-line:#dededb;--color-line-2:#bdbdb8;--color-ink:#171717;--color-ink-2:#3f3f3f;--color-ink-3:#666;--color-ink-4:#8a8a86;--color-accent:#171717;--color-accent-2:#000;--color-accent-soft:#dededb;--color-accent-fg:#fff;--color-node-gate:#1f5eff;--color-node-cell:#6941c6;--color-node-sweep:#087e8b;--color-node-decision:#666;--color-node-output:#197a45;--color-ok:#197a45;--color-ok-soft:#e3f3e9;--color-warn:#8a5b00;--color-warn-soft:#fff3d6;--color-danger:#b42318;--color-danger-soft:#fee9e7;--color-info:#171717;--color-human:#6941c6}:not(.rounded-full){border-radius:0!important}.MuiSwitch-thumb{border-radius:999px!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes shimmer{0%{background-position:-480px 0}to{background-position:480px 0}}@keyframes pulse-ring{0%{box-shadow:0 0 oklch(90% .004 70/.4)}70%{box-shadow:0 0 0 12px oklch(90% .004 70/0)}to{box-shadow:0 0 oklch(90% .004 70/0)}} diff --git a/src/programsmith/ui/frontend/dist/assets/index-CTusfz0r.css b/src/programsmith/ui/frontend/dist/assets/index-CTusfz0r.css new file mode 100644 index 0000000..45a41ca --- /dev/null +++ b/src/programsmith/ui/frontend/dist/assets/index-CTusfz0r.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--font-mono:ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#f7f7f5;--color-bg-2:#f0f0ed;--color-surface:#fff;--color-surface-2:#f7f7f5;--color-surface-3:#eeeeeb;--color-line:#dededb;--color-line-2:#bdbdb8;--color-ink:#171717;--color-ink-2:#3f3f3f;--color-ink-3:#666;--color-ink-4:#8a8a86;--color-accent:#171717;--color-accent-soft:#dededb;--color-accent-fg:#fff;--color-node-gate:#1f5eff;--color-node-cell:#6941c6;--color-node-sweep:#087e8b;--color-node-decision:#666;--color-node-output:#197a45;--color-ok:#197a45;--color-ok-soft:#e3f3e9;--color-warn:#8a5b00;--color-warn-soft:#fff3d6;--color-danger:#b42318;--color-danger-soft:#fee9e7;--color-info:#171717;--color-human:#6941c6;--animate-shimmer:shimmer 2.2s linear infinite;--animate-pulse-ring:pulse-ring 2s ease-out infinite}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--color-line,currentColor)}::file-selector-button{border-color:var(--color-line,currentColor)}html{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;scrollbar-gutter:stable;-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;overflow-y:scroll}html[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}body{background-color:var(--color-bg);min-height:100vh;color:var(--color-ink);font-family:var(--font-sans);margin:0}::selection{background:var(--color-accent-soft)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-line);background-clip:padding-box;border:2px solid #0000;border-radius:0}::-webkit-scrollbar-thumb:hover{background:var(--color-line-2);background-clip:padding-box}}@layer components{.glass{background:var(--color-surface);border:1px solid var(--color-line)}.glass-hover{transition:border-color .15s,background-color .15s}.glass-hover:hover{border-color:var(--color-line-2);background:var(--color-surface-2)}.shimmer{background:linear-gradient(90deg, var(--color-surface) 0%, var(--color-surface-2) 50%, var(--color-surface) 100%);animation:var(--animate-shimmer);background-size:480px 100%}.focus-ring{outline:none}.focus-ring:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}}@layer utilities{.\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-1\/2{top:50%}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-24{top:calc(var(--spacing) * 24)}.right-0{right:0}.left-3{left:calc(var(--spacing) * 3)}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1{margin-left:var(--spacing)}.ml-5{margin-left:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-40{height:calc(var(--spacing) * 40)}.h-80{height:calc(var(--spacing) * 80)}.h-\[150px\]{height:150px}.h-\[360px\]{height:360px}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.h-px{height:1px}.max-h-\[28rem\]{max-height:28rem}.max-h-\[70vh\]{max-height:70vh}.max-h-\[440px\]{max-height:440px}.max-h-\[460px\]{max-height:460px}.min-h-0{min-height:0}.min-h-screen{min-height:100vh}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[1040px\]{max-width:1040px}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[720px\]{min-width:720px}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink\!{flex-shrink:1!important}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.transform\!{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.animate-pulse{animation:var(--animate-pulse)}.animate-pulse-ring{animation:var(--animate-pulse-ring)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-y{resize:vertical}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.grid-cols-\[22px_minmax\(0\,1fr\)\]{grid-template-columns:22px minmax(0,1fr)}.grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block:0}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 10) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--color-line)}:where(.divide-line\/70>:not(:last-child)){border-color:#dededbb3}@supports (color:color-mix(in lab, red, red)){:where(.divide-line\/70>:not(:last-child)){border-color:color-mix(in oklab, var(--color-line) 70%, transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/30{border-color:#1717174d}@supports (color:color-mix(in lab, red, red)){.border-accent\/30{border-color:color-mix(in oklab, var(--color-accent) 30%, transparent)}}.border-accent\/40{border-color:#17171766}@supports (color:color-mix(in lab, red, red)){.border-accent\/40{border-color:color-mix(in oklab, var(--color-accent) 40%, transparent)}}.border-accent\/60{border-color:#17171799}@supports (color:color-mix(in lab, red, red)){.border-accent\/60{border-color:color-mix(in oklab, var(--color-accent) 60%, transparent)}}.border-danger\/25{border-color:#b4231840}@supports (color:color-mix(in lab, red, red)){.border-danger\/25{border-color:color-mix(in oklab, var(--color-danger) 25%, transparent)}}.border-danger\/30{border-color:#b423184d}@supports (color:color-mix(in lab, red, red)){.border-danger\/30{border-color:color-mix(in oklab, var(--color-danger) 30%, transparent)}}.border-danger\/40{border-color:#b4231866}@supports (color:color-mix(in lab, red, red)){.border-danger\/40{border-color:color-mix(in oklab, var(--color-danger) 40%, transparent)}}.border-human\/30{border-color:#6941c64d}@supports (color:color-mix(in lab, red, red)){.border-human\/30{border-color:color-mix(in oklab, var(--color-human) 30%, transparent)}}.border-info\/30{border-color:#1717174d}@supports (color:color-mix(in lab, red, red)){.border-info\/30{border-color:color-mix(in oklab, var(--color-info) 30%, transparent)}}.border-line{border-color:var(--color-line)}.border-line\/60{border-color:#dededb99}@supports (color:color-mix(in lab, red, red)){.border-line\/60{border-color:color-mix(in oklab, var(--color-line) 60%, transparent)}}.border-line\/70{border-color:#dededbb3}@supports (color:color-mix(in lab, red, red)){.border-line\/70{border-color:color-mix(in oklab, var(--color-line) 70%, transparent)}}.border-ok\/20{border-color:#197a4533}@supports (color:color-mix(in lab, red, red)){.border-ok\/20{border-color:color-mix(in oklab, var(--color-ok) 20%, transparent)}}.border-ok\/30{border-color:#197a454d}@supports (color:color-mix(in lab, red, red)){.border-ok\/30{border-color:color-mix(in oklab, var(--color-ok) 30%, transparent)}}.border-warn{border-color:var(--color-warn)}.border-warn\/30{border-color:#8a5b004d}@supports (color:color-mix(in lab, red, red)){.border-warn\/30{border-color:color-mix(in oklab, var(--color-warn) 30%, transparent)}}.bg-accent{background-color:var(--color-accent)}.bg-accent-soft\/15{background-color:#dededb26}@supports (color:color-mix(in lab, red, red)){.bg-accent-soft\/15{background-color:color-mix(in oklab, var(--color-accent-soft) 15%, transparent)}}.bg-accent-soft\/30{background-color:#dededb4d}@supports (color:color-mix(in lab, red, red)){.bg-accent-soft\/30{background-color:color-mix(in oklab, var(--color-accent-soft) 30%, transparent)}}.bg-accent-soft\/40{background-color:#dededb66}@supports (color:color-mix(in lab, red, red)){.bg-accent-soft\/40{background-color:color-mix(in oklab, var(--color-accent-soft) 40%, transparent)}}.bg-bg-2{background-color:var(--color-bg-2)}.bg-bg-2\/30{background-color:#f0f0ed4d}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/30{background-color:color-mix(in oklab, var(--color-bg-2) 30%, transparent)}}.bg-bg-2\/40{background-color:#f0f0ed66}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/40{background-color:color-mix(in oklab, var(--color-bg-2) 40%, transparent)}}.bg-bg-2\/60{background-color:#f0f0ed99}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/60{background-color:color-mix(in oklab, var(--color-bg-2) 60%, transparent)}}.bg-bg-2\/70{background-color:#f0f0edb3}@supports (color:color-mix(in lab, red, red)){.bg-bg-2\/70{background-color:color-mix(in oklab, var(--color-bg-2) 70%, transparent)}}.bg-current{background-color:currentColor}.bg-danger-soft\/15{background-color:#fee9e726}@supports (color:color-mix(in lab, red, red)){.bg-danger-soft\/15{background-color:color-mix(in oklab, var(--color-danger-soft) 15%, transparent)}}.bg-danger-soft\/20{background-color:#fee9e733}@supports (color:color-mix(in lab, red, red)){.bg-danger-soft\/20{background-color:color-mix(in oklab, var(--color-danger-soft) 20%, transparent)}}.bg-danger-soft\/40{background-color:#fee9e766}@supports (color:color-mix(in lab, red, red)){.bg-danger-soft\/40{background-color:color-mix(in oklab, var(--color-danger-soft) 40%, transparent)}}.bg-danger\/15{background-color:#b4231826}@supports (color:color-mix(in lab, red, red)){.bg-danger\/15{background-color:color-mix(in oklab, var(--color-danger) 15%, transparent)}}.bg-danger\/20{background-color:#b4231833}@supports (color:color-mix(in lab, red, red)){.bg-danger\/20{background-color:color-mix(in oklab, var(--color-danger) 20%, transparent)}}.bg-ink\/5{background-color:#1717170d}@supports (color:color-mix(in lab, red, red)){.bg-ink\/5{background-color:color-mix(in oklab, var(--color-ink) 5%, transparent)}}.bg-line{background-color:var(--color-line)}.bg-line-2{background-color:var(--color-line-2)}.bg-ok-soft\/15{background-color:#e3f3e926}@supports (color:color-mix(in lab, red, red)){.bg-ok-soft\/15{background-color:color-mix(in oklab, var(--color-ok-soft) 15%, transparent)}}.bg-ok-soft\/40{background-color:#e3f3e966}@supports (color:color-mix(in lab, red, red)){.bg-ok-soft\/40{background-color:color-mix(in oklab, var(--color-ok-soft) 40%, transparent)}}.bg-ok\/20{background-color:#197a4533}@supports (color:color-mix(in lab, red, red)){.bg-ok\/20{background-color:color-mix(in oklab, var(--color-ok) 20%, transparent)}}.bg-surface{background-color:var(--color-surface)}.bg-surface-2{background-color:var(--color-surface-2)}.bg-surface-3{background-color:var(--color-surface-3)}.bg-transparent{background-color:#0000}.bg-warn{background-color:var(--color-warn)}.bg-warn-soft\/25{background-color:#fff3d640}@supports (color:color-mix(in lab, red, red)){.bg-warn-soft\/25{background-color:color-mix(in oklab, var(--color-warn-soft) 25%, transparent)}}.bg-warn-soft\/40{background-color:#fff3d666}@supports (color:color-mix(in lab, red, red)){.bg-warn-soft\/40{background-color:color-mix(in oklab, var(--color-warn-soft) 40%, transparent)}}.bg-warn\/5{background-color:#8a5b000d}@supports (color:color-mix(in lab, red, red)){.bg-warn\/5{background-color:color-mix(in oklab, var(--color-warn) 5%, transparent)}}.bg-\[url\(\'data\:image\/svg\+xml\;charset\=utf-8\,\%3Csvg\%20xmlns\%3D\%22http\%3A\%2F\%2Fwww\.w3\.org\%2F2000\%2Fsvg\%22\%20width\%3D\%2224\%22\%20height\%3D\%2224\%22\%20viewBox\%3D\%220\%200\%2024\%2024\%22\%20fill\%3D\%22none\%22\%20stroke\%3D\%22\%23888\%22\%20stroke-width\%3D\%222\%22\%20stroke-linecap\%3D\%22round\%22\%20stroke-linejoin\%3D\%22round\%22\%3E\%3Cpath\%20d\%3D\%22m6\%209\%206\%206\%206-6\%22\%2F\%3E\%3C\%2Fsvg\%3E\'\)\]{background-image:url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E)}.bg-\[length\:16px\]{background-size:16px}.bg-\[right_0\.75rem_center\]{background-position:right .75rem center}.bg-no-repeat{background-repeat:no-repeat}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:var(--spacing)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.9em\]{font-size:.9em}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--color-accent)}.text-accent-fg{color:var(--color-accent-fg)}.text-danger{color:var(--color-danger)}.text-human{color:var(--color-human)}.text-info{color:var(--color-info)}.text-ink{color:var(--color-ink)}.text-ink-2{color:var(--color-ink-2)}.text-ink-3{color:var(--color-ink-3)}.text-ink-4{color:var(--color-ink-4)}.text-node-decision{color:var(--color-node-decision)}.text-ok{color:var(--color-ok)}.text-warn{color:var(--color-warn)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-accent\/40{--tw-ring-color:#17171766}@supports (color:color-mix(in lab, red, red)){.ring-accent\/40{--tw-ring-color:color-mix(in oklab, var(--color-accent) 40%, transparent)}}.ring-bg{--tw-ring-color:var(--color-bg)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}.group-open\:hidden:is(:where(.group):is([open],:popover-open,:open) *){display:none}.group-open\:inline:is(:where(.group):is([open],:popover-open,:open) *){display:inline}.placeholder\:text-ink-4::placeholder{color:var(--color-ink-4)}.first\:mt-0:first-child{margin-top:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:pb-0:last-child{padding-bottom:0}@media (hover:hover){.hover\:border-line-2:hover{border-color:var(--color-line-2)}.hover\:bg-danger-soft\/20:hover{background-color:#fee9e733}@supports (color:color-mix(in lab, red, red)){.hover\:bg-danger-soft\/20:hover{background-color:color-mix(in oklab, var(--color-danger-soft) 20%, transparent)}}.hover\:bg-info\/10:hover{background-color:#1717171a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-info\/10:hover{background-color:color-mix(in oklab, var(--color-info) 10%, transparent)}}.hover\:bg-ok-soft\/20:hover{background-color:#e3f3e933}@supports (color:color-mix(in lab, red, red)){.hover\:bg-ok-soft\/20:hover{background-color:color-mix(in oklab, var(--color-ok-soft) 20%, transparent)}}.hover\:bg-surface-2:hover{background-color:var(--color-surface-2)}.hover\:bg-surface-2\/50:hover{background-color:#f7f7f580}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-2\/50:hover{background-color:color-mix(in oklab, var(--color-surface-2) 50%, transparent)}}.hover\:bg-surface-2\/60:hover{background-color:#f7f7f599}@supports (color:color-mix(in lab, red, red)){.hover\:bg-surface-2\/60:hover{background-color:color-mix(in oklab, var(--color-surface-2) 60%, transparent)}}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-ink:hover{color:var(--color-ink)}.hover\:text-ink-2:hover{color:var(--color-ink-2)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-accent\/50:focus{border-color:#17171780}@supports (color:color-mix(in lab, red, red)){.focus\:border-accent\/50:focus{border-color:color-mix(in oklab, var(--color-accent) 50%, transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,0\.9fr\)_1fr\]{grid-template-columns:minmax(0,.9fr) 1fr}.sm\:gap-4{gap:calc(var(--spacing) * 4)}}@media (width>=64rem){.lg\:sticky{position:sticky}.lg\:block{display:block}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[180px_1fr\]{grid-template-columns:180px 1fr}}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none}}:root,html[data-theme=dark]{--color-bg:#111;--color-bg-2:#141414;--color-surface:#181818;--color-surface-2:#202020;--color-surface-3:#282828;--color-line:#343434;--color-line-2:#505050;--color-ink:#f2f2f2;--color-ink-2:#d6d6d6;--color-ink-3:#a6a6a6;--color-ink-4:#777;--color-accent:#f2f2f2;--color-accent-2:#fff;--color-accent-soft:#3a3a3a;--color-accent-fg:#111;--color-node-gate:#7093ff;--color-node-cell:#a98cff;--color-node-sweep:#42bdc9;--color-node-decision:#a6a6a6;--color-node-output:#58c882;--color-ok:#58c882;--color-ok-soft:#153824;--color-warn:#f0b84d;--color-warn-soft:#44310d;--color-danger:#ff7b72;--color-danger-soft:#4b1f1c;--color-info:#f2f2f2;--color-human:#b897ff}html[data-theme=light]{--color-bg:#f7f7f5;--color-bg-2:#f0f0ed;--color-surface:#fff;--color-surface-2:#f7f7f5;--color-surface-3:#eeeeeb;--color-line:#dededb;--color-line-2:#bdbdb8;--color-ink:#171717;--color-ink-2:#3f3f3f;--color-ink-3:#666;--color-ink-4:#8a8a86;--color-accent:#171717;--color-accent-2:#000;--color-accent-soft:#dededb;--color-accent-fg:#fff;--color-node-gate:#1f5eff;--color-node-cell:#6941c6;--color-node-sweep:#087e8b;--color-node-decision:#666;--color-node-output:#197a45;--color-ok:#197a45;--color-ok-soft:#e3f3e9;--color-warn:#8a5b00;--color-warn-soft:#fff3d6;--color-danger:#b42318;--color-danger-soft:#fee9e7;--color-info:#171717;--color-human:#6941c6}:not(.rounded-full){border-radius:0!important}.MuiSwitch-thumb{border-radius:999px!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes shimmer{0%{background-position:-480px 0}to{background-position:480px 0}}@keyframes pulse-ring{0%{box-shadow:0 0 oklch(90% .004 70/.4)}70%{box-shadow:0 0 0 12px oklch(90% .004 70/0)}to{box-shadow:0 0 oklch(90% .004 70/0)}} diff --git a/src/programsmith/ui/frontend/dist/index.html b/src/programsmith/ui/frontend/dist/index.html index 7d2f79a..b269f20 100644 --- a/src/programsmith/ui/frontend/dist/index.html +++ b/src/programsmith/ui/frontend/dist/index.html @@ -9,8 +9,8 @@ name="description" content="ProgramSmith — dashboard for the ProgramBench task generation pipeline." /> - - + +
diff --git a/src/programsmith/ui/frontend/src/api.ts b/src/programsmith/ui/frontend/src/api.ts index e1844e7..bacf9b2 100644 --- a/src/programsmith/ui/frontend/src/api.ts +++ b/src/programsmith/ui/frontend/src/api.ts @@ -88,6 +88,11 @@ export interface Settings { openai_api_key?: string | null; gemini_api_key?: string | null; zai_api_key?: string | null; + oddish_api_key?: string | null; + oddish_api_url?: string | null; + oddish_dashboard_url?: string | null; + oddish_agent?: string | null; + oddish_model?: string | null; } /** Effective runtime the served auto-driver is using (read-only status). */ @@ -337,6 +342,42 @@ export interface RunDetail { waiting?: WaitingInfo | null; /** Background-job state for slow ops (clone/ingest, task-matrix cell). */ jobs?: RunJobs; + artifact?: { + available: boolean; + download_url: string; + calibrated: boolean; + }; +} + +export interface OddishTrial { + id: string | null; + index?: number | null; + status: string; + agent?: string | null; + model?: string | null; + reward?: number | null; + started_at?: string | null; + finished_at?: string | null; + duration_seconds?: number | null; + tool_calls?: number | null; + cost_usd?: number | null; + error?: string | null; +} + +export interface OddishRun { + status: "idle" | "submitting" | "queued" | "running" | "complete" | "failed" | string; + task_name?: string | null; + task_id?: string | null; + experiment_id?: string | null; + experiment_name?: string | null; + experiment_url?: string | null; + public_url?: string | null; + agent?: string | null; + model?: string | null; + trials: OddishTrial[]; + error?: string | null; + refresh_error?: string | null; + updated_at?: string | null; } /** One TASK MATRIX candidate. The ProgramBench pivot (ADR-0038) replaced the rewrite-port axes @@ -567,6 +608,20 @@ export const api = { agentOutput: (key: string) => request(`/runs/${encodeURIComponent(key)}/agent-output`), + + oddishStatus: (key: string) => + request(`/runs/${encodeURIComponent(key)}/oddish`), + runOnOddish: (key: string, body: { agent?: string; model?: string } = {}) => + request(`/runs/${encodeURIComponent(key)}/oddish`, { + method: "POST", + json: body, + }), + oddishTrajectory: (key: string, trialId?: string) => + request( + `/runs/${encodeURIComponent(key)}/oddish/trajectory${ + trialId ? `?trial_id=${encodeURIComponent(trialId)}` : "" + }`, + ), }; export interface AgentOutput { diff --git a/src/programsmith/ui/frontend/src/components/OddishPanel.tsx b/src/programsmith/ui/frontend/src/components/OddishPanel.tsx new file mode 100644 index 0000000..615df50 --- /dev/null +++ b/src/programsmith/ui/frontend/src/components/OddishPanel.tsx @@ -0,0 +1,303 @@ +import { useCallback, useEffect, useMemo, useState } from "react"; +import { + Check, + ChevronDown, + Cloud, + Download, + ExternalLink, + Play, + Settings, + TerminalSquare, +} from "lucide-react"; +import { Link } from "react-router-dom"; +import { api, ApiError, type OddishRun } from "../api"; +import { Badge } from "./ui/Badge"; +import { Button } from "./ui/Button"; +import { Card, CardBody, CardHeader, CardTitle } from "./ui/Card"; + +type Artifact = { + available: boolean; + download_url: string; + calibrated: boolean; +}; + +type TimelineItem = { + label: string; + detail?: string; + raw?: unknown; +}; + +function isRecord(value: unknown): value is Record { + return !!value && typeof value === "object" && !Array.isArray(value); +} + +function text(value: unknown): string | undefined { + return typeof value === "string" && value.trim() ? value.trim() : undefined; +} + +function trajectoryItems(payload: unknown): TimelineItem[] { + const candidates = [ + payload, + isRecord(payload) ? payload.steps : undefined, + isRecord(payload) ? payload.events : undefined, + isRecord(payload) && isRecord(payload.trajectory) ? payload.trajectory.steps : undefined, + isRecord(payload) && isRecord(payload.trajectory) ? payload.trajectory.events : undefined, + ]; + const rows = candidates.find(Array.isArray) as unknown[] | undefined; + if (!rows) return []; + return rows.slice(-80).map((row, index) => { + if (!isRecord(row)) return { label: `Step ${index + 1}`, detail: String(row), raw: row }; + const role = text(row.role); + const source = text(row.source); + const kind = text(row.type) ?? text(row.kind) ?? text(row.event); + const tool = text(row.tool_name) ?? text(row.tool); + const toolCalls = Array.isArray(row.tool_calls) ? row.tool_calls.filter(isRecord) : []; + const toolNames = toolCalls + .map((call) => text(call.function_name) ?? text(call.name)) + .filter((name): name is string => !!name); + const observations = isRecord(row.observation) && Array.isArray(row.observation.results) + ? row.observation.results.filter(isRecord).map((item) => text(item.content)).filter((value): value is string => !!value) + : []; + const label = tool + ? `Tool · ${tool}` + : toolNames.length + ? `Tool · ${toolNames.join(", ")}` + : source ?? role ?? (kind ? kind.replaceAll("_", " ") : `Step ${index + 1}`); + const detail = + text(row.reasoning_content) ?? + text(row.content) ?? + text(row.message) ?? + text(row.text) ?? + text(row.command) ?? + (observations.length ? observations.join("\n") : undefined) ?? + (isRecord(row.function) ? text(row.function.name) : undefined); + return { label, detail, raw: row }; + }); +} + +function statusTone(status: string): "neutral" | "ok" | "warn" | "danger" | "info" { + if (["complete", "completed", "success", "passed"].includes(status)) return "ok"; + if (["failed", "error", "cancelled"].includes(status)) return "danger"; + if (["queued", "submitting", "running", "pending"].includes(status)) return "info"; + return "neutral"; +} + +export function OddishPanel({ + runKey, + artifact, +}: { + runKey: string; + artifact?: Artifact; +}) { + const [oddish, setOddish] = useState(null); + const [trajectory, setTrajectory] = useState(null); + const [launching, setLaunching] = useState(false); + const [loadingTrajectory, setLoadingTrajectory] = useState(false); + const [error, setError] = useState(null); + + const refresh = useCallback(async () => { + try { + const next = await api.oddishStatus(runKey); + setOddish(next); + setError(next.error ?? next.refresh_error ?? null); + } catch (caught) { + if (!(caught instanceof ApiError && caught.status === 404)) { + setError(caught instanceof Error ? caught.message : "Could not load Oddish status"); + } + } + }, [runKey]); + + useEffect(() => { + void refresh(); + }, [refresh]); + + useEffect(() => { + if (!oddish || !["submitting", "queued", "running", "pending"].includes(oddish.status)) return; + const timer = window.setInterval(() => void refresh(), 4000); + return () => window.clearInterval(timer); + }, [oddish, refresh]); + + const trial = oddish?.trials?.[0]; + const running = !!oddish && ["submitting", "queued", "running", "pending"].includes(oddish.status); + const timeline = useMemo(() => trajectoryItems(trajectory), [trajectory]); + + const launch = useCallback(async () => { + setLaunching(true); + setError(null); + try { + setOddish(await api.runOnOddish(runKey)); + } catch (caught) { + setError(caught instanceof Error ? caught.message : "Could not start the Oddish run"); + } finally { + setLaunching(false); + } + }, [runKey]); + + const loadTrajectory = useCallback(async () => { + setLoadingTrajectory(true); + setError(null); + try { + setTrajectory(await api.oddishTrajectory(runKey, trial?.id ?? undefined)); + } catch (caught) { + setError(caught instanceof Error ? caught.message : "Could not load the trajectory"); + } finally { + setLoadingTrajectory(false); + } + }, [runKey, trial?.id]); + + return ( + + + + + Task + + {oddish && oddish.status !== "idle" && ( + + {running && } + {oddish.status} + + )} + + +
+
+

+ {artifact?.available ? "Your task is ready" : "Building your task"} +

+

+ {artifact?.available + ? "Download the portable task, or use your Oddish free-plan quota for one agent trial and a public result." + : "Download and cloud execution become available after Static CI passes."} +

+
+
+ {artifact?.available && ( + + )} + +
+
+ + {artifact?.available && !artifact.calibrated && ( +

+ This is a draft task: Static CI passed, but model difficulty has not been calibrated. +

+ )} + + {error && ( +
+ {error} + {error.toLowerCase().includes("key") && ( + + + + )} +
+ )} + + {oddish && oddish.status !== "idle" && ( +
+
+ + + + +
+ +
+ {trial?.id && ( + + )} + {oddish.public_url && ( + + )} +
+
+ )} + + {trajectory !== null && ( +
+
+

Agent trajectory

+ {timeline.length} events +
+ {timeline.length ? ( +
    + {timeline.map((item, index) => ( +
  1. + + {index + 1} + +
    +

    {item.label}

    + {item.detail && ( +

    + {item.detail.length > 900 ? `${item.detail.slice(0, 900)}…` : item.detail} +

    + )} + {!item.detail && item.raw !== undefined && ( +
    + + Raw event + +
    +                            {JSON.stringify(item.raw, null, 2)}
    +                          
    +
    + )} +
    +
  2. + ))} +
+ ) : ( +
+ + The trajectory is available in the public Oddish experiment. +
+ )} +
+ )} +
+
+ ); +} + +function Metric({ label, value }: { label: string; value: string }) { + return ( +
+

{label}

+

{value}

+
+ ); +} diff --git a/src/programsmith/ui/frontend/src/components/ui/Button.tsx b/src/programsmith/ui/frontend/src/components/ui/Button.tsx index fb2204f..5f7a5cf 100644 --- a/src/programsmith/ui/frontend/src/components/ui/Button.tsx +++ b/src/programsmith/ui/frontend/src/components/ui/Button.tsx @@ -9,6 +9,8 @@ interface ButtonProps extends Omit variant?: Variant; size?: Size; loading?: boolean; + target?: string; + rel?: string; } const variantProps: Record< diff --git a/src/programsmith/ui/frontend/src/pages/DocsPage.tsx b/src/programsmith/ui/frontend/src/pages/DocsPage.tsx index 179f1ab..1b47c4a 100644 --- a/src/programsmith/ui/frontend/src/pages/DocsPage.tsx +++ b/src/programsmith/ui/frontend/src/pages/DocsPage.tsx @@ -98,7 +98,8 @@ const CLI_GROUPS: Array<{ title: string; rows: Array<[string, string]> }> = [ { title: "Create & farm", rows: [ - ["programsmith create --repo owner/name [--sha] [--slug]", "One repo → one calibrated task (resolves HEAD if no --sha)."], + ["programsmith create --repo owner/name [--sha] [--slug]", "One repo → one calibrated task; starts and opens its local dashboard."], + ["programsmith create --repo owner/name --draft", "Export after Static CI with no model sweeps or calibration."], ["programsmith farm --repos-file repos.txt", "Start and drive many runs from a file (one spec per line)."], ], }, diff --git a/src/programsmith/ui/frontend/src/pages/RunPage.tsx b/src/programsmith/ui/frontend/src/pages/RunPage.tsx index 8ed5fec..d7be6bc 100644 --- a/src/programsmith/ui/frontend/src/pages/RunPage.tsx +++ b/src/programsmith/ui/frontend/src/pages/RunPage.tsx @@ -14,7 +14,7 @@ import { } from "lucide-react"; import { api } from "../api"; import { usePolling } from "../lib/usePolling"; -import { Card, CardBody, CardHeader, CardTitle } from "../components/ui/Card"; +import { Card, CardBody } from "../components/ui/Card"; import { Button } from "../components/ui/Button"; import { Badge, StatusBadge } from "../components/ui/Badge"; import { Tooltip } from "../components/ui/Tooltip"; @@ -25,6 +25,7 @@ import { RunContextPanel } from "../components/RunContextPanel"; import { HistoryTimeline } from "../components/HistoryTimeline"; import { FileExplorer } from "../components/FileExplorer"; import { AgentOutput } from "../components/AgentOutput"; +import { OddishPanel } from "../components/OddishPanel"; import { TerminalPanel } from "../components/TerminalPanel"; import { TaskMatrixReview } from "../components/TaskMatrixReview"; import { QaGatePanel } from "../components/QaGatePanel"; @@ -207,10 +208,12 @@ export function RunPage() { + + {/* terminal (dropped/blocked/easy): rich panel with the WHY + harden-review + re-open. A DONE run needs no panel — the export is conveyed by the green "Done" DAG node. */} - {(data.waiting?.kind === "terminal" || data.waiting?.kind === "draft") && - summary.status !== "done" && ( + {data.waiting?.kind === "terminal" && + summary.status !== "done" && summary.status !== "draft" && ( )} - {/* DAG */} - - - +
+ + - Pipeline - - - + Build details + + + {summary.status === "draft" ? "Static CI passed" : `${summary.stage.replaceAll("_", " ")} · ${Math.round(summary.progress * 100)}%`} + + +
)} - - +
+
{/* human reviews (conditional) */} {summary.status === "in_progress" && summary.stage === "TASK_MATRIX" && ( @@ -264,15 +269,20 @@ export function RunPage() { void refresh()} /> )} - {/* context + history — items-start so each card wraps its own content (History's scroll - container fills its card instead of leaving a gap below a stretched card) */} -
- - -
- - {/* live cell-agent terminal — under history (auto-tails while a claude -p worker runs) */} - +
+ + Diagnostics + Show + Hide + +
+
+ + +
+ +
+
run claude setup-token} field="claude_code_oauth_token" required mask={secretMasks.claude_code_oauth_token} value={secretValues.claude_code_oauth_token ?? ""} busy={savingSecret === "claude_code_oauth_token"} onChange={(value) => setSecretValues((s) => ({ ...s, claude_code_oauth_token: value }))} onSave={(clear) => void saveSecret("claude_code_oauth_token", clear)} /> setSecretValues((s) => ({ ...s, anthropic_api_key: value }))} onSave={(clear) => void saveSecret("anthropic_api_key", clear)} /> - setSecretValues((s) => ({ ...s, openai_api_key: value }))} onSave={(clear) => void saveSecret("openai_api_key", clear)} /> - setSecretValues((s) => ({ ...s, gemini_api_key: value }))} onSave={(clear) => void saveSecret("gemini_api_key", clear)} /> - setSecretValues((s) => ({ ...s, zai_api_key: value }))} onSave={(clear) => void saveSecret("zai_api_key", clear)} /> + Create a full-scope key for one-click hosted runs.} + field="oddish_api_key" + mask={secretMasks.oddish_api_key} + value={secretValues.oddish_api_key ?? ""} + busy={savingSecret === "oddish_api_key"} + onChange={(value) => setSecretValues((s) => ({ ...s, oddish_api_key: value }))} + onSave={(clear) => void saveSecret("oddish_api_key", clear)} + /> +
+ + Other model providers + Optional + Hide + +
+ setSecretValues((s) => ({ ...s, openai_api_key: value }))} onSave={(clear) => void saveSecret("openai_api_key", clear)} /> + setSecretValues((s) => ({ ...s, gemini_api_key: value }))} onSave={(clear) => void saveSecret("gemini_api_key", clear)} /> + setSecretValues((s) => ({ ...s, zai_api_key: value }))} onSave={(clear) => void saveSecret("zai_api_key", clear)} /> +
+
@@ -259,6 +292,42 @@ export function SettingsPage() { + + + + + Oddish + + + +

+ The run button uploads an exported task, launches one hosted trial, and creates a + public experiment link. Oddish free-plan limits apply. +

+
+ + Advanced Oddish settings + Defaults + Hide + +
+ + setOddishAgent(event.target.value)} /> + + + setOddishModel(event.target.value)} /> + + + setOddishApiUrl(event.target.value)} /> + + + setOddishDashboardUrl(event.target.value)} /> + +
+
+
+
+ {/* Task authorship — stamped into every generated task.toml */} diff --git a/tests/test_config.py b/tests/test_config.py index abc6b94..860385f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -9,14 +9,16 @@ def test_saved_config_is_owner_only_and_redacts_keys(tmp_path, monkeypatch): path = tmp_path / "programsmith" / "config.json" monkeypatch.setenv("PROGRAMSMITH_CONFIG_PATH", str(path)) cfg = LhConfig(claude_code_oauth_token="oauth-secret", anthropic_api_key="sk-ant-secret", - openai_api_key="sk-openai-secret") + openai_api_key="sk-openai-secret", oddish_api_key="ok_oddish-secret") assert cfg.save() == path assert stat.S_IMODE(path.stat().st_mode) == 0o600 assert LhConfig.load().anthropic_api_key == "sk-ant-secret" assert cfg.redacted()["anthropic_api_key"] == "…cret" assert cfg.redacted()["claude_code_oauth_token"] == "…cret" + assert cfg.redacted()["oddish_api_key"] == "…cret" assert "sk-ant-secret" not in str(cfg.redacted()) + assert "ok_oddish-secret" not in str(cfg.redacted()) def test_persisted_load_does_not_copy_environment_secrets(tmp_path, monkeypatch): diff --git a/tests/test_oddish.py b/tests/test_oddish.py new file mode 100644 index 0000000..e78f795 --- /dev/null +++ b/tests/test_oddish.py @@ -0,0 +1,149 @@ +import json + +import httpx + +from programsmith import oddish +from programsmith.oddish import load_state, refresh_state, save_state, submit_task, task_content_hash + + +def test_task_content_hash_is_stable_and_content_sensitive(tmp_path): + task = tmp_path / "task" + (task / "environment").mkdir(parents=True) + (task / "task.toml").write_text("version = 1\n") + (task / "environment" / "Dockerfile").write_text("FROM ubuntu:24.04\n") + + first = task_content_hash(task) + assert first == task_content_hash(task) + (task / "task.toml").write_text("version = 2\n") + assert task_content_hash(task) != first + + +def test_task_content_hash_records_symlink_target_without_following_it(tmp_path): + task = tmp_path / "task" + task.mkdir() + outside = tmp_path / "outside" + outside.write_text("secret") + (task / "link").symlink_to(outside) + first = task_content_hash(task) + outside.write_text("changed") + assert task_content_hash(task) == first + (task / "link").unlink() + (task / "link").symlink_to("elsewhere") + assert task_content_hash(task) != first + + +def test_oddish_state_is_atomic_and_contains_no_credential(tmp_path): + saved = save_state(tmp_path, {"status": "queued", "task_id": "t1", "trials": []}) + assert saved["updated_at"] + assert load_state(tmp_path)["task_id"] == "t1" + raw = json.loads((tmp_path / "oddish.json").read_text()) + assert "api_key" not in raw + + +def test_submit_task_uses_low_priority_public_single_trial(tmp_path, monkeypatch): + task = tmp_path / "exported" / "demo-task" + task.mkdir(parents=True) + (task / "task.toml").write_text("version = 1\n") + calls = [] + + class FakeClient: + def __init__(self, *args, **kwargs): + self.headers = kwargs.get("headers") or {} + + def __enter__(self): + return self + + def __exit__(self, *_args): + return False + + def request(self, method, url, **kwargs): + calls.append((method, url, kwargs, self.headers)) + request = httpx.Request(method, url) + if url.endswith("/tasks/sweep"): + return httpx.Response( + 200, + request=request, + json={ + "id": "task-1", + "experiment_id": "exp-1", + "experiment_name": "ProgramSmith demo", + "new_trial_ids": ["trial-1"], + }, + ) + if url.endswith("/experiments/exp-1/share"): + return httpx.Response( + 200, + request=request, + json={"public_token": "share-1", "is_public": True}, + ) + raise AssertionError(f"unexpected request: {method} {url}") + + monkeypatch.setattr(oddish.httpx, "Client", FakeClient) + monkeypatch.setattr( + oddish, + "_upload_task", + lambda *_args, **_kwargs: { + "task_id": "task-1", + "existing_task": False, + "content_hash": "hash-1", + }, + ) + + result = submit_task( + tmp_path / "run", + task, + api_key="not-written-to-disk", + api_url="https://api.oddish.test", + dashboard_url="https://oddish.test", + agent="claude-code", + model="anthropic/claude-sonnet-4-6", + ) + + assert result["status"] == "queued" + assert result["public_url"] == "https://oddish.test/share/share-1" + sweep = next(item for item in calls if item[1].endswith("/tasks/sweep")) + assert sweep[2]["json"]["priority"] == "low" + assert sweep[2]["json"]["publish_experiment"] is True + assert sweep[2]["json"]["configs"] == [{ + "agent": "claude-code", + "model": "anthropic/claude-sonnet-4-6", + "n_trials": 1, + }] + assert sweep[2]["headers"]["Idempotency-Key"] + assert "api_key" not in (tmp_path / "run" / "oddish.json").read_text() + + +def test_refresh_state_compacts_public_trial_and_error_message(tmp_path, monkeypatch): + save_state(tmp_path, { + "status": "queued", + "task_id": "task-1", + "public_token": "share-1", + "trials": [], + }) + monkeypatch.setattr(oddish, "_public_get", lambda *_args, **_kwargs: [{ + "id": "trial-1", + "status": "success", + "agent": "claude-code", + "model": "anthropic/claude-sonnet-4-6", + "reward": 0.75, + "error_message": "verifier note", + "trajectory_duration_seconds": 14.2, + "total_tool_calls": 3, + }]) + + result = refresh_state(tmp_path, api_url="https://api.oddish.test") + assert result["status"] == "complete" + assert result["trials"] == [{ + "id": "trial-1", + "index": None, + "status": "success", + "agent": "claude-code", + "model": "anthropic/claude-sonnet-4-6", + "reward": 0.75, + "started_at": None, + "finished_at": None, + "duration_seconds": 14.2, + "tool_calls": 3, + "cost_usd": None, + "error": "verifier note", + }] diff --git a/tests/test_serve_defaults.py b/tests/test_serve_defaults.py index 4a38ea9..82491eb 100644 --- a/tests/test_serve_defaults.py +++ b/tests/test_serve_defaults.py @@ -13,7 +13,7 @@ import pytest -from programsmith.cli import _ensure_dashboard, _remember_runs_dir, _save_dashboard_state, main +from programsmith.cli import _ensure_dashboard, _open_dashboard, _remember_runs_dir, _save_dashboard_state, main from programsmith.config import LhConfig @@ -123,6 +123,19 @@ def popen(argv, **_kwargs): assert kwargs["start_new_session"] is True +def test_open_dashboard_is_best_effort_and_disabled_in_ci(monkeypatch): + calls = [] + monkeypatch.delenv("CI", raising=False) + monkeypatch.delenv("PROGRAMSMITH_NO_BROWSER", raising=False) + monkeypatch.setattr("webbrowser.open", lambda url, new=0: calls.append((url, new)) or True) + assert _open_dashboard("http://127.0.0.1:8765/run/demo") is True + assert calls == [("http://127.0.0.1:8765/run/demo", 2)] + + monkeypatch.setenv("CI", "1") + assert _open_dashboard("http://127.0.0.1:8765/run/demo") is False + assert len(calls) == 1 + + def test_serve_no_autodrive_opts_out(monkeypatch, tmp_path): _stub_uvicorn(monkeypatch) main(["serve", "--foreground", "--runs-dir", str(tmp_path), "--no-autodrive"]) diff --git a/tests/test_ui.py b/tests/test_ui.py index a21ffac..9b8e5ef 100644 --- a/tests/test_ui.py +++ b/tests/test_ui.py @@ -59,6 +59,7 @@ def test_screened_out_http_detail_surfaces_specific_matrix_reason(tmp_path, monk "source_ref": "o/n@abc", "candidates": [], "no_candidate_reason": reason, })) monkeypatch.setenv("PROGRAMSMITH_CONFIG_PATH", str(tmp_path / "config.json")) + monkeypatch.delenv("ODDISH_API_KEY", raising=False) from programsmith.config import LhConfig LhConfig(runs_dir=str(runs)).save() from programsmith.ui.app import app @@ -161,6 +162,43 @@ def test_completed_draft_http_detail_uses_draft_waiting_panel(tmp_path, monkeypa assert detail["node_statuses"]["DIFFICULTY_SWEEP"] == "pending" +def test_exported_task_has_download_and_oddish_actions(tmp_path, monkeypatch): + pytest.importorskip("fastapi") + from fastapi.testclient import TestClient + + runs = tmp_path / "runs" + _make_run(runs, "draft", ["pass", "selected", "pass", "pass", "pass", "pass"]) + task = tmp_path / "out" / "drafts" / "draft" + task.mkdir(parents=True) + (task / "task.toml").write_text("version = 1\n") + manifest = Manifest.load(runs / "draft") + manifest.pipeline_mode = "draft" + manifest.snapshot = {"outbox_path": str(task)} + manifest.save(runs / "draft") + (runs / "draft" / "drive.json").write_text(json.dumps({ + "halted": "draft", "final_stage": "DIFFICULTY_SWEEP", "halt_reason": "done", + })) + + monkeypatch.setenv("PROGRAMSMITH_CONFIG_PATH", str(tmp_path / "config.json")) + monkeypatch.delenv("ODDISH_API_KEY", raising=False) + from programsmith.config import LhConfig + LhConfig(runs_dir=str(runs)).save() + from programsmith.ui.app import app + + client = TestClient(app) + detail = client.get("/api/runs/draft").json() + assert detail["artifact"] == { + "available": True, + "download_url": "/api/runs/draft/download", + "calibrated": False, + } + downloaded = client.get("/api/runs/draft/download") + assert downloaded.status_code == 200 + assert downloaded.headers["content-type"] == "application/zip" + missing_key = client.post("/api/runs/draft/oddish", json={}) + assert missing_key.status_code == 422 and "Connect Oddish" in missing_key.json()["detail"] + + def test_difficulty_pass_at_1_reads_real_value(tmp_path): """The fleet card reads the real pass@1 the orchestrator records under `pass_at_1` (not the legacy `claude_code_pass_at_1` key, which left the card showing '—').""" diff --git a/uv.lock b/uv.lock index 44e6178..00dc6d3 100644 --- a/uv.lock +++ b/uv.lock @@ -184,6 +184,7 @@ version = "0.1.0" source = { editable = "." } dependencies = [ { name = "fastapi" }, + { name = "httpx" }, { name = "pydantic" }, { name = "rich" }, { name = "uvicorn" }, @@ -198,6 +199,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "fastapi", specifier = ">=0.110" }, + { name = "httpx", specifier = ">=0.27" }, { name = "httpx", marker = "extra == 'dev'", specifier = ">=0.27" }, { name = "pydantic", specifier = ">=2.7" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8" },